void atmel_sysinfo()
{
- char sysDescr[] =
- { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01,
- 0x01, 0x01, 0x00
+ char sysDescr[] = {
+ 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01, 0x01, 0x01, 0x00
};
- char sysDeviceInfo[] =
- { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01,
- 0x01, 0x05, 0x00
+ char sysDeviceInfo[] = {
+ 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A, 0x01, 0x01, 0x01, 0x05, 0x00
+ };
+ /* This one is ATMEL12350 VERNET MIB specific. */
+ char UpTime[] = {
+ 0x2B, 0x06, 0x01, 0x04, 0x01, 0xE0, 0x3E, 0x01, 0x02, 0x09, 0x01, 0x00
};
char message[200];
int i;
- varbind varbinds[2];
+ varbind varbinds[3];
+ struct SysDeviceInfo_ATMEL410 ptr410;
+ struct SysDeviceInfo_ATMEL12350 ptr12350;
extern short ap_type;
- struct SysDeviceInfo_ATMEL410 ptr410;
- struct SysDeviceInfo_ATMEL12350 ptr12350;
+ extern char IS_ATMEL12350_VERNET;
/*
* These have to represent used SysDeviceInfo_{ATMEL410,ATMEL12350} members
sysDeviceInfo[6] = 0x3E;
}
+ i = 0;
+
varbinds[0].oid = sysDescr;
varbinds[0].len_oid = sizeof(sysDescr);
varbinds[0].value = sysDescr;
varbinds[0].type = NULL_VALUE;
varbinds[0].len_val = 0;
+ i++;
varbinds[1].oid = sysDeviceInfo;
varbinds[1].len_oid = sizeof(sysDeviceInfo);
- varbinds[1].value = sysDescr;
+ varbinds[1].value = sysDeviceInfo;
varbinds[1].len_val = 0;
varbinds[1].type = NULL_VALUE;
+ i++;
+
+ if (IS_ATMEL12350_VERNET) {
+ varbinds[2].oid = UpTime;
+ varbinds[2].len_oid = sizeof(UpTime);
+ varbinds[2].value = UpTime;
+ varbinds[2].len_val = 0;
+ varbinds[2].type = NULL_VALUE;
+ i++;
+ }
print_help(WAIT_RET);
- if (snmp(varbinds, 2, GET) <= 0) {
+ if (snmp(varbinds, i, GET) <= 0) {
print_helperr(ERR_RET);
goto exit;
}
} else { /* ATMEL12350 */
memcpy(&ptr12350, varbinds[1].value, sizeof(struct SysDeviceInfo_ATMEL12350));
- ap_regdomain=ptr12350.RegulationDomain;
+ ap_regdomain = ptr12350.RegulationDomain;
ap_sversion = ptr12350.StructVersion;
ap_macaddr = ptr12350.MacAddress;
ap_prodtype = ptr12350.ProductType;
oui2manufacturer(ap_macaddr));
mvwaddstr(main_sub, 10, 0, message);
+ if (IS_ATMEL12350_VERNET) {
+ i = varbinds[2].len_val == 2 ?
+ (varbinds[2].value[0] << 8) | varbinds[2].value[1] :
+ varbinds[2].value[0] < 0x80 ?
+ varbinds[2].value[0] : 0xff00 | varbinds[2].value[0];
+ sprintf(message, _("Uptime: %u days, %02u:%02u:%02u hours:mins:secs"),
+ i / 60 / 60 / 24, i / 60 / 60 % 24, i / 60 % 60, i % 60);
+ mvwaddstr(main_sub, 11, 0, message);
+ }
+
wrefresh(main_sub);
print_help(ANY_KEY);
exit:
goto exit;
}
- sprintf(message, _("WEP inplemented: %s"),
+ sprintf(message, _("WEP implemented: %s"),
(*(varbinds[0].value) == 1) ? ON : OFF);
mvwaddstr(main_sub, 13, 0, message);
sprintf(message, _("Diversity: %s"),