- mvwaddstr(main_sub, 2, 0, message);
-
- mvwaddstr(main_sub, 3, 0, _("Product name:"));
- for (i = 0; i < 32 && ap_prodname[i]; i++) {
- mvwaddch(main_sub, 3, i + 14, ap_prodname[i]);
- }
-
- sprintf(message, _("Product type: %u"), swap4(ap_prodtype));
- mvwaddstr(main_sub, 4, 0, message);
-
- sprintf(message, _("Hardware revision: %u"), swap4(ap_hwrev));
- mvwaddstr(main_sub, 5, 0, message);
-
- mvwaddstr(main_sub, 6, 0, _("OEM name:"));
- for (i = 0; i < 32 && ap_oemname[i]; i++) {
- mvwaddch(main_sub, 6, i + 10, ap_oemname[i]);
+ mvwaddstr(main_sub, 3, 0, message);
+
+ mvwaddstr(main_sub, 4, 0, _("Product name: "));
+ for (i = 0; i < 32 && ap_prodname[i]; i++)
+ waddch(main_sub, ap_prodname[i]);
+
+ sprintf(message, _("Product type: %u"), swap4(ap_prodtype));
+ mvwaddstr(main_sub, 5, 0, message);
+
+ mvwaddstr(main_sub, 6, 0, _("OEM name: "));
+ for (i = 0; i < 32 && ap_oemname[i]; i++)
+ waddch(main_sub, ap_oemname[i]);
+
+ sprintf(message, "OEM ID: %u", swap4(ap_oemid));
+ mvwaddstr(main_sub, 7, 0, message);
+
+ sprintf(message, _("Hardware revision: %u"), swap4(ap_hwrev));
+ mvwaddstr(main_sub, 8, 0, message);
+
+ i = regdom_idx(ap_regdomain);
+ sprintf(message, "Regulatory domain: %s [%d]",
+ regdom_types[i].desc, ap_regdomain);
+ mvwaddstr(main_sub, 9, 0, message);
+
+ sprintf(message, _("Info structure version: %u"), swap4(ap_sversion));
+ mvwaddstr(main_sub, 10, 0, message);
+
+ sprintf(message, _("Manufacturer OUI: %02X %02X %02X (%s)"),
+ ap_macaddr[0] & 0xFF, ap_macaddr[1] & 0xFF, ap_macaddr[2] & 0xFF,
+ oui2manufacturer(ap_macaddr));
+ mvwaddstr(main_sub, 11, 0, message);
+
+ if (ap_type == ATMEL12350 && ap_vendorext == EZYNET) {
+ unsigned int j = 0;
+
+ if (varbinds[3].len_val > 1) {
+ for (i = 0; i < varbinds[3].len_val; i++)
+ j |= (varbinds[3].value[i]
+ << (8 * (varbinds[3].len_val - i - 1)));
+ } else {
+ j = varbinds[3].value[0] & 0x80 ?
+ 0xff00 | varbinds[3].value[0] : varbinds[3].value[0];
+ }
+ sprintf(message,
+ _("Uptime: %u days, %02u:%02u:%02u hours:mins:secs"),
+ j / 60 / 60 / 24, j / 60 / 60 % 24, j / 60 % 60, j % 60);
+ mvwaddstr(main_sub, 12, 0, message);
+ }
+
+ wrefresh(main_sub);
+
+ i = wait_key(poll_delay);
+ if (i == -1)
+ goto quit;
+
+ switch((char) i) {
+ case 'q':
+ case 'Q':
+ goto quit;
+ case 't':
+ case 'T':
+ wait_mode = (wait_mode == WAIT_FOREVER ?
+ WAIT_TIMEOUT : WAIT_FOREVER);
+ print_top(wait_mode == WAIT_TIMEOUT ? POLL_ON : POLL_OFF,
+ SYSINFO);
+ }
+
+ /* either timeout for user input (i == 0) or invalid key => continue */