To include support for subagents in WindNet SNMP, edit the subInstall.h file (shipped in h/snmp) and make sure that it defines INSTALL_MASTER_SUBAGENT. This define has configuration consequences for snmpIoLib.c, saIoLib.c, and masterIoLib.c.
If INSTALL_MASTER_SUBAGENT is defined, snmpIoLib.c includes ipcLib.h and subagentLib.h. Both of these include files are required to support subagents. In addition, snmpIoLib.c includes the lines:
#if INSTALL_MASTER_SUBAGENT if (masterIoInit () == ERROR) printf ("Error: Could not initialize master IPC \n"); #endif
#if INSTALL_MASTER_SUBAGENT masterQueCleanup (); #endif
The call to masterIoInit( ) is essential to setting up the master-agent side of the IPC mechanism used to communicate with subagents. Enabling the call to masterQueCleanup( ) lets WindNet SNMP free the resources allocated by the previous call to masterIoInit( ).