Platform SDK: Network Management

SnmpExtensionMonitor

The Microsoft SNMP service calls the SnmpExtensionMonitor function to provide the SNMP extension agent with a view to the service's internal counters and parameters. This function is an element of the SNMP Extension Agent API.

The SnmpExtensionMonitor function is optional. Extension agents should implement the function if they are interested in a view of the SNMP service's internal management objects, as defined in RFC 1213, "Management Information Base for Network Management of TCP/IP-based internets: MIB-II."

BOOL SnmpExtensionMonitor(
  LPVOID pAgentMgmtData 
);

Parameters

pAgentMgmtData
[in] Pointer to an array of AsnAny objects (structures). The number of objects, and the type and description of each object, are in accordance with RFC 1213. For more information, see the following Remarks section.

Return Values

Unless an unexpected error occurs while the SNMP extension agent is processing the value of the pAgentMgmtData parameter, the extension agent should return TRUE. If the extension agent returns FALSE, the SNMP service does not load the extension agent, and the service stops directing SNMP requests to the extension agent.

Remarks

If the extension agent exports the SnmpExtensionMonitor function, the SNMP service calls the function during initialization of the extension agent, immediately after the service calls the SnmpExtensionInit and the SnmpExtensionInitEx functions.

The SNMP service dynamically updates the SNMP counters (for example, the snmpInPkts and the snmpOutNoSuchNames counters) in the array pointed to by the pAgentMgmtData parameter. In order to be able to read these values while the SNMP service is running, the extension agent must store the pointer to pAgentMgmtData.

Note that an SNMP extension agent should not update the memory pointed to by the pAgentMgmtData parameter. This is because the values of the SNMP service's internal counters would no longer be valid, and the behavior of the SNMP service could become unpredictable. As long as the extension agent does not alter it, the memory pointed to by pAgentMgmtData is valid while the SNMP service is running.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Snmp.h.

See Also

Simple Network Management Protocol (SNMP) Overview, SNMP Functions, SnmpExtensionInit, SnmpExtensionInitEx, SnmpExtensionClose, AsnAny