SNMP Subagent Programmer's Guide
Management Functions
4-10 119728—SNMP Subagent Programmer’s Guide
Writing Subagent Logic
Errors
If an error occurs, this function returns NULL. Possible errors include inability to
communicate with the NonStop agent or a memory allocation failure.
Example
The following example is taken from the Hello World sample program. The argument
&GI_hello refers to the object identifier structure for the subagent generated by
GDMOC. The name of the agent process is passed as the first parameter in the subagent
invocation line.
if ((mgmt_env = mgmt_init_env(argv[1],
(ObjId_t *) &GI_hello
"Hello World Example",
(Octets_t *)NULL,
(void_function) NULL))==NULL)
{
(void) fputs(argv[0], stderr);
(void) fputs(":mgmt_init_env failure\n", stderr);
return(1);
}