SNMP Subagent Programmer's Guide
Writing Subagent Logic
SNMP Subagent Programmer’s Guide—119728 4-17
Management Functions
mgmt_read_nowait()
The mgmt_read_nowait() function posts a nowaited read to the NonStop agent. Because
the function does not initiate a blocking operation, the subagent can perform other
activities while waiting for a message from the NonStop agent. When using this
function, perform the following activities in sequence:
1. Call mgmt_init_env() and mgmt_new_instance() to initialize object management
structures.
2. Allocate a buffer for the request from the NonStop agent, associating the buffer with
the management environment.
3. Call mgmt_read_nowait().
4. Call Guardian procedure AWAITIO[X] to detect when a message is available for
processing.
5. Make a blocking call to mgmt_poll() to process the message.
6. Call mgmt_read_nowait() again if you will be processing any additional SNMP
messages.
fileno
is a file number identifying the connection with the NonStop agent.
mgmt-env
is the void pointer returned from an earlier call to mgmt_init_env().
tag
is reserved for future use.
Entry Condition
The value of mgmt-env must be valid.
Errors
A fileno value of -1 indicates that the function call failed.
#include "mgmtpubh"
#include "mgmtenvh"
#include "snmpvblh"
fileno = mgmt_read_nowait(mgmt-env, tag);
short
mgmt_read_nowait (mgmt_env, tag);
void *mgmt-env;
long tag