SNMP Manager Programmer's Guide

Programming Examples
SNMP Manager Programmer’s Guide–134249
2-26
Managers Supporting UDP and IPC
#pragma page
/***************************************************************************
NAME: SNMP_WriteRead_
PURPOSE: Send and receive an SNMP buffer to the destination based
upon the info in the SNMP_HOST_INT_T structure.
PARAMETERS: SNMP_HOST_INT_T * Location of host interface struct.
SNMP_PKT_T * Send packet pointer. Points to the data to send.
SNMP_PKT_T ** Received packet pointer pointer. Points to
where to store the pointer to the data received.
EBUFFER_T * Pointer to an EBUFFER_T buffer to be used as
a temporary buffer. This will be used to
create the encoded SNMP message that will be
sent to the agent. It will also be used to
receive the encoded SNMP response. This should
point to a buffer of about 2000 bytes.
UNSIGNED SHORT Debug flag. Controls the displaying of debug
information.
0 - No debug info is displayed.
Bit 0 (0x0001) - display debug messages.
Bit 1 (0x0002) - display send packets.
Bit 2 (0x0004) - display receive packets.
RETURNS: an error value (not 0) if the procedure fails to communicate
with the host.
****************************************************************************/
short SNMP_WriteRead_ (SNMP_HOST_INT_T *host_int, <--32
SNMP_PKT_T *spkt,
SNMP_PKT_T **rpkt,
EBUFFER_T *ebuffp,
unsigned short debug_flag)
{
short err = 0;
int err2 = 0;
long IO_tag = 1;
unsigned char *IOC_buffp; /* IO complete buffer pointer */
EBUFFER_T myEBuff; /* A modified version of ebuffp that */ <--33
/* points past the sockaddr_in field */
Example 2-2. Contents of snmpfsc (page 13 of 19)