SNMP Subagent Programmer's Guide
Writing Subagent Logic
SNMP Subagent Programmer’s Guide—119728 4-15
Management Functions
rc
is an integer describing the outcome of the call. Any value other than the following 
indicates that an error occurred:  
mgmt-env
is the void pointer returned from an earlier call to mgmt_init_env().
timeout
is a pointer to a timeval structure that specifies how long this function should block 
if no SNMP requests are pending.  To avoid blocking, fill in the timeval structure 
with 0s before calling mgmt_poll(). To block indefinitely, assign the value NULL to 
this argument.  Always use NULL if you previously called mgmt_read_nowait(). 
count-xferd
is a pointer to the number of bytes received from the NonStop agent when you use 
the mgmt_read_nowait() management function and the AWAITIO[X] Guardian 
procedure call to suspend execution of mgmt_poll() until the NonStop agent has a 
message to pass to you. Otherwise, this argument is ignored.
Entry Condition
The value of mgmt-env must be valid. 
Errors
A value of -1 indicates that an error, such as loss of connection with the NonStop agent, 
occurred. The subagent should call mgmt_del_instance() and mgmt_term_env() to clean 
up. The subagent can try again after calling mgmt_init_env() until success is indicated.
#include "mgmtpubh"
rc = mgmt_poll(mgmt-env, timeout, count-xferd);
int
mgmt_poll(mgmt-env, timeout, count-xferd);
 void *mgmt-env;
 struct timeval *timeout;
 short *count-xferd;
0 The NonStop agent processed a registration request, a timeout occurred, or 
the run-time library could not allocate a buffer.
1 A Set operation was processed.
2 A Test operation was processed.
4 A Get operation was processed.
8 A GetNext operation was processed.










