SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-21
Managers Supporting UDP and IPC
  case READ_FAILED:
   sprintf (myBuff, "Read returned error %i", det_err_num);
   return myBuff;
  case HOST_INT_ERROR:
   return "SNMP_HOST_INT_T structure error";
  case HOSTNAME_ERROR:
   return "Hostname error";
  case LOCAL_HOSTNAME:
   return "Local hostname";
  case REMOTE_HOSTNAME:
   return "Remote hostname";
  default:
 } /* end of switch (err_num) */
} /* End SNMP_FS_ErrMsg_ */
#pragma page
/***************************************************************************
NAME:  SNMP_Init_
PURPOSE:  Determine if host name parameter is local or remote and
   initialize the SNMP_HOST_INT_T structure.
PARAMETERS: SNMP_HOST_INT_T * Location of converted host interface struct.
   SHORT  Size of the SNMP_HOST_INT_T structure.
   CHAR *  Hostname string (in_name) to check (input).
RETURNS: 1 - if local, 0 - if remote, Else - error number
****************************************************************************/
short SNMP_Init_ (SNMP_HOST_INT_T *host_int, short host_int_size, <--23
     char *in_name)
{
 struct hostent *host;
 char   *t2;
 short  val;
 if (host_int_size != sizeof(*host_int))
  return HOST_INT_ERROR;
Example 2-2. Contents of snmpfsc (page 8 of 19)










