82
82
static int device_id(const char *ip, int port, char *buffer, int size)
84
84
int len=0, maxSize, result, dt, status;
86
87
maxSize = (size > 1024) ? 1024 : size; /* RH8 has a size limit for device id */
88
if ((len = GetSnmp(ip, port, (char *)kStatusOID, (unsigned char *)buffer, maxSize, &dt, &status, &result)) == 0)
89
if ((len = GetSnmp(ip, public_comunity_index, (char *)kStatusOID, (unsigned char *)buffer, maxSize, &dt, &status, &result)) == 0)
91
if ((len = GetSnmp(ip, port, (char *)kStatusOID, (unsigned char *)buffer, maxSize, &dt, &status, &result)) == 0)
91
97
return len; /* length does not include zero termination */