SNMP Manager Programmer's Guide

Programming Examples
SNMP Manager Programmer’s Guide134249
2-10
Managers Supporting UDP and IPC
6. These defines describe flags passed to SNMP_Open_() and SNMP_WriteRead_()
to specify the kind and amount of information to print:
0 suppresses all output messages.
1 (PRINT_DEBUG_MSG) prints debug messages.
2 (PRINT_SEND_MSG) prints outgoing packets.
4 (PRINT_RECV_MSG) prints incoming packets.
7. The check_host_name() function accepts a character pointer to the target SNMP
entity specified at invocation and returns one of the six values described in Item 3.
8. The number of the node on which the manager is executing is obtained.
9. This block of code examines host names that begin with an alphabetic character.
10. If the NODENAME_TO_NODENUMBER_() system call returns an error, the target
SNMP entity is not an Expand node, so check_host_name() returns
CK_REMOTE_NAME.
11. If the system call succeeds, the target SNMP entity is an Expand node. If the
number of the Expand node is the same as that on which the manager is executing,
check_host_name() returns CK_LOCAL_NAME. If the number differs, the target
host is remote and the function returns CK_REMOTE_NAME_NOBSL_EXPAND.
12. This block of code examines target SNMP entity names that do not begin with an
alphabetic character. It performs the same operations as the block of code described
in 9 through 11.
13. The remaining code examines target SNMP entities identified at invocation by IP
address.
14. The host_file_gethostbyaddr() call determines whether the IP address is in the host
file.
15. If the IP address is not in the host file, check_host_name() returns
CK_REMOTE_IP.
16. If the IP address is in the host file and the host name with a prefix of “\” is longer
than 8 bytes, check_host_name() returns CK_REMOTE_IP.
17. If the NODENAME_TO_NODENUMBER() call fails, the host is not defined on the
Expand network, and check_host_name() returns CK_REMOTE_IP.
18. If the number of the Expand node is the same as that on which the manager is
executing, check_host_name() returns CK_LOCAL_NAME. If the number differs,
the target host is remote and the function returns CK_REMOTE_IP_EXPAND.
19. The SNMP_Close_() function accepts a pointer to the SNMP_HOST_INT_T
structure and returns an integer describing whether the function succeeded.
20. Any open socket used for UDP communication is closed.
21. Any open file used for IPC communication is closed.