+ /*
+ * Part detecting ap_type (ATMEL AP MIB type) follows.
+ * We could use get_mib_details() here with advantage, but it would
+ * have to involve 1. putting it to separate file in lib/ and
+ * 2. patch it so it would not contain curses-related commands (TODO)
+ */
+
+ /* determine private MIB type according to enterprises ID */
+ varbinds[0].oid = sysDescr_NWN;
+ varbinds[0].len_oid = sizeof(sysDescr_NWN);
+ varbinds[0].value = NULL;
+ varbinds[0].len_val = 0;
+ varbinds[0].type = NULL_VALUE;
+ if (snmp(varbinds, 1, GET) > 0) {
+ ap_type = NWN;
+ } else {
+ varbinds[0].oid = sysDescr_ATMEL;
+ varbinds[0].len_oid = sizeof(sysDescr_ATMEL);
+ varbinds[0].value = NULL;
+ varbinds[0].len_val = 0;
+ varbinds[0].type = NULL_VALUE;
+ if (snmp(varbinds, 1, GET) > 0) {
+ ap_type = ATMEL410;
+ } else {
+ sysDescr_ATMEL[5] = 0xE0;
+ sysDescr_ATMEL[6] = 0x3E;
+ varbinds[0].oid = sysDescr_ATMEL;
+ varbinds[0].len_oid = sizeof(sysDescr_ATMEL);
+ varbinds[0].value = NULL;
+ varbinds[0].len_val = 0;
+ varbinds[0].type = NULL_VALUE;
+ if (snmp(varbinds, 1, GET) > 0) {
+ ap_type = ATMEL12350;
+ } else {
+ printf(_("Unable to determine AP MIB type "
+ "(no response from AP)."));
+ return 1;
+ }
+ }
+ }