+* *
+****************************************************************************/
+unsigned char *
-+var_ieee802dot11 ( struct variable *vp,
-+ oid *name,
-+ size_t *length,
-+ int exact,
-+ size_t *var_len,
++var_ieee802dot11 ( struct variable *vp,
++ oid *name,
++ size_t *length,
++ int exact,
++ size_t *var_len,
+ WriteMethod **write_method)
+{
-+ loadTables();
++ loadTables();
+
+ if ( header_generic ( vp, name, length, exact,var_len,write_method )
+ == MATCH_FAILED )
+ for ( np = LIST_FIRST ( &scList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
+ sc = ( struct scTbl_data * ) np->data;
+ rName[vp->namelen] = sc->ifIndex;
-+ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
++ if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
+ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
+
+ switch ( vp->magic ) { // found requested OID, now check for requested variable
-+ case DOT11STATIONID:
++ case DOT11STATIONID:
+ if ( sc->haveStationID ) found = TRUE; break;
+ case DOT11MEDIUMOCCUPANCYLIMIT:
+ if ( sc->haveMediumOccupancyLimit ) found = TRUE; break;
+ if ( sc->haveDesiredBSSType ) found = TRUE; break;
+ case DOT11OPERATIONALRATESET:
+ if ( sc->haveOperationalRateSet ) found = TRUE; break;
-+ case DOT11BEACONPERIOD:
++ case DOT11BEACONPERIOD:
+ if ( sc->haveBeaconPeriod ) found = TRUE; break;
+ case DOT11DTIMPERIOD:
+ if ( sc->haveDTIMPeriod ) found = TRUE; break;
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+
+ switch ( vp->magic ) {
+
-+ case DOT11STATIONID:
++ case DOT11STATIONID:
+// *write_method = write_dot11StationID;
+ MACWork[ 0] = sc->stationID [ 0];
+ MACWork[ 1] = sc->stationID [ 1];
+ *var_len = strlen ( sc->operationalRateSet );
+ return ( UCHAR * ) sc->operationalRateSet;
+
-+ case DOT11BEACONPERIOD:
++ case DOT11BEACONPERIOD:
+// *write_method = write_dot11BeaconPeriod;
+ return ( UCHAR * ) &sc->beaconPeriod;
+
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
+
+ case DOT11AUTHENTICATIONALGORITHM:
+ return ( UCHAR * ) &aa->authenticationAlgorithm;
-+
++
+ case DOT11AUTHENTICATIONALGORITHMSENABLE:
+// *write_method = write_dot11AuthenticationAlgorithmsEnable;
+ return ( UCHAR * ) &aa->authenticationAlgorithmsEnable;
+ switch ( vp->magic ) {
+ case DOT11WEPDEFAULTKEYVALUE:
+ if ( df->haveWEPDefaultKeyValue ) found = TRUE; break;
-+ }
-+ }
++ }
++ }
+ if ( found )
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
+ case DOT11WEPKEYMAPPINGVALUE:
+ if ( km->haveWEPKeyMappingValue ) found = TRUE; break;
+ case DOT11WEPKEYMAPPINGSTATUS:
-+ if ( km->haveWEPKeyMappingStatus ) found = TRUE; break;
++ if ( km->haveWEPKeyMappingStatus ) found = TRUE; break;
+ }
+ }
+ if ( found )
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
+ if ( pr->haveWEPICVErrorCount ) found = TRUE; break;
+ case DOT11WEPEXCLUDEDCOUNT:
+ if ( pr->haveWEPExcludedCount ) found = TRUE; break;
-+ }
++ }
+ }
+ if ( found )
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+
+ case DOT11WEPICVERRORCOUNT:
+ return ( UCHAR * ) &pr->WEPICVErrorCount;
-+
++
+ case DOT11WEPEXCLUDEDCOUNT:
+ return ( UCHAR * ) &pr->WEPExcludedCount;
-+
++
+ default:
+ ERROR_MSG ( "" );
+ }
+ ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
+
+ switch ( vp->magic ) { // found requested OID, now check for requested variable
-+ case DOT11MACADDRESS:
++ case DOT11MACADDRESS:
+ if ( op->haveMACAddress ) found = TRUE; break;
-+ case DOT11RTSTHRESHOLD:
++ case DOT11RTSTHRESHOLD:
+ if ( op->haveRTSThreshold ) found = TRUE; break;
-+ case DOT11SHORTRETRYLIMIT:
++ case DOT11SHORTRETRYLIMIT:
+ if ( op->haveShortRetryLimit ) found = TRUE; break;
+ case DOT11LONGRETRYLIMIT:
+ if ( op->haveLongRetryLimit ) found = TRUE; break;
-+ case DOT11FRAGMENTATIONTHRESHOLD:
++ case DOT11FRAGMENTATIONTHRESHOLD:
+ if ( op->haveFragmentationThreshold ) found = TRUE; break;
-+ case DOT11MAXTRANSMITMSDULIFETIME:
++ case DOT11MAXTRANSMITMSDULIFETIME:
+ if ( op->haveMaxTransmitMSDULifetime ) found = TRUE; break;
+ case DOT11MAXRECEIVELIFETIME:
+ if ( op->haveMaxReceiveLifetime ) found = TRUE; break;
+ if ( op->haveProductID ) found = TRUE; break;
+ }
+ }
-+ if ( found )
++ if ( found )
+ break;
+ }
+
+ MACWork[12] = '\0';
+ *var_len = 6;
+ return ( UCHAR * ) htob ( MACWork );
-+
++
+ case DOT11RTSTHRESHOLD:
+// *write_method = write_dot11RTSThreshold;
+ return ( UCHAR * ) &op->RTSThreshold;
+ case DOT11PRODUCTID:
+ *var_len = strlen ( op->productID );
+ return ( UCHAR * ) op->productID;
-+
++
+ default:
+ ERROR_MSG ( "" );
+ }
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+ case DOT11FCSERRORCOUNT: return ( UCHAR * ) &co->FCSErrorCount;
+ case DOT11TRANSMITTEDFRAMECOUNT: return ( UCHAR * ) &co->transmittedFrameCount;
+ case DOT11WEPUNDECRYPTABLECOUNT: return ( UCHAR * ) &co->WEPUndecryptableCount;
-+
++
+ default:
+ ERROR_MSG ( "" );
+ }
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+ case DOT11MANUFACTUREROUI:
+ *var_len = strlen ( ri->manufacturerOUI );
+ return ( UCHAR * ) ri->manufacturerOUI;
-+
++
+ case DOT11MANUFACTURERNAME:
+ *var_len = strlen ( ri->manufacturerName );
+ return ( UCHAR * ) ri->manufacturerName;
-+
++
+ case DOT11MANUFACTURERPRODUCTNAME:
+ *var_len = strlen ( ri->manufacturerProductName );
+ return ( UCHAR * ) ri->manufacturerProductName;
-+
++
+ case DOT11MANUFACTURERPRODUCTVERSION:
+ *var_len = strlen ( ri->manufacturerProductVersion );
+ return ( UCHAR * ) ri->manufacturerProductVersion;
-+
-+ default:
++
++ default:
+ ERROR_MSG ( "" );
+ }
+
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+
+ case DOT11PHYTYPE:
+ return ( UCHAR * ) &po->PHYType;
-+
++
+ case DOT11CURRENTREGDOMAIN:
+// *write_method = write_dot11CurrentRegDomain;
+ return ( UCHAR * ) &po->currentRegDomain;
+
+ case DOT11TEMPTYPE:
+ return ( UCHAR * ) &po->tempType;
-+
++
+ default:
+ ERROR_MSG ( "" );
+ }
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+
+ case DOT11DIVERSITYSUPPORT:
+ return ( UCHAR * ) &pa->diversitySupport;
-+
++
+ case DOT11CURRENTRXANTENNA:
+// *write_method = write_dot11CurrentRxAntenna;
+ return ( UCHAR * ) &pa->currentRxAntenna;
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+
+ switch ( vp->magic ) {
+
-+ case DOT11NUMBERSUPPORTEDPOWERLEVELS:
++ case DOT11NUMBERSUPPORTEDPOWERLEVELS:
+ return ( UCHAR * ) &pt->numberSupportedPowerLevels;
+
+ case DOT11TXPOWERLEVEL1: return ( UCHAR * ) &pt->TxPowerLevel1;
+ case DOT11TXPOWERLEVEL6: return ( UCHAR * ) &pt->TxPowerLevel6;
+ case DOT11TXPOWERLEVEL7: return ( UCHAR * ) &pt->TxPowerLevel7;
+ case DOT11TXPOWERLEVEL8: return ( UCHAR * ) &pt->TxPowerLevel8;
-+
++
+ case DOT11CURRENTTXPOWERLEVEL:
+// *write_method = write_dot11CurrentTxPowerLevel;
+ return ( UCHAR * ) &pt->currentTxPowerLevel;
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+
+ case DOT11HOPTIME:
+ return ( UCHAR * ) &pf->hopTime;
-+
++
+ case DOT11CURRENTCHANNELNUMBER:
+// *write_method = write_dot11CurrentChannelNumber;
+ return ( UCHAR * ) &pf->currentChannelNumber;
+
+ case DOT11MAXDWELLTIME:
+ return ( UCHAR * ) &pf->maxDwellTime;
-+
++
+ case DOT11CURRENTDWELLTIME:
+// *write_method = write_dot11CurrentDwellTime;
+ return ( UCHAR * ) &pf->currentDwellTime;
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+
+ case DOT11CCAMODESUPPORTED:
+ return ( UCHAR * ) &pd->CCAModeSupported;
-+
++
+ case DOT11CURRENTCCAMODE:
+// *write_method = write_dot11CurrentCCAMode;
+ return ( UCHAR * ) &pd->currentCCAMode;
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
+
+ case DOT11REGDOMAINSSUPPORTVALUE:
+ return ( UCHAR * ) &rd->regDomainsSupportValue;
-+
++
+ default:
+ ERROR_MSG ( "" );
+ }
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
+
+ case DOT11SUPPORTEDDATARATESTXVALUE:
+ return ( UCHAR * ) &rt->supportedDataRatesTxValue;
-+
++
+ default:
+ ERROR_MSG ( "" );
+ }
+ break;
+ }
+
-+ if ( !found )
++ if ( !found )
+ return NULL;
+
+ memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
+
+ case DOT11SUPPORTEDDATARATESRXVALUE:
+ return ( UCHAR * ) &rr->supportedDataRatesRxValue;
-+
++
+ default:
+ ERROR_MSG ( "" );
+ }
+* load80211Structs() - load the 802.11 structures *
+* *
+****************************************************************************/
-+static void
++static void
+load80211Structs ( int skfd, char *ifName, struct wireless_info *wi )
+{
+ int rc, ifIndex = 0;
+ rc = ioctl ( skfd, SIOCGIFHWADDR, &ifr );
+ if ( rc >= 0 ) {
+
-+ sprintf ( MACAddress, "%02X:%02X:%02X:%02X:%02X:%02X",
-+ ( UCHAR ) ifr.ifr_hwaddr.sa_data[0], ( UCHAR ) ifr.ifr_hwaddr.sa_data[1],
-+ ( UCHAR ) ifr.ifr_hwaddr.sa_data[2], ( UCHAR ) ifr.ifr_hwaddr.sa_data[3],
++ sprintf ( MACAddress, "%02X:%02X:%02X:%02X:%02X:%02X",
++ ( UCHAR ) ifr.ifr_hwaddr.sa_data[0], ( UCHAR ) ifr.ifr_hwaddr.sa_data[1],
++ ( UCHAR ) ifr.ifr_hwaddr.sa_data[2], ( UCHAR ) ifr.ifr_hwaddr.sa_data[3],
+ ( UCHAR ) ifr.ifr_hwaddr.sa_data[4], ( UCHAR ) ifr.ifr_hwaddr.sa_data[5] );
+
+ nSc.haveStationID = TRUE;
+ nOp.haveMACAddress = TRUE;
+ strcpy ( nOp.MACAddress, MACAddress );
+ nRi.haveManufacturerOUI = TRUE;
-+ strncpy ( nRi.manufacturerOUI, MACAddress, MAN_OUI_LEN );
++ strncpy ( nRi.manufacturerOUI, MACAddress, MAN_OUI_LEN );
+
+ ifIndex = if_nametoindex ( ifName );
+ if ( !ifIndex ) {
-+ syslog ( LOG_ERR, "SNMP %s - %s %s\n",
++ syslog ( LOG_ERR, "SNMP %s - %s %s\n",
+ "ieee802dot11.load80211Structs()", ifName, "has no ifIndex" );
+ return;
+ }
+ }
+ }
+
-+//printf ( "%s - ifIndex: %ld ifName: %s UID: %s\n",
++//printf ( "%s - ifIndex: %ld ifName: %s UID: %s\n",
+// "load80211Structs() - HASCHANGED", ifIndex, ifName, nSc.UID );
+}
+
+* loadWiExtTo80211Structs() - load wireless extensions to 802.11 structures *
+* *
+****************************************************************************/
-+static void
++static void
+loadWiExtTo80211Structs ( int ifIndex, char *ifName, struct wireless_info *wi )
+{
+ int i, j = 0;
+ if ( wi->has_power ) {
+ nSc.havePowerManagementMode = TRUE;
+ nSc.powerManagementMode = 1; // assume power is active
-+ if ( !wi->power.disabled &&
++ if ( !wi->power.disabled &&
+ wi->power.flags & IW_POWER_MIN )
+ nSc.powerManagementMode = 2; // power save mode
+ }
+
+ if ( wi->has_essid && strlen ( wi->essid )) {
+ nSc.haveDesiredSSID = TRUE;
-+ strcpy ( nSc.desiredSSID, wi->essid );
++ strcpy ( nSc.desiredSSID, wi->essid );
+ }
+
+ if ( wi->has_mode ) {
+ nSc.haveDesiredBSSType = TRUE;
-+ if ( wi->mode == IW_MODE_ADHOC )
++ if ( wi->mode == IW_MODE_ADHOC )
+ nSc.desiredBSSType = 2; // independent
+ else if ( wi->has_ap_addr )
+ nSc.desiredBSSType = 1; // infrastructure
+ }
+
+ // dot11AuthenticationAlgorithmsTable
-+ nAa.haveAuthenticationAlgorithm = TRUE; // it's a rule to always have
++ nAa.haveAuthenticationAlgorithm = TRUE; // it's a rule to always have
+ nAa.haveAuthenticationAlgorithmsEnable = TRUE; // 'open' supported
+ nAa.ifIndex = ifIndex;
+ nAa.authenticationAlgorithmsIndex = 1; // index number one
+ // dot11PhyOperationTable
+ if ( strstr ( wi->name, "IEEE 802.11-FS" )) nPo.PHYType = 1; // So what if I
+ if ( strstr ( wi->name, "IEEE 802.11-DS" )) nPo.PHYType = 2; // made up a couple?
-+ if ( strstr ( wi->name, "IEEE 802.11-IR" )) nPo.PHYType = 3;
++ if ( strstr ( wi->name, "IEEE 802.11-IR" )) nPo.PHYType = 3;
+ if ( strstr ( wi->name, "IEEE 802.11-OFDM" )) nPo.PHYType = 4; // 802.11a
+ if ( strstr ( wi->name, "IEEE 802.11-OFDM/DS" )) nPo.PHYType = 5; // 802.11g
+ if ( strstr ( wi->name, "IEEE 802.11-TURBO" )) nPo.PHYType = 6; // Atheros TURBO mode
+ for ( i = 0; i < wi->range.num_frequency; i++ ) {
+ if ((( double ) ( wi->range.freq[i].e * 10 ) * ( double ) wi->range.freq[i].m ) == wi->freq ) {
+ nPd.haveCurrentChannel = TRUE;
-+ nPd.currentChannel = wi->range.freq[i].i;
++ nPd.currentChannel = wi->range.freq[i].i;
+ }
+ }
+ }
+ }
+ }
+
-+//printf ( "%s max_encoding_tokens: %d\n",
++//printf ( "%s max_encoding_tokens: %d\n",
+// "loadWiExtTo80211Structs() - ", wi->range.max_encoding_tokens );
+}
+
+ }
+
+ /* Get retry limit/lifetime */ // #if WIRELESS_EXT > 10
-+ if ( ioctl ( skfd, SIOCGIWRETRY, &wrq ) >= 0 ) {
++ if ( ioctl ( skfd, SIOCGIWRETRY, &wrq ) >= 0 ) {
+ wi->has_retry = 1;
+ memcpy ( &wi->retry, &wrq.u.retry, sizeof ( iwparam ));
+ }
+ s = bfr;
+ s = strchr ( s, ':' ); s++; /* Skip ethX: */
+ s = strtok ( s, " " ); /* ' ' => '\0' */
-+ sscanf ( s, "%hX", &wi->stats.status ); // status
++ sscanf ( s, "%hX", &wi->stats.status ); // status
+
+ s = strtok ( NULL, " " ); // link quality
+ if ( strchr ( s, '.' ) != NULL )
+ else
+ printf ( "%s %s\n", "SIOCGIWNICKN", " ===> no info.nickname support" );
+
-+ if ( info.has_essid )
++ if ( info.has_essid )
+ printf ( "%s essid_on: %d essid: %s\n", "SIOCGIWESSID", info.essid_on, info.essid );
+ else
+ printf ( "%s %s\n", "SIOCGIWESSID", " ===> no info.essid support" );
+ printf ( "%s max_nwid: %d\n", "SIOCGIWRANGE", info.range.max_nwid );
+ printf ( "%s sensitivity: %d\n", "SIOCGIWRANGE", info.range.sensitivity );
+ printf ( "%s num_bitrates: %d\n", "SIOCGIWRANGE", info.range.num_bitrates );
-+ for ( i = 0; i < info.range.num_bitrates; i++ )
++ for ( i = 0; i < info.range.num_bitrates; i++ )
+ printf ( "%s bitrate[%d]: %d\n", "SIOCGIWRANGE", i, info.range.bitrate[i] );
+ printf ( "%s min_rts: %d\n", "SIOCGIWRANGE", info.range.min_rts );
+ printf ( "%s max_rts: %d\n", "SIOCGIWRANGE", info.range.max_rts );
+ printf ( "%s pmt_flags: %d\n", "SIOCGIWRANGE", info.range.pmt_flags );
+ printf ( "%s pm_capa: %d\n", "SIOCGIWRANGE", info.range.pm_capa );
+ printf ( "%s num_encoding_sizes: %d\n", "SIOCGIWRANGE", info.range.num_encoding_sizes );
-+ for ( i = 0; i < info.range.num_encoding_sizes; i++ )
++ for ( i = 0; i < info.range.num_encoding_sizes; i++ )
+ printf ( "%s encoding_size[%d]: %d\n", "SIOCGIWRANGE", i, info.range.encoding_size[i] );
+ printf ( "%s max_encoding_tokens: %d\n", "SIOCGIWRANGE", info.range.max_encoding_tokens );
+// printf ( "%s encoding_login_index: %d\n", "SIOCGIWRANGE", info.range.encoding_login_index );
+ printf ( "%s txpower_capa: %d\n", "SIOCGIWRANGE", info.range.txpower_capa );
+ printf ( "%s num_txpower: %d dBm\n", "SIOCGIWRANGE", info.range.num_txpower );
-+ for ( i = 0; i < info.range.num_txpower; i++ )
++ for ( i = 0; i < info.range.num_txpower; i++ )
+ printf ( "%s txpower[%d]: %d\n", "SIOCGIWRANGE", i, info.range.txpower[i] );
+ printf ( "%s we_version_compiled: %d\n", "SIOCGIWRANGE", info.range.we_version_compiled );
+ printf ( "%s we_version_source: %d\n", "SIOCGIWRANGE", info.range.we_version_source );
+ printf ( "%s max_r_time: %d\n", "SIOCGIWRANGE", info.range.max_r_time );
+ printf ( "%s num_channels: %d\n", "SIOCGIWRANGE", info.range.num_channels );
+ printf ( "%s num_frequency: %d\n", "SIOCGIWRANGE", info.range.num_frequency );
-+ for ( i = 0; i < info.range.num_frequency; i++ )
-+ printf ( "%s freq[%d].i: %d freq[%d].e: %d freq[%d].m: %d\n", "SIOCGIWRANGE",
++ for ( i = 0; i < info.range.num_frequency; i++ )
++ printf ( "%s freq[%d].i: %d freq[%d].e: %d freq[%d].m: %d\n", "SIOCGIWRANGE",
+ i, info.range.freq[i].i, i, info.range.freq[i].e, i, info.range.freq[i].m );
+ }
+ else
+ printf ( "%s %s\n", "SIOCGIWRANGE", " ===> no info.range support" );
+
-+ if ( info.has_nwid )
++ if ( info.has_nwid )
+ printf ( "%s nwid - disabled: %d value: %X\n", "SIOCGIWNWID", info.nwid.disabled, info.nwid.value );
+ else
+ printf ( "%s %s\n", "SIOCGIWNWID", " ===> no info.nwid support" );
+ printf ( "%s %s\n", "SIOCGIWSENS", " ===> no info.sens support" );
+
+ if ( info.has_key ) {
-+ printf ( "%s key_size: %d key_flags: %d wepCurrentKey: %ld\n",
++ printf ( "%s key_size: %d key_flags: %d wepCurrentKey: %ld\n",
+ "SIOCGIWENCODE", info.key_size, info.key_flags, wepCurrentKey );
+ printf ( "%s MODE: %d DISABLED: %d INDEX: %d OPEN: %d RESTRICTED: %d NOKEY: %d TEMP: %d\n",
+ "SIOCGIWENCODE", info.key_flags & IW_ENCODE_MODE,
+
+ for ( i = 0; i < MAX_WEP_KEYS; i++ ) {
+ if ( wep[i].haveKey )
-+ printf ( "%s wep[%d].len: %ld wep[%d].key: %s\n",
++ printf ( "%s wep[%d].len: %ld wep[%d].key: %s\n",
+ "SIOCGIWENCODE", i, wep[i].len, i, wep[i].key );
+ }
+
+ if ( info.has_ap_addr )
-+ printf ( "%s ap_addr.sa_data: %02X:%02X:%02X:%02X:%02X:%02X ap_addr.sa_family: %d\n",
-+ "SIOCGIWAP", ( UCHAR ) info.ap_addr.sa_data[0], ( UCHAR ) info.ap_addr.sa_data[1],
-+ ( UCHAR ) info.ap_addr.sa_data[2], ( UCHAR ) info.ap_addr.sa_data[3],
-+ ( UCHAR ) info.ap_addr.sa_data[4], ( UCHAR ) info.ap_addr.sa_data[5],
++ printf ( "%s ap_addr.sa_data: %02X:%02X:%02X:%02X:%02X:%02X ap_addr.sa_family: %d\n",
++ "SIOCGIWAP", ( UCHAR ) info.ap_addr.sa_data[0], ( UCHAR ) info.ap_addr.sa_data[1],
++ ( UCHAR ) info.ap_addr.sa_data[2], ( UCHAR ) info.ap_addr.sa_data[3],
++ ( UCHAR ) info.ap_addr.sa_data[4], ( UCHAR ) info.ap_addr.sa_data[5],
+ info.ap_addr.sa_family );
+ else
+ printf ( "%s %s\n", "SIOCGIWAP", " ===> no ap_addr information" );
+
+ if ( info.has_bitrate )
-+ printf ( "%s bitrate: %" PRIdPTR " value: %d fixed: %d disabled: %d flags: %d\n",
-+ "SIOCGIWRATE", *(intptr_t *)&info.bitrate, info.bitrate.value, info.bitrate.fixed,
++ printf ( "%s bitrate: %" PRIdPTR " value: %d fixed: %d disabled: %d flags: %d\n",
++ "SIOCGIWRATE", *(intptr_t *)&info.bitrate, info.bitrate.value, info.bitrate.fixed,
+ info.bitrate.disabled, info.bitrate.flags );
+ else
+ printf ( "%s %s\n", "SIOCGIWRATE", " ===> no info.bitrate support" );
+ else
+ printf ( "%s %s\n", "SIOCGIWFRAG", " ===> no info.frag support" );
+
-+ if ( info.has_mode )
++ if ( info.has_mode )
+ printf ( "%s mode: %d\n", "SIOCGIWMODE", info.mode );
+ else
+ printf ( "%s %s\n", "SIOCGIWMODE", " ===> no info.mode support" );
+ printf ( "%s power: %" PRIdPTR "\n", "SIOCGIWPOWER", *(intptr_t *)&info.power );
+ printf ( "%s disabled: %d MIN: %d MAX: %d TIMEOUT: %d RELATIVE: %d\n",
+ "SIOCGIWPOWER",
-+ info.power.disabled ? 1:0,
-+ info.power.flags & IW_POWER_MIN ? 1:0,
-+ info.power.flags & IW_POWER_MAX ? 1:0,
-+ info.power.flags & IW_POWER_TIMEOUT ? 1:0,
-+ info.power.flags & IW_POWER_RELATIVE ? 1:0 );
++ info.power.disabled ? 1:0,
++ info.power.flags & IW_POWER_MIN ? 1:0,
++ info.power.flags & IW_POWER_MAX ? 1:0,
++ info.power.flags & IW_POWER_TIMEOUT ? 1:0,
++ info.power.flags & IW_POWER_RELATIVE ? 1:0 );
+ printf ( "%s UNICAST: %d MULTICAST: %d ALL: %d FORCE: %d REPEATER: %d\n",
+ "SIOCGIWPOWER",
-+ info.power.flags & IW_POWER_UNICAST_R ? 1:0,
-+ info.power.flags & IW_POWER_MULTICAST_R ? 1:0,
-+ info.power.flags & IW_POWER_ALL_R ? 1:0,
-+ info.power.flags & IW_POWER_FORCE_S ? 1:0,
-+ info.power.flags & IW_POWER_REPEATER ? 1:0 );
++ info.power.flags & IW_POWER_UNICAST_R ? 1:0,
++ info.power.flags & IW_POWER_MULTICAST_R ? 1:0,
++ info.power.flags & IW_POWER_ALL_R ? 1:0,
++ info.power.flags & IW_POWER_FORCE_S ? 1:0,
++ info.power.flags & IW_POWER_REPEATER ? 1:0 );
+ }
+ else
+ printf ( "%s %s\n", "SIOCGIWPOWER", " ===> no info.power support" );
+ printf ( "%s %s\n", "SIOCGIWSTATS", " ===> no info.stats support" );
+
+ if ( info.txpower.flags & IW_TXPOW_MWATT )
-+ printf ( "%s txpower1: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE",
++ printf ( "%s txpower1: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE",
+ mWatt2dbm ( info.txpower.value ), info.txpower.disabled, info.txpower.fixed, info.txpower.flags);
+ else
+ printf ( "%s txpower2: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE", info.txpower.value, info.txpower.disabled, info.txpower.fixed, info.txpower.flags );
+
-+ if ( info.has_range )
++ if ( info.has_range )
+ if ( info.sens.value < 0 )
+ printf ( "%s sens: %d dBm\n", "SIOCGIWRANGE", info.sens.value );
+ else
+* addList() - add an entry to a linked list *
+* *
+****************************************************************************/
-+static void
++static void
+addList ( char *l, char *data, int len )
+{
+ char uid[256];
-+ avList_t *list;
++ avList_t *list;
+
-+ // NOTE: this assumes the UID is at the beginning of the
++ // NOTE: this assumes the UID is at the beginning of the
+ // data structure and that UIDs are strings
-+
-+ list = ( avList_t * ) l; // NOTE: don't know how to get
++
++ list = ( avList_t * ) l; // NOTE: don't know how to get
+ strcpy ( uid, data ); // rid of compiler warning on
+ // LISTHEAD typecast
+ // create a new node and the data that goes in it
+static void flushList ( char *l )
+{
+ avList_t *list;
-+
-+ list = ( avList_t * ) l; // NOTE: don't know how to get
++
++ list = ( avList_t * ) l; // NOTE: don't know how to get
+ while ( !LIST_EMPTY ( list )) { // rid of compiler warning on
+ np = LIST_FIRST ( list ); // LISTHEAD typecast
+ if ( np->data )
+/****************************************************************************
+* Linked List Defines *
+****************************************************************************/
-+// here are some Linked List MACROS I wanted to use,
++// here are some Linked List MACROS I wanted to use,
+// but curiously were not in /usr/includes/sys/queue.h
+
+#ifndef LIST_EMPTY
+/****************************************************************************
+* Linked List Structure *
+****************************************************************************/
-+struct avNode {
-+ LIST_ENTRY ( avNode ) nodes;
++struct avNode {
++ LIST_ENTRY ( avNode ) nodes;
+ char *data; // pointer to data
+};
+
+/****************************************************************************
+* *
+****************************************************************************/
-+config_require(util_funcs)
++config_require(util_funcs);
+
+/* function prototypes */
+
+#error "Your kernel/libc combination is not supported"
+#endif
+
-+#ifdef GENERIC_HEADERS
++#ifdef GENERIC_HEADERS
+/* Proposed by Dr. Michael Rietz <rietz@mail.amps.de>, 27.3.2 */
+/* If this works for all, it might be more stable on the long term - Jean II */
+#include <net/if_arp.h> /* For ARPHRD_ETHER */
+#include <sys/socket.h> /* For AF_INET & struct sockaddr */
+#include <netinet/in.h> /* For struct sockaddr_in */
+#include <netinet/if_ether.h>
-+#endif /* GENERIC_HEADERS */
++#endif /* GENERIC_HEADERS */
+
-+#ifdef GLIBC22_HEADERS
++#ifdef GLIBC22_HEADERS
+/* Added by Ross G. Miller <Ross_Miller@baylor.edu>, 3/28/01 */
+#include <linux/if_arp.h> /* For ARPHRD_ETHER */
+#include <linux/socket.h> /* For AF_INET & struct sockaddr */
+#include <sys/socket.h>
-+#endif /* GLIBC22_HEADERS */
++#endif /* GLIBC22_HEADERS */
+
+#ifdef KLUDGE_HEADERS
+#include <socketbits.h>
+#endif
+
+#endif /* IWLIB_H */
+--- a/agent/mib_modules.c
++++ b/agent/mib_modules.c
+@@ -42,6 +42,7 @@
+ #include <net-snmp/agent/table.h>
+ #include <net-snmp/agent/table_iterator.h>
+ #include "mib_module_includes.h"
++#include "mibgroup/ieee802dot11.h"
+
+ static int need_shutdown = 0;
+
+++ /dev/null
---- a/configure.d/config_modules_agent
-+++ b/configure.d/config_modules_agent
-@@ -27,8 +27,6 @@ done
- #
- AC_MSG_CHECKING([for and configuring mib modules to use])
-
--AH_TOP([#define NETSNMP_REQUIRE_SEMICOLON extern void netsnmp_unused_function(void)])
--
- # set up the CPP command
- MODULECPP="$CPP $PARTIALTARGETFLAGS $CPPFLAGS -DNETSNMP_FEATURE_CHECKING -I${srcdir}/include -I${srcdir}/agent/mibgroup"
- if test "x$enable_mfd_rewrites" = "xyes"; then
-@@ -194,7 +192,7 @@ while test "x$new_module_list" != "x"; d
- # - mib_module => libnetsnmpmibs (default)
- # - agent_module => libnetsnmpagent
- #
-- AH_TOP([#define config_belongs_in(x) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_belongs_in(x)])
- module_type=mib_module
- if test -f $srcdir/$mibdir/$i.h; then
- changequote(, )
-@@ -279,7 +277,7 @@ while test "x$new_module_list" != "x"; d
- #
- # check if $i has any conflicts
- #
-- AH_TOP([#define config_exclude(x) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_exclude(x)])
- new_list_excl=`$MODULECPP module_tmp_header.h | \
- $SED -n 's/.*config_exclude(\(.*\)).*/\1/p'`
- if test "x$new_list_excl" != "x"; then
-@@ -308,7 +306,7 @@ while test "x$new_module_list" != "x"; d
- #
- # check if $i has any architecture specific requirements
- #
-- AH_TOP([#define config_arch_require(x,y) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_arch_require(x,y)])
- changequote(, )
- new_list_arch=`$MODULECPP module_tmp_header.h | \
- $SED -n 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/p'`
-@@ -330,7 +328,7 @@ while test "x$new_module_list" != "x"; d
- # macro: config_version_require((base, version, version-modules, ...))
- # - lists alternative modules used from different versions.
- #
-- AH_TOP([#define config_version_require(x) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_version_require(x)])
- [new_list_alt3=`$MODULECPP module_tmp_header.h | \
- $AWK '
- BEGIN {
-@@ -372,7 +370,7 @@ while test "x$new_module_list" != "x"; d
- #
- # check if $i has any other required modules
- #
-- AH_TOP([#define config_require(x) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_require(x)])
- new_list="$new_list `$MODULECPP module_tmp_header.h | \
- $SED -n 's/.*config_require(\(.*\)).*/\1/p'`"
- AC_MSG_MODULE_DBG(" $i will test: $new_list")
-@@ -409,7 +407,7 @@ while test "x$new_module_list" != "x"; d
- #
- # check if $i has any mibs to add
- #
-- AH_TOP([#define config_add_mib(x) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_add_mib(x)])
- new_mibs=`$MODULECPP module_tmp_header.h | \
- $SED -n 's/.*config_add_mib(\(.*\)).*/\1/p'`
- if test "x$new_mibs" != "x"; then
-@@ -456,7 +454,7 @@ while test "x$new_module_list" != "x"; d
- # check for config_parse_dot_conf
- # (generally not used any longer; old auto-load a .conf token)
- #
-- AH_TOP([#define config_parse_dot_conf(w,x,y,z) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_parse_dot_conf(w,x,y,z)])
- changequote(, )
- $MODULECPP module_tmp_header.h | \
- $SED -n 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@p' >> $mibdir/mib_module_dot_conf.h
-@@ -468,7 +466,7 @@ while test "x$new_module_list" != "x"; d
- #
- # check if $i has any errors, or warnings
- #
-- AH_TOP([#define config_error(x) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_error(x)])
- error=`$MODULECPP module_tmp_header.h | \
- $SED -n 's/.*config_error(\(.*\)).*/\1/p'`
- if test "x$error" != "x"; then
-@@ -481,7 +479,7 @@ while test "x$new_module_list" != "x"; d
- # macro: config_warning(warning text)
- # - used to signal a configuration "warning" to be printed to the user
- #
-- AH_TOP([#define config_warning(x) NETSNMP_REQUIRE_SEMICOLON])
-+ AH_TOP([#define config_warning(x)])
- warning=`$MODULECPP module_tmp_header.h | \
- $SED -n 's/.*config_warning(\(.*\)).*/\1/p'`
- if test "x$warning" != "x"; then
---- a/include/net-snmp/net-snmp-config.h.in
-+++ b/include/net-snmp/net-snmp-config.h.in
-@@ -36,25 +36,25 @@
-
- /* definitions added by configure on-the-fly */
-
--#define config_parse_dot_conf(w,x,y,z) NETSNMP_REQUIRE_SEMICOLON
-+#define config_parse_dot_conf(w,x,y,z)
-
--#define config_error(x) NETSNMP_REQUIRE_SEMICOLON
-+#define config_error(x)
-
--#define config_warning(x) NETSNMP_REQUIRE_SEMICOLON
-+#define config_warning(x)
-
--#define NETSNMP_REQUIRE_SEMICOLON extern void netsnmp_unused_function(void)
-+#define extern void netsnmp_unused_function(void)
-
--#define config_belongs_in(x) NETSNMP_REQUIRE_SEMICOLON
-+#define config_belongs_in(x)
-
--#define config_exclude(x) NETSNMP_REQUIRE_SEMICOLON
-+#define config_exclude(x)
-
--#define config_arch_require(x,y) NETSNMP_REQUIRE_SEMICOLON
-+#define config_arch_require(x,y)
-
--#define config_version_require(x) NETSNMP_REQUIRE_SEMICOLON
-+#define config_version_require(x)
-
--#define config_require(x) NETSNMP_REQUIRE_SEMICOLON
-+#define config_require(x)
-
--#define config_add_mib(x) NETSNMP_REQUIRE_SEMICOLON
-+#define config_add_mib(x)
-
- /* Define to 1 if using 'alloca.c'. */
- #undef C_ALLOCA