About SnmpExtensionQuery

The master agent calls the SnmpExtensionQuery function to pass on to the appropriate extension agent the variable bindings of each authenticated GetRequest, GetNextRequest, and SetRequest message that the SNMP agent received. Before calling any extension agent, the master agent separates the variables into individual lists that are based on the extension agent that supports them. The master agent then delivers each list to the SnmpExtensionQuery function of the associated extension agent, along with the type of request (Get, Set, or GetNext).

The extension agent determines whether the request is valid, processes the request, and returns the data that is collected to the master agent. The master agent combines the results that are returned from the individual extension-agent requests and sends back a response to the management console. The SnmpExtensionQuery function should return TRUE if the query was processed successfully or FALSE if the query failed. If one of the extension agents fails to complete a request, the entire request is aborted. Failure to complete a request is different from returning an error.

The SnmpExtensionQuery function has the following parameters:

  • A value that represents the type of request that is being passed to the extension agent by this call (GetRequest, Set, GetNext, GetBulk).
  • A list of variable bindings that are contained within the request message and are registered as being supported by the extension agent. Each binding must be parsed, and the specified GetRequest, GetNextRequest, or SetRequest operation must be applied to its OID and value. If the extension agent changes any variable-length data that is pointed to by pVariableBindings, it must free and reallocate the memory in the specific Varbind object by calling the SnmpUtilOidFree function.
  • An errorStatus value that is included in the GetResponse message in the event of an error.
  • An error index that refers to the variable binding that caused the error. If no error occurred, a value of 0 is returned.

See Also

Extension-Agent Architecture

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.