SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-8
Managers Supporting UDP and IPC
Several fields in this structure are assigned values by the user when invoking the
managers, as subsequent subsections describe.
The functions named in snmpfsh are used to manage packet transmission and receipt:
snmpfsc
Example 2-2 illustrates the contents of snmpfsc. Figure 2-2, shown earlier, illustrates the
order in which functions defined in snmpfsc are called. Numbers in Example 2-2
correspond to numbers in the observations made between here and the example.
agent_name The name of a NonStop agent process; used for IPC
communication.
host_addr The IP address of a NonStop Kernel or other system; used for
UDP communication.
dest A structure (defined in in.h) describing a socket to use for
sending requests and traps when using UDP communication.
from The socket from which a response or trap is received when using
UDP communication.
file_num The file number identifying a UDP socket or IPC agent process
connection.
err_num A returned integer indicating whether the functions in snmpfsc
completed successfully; code in a manager’s main block calls
SNMP_FS_ErrMsg_() to convert the integer to a readable
message.
timeout The maximum number of centiseconds to wait for a response
packet before resending a request packet or terminating manager
execution.
count_written The number of bytes in a transmitted request or trap packet.
count_read The number of bytes in a received response or trap packet.
SNMP_Close_() Closes a socket or an open file.
SNMP_FS_ErrMsg() Converts return codes into readable messages.
SNMP_Init_() Determines whether to use UDP or IPC protocol.
SNMP_Open_() Creates a socket for UDP communication or opens a file for
IPC communication.
SNMP_WriteRead_() Encodes, prints, and transmits request packets; receives,
decodes, and prints response packets.
check_host_name() Examines target host name.