SNMP Manager Programmer's Guide

Programming Examples
SNMP Manager Programmer’s Guide–134249
2-6
Managers Supporting UDP and IPC
includes snmpfsh, a header file that declares the structure and prototypes of functions
used in snmpfsc.
snmpfsh
Example 2-1 shows the contents of this header file, which defines a data structure named
SNMP_HOST_INT_T and six function prototypes.
Figure 2-2. Logic Flow of Managers Supporting UDP and IPC
202
Declare buffer, for
encoded request and response
Declare two packet structures, for
unencoded request and response
Initialize request packet
Bind variable bindings
to request packet
Start
Stop
Encode, print, and transmit
request packet
Receive, decode, and print
response packet
Parse invocation
parameters
Determine whether to use
UDP or IPC protocol
Examine target host name
check_host_name()
SNMP_Init_()
Create socket for UDP
or open file for IPC
communication
SNMP_Open_()
SNMP_WriteRead_()
Main Control Block Functions in snmpfsc
Close socket
or close open
file
SNMP_Close_()