SNMP Manager Programmer's Guide

Programming Examples
SNMP Manager Programmer’s Guide–134249
2-15
Managers Supporting UDP and IPC
#define MAXNAMEBUF 80 <--2
#define MAXHOSTNAME 8
#define INVALID_HOST_ADDR 0XFFFFFFFFl
/* Defines for the return values for the check_host_name procedure. */
#define CK_REMOTE_NAME 1 /* name is undefined on EXPAND */ <--3
#define CK_LOCAL_NAME 2 /* name is the same as local system */
#define CK_REMOTE_NAME_NOBSL_EXPAND 3 /* remote name and doesn't have '\' */
#define CK_REMOTE_NAME_BSL_EXPAND 4 /* remote name with '\' */
#define CK_REMOTE_IP 5 /* remote IP addr. */
#define CK_REMOTE_IP_EXPAND 6 /* remote IP addr., and is defined */
/* in HOSTS file. */
/* Defines for the return values for the SNMP_* procedures. */
#define HOSTNAME_ERROR -11
#define NAME_TOO_LONG -10 <--4
#define NO_SOCKET_ERROR -9
#define BAD_EBUFF_PARAM -8
#define REQ_ID_MISMATCH -7
#define DECODE_FAILED -6
#define ENCODE_FAILED -5
#define WRITE_FAILED -4
#define READ_FAILED -3
#define HOST_INT_ERROR -2
/* Don't use -1, just to be safe. */
#define LOCAL_HOSTNAME 1 <--5
#define REMOTE_HOSTNAME 0
/* Defines for the debug flag. This 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. */
#define PRINT_DEBUG_MSG ((debug_flag & 0x0001) == 0x0001) <--6
#define PRINT_SEND_MSG ((debug_flag & 0x0002) == 0x0002)
#define PRINT_RECV_MSG ((debug_flag & 0x0004) == 0x0004)
Example 2-2. Contents of snmpfsc (page 2 of 19)