7.2   Configuring WindNet SNMP to Support Subagents

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.

  • snmpIoLib.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

    and

    #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( ).

  • saIoLib.c and masterIoLib.c
  • All the functions defined in these files are excluded from WindNet SNMP if INSTALL_MASTER_SUBAGENT is undefined.