SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-24
Managers Supporting UDP and IPC
#pragma page
/***************************************************************************
NAME: SNMP_Open_
PURPOSE: Create a path to get to the SNMP agent based upon the
info in the SNMP_HOST_INT_T structure. This will either
get a SOCKET or open a file.
PARAMETERS: SNMP_HOST_INT_T * Location of host interface struct.
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) - not used.
Bit 2 (0x0004) - not used.
RETURNS: 0 - if no error. Else error number.
****************************************************************************/
short SNMP_Open_ (SNMP_HOST_INT_T *host_int, <--28
unsigned short debug_flag)
{
char temp_file_name[28];
if (host_int->version != 1)
return HOST_INT_ERROR;
host_int->err_num = 0;
if(host_int->local_flag == REMOTE_HOSTNAME)
{
/* Remote Access using sockets */
/* nowait depth set to 2 for concurrent read and write */
if ((host_int->file_num = socket_nw(AF_INET, SOCK_DGRAM, 0, <--29
2, 1)) == -1)
{
return NO_SOCKET_ERROR;
}
Example 2-2. Contents of snmpfsc (page 11 of 19)