+ int readen = 0;
+
+ if (community) {
+ /*
+ * OK, looks like we want to upgrade SmartBridges hardware => no
+ * firmware file cutoff, and lets check whether the target device
+ * appears to have SmartBridges firmware. If not, bail out.
+ */
+/*
+ char operEthernetAddress[12] = {
+ 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A,
+ 0x01, 0x01, 0x02, 0x03, 0x00
+ };
+*/
+ char AuthRadiusIP[] = {
+ 0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1A,
+ 0x01, 0x02, 0x06, 0x03, 0x00
+ };
+ varbind varbinds[1];
+
+ maxdlen = sb.st_size;
+
+/*
+ varbinds[0].oid = operEthernetAddress;
+ varbinds[0].len_oid = sizeof(operEthernetAddress);
+*/
+ varbinds[0].oid = AuthRadiusIP;
+ varbinds[0].len_oid = sizeof(AuthRadiusIP);
+ varbinds[0].value = NULL;
+ varbinds[0].len_val = 0;
+ varbinds[0].type = NULL_VALUE;
+ if (snmp(varbinds, 1, GET) > 0) {
+/*
+ i = varbinds[0].value[0] << 24 |
+ varbinds[0].value[1] << 16 |
+ varbinds[0].value[2] << 8 |
+ varbinds[0].value[3];
+ if (i != 0x00301A09) {
+*/
+ if (varbinds[0].len_val != 4) {
+ printf(_("Error: device with the given IP does not seem "
+ "to run SmartBridges firmware.\n"));
+ result = EXIT_FAILURE;
+ goto quit;
+ }
+ } else {
+ printf(_("Error: SNMP authorization error or device unavailable"
+ ".\n"));
+ result = EXIT_FAILURE;
+ goto quit;
+ }
+ } else {
+ /* non-SB hardware */
+ maxdlen = 94448;
+ }