Share via


SnmpTfxQuery

The SnmpTfxQuery function resolves SNMP requests that contain variables within one or more of the SNMP extension agent's registered MIB views. This function is an element of the SNMPTfx API. It must be called from the SnmpExtensionQuery subagent routine

BOOL WINAPI SnmpTfxQuery (
SnmpTfxHandle tfxHandle, 
BYTE RequestType, 
RFC1157VarBindList *pVarBindList, 
AsnInteger *pErrorStatus, 
AsnInteger *pErrorIndex);

Parameters

  • tfxHandle
    [in] Handle to the current subtree's MIB view. This is the value that is returned from the call to the SnmpTfxOpen function.

  • RequestType
    [in] The request type that is passed in to the SnmpExtensionQuery function call. This is the SNMP request that is passed from the extensible agent to the subagent code. This parameter can be one of the following values defined by SNMPv2c:

    Value Description
    SNMP_PDU_GET Retrieve the value or values of the specified variables.
    SNMP_PDU_GETNEXT Retrieve the value or values of the lexicographic successor of the specified variable.
    SNMP_PDU_SET Write a value within a specific variable.
    SNMP_PDU_GETBULK Retrieve the values of the specified variables.
  • pVarBindList
    [in/out] Pointer to the list of variable bindings.

  • pErrorStatus
    [out] Pointer to a variable in which the result of the error status will be returned. This parameter can be one of the following values defined by SNMPv1.

    Value Description
    SNMP_ERRORSTATUS_NOERROR The agent reports that no errors occurred during transmission.
    SNMP_ERRORSTATUS_TOOBIG The agent could not place the results of the requested operation into a single SNMP message.
    SNMP_ERRORSTATUS_NOSUCHNAME The requested operation identified an unknown variable. (v1 only)
    SNMP_ERRORSTATUS_BADVALUE The requested operation tried to change a variable but it specified either a syntax or value error. (v1 only)
    SNMP_ERRORSTATUS_READONLY The requested operation tried to change a variable that was not allowed to change according to the community profile of the variable. (v1 only)
    SNMP_ERRORSTATUS_GENERR An error other than one of those listed here occurred during the requested operation.
    SNMP_ERRORSTATUS_NOACCESS The variable is not in the community's view.
    SNMP_ERRORSTATUS_WRONGTYPE The variable's typing as received doesn't match the ASN.1 typing as kept by the local subagent.
    SNMP_ERRORSTATUS_WRONGLENGTH The ASN.1 encoded data length is incorrect.
    SNMP_ERRORSTATUS_WRONGENCODING The ASN.1 encoding is inconsistent.
    SNMP_ERRORSTATUS_WRONGVALUE The value of the variable is incorrect.
    SNMP_ERRORSTATUS_NOCREATION The variable cannot be created.
    SNMP_ERRORSTATUS_INCONSISTENTVALUE The variable cannot be assigned a value.
    SNMP_ERRORSTATUS_RESOURCEUNAVAILABLE The resource(s) needed to fulfill the request is/are not available.
    SNMP_ERRORSTATUS_COMMITFAILED A row-commit operation for this variable failed.
    SNMP_ERRORSTATUS_UNDOFAILED A row-undo operation for this variable failed.
    SNMP_ERRORSTATUS_AUTHORIZATIONERROR Unrecognized community name.
    SNMP_ERRORSTATUS_NOTWRITABLE Variable cannot be created or modified
    SNMP_ERRORSTATUS_INCONSISTENTNAME Variable cannot be created.
  • pErrorIndex
    [out] Pointer to a variable to which the result of the error index is returned.

Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE.

Remarks

The SnmpTfxQuery function should be called from the subagent's SnmpExtensionQuery routine. The first parameter to this call is the handle returned by the call to SnmpTfxOpen. All the other parameters should be passed directly from the corresponding parameters in the SnmpExtensionQuery call.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 3.0 and later Snmpexts.h   Snmpapi.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

SnmpTfxClose, SnmpTfxOpen, SnmpExtensionQuery

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.