SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-131
SNMPHOST Source Code
GetDiskCapacity (DEV_ENTRY_T* pEntry)
{
 return pEntry->auxInfo.nDiskCapacity;
} /* GetDiskCapacity */
short
GetHostDevices (SNMP_HOST_INT_T* host_int, <--14
 DEV_ENTRY_T** ppDevTable, short devcnt, char* community,
 short retrycnt, int requestid)
{
 short   bMoreEntries; <--15
 static OBJ_ID_T  devIndexObj;
 short   err1;
 char    hrDeviceDescr[] = "1.3.6.1.2.1.25.3.2.1.3";
 char    hrDeviceIndex[] = "1.3.6.1.2.1.25.3.2.1.1";
 char    hrDeviceStatus[] = "1.3.6.1.2.1.25.3.2.1.5";
 char    hrDeviceType[] = "1.3.6.1.2.1.25.3.2.1.2";
 short   i;
 short   nCurrDevIndex = 0;
 OBJ_ID_T   *objp;
 DEV_ENTRY_T  *pCurrOutputEntry;
 SNMP_PKT_T  *pkt = 0;
 SNMP_PKT_T  *recv_pkt = 0;
#define MAX_OID_STR_LEN 128
 char    strOid[MAX_OID_STR_LEN];
 short   vbIndex = 0;
 VB_T    *vbp;
 /* Set up a Getnext request for 4 Host device table variables */
 pkt = SNMP_Create_Request(GET_NEXT_REQUEST_PDU, VERSION_RFC1067, <--16
   strlen(community), community, (INT_32_T)requestid, 4);
 /* Set up the hrDeviceIndex */
 base_oid.num_components = oidstring2oid (hrDeviceIndex, <--17
   base_oid.component_list, MAX_OID_COUNT);
 if (base_oid.num_components == 0) {
  fprintf(stdout, "Bad object identifier: %s\n", hrDeviceIndex);
  exit(0);
 }
Example 2-18. Contents of snmphosc (page 6 of 23)










