+ /*
+ * 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;
+ }
+ }
+ }
+
+ if (ap_type == NWN) {
+ printf("NWN devices are not yet supported.");
+ return 1;
+ }
+
+ if (ap_type == ATMEL12350) {
+ bridgeOperationalMode[5] = 0xE0;
+ bridgeOperationalMode[6] = 0x3E;
+ EthRxStatistics[5] = 0xE0;
+ EthRxStatistics[6] = 0x3E;
+ EthTxStatistics[5] = 0xE0;
+ EthTxStatistics[6] = 0x3E;
+ operAccessPointName[5] = 0xE0;
+ operAccessPointName[6] = 0x3E;
+ wirelessStatistics[5] = 0xE0;
+ wirelessStatistics[6] = 0x3E;
+ AssociatedSTAsNum[5] = 0xE0;
+ AssociatedSTAsNum[6] = 0x3E;
+ wirelessKnownAPs[5] = 0xE0;
+ wirelessKnownAPs[6] = 0x3E;
+ }
+