snmpDiscover_v3()--SNMP Version 3 Discovery


  Syntax
 #include <qtomeapi.h>

 int snmpDiscover_v3(char  *             host_ptr,
                     unsigned long int   time_out,
                     snmp_auth_cb *      my_auth_cb);

  Service Program Name: QTOMEAPI

  Default Public Authority: *USE

  Threadsafe: No

An SNMP managing application uses the snmpDiscover_v3() function to discover authentication-related information about a remote or local SNMP version 3 (SNMPv3) agent. This function must be used prior to doing any other SNMPv3 operation such as a GET or SET. This function must also be used for each individual agent that a manager communicates with.


Parameters

host_ptr
(Input) A pointer to the character string that contains the Internet Protocol (IP) address. The internet address may be an IPv4 or IPv6 address.

An IPv4 internet address is specified in the form nnn.nnn.nnn.nnn, where nnn is a decimal number ranging from 0 through 255. An IPv4 internet address is not valid if it has a value of all binary ones or all binary zeros for the network identifier (ID) portion or the host ID portion of the address.

An IPv6 internet address is specified in the form x:x:x:x:x:x:x:x, where x is a hexadecimal number ranging from 0 through X'FFFF'. "::" may be used once in the IPv6 address to indicate one or more groups of 16 bits of zeros. The "::" may be used to compress leading, imbedded, or trailing zeros in the address.

This parameter can also be stored in host address format, that is, mycompany.com. This parameter must contain printable characters only.

time_out
(Input) The time-out value.

This parameter is the amount of time in seconds that the management application is willing to wait for the response PDU. The minimum value is 1, and the maximum is 100.

my_auth_cb
(Output) The address of a pointer to an SNMPv3 authentication control block built by the snmpDiscover_v3() function for the host specified by the host_ptr parameter.

Authorities

Service Program Authority
*USE

Return Value

The following are the possible return codes posted by the snmpDiscover_v3() function:

For more information, see the Simple Network Management Protocol (SNMP) SupportLink to PDF manual.



Usage Notes

  1. All character strings that are passed to the APIs must be null-terminated.
  2. The data returned in the authentication control block should not be modified in any way. The authentication control block is directly tied to a specific agent, so the manager application must call the snmpDiscover_v3 API for each agent it communicates with.
  3. If an agent or the manager is restarted, the data in the authentication control block is no longer valid. So, a new authentication control block is required. The snmpDiscover_v3 API must be called again in order to build a new control block for the agent.
  4. A timeout on a version 3 get, get next, set operation may indicate one of the following:
    • The authentication control block is no longer valid. The snmpDiscover_v3 API needs to be called again to get a new authentication control block.
    • Authentication of the specified user failed.
    • There was an error communicating with the agent.
  5. The snmpDiscover_v3 API does not reuse storage for an authentication control block. The storage used by the authentication control block must be freed using the snmpFreeAuthCB_v3 API.
  6. The snmpDiscover_v3 API opens a socket that will be used by subsequent calls to other SNMPv3 manager APIs. The socket is closed by the snmpFreeAuthCB_v3 API.
  7. The snmpDiscover_v3 API attempts to bind to the port specified by the snmp-mgr service table entry. If for any reason it can not bind to that port, a random ephemeral port is used.
  8. These APIs are blocked, which means that on a call to the API a request is sent across a communications protocol to an SNMP agent on a local or remote system. The call returns when a response has been received from the agent or when the command times out. On the return, all returned data is placed in the appropriate locations. You need do no further action to retrieve such data.

Related Information


Example

For examples that pertain to the SNMP manager APIs, see Using SNMP Manager APIs--Example.



API introduced: V7R2