1 --- net-snmp-5.1.2-orig/agent/mibgroup/ieee802dot11.c 1970-01-01 01:00:00.000000000 +0100
2 +++ net-snmp-5.1.2-5/agent/mibgroup/ieee802dot11.c 2005-03-13 16:17:21.000000000 +0100
4 +/****************************************************************************
6 +* File Name: ieee802dot11.c *
14 +* Author: Larry Simmons *
15 +* lsimmons@avantcom.com *
18 +* Creation Date: 09/02/03 *
20 +* Ver Date Inits Modification *
21 +* ----- -------- ----- ------------ *
22 +* 0.0.1 09/02/03 LRS created *
23 +* 0.0.2 09/24/03 LRS wouldn't build after fresh ./configure *
24 +****************************************************************************/
25 +/****************************************************************************
27 +****************************************************************************/
28 +#include <net-snmp/net-snmp-config.h>
29 +#include <net-snmp/net-snmp-includes.h>
30 +#include <net-snmp/agent/net-snmp-agent-includes.h>
31 +#include "ieee802dot11.h"
34 +/****************************************************************************
36 +****************************************************************************/
37 +#define DISPLAYWIEXT // display wireless ext info
39 +//#define MINLOADFREQ 15 // min reload frequency in seconds
40 +#define MINLOADFREQ 5 // min reload frequency in seconds // for testing
41 +#define PROC_NET_DEV "/proc/net/dev"
42 +#define PROC_NET_WIRELESS "/proc/net/wireless"
45 + typedef unsigned char UCHAR;
48 +/****************************************************************************
49 +* Private Functions *
50 +****************************************************************************/
51 +static void loadTables();
52 +static void loadWiExt ( int, char *, struct wireless_info * );
53 +static void load80211Structs ( int, char *, struct wireless_info * );
54 +static void initStructs();
56 +// Wireless Extensions Specific Functions
57 +static void loadWiExtTo80211Structs ( int, char *, struct wireless_info * );
58 +static void displayWiExt ( struct wireless_info );
60 +// Linked List Functions
61 +static void addList ( char *, char *, int );
62 +static void initLists(); // initialize all the linked lists
63 +static void flushLists(); // flush all the linked lists
64 +static void flushList ( char * ); // flush a single linked list
67 +static int openSocket ( void );
68 +static int mWatt2dbm ( int );
69 +static char *htob ( char * );
70 +static int hasChanged ( char *, int );
72 +/****************************************************************************
73 +* Private Variables *
74 +****************************************************************************/
75 +static unsigned long lastLoad = 0; // ET in secs at last table load
77 +static struct avNode *lastNode, *newNode, *np;
79 +/****************************************************************************
80 +* External Functions *
81 +****************************************************************************/
83 +/****************************************************************************
84 +* ieee802dot11_variables_oid: *
85 +* this is the top level oid that we want to register under. This *
86 +* is essentially a prefix, with the suffix appearing in the *
88 +****************************************************************************/
89 +oid ieee802dot11_variables_oid[] = { 1,2,840,10036 };
91 +/****************************************************************************
92 +* variable7 ieee802dot11_variables: *
93 +* this variable defines function callbacks and type return information *
94 +* for the ieee802dot11 mib section *
95 +****************************************************************************/
96 +struct variable7 ieee802dot11_variables[] = {
97 +/* magic number , variable type , ro/rw , callback fn , L, oidsuffix */
98 +#define DOT11STATIONID 3
99 + { DOT11STATIONID , ASN_OCTET_STR , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,1 } },
100 +#define DOT11MEDIUMOCCUPANCYLIMIT 4
101 + { DOT11MEDIUMOCCUPANCYLIMIT, ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,2 } },
102 +#define DOT11CFPOLLABLE 5
103 + { DOT11CFPOLLABLE , ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,3 } },
104 +#define DOT11CFPPERIOD 6
105 + { DOT11CFPPERIOD , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,4 } },
106 +#define DOT11CFPMAXDURATION 7
107 + { DOT11CFPMAXDURATION , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,5 } },
108 +#define DOT11AUTHENTICATIONRESPONSETIMEOUT 8
109 + { DOT11AUTHENTICATIONRESPONSETIMEOUT, ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,6 } },
110 +#define DOT11PRIVACYOPTIONIMPLEMENTED 9
111 + { DOT11PRIVACYOPTIONIMPLEMENTED, ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,7 } },
112 +#define DOT11POWERMANAGEMENTMODE 10
113 + { DOT11POWERMANAGEMENTMODE, ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,8 } },
114 +#define DOT11DESIREDSSID 11
115 + { DOT11DESIREDSSID , ASN_OCTET_STR , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,9 } },
116 +#define DOT11DESIREDBSSTYPE 12
117 + { DOT11DESIREDBSSTYPE , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,10 } },
118 +#define DOT11OPERATIONALRATESET 13
119 + { DOT11OPERATIONALRATESET, ASN_OCTET_STR , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,11 } },
120 +#define DOT11BEACONPERIOD 14
121 + { DOT11BEACONPERIOD , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,12 } },
122 +#define DOT11DTIMPERIOD 15
123 + { DOT11DTIMPERIOD , ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,13 } },
124 +#define DOT11ASSOCIATIONRESPONSETIMEOUT 16
125 + { DOT11ASSOCIATIONRESPONSETIMEOUT, ASN_INTEGER , RWRITE, var_dot11StationConfigTable, 4, { 1,1,1,14 } },
126 +#define DOT11DISASSOCIATEREASON 17
127 + { DOT11DISASSOCIATEREASON, ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,15 } },
128 +#define DOT11DISASSOCIATESTATION 18
129 + { DOT11DISASSOCIATESTATION, ASN_OCTET_STR , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,16 } },
130 +#define DOT11DEAUTHENTICATEREASON 19
131 + { DOT11DEAUTHENTICATEREASON, ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,17 } },
132 +#define DOT11DEAUTHENTICATESTATION 20
133 + { DOT11DEAUTHENTICATESTATION, ASN_OCTET_STR , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,18 } },
134 +#define DOT11AUTHENTICATEFAILSTATUS 21
135 + { DOT11AUTHENTICATEFAILSTATUS, ASN_INTEGER , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,19 } },
136 +#define DOT11AUTHENTICATEFAILSTATION 22
137 + { DOT11AUTHENTICATEFAILSTATION, ASN_OCTET_STR , RONLY , var_dot11StationConfigTable, 4, { 1,1,1,20 } },
139 +#define DOT11AUTHENTICATIONALGORITHM 26
140 + { DOT11AUTHENTICATIONALGORITHM, ASN_INTEGER , RONLY , var_dot11AuthenticationAlgorithmsTable, 4, { 1,2,1,2 } },
141 +#define DOT11AUTHENTICATIONALGORITHMSENABLE 27
142 + { DOT11AUTHENTICATIONALGORITHMSENABLE, ASN_INTEGER , RWRITE, var_dot11AuthenticationAlgorithmsTable, 4, { 1,2,1,3 } },
144 +#define DOT11WEPDEFAULTKEYVALUE 31
145 + { DOT11WEPDEFAULTKEYVALUE, ASN_OCTET_STR , RWRITE, var_dot11WEPDefaultKeysTable, 4, { 1,3,1,2 } },
147 +#define DOT11WEPKEYMAPPINGADDRESS 35
148 + { DOT11WEPKEYMAPPINGADDRESS, ASN_OCTET_STR , RWRITE, var_dot11WEPKeyMappingsTable, 4, { 1,4,1,2 } },
149 +#define DOT11WEPKEYMAPPINGWEPON 36
150 + { DOT11WEPKEYMAPPINGWEPON, ASN_INTEGER , RWRITE, var_dot11WEPKeyMappingsTable, 4, { 1,4,1,3 } },
151 +#define DOT11WEPKEYMAPPINGVALUE 37
152 + { DOT11WEPKEYMAPPINGVALUE, ASN_OCTET_STR , RWRITE, var_dot11WEPKeyMappingsTable, 4, { 1,4,1,4 } },
153 +#define DOT11WEPKEYMAPPINGSTATUS 38
154 + { DOT11WEPKEYMAPPINGSTATUS, ASN_INTEGER , RWRITE, var_dot11WEPKeyMappingsTable, 4, { 1,4,1,5 } },
156 +#define DOT11PRIVACYINVOKED 41
157 + { DOT11PRIVACYINVOKED , ASN_INTEGER , RWRITE, var_dot11PrivacyTable, 4, { 1,5,1,1 } },
158 +#define DOT11WEPDEFAULTKEYID 42
159 + { DOT11WEPDEFAULTKEYID, ASN_INTEGER , RWRITE, var_dot11PrivacyTable, 4, { 1,5,1,2 } },
160 +#define DOT11WEPKEYMAPPINGLENGTH 43
161 + { DOT11WEPKEYMAPPINGLENGTH, ASN_INTEGER , RWRITE, var_dot11PrivacyTable, 4, { 1,5,1,3 } },
162 +#define DOT11EXCLUDEUNENCRYPTED 44
163 + { DOT11EXCLUDEUNENCRYPTED, ASN_INTEGER , RWRITE, var_dot11PrivacyTable, 4, { 1,5,1,4 } },
164 +#define DOT11WEPICVERRORCOUNT 45
165 + { DOT11WEPICVERRORCOUNT, ASN_COUNTER , RONLY , var_dot11PrivacyTable, 4, { 1,5,1,5 } },
166 +#define DOT11WEPEXCLUDEDCOUNT 46
167 + { DOT11WEPEXCLUDEDCOUNT, ASN_COUNTER , RONLY , var_dot11PrivacyTable, 4, { 1,5,1,6 } },
169 +#define DOT11MACADDRESS 49
170 + { DOT11MACADDRESS , ASN_OCTET_STR , RONLY , var_dot11OperationTable, 4, { 2,1,1,1 } },
171 +#define DOT11RTSTHRESHOLD 50
172 + { DOT11RTSTHRESHOLD , ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,2 } },
173 +#define DOT11SHORTRETRYLIMIT 51
174 + { DOT11SHORTRETRYLIMIT, ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,3 } },
175 +#define DOT11LONGRETRYLIMIT 52
176 + { DOT11LONGRETRYLIMIT , ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,4 } },
177 +#define DOT11FRAGMENTATIONTHRESHOLD 53
178 + { DOT11FRAGMENTATIONTHRESHOLD, ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,5 } },
179 +#define DOT11MAXTRANSMITMSDULIFETIME 54
180 + { DOT11MAXTRANSMITMSDULIFETIME, ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,6 } },
181 +#define DOT11MAXRECEIVELIFETIME 55
182 + { DOT11MAXRECEIVELIFETIME, ASN_INTEGER , RWRITE, var_dot11OperationTable, 4, { 2,1,1,7 } },
183 +#define DOT11MANUFACTURERID 56
184 + { DOT11MANUFACTURERID , ASN_OCTET_STR , RONLY , var_dot11OperationTable, 4, { 2,1,1,8 } },
185 +#define DOT11PRODUCTID 57
186 + { DOT11PRODUCTID , ASN_OCTET_STR , RONLY , var_dot11OperationTable, 4, { 2,1,1,9 } },
188 +#define DOT11TRANSMITTEDFRAGMENTCOUNT 60
189 + { DOT11TRANSMITTEDFRAGMENTCOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,1 } },
190 +#define DOT11MULTICASTTRANSMITTEDFRAMECOUNT 61
191 + { DOT11MULTICASTTRANSMITTEDFRAMECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,2 } },
192 +#define DOT11FAILEDCOUNT 62
193 + { DOT11FAILEDCOUNT , ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,3 } },
194 +#define DOT11RETRYCOUNT 63
195 + { DOT11RETRYCOUNT , ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,4 } },
196 +#define DOT11MULTIPLERETRYCOUNT 64
197 + { DOT11MULTIPLERETRYCOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,5 } },
198 +#define DOT11FRAMEDUPLICATECOUNT 65
199 + { DOT11FRAMEDUPLICATECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,6 } },
200 +#define DOT11RTSSUCCESSCOUNT 66
201 + { DOT11RTSSUCCESSCOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,7 } },
202 +#define DOT11RTSFAILURECOUNT 67
203 + { DOT11RTSFAILURECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,8 } },
204 +#define DOT11ACKFAILURECOUNT 68
205 + { DOT11ACKFAILURECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,9 } },
206 +#define DOT11RECEIVEDFRAGMENTCOUNT 69
207 + { DOT11RECEIVEDFRAGMENTCOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,10 } },
208 +#define DOT11MULTICASTRECEIVEDFRAMECOUNT 70
209 + { DOT11MULTICASTRECEIVEDFRAMECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,11 } },
210 +#define DOT11FCSERRORCOUNT 71
211 + { DOT11FCSERRORCOUNT , ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,12 } },
212 +#define DOT11TRANSMITTEDFRAMECOUNT 72
213 + { DOT11TRANSMITTEDFRAMECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,13 } },
214 +#define DOT11WEPUNDECRYPTABLECOUNT 73
215 + { DOT11WEPUNDECRYPTABLECOUNT, ASN_COUNTER , RONLY , var_dot11CountersTable, 4, { 2,2,1,14 } },
217 +#define DOT11ADDRESS 77
218 + { DOT11ADDRESS , ASN_OCTET_STR , RWRITE, var_dot11GroupAddressesTable, 4, { 2,3,1,2 } },
219 +#define DOT11GROUPADDRESSESSTATUS 78
220 + { DOT11GROUPADDRESSESSTATUS, ASN_INTEGER , RWRITE, var_dot11GroupAddressesTable, 4, { 2,3,1,3 } },
222 +#define DOT11RESOURCETYPEIDNAME 79
223 + { DOT11RESOURCETYPEIDNAME, ASN_OCTET_STR , RONLY , var_ieee802dot11, 3, { 3,1,1 } },
224 +#define DOT11MANUFACTUREROUI 82
225 + { DOT11MANUFACTUREROUI, ASN_OCTET_STR , RONLY , var_dot11ResourceInfoTable, 5, { 3,1,2,1,1 } },
226 +#define DOT11MANUFACTURERNAME 83
227 + { DOT11MANUFACTURERNAME, ASN_OCTET_STR , RONLY , var_dot11ResourceInfoTable, 5, { 3,1,2,1,2 } },
228 +#define DOT11MANUFACTURERPRODUCTNAME 84
229 + { DOT11MANUFACTURERPRODUCTNAME, ASN_OCTET_STR , RONLY , var_dot11ResourceInfoTable, 5, { 3,1,2,1,3 } },
230 +#define DOT11MANUFACTURERPRODUCTVERSION 85
231 + { DOT11MANUFACTURERPRODUCTVERSION, ASN_OCTET_STR , RONLY , var_dot11ResourceInfoTable, 5, { 3,1,2,1,4 } },
233 +#define DOT11PHYTYPE 88
234 + { DOT11PHYTYPE , ASN_INTEGER , RONLY , var_dot11PhyOperationTable, 4, { 4,1,1,1 } },
235 +#define DOT11CURRENTREGDOMAIN 89
236 + { DOT11CURRENTREGDOMAIN, ASN_INTEGER , RWRITE, var_dot11PhyOperationTable, 4, { 4,1,1,2 } },
237 +#define DOT11TEMPTYPE 90
238 + { DOT11TEMPTYPE , ASN_INTEGER , RONLY , var_dot11PhyOperationTable, 4, { 4,1,1,3 } },
239 +#define DOT11CURRENTTXANTENNA 93
240 + { DOT11CURRENTTXANTENNA, ASN_INTEGER , RWRITE, var_dot11PhyAntennaTable, 4, { 4,2,1,1 } },
241 +#define DOT11DIVERSITYSUPPORT 94
242 + { DOT11DIVERSITYSUPPORT, ASN_INTEGER , RONLY , var_dot11PhyAntennaTable, 4, { 4,2,1,2 } },
243 +#define DOT11CURRENTRXANTENNA 95
244 + { DOT11CURRENTRXANTENNA, ASN_INTEGER , RWRITE, var_dot11PhyAntennaTable, 4, { 4,2,1,3 } },
245 +#define DOT11NUMBERSUPPORTEDPOWERLEVELS 98
246 + { DOT11NUMBERSUPPORTEDPOWERLEVELS, ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,1 } },
247 +#define DOT11TXPOWERLEVEL1 99
248 + { DOT11TXPOWERLEVEL1 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,2 } },
249 +#define DOT11TXPOWERLEVEL2 100
250 + { DOT11TXPOWERLEVEL2 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,3 } },
251 +#define DOT11TXPOWERLEVEL3 101
252 + { DOT11TXPOWERLEVEL3 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,4 } },
253 +#define DOT11TXPOWERLEVEL4 102
254 + { DOT11TXPOWERLEVEL4 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,5 } },
255 +#define DOT11TXPOWERLEVEL5 103
256 + { DOT11TXPOWERLEVEL5 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,6 } },
257 +#define DOT11TXPOWERLEVEL6 104
258 + { DOT11TXPOWERLEVEL6 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,7 } },
259 +#define DOT11TXPOWERLEVEL7 105
260 + { DOT11TXPOWERLEVEL7 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,8 } },
261 +#define DOT11TXPOWERLEVEL8 106
262 + { DOT11TXPOWERLEVEL8 , ASN_INTEGER , RONLY , var_dot11PhyTxPowerTable, 4, { 4,3,1,9 } },
263 +#define DOT11CURRENTTXPOWERLEVEL 107
264 + { DOT11CURRENTTXPOWERLEVEL, ASN_INTEGER , RWRITE, var_dot11PhyTxPowerTable, 4, { 4,3,1,10 } },
266 +#define DOT11HOPTIME 110
267 + { DOT11HOPTIME , ASN_INTEGER , RONLY , var_dot11PhyFHSSTable, 4, { 4,4,1,1 } },
268 +#define DOT11CURRENTCHANNELNUMBER 111
269 + { DOT11CURRENTCHANNELNUMBER, ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,2 } },
270 +#define DOT11MAXDWELLTIME 112
271 + { DOT11MAXDWELLTIME , ASN_INTEGER , RONLY , var_dot11PhyFHSSTable, 4, { 4,4,1,3 } },
272 +#define DOT11CURRENTDWELLTIME 113
273 + { DOT11CURRENTDWELLTIME, ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,4 } },
274 +#define DOT11CURRENTSET 114
275 + { DOT11CURRENTSET , ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,5 } },
276 +#define DOT11CURRENTPATTERN 115
277 + { DOT11CURRENTPATTERN , ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,6 } },
278 +#define DOT11CURRENTINDEX 116
279 + { DOT11CURRENTINDEX , ASN_INTEGER , RWRITE, var_dot11PhyFHSSTable, 4, { 4,4,1,7 } },
281 +#define DOT11CURRENTCHANNEL 119
282 + { DOT11CURRENTCHANNEL , ASN_INTEGER , RWRITE, var_dot11PhyDSSSTable, 4, { 4,5,1,1 } },
283 +#define DOT11CCAMODESUPPORTED 120
284 + { DOT11CCAMODESUPPORTED, ASN_INTEGER , RONLY , var_dot11PhyDSSSTable, 4, { 4,5,1,2 } },
285 +#define DOT11CURRENTCCAMODE 121
286 + { DOT11CURRENTCCAMODE , ASN_INTEGER , RWRITE, var_dot11PhyDSSSTable, 4, { 4,5,1,3 } },
287 +#define DOT11EDTHRESHOLD 122
288 + { DOT11EDTHRESHOLD , ASN_INTEGER , RWRITE, var_dot11PhyDSSSTable, 4, { 4,5,1,4 } },
290 +#define DOT11CCAWATCHDOGTIMERMAX 125
291 + { DOT11CCAWATCHDOGTIMERMAX, ASN_INTEGER , RWRITE, var_dot11PhyIRTable, 4, { 4,6,1,1 } },
292 +#define DOT11CCAWATCHDOGCOUNTMAX 126
293 + { DOT11CCAWATCHDOGCOUNTMAX, ASN_INTEGER , RWRITE, var_dot11PhyIRTable, 4, { 4,6,1,2 } },
294 +#define DOT11CCAWATCHDOGTIMERMIN 127
295 + { DOT11CCAWATCHDOGTIMERMIN, ASN_INTEGER , RWRITE, var_dot11PhyIRTable, 4, { 4,6,1,3 } },
296 +#define DOT11CCAWATCHDOGCOUNTMIN 128
297 + { DOT11CCAWATCHDOGCOUNTMIN, ASN_INTEGER , RWRITE, var_dot11PhyIRTable, 4, { 4,6,1,4 } },
299 +#define DOT11REGDOMAINSSUPPORTVALUE 132
300 + { DOT11REGDOMAINSSUPPORTVALUE, ASN_INTEGER , RONLY , var_dot11RegDomainsSupportedTable, 4, { 4,7,1,2 } },
302 +#define DOT11SUPPORTEDTXANTENNA 136
303 + { DOT11SUPPORTEDTXANTENNA, ASN_INTEGER , RWRITE, var_dot11AntennasListTable, 4, { 4,8,1,2 } },
304 +#define DOT11SUPPORTEDRXANTENNA 137
305 + { DOT11SUPPORTEDRXANTENNA, ASN_INTEGER , RWRITE, var_dot11AntennasListTable, 4, { 4,8,1,3 } },
306 +#define DOT11DIVERSITYSELECTIONRX 138
307 + { DOT11DIVERSITYSELECTIONRX, ASN_INTEGER , RWRITE, var_dot11AntennasListTable, 4, { 4,8,1,4 } },
309 +#define DOT11SUPPORTEDDATARATESTXVALUE 142
310 + { DOT11SUPPORTEDDATARATESTXVALUE, ASN_INTEGER , RONLY , var_dot11SupportedDataRatesTxTable, 4, { 4,9,1,2 } },
312 +#define DOT11SUPPORTEDDATARATESRXVALUE 146
313 + { DOT11SUPPORTEDDATARATESRXVALUE, ASN_INTEGER , RONLY , var_dot11SupportedDataRatesRxTable, 4, { 4,10,1,2 } },
315 +// ( L = length of the oidsuffix )
317 +/****************************************************************************
319 +* init_ieee802dot11() - perform any required initialization *
321 +****************************************************************************/
322 +void init_ieee802dot11 ( void ) {
324 + /* register ourselves with the agent to handle our mib tree */
325 + REGISTER_MIB("ieee802dot11", ieee802dot11_variables, variable7,
326 + ieee802dot11_variables_oid);
331 +/****************************************************************************
333 +* shutdown_ieee802dot11() - perform any required cleanup @ shutdown *
335 +****************************************************************************/
336 +void shutdown_ieee802dot11 ( void )
341 +/****************************************************************************
343 +* var_ieee802dot11() - *
345 +****************************************************************************/
347 +var_ieee802dot11 ( struct variable *vp,
352 + WriteMethod **write_method)
356 + if ( header_generic ( vp, name, length, exact,var_len,write_method )
360 + switch ( vp->magic ) {
362 + case DOT11RESOURCETYPEIDNAME:
363 + if ( !haveResourceTypeIDName )
365 + *var_len = strlen ( resourceTypeIDName );
366 + return ( UCHAR * ) resourceTypeIDName;
375 +/****************************************************************************
377 +* var_dot11StationConfigTable() - return a variable value from the table *
379 +****************************************************************************/
381 +var_dot11StationConfigTable ( struct variable *vp,
386 + WriteMethod **write_method )
389 + oid rName [ MAX_OID_LEN ]; // OID to be returned
390 + static char MACWork[17];
393 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
394 + for ( np = LIST_FIRST ( &scList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
395 + sc = ( struct scTbl_data * ) np->data;
396 + rName[vp->namelen] = sc->ifIndex;
397 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
398 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
400 + switch ( vp->magic ) { // found requested OID, now check for requested variable
401 + case DOT11STATIONID:
402 + if ( sc->haveStationID ) found = TRUE; break;
403 + case DOT11MEDIUMOCCUPANCYLIMIT:
404 + if ( sc->haveMediumOccupancyLimit ) found = TRUE; break;
405 + case DOT11CFPOLLABLE:
406 + if ( sc->haveCFPPollable ) found = TRUE; break;
407 + case DOT11CFPPERIOD:
408 + if ( sc->haveCFPPeriod ) found = TRUE; break;
409 + case DOT11CFPMAXDURATION:
410 + if ( sc->haveMaxDuration ) found = TRUE; break;
411 + case DOT11AUTHENTICATIONRESPONSETIMEOUT:
412 + if ( sc->haveAuthenticationResponseTimeOut ) found = TRUE; break;
413 + case DOT11PRIVACYOPTIONIMPLEMENTED:
414 + if ( sc->havePrivacyOptionImplemented ) found = TRUE; break;
415 + case DOT11POWERMANAGEMENTMODE:
416 + if ( sc->havePowerManagementMode ) found = TRUE; break;
417 + case DOT11DESIREDSSID:
418 + if ( sc->haveDesiredSSID ) found = TRUE; break;
419 + case DOT11DESIREDBSSTYPE:
420 + if ( sc->haveDesiredBSSType ) found = TRUE; break;
421 + case DOT11OPERATIONALRATESET:
422 + if ( sc->haveOperationalRateSet ) found = TRUE; break;
423 + case DOT11BEACONPERIOD:
424 + if ( sc->haveBeaconPeriod ) found = TRUE; break;
425 + case DOT11DTIMPERIOD:
426 + if ( sc->haveDTIMPeriod ) found = TRUE; break;
427 + case DOT11ASSOCIATIONRESPONSETIMEOUT:
428 + if ( sc->haveAssociationResponseTimeOut ) found = TRUE; break;
429 + case DOT11DISASSOCIATEREASON:
430 + if ( sc->disAssociationReason ) found = TRUE; break;
431 + case DOT11DISASSOCIATESTATION:
432 + if ( sc->haveDisAssociationStation ) found = TRUE; break;
433 + case DOT11DEAUTHENTICATEREASON:
434 + if ( sc->deAuthenticationReason ) found = TRUE; break;
435 + case DOT11DEAUTHENTICATESTATION:
436 + if ( sc->haveDeAuthenticationStation ) found = TRUE; break;
437 + case DOT11AUTHENTICATEFAILSTATUS:
438 + if ( sc->authenticateFailStatus ) found = TRUE; break;
439 + case DOT11AUTHENTICATEFAILSTATION:
440 + if ( sc->haveAuthenticateFailStation ) found = TRUE; break;
450 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
451 + *length = vp->namelen + 1;
452 + *var_len = sizeof ( long );
453 + *write_method = NULL;
455 + switch ( vp->magic ) {
457 + case DOT11STATIONID:
458 +// *write_method = write_dot11StationID;
459 + MACWork[ 0] = sc->stationID [ 0];
460 + MACWork[ 1] = sc->stationID [ 1];
461 + MACWork[ 2] = sc->stationID [ 3];
462 + MACWork[ 3] = sc->stationID [ 4];
463 + MACWork[ 4] = sc->stationID [ 6];
464 + MACWork[ 5] = sc->stationID [ 7];
465 + MACWork[ 6] = sc->stationID [ 9];
466 + MACWork[ 7] = sc->stationID [10];
467 + MACWork[ 8] = sc->stationID [12];
468 + MACWork[ 9] = sc->stationID [13];
469 + MACWork[10] = sc->stationID [15];
470 + MACWork[11] = sc->stationID [16];
471 + MACWork[12] = '\0';
473 + return ( UCHAR * ) htob ( MACWork );
475 + case DOT11MEDIUMOCCUPANCYLIMIT:
476 +// *write_method = write_dot11MediumOccupancyLimit;
477 + sc->mediumOccupancyLimit = 5;
478 + return ( UCHAR * ) &sc->mediumOccupancyLimit;
480 + case DOT11CFPOLLABLE:
481 + return ( UCHAR * ) &sc->CFPPollable;
483 + case DOT11CFPPERIOD:
484 +// *write_method = write_dot11CFPPeriod;
485 + return ( UCHAR * ) &sc->CFPPeriod;
487 + case DOT11CFPMAXDURATION:
488 +// *write_method = write_dot11CFPMaxDuration;
489 + return ( UCHAR * ) &sc->maxDuration;
491 + case DOT11AUTHENTICATIONRESPONSETIMEOUT:
492 +// *write_method = write_dot11AuthenticationResponseTimeOut;
493 + return ( UCHAR * ) &sc->authenticationResponseTimeOut;
495 + case DOT11PRIVACYOPTIONIMPLEMENTED:
496 + return ( UCHAR * ) &sc->privacyOptionImplemented;
498 + case DOT11POWERMANAGEMENTMODE:
499 +// *write_method = write_dot11PowerManagementMode;
500 + return ( UCHAR * ) &sc->powerManagementMode;
502 + case DOT11DESIREDSSID:
503 +// *write_method = write_dot11DesiredSSID;
504 + *var_len = strlen ( sc->desiredSSID );
505 + return ( UCHAR * ) sc->desiredSSID;
507 + case DOT11DESIREDBSSTYPE:
508 +// *write_method = write_dot11DesiredBSSType;
509 + return ( UCHAR * ) &sc->desiredBSSType;
511 + case DOT11OPERATIONALRATESET:
512 +// *write_method = write_dot11OperationalRateSet;
513 + *var_len = strlen ( sc->operationalRateSet );
514 + return ( UCHAR * ) sc->operationalRateSet;
516 + case DOT11BEACONPERIOD:
517 +// *write_method = write_dot11BeaconPeriod;
518 + return ( UCHAR * ) &sc->beaconPeriod;
520 + case DOT11DTIMPERIOD:
521 +// *write_method = write_dot11DTIMPeriod;
522 + return ( UCHAR * ) &sc->DTIMPeriod;
524 + case DOT11ASSOCIATIONRESPONSETIMEOUT:
525 +// *write_method = write_dot11AssociationResponseTimeOut;
526 + return ( UCHAR * ) &sc->associationResponseTimeOut;
528 + case DOT11DISASSOCIATEREASON:
529 + return ( UCHAR * ) &sc->disAssociationReason;
531 + case DOT11DISASSOCIATESTATION:
532 + MACWork[ 0] = sc->disAssociationStation[ 0];
533 + MACWork[ 1] = sc->disAssociationStation[ 1];
534 + MACWork[ 2] = sc->disAssociationStation[ 3];
535 + MACWork[ 3] = sc->disAssociationStation[ 4];
536 + MACWork[ 4] = sc->disAssociationStation[ 6];
537 + MACWork[ 5] = sc->disAssociationStation[ 7];
538 + MACWork[ 6] = sc->disAssociationStation[ 9];
539 + MACWork[ 7] = sc->disAssociationStation[10];
540 + MACWork[ 8] = sc->disAssociationStation[12];
541 + MACWork[ 9] = sc->disAssociationStation[13];
542 + MACWork[10] = sc->disAssociationStation[15];
543 + MACWork[11] = sc->disAssociationStation[16];
544 + MACWork[12] = '\0';
546 + return ( UCHAR * ) htob ( MACWork );
548 + case DOT11DEAUTHENTICATEREASON:
549 + return ( UCHAR * ) &sc->deAuthenticationReason;
551 + case DOT11DEAUTHENTICATESTATION:
552 + MACWork[ 0] = sc->deAuthenticationStation[ 0];
553 + MACWork[ 1] = sc->deAuthenticationStation[ 1];
554 + MACWork[ 2] = sc->deAuthenticationStation[ 3];
555 + MACWork[ 3] = sc->deAuthenticationStation[ 4];
556 + MACWork[ 4] = sc->deAuthenticationStation[ 6];
557 + MACWork[ 5] = sc->deAuthenticationStation[ 7];
558 + MACWork[ 6] = sc->deAuthenticationStation[ 9];
559 + MACWork[ 7] = sc->deAuthenticationStation[10];
560 + MACWork[ 8] = sc->deAuthenticationStation[12];
561 + MACWork[ 9] = sc->deAuthenticationStation[13];
562 + MACWork[10] = sc->deAuthenticationStation[15];
563 + MACWork[11] = sc->deAuthenticationStation[16];
564 + MACWork[12] = '\0';
566 + return ( UCHAR * ) htob ( MACWork );
568 + case DOT11AUTHENTICATEFAILSTATUS:
569 + return ( UCHAR * ) &sc->authenticateFailStatus;
571 + case DOT11AUTHENTICATEFAILSTATION:
572 + MACWork[ 0] = sc->authenticateFailStation[ 0];
573 + MACWork[ 1] = sc->authenticateFailStation[ 1];
574 + MACWork[ 2] = sc->authenticateFailStation[ 3];
575 + MACWork[ 3] = sc->authenticateFailStation[ 4];
576 + MACWork[ 4] = sc->authenticateFailStation[ 6];
577 + MACWork[ 5] = sc->authenticateFailStation[ 7];
578 + MACWork[ 6] = sc->authenticateFailStation[ 9];
579 + MACWork[ 7] = sc->authenticateFailStation[10];
580 + MACWork[ 8] = sc->authenticateFailStation[12];
581 + MACWork[ 9] = sc->authenticateFailStation[13];
582 + MACWork[10] = sc->authenticateFailStation[15];
583 + MACWork[11] = sc->authenticateFailStation[16];
584 + MACWork[12] = '\0';
586 + return ( UCHAR * ) htob ( MACWork );
595 +/****************************************************************************
597 +* var_dot11AuthenticationAlgorithmsTable() - *
599 +****************************************************************************/
601 +var_dot11AuthenticationAlgorithmsTable ( struct variable *vp,
606 + WriteMethod **write_method )
609 + oid rName [ MAX_OID_LEN ]; // OID to be returned
612 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
613 + for ( np = LIST_FIRST ( &aaList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
614 + aa = ( struct aaTbl_data * ) np->data;
615 + rName[vp->namelen + 0] = aa->ifIndex;
616 + rName[vp->namelen + 1] = aa->authenticationAlgorithmsIndex;
617 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) ||
618 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) {
619 + switch ( vp->magic ) {
620 + case DOT11AUTHENTICATIONALGORITHM:
621 + if ( aa->haveAuthenticationAlgorithm ) found = TRUE; break;
622 + case DOT11AUTHENTICATIONALGORITHMSENABLE:
623 + if ( aa->authenticationAlgorithmsEnable ) found = TRUE; break;
633 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
634 + *length = vp->namelen + 2;
635 + *var_len = sizeof ( long );
636 + *write_method = NULL;
638 + switch ( vp->magic ) {
640 + case DOT11AUTHENTICATIONALGORITHM:
641 + return ( UCHAR * ) &aa->authenticationAlgorithm;
643 + case DOT11AUTHENTICATIONALGORITHMSENABLE:
644 +// *write_method = write_dot11AuthenticationAlgorithmsEnable;
645 + return ( UCHAR * ) &aa->authenticationAlgorithmsEnable;
654 +/****************************************************************************
656 +* var_dot11WEPDefaultKeysTable() - *
658 +****************************************************************************/
660 +var_dot11WEPDefaultKeysTable ( struct variable *vp,
665 + WriteMethod **write_method )
668 + oid rName [ MAX_OID_LEN ]; // OID to be returned
671 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
672 + for ( np = LIST_FIRST ( &dfList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
673 + df = ( struct dfTbl_data * ) np->data;
674 + rName[vp->namelen + 0] = df->ifIndex;
675 + rName[vp->namelen + 1] = df->WEPDefaultKeyIndex;
676 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) ||
677 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) {
678 + switch ( vp->magic ) {
679 + case DOT11WEPDEFAULTKEYVALUE:
680 + if ( df->haveWEPDefaultKeyValue ) found = TRUE; break;
690 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
691 + *length = vp->namelen + 2;
692 + *var_len = sizeof ( long );
693 + *write_method = NULL;
695 + switch ( vp->magic ) {
697 + case DOT11WEPDEFAULTKEYVALUE:
698 +// *write_method = write_dot11WEPDefaultKeyValue;
699 + *var_len = strlen ( df->WEPDefaultKeyValue );
700 + return ( UCHAR * ) df->WEPDefaultKeyValue;
709 +/****************************************************************************
711 +* var_dot11WEPKeyMappingsTable() - *
713 +****************************************************************************/
715 +var_dot11WEPKeyMappingsTable ( struct variable *vp,
720 + WriteMethod **write_method)
722 + static char MACWork[17];
724 + oid rName [ MAX_OID_LEN ]; // OID to be returned
727 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
728 + for ( np = LIST_FIRST ( &kmList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
729 + km = ( struct kmTbl_data * ) np->data;
730 + rName[vp->namelen + 0] = km->ifIndex;
731 + rName[vp->namelen + 1] = km->WEPKeyMappingIndex;
732 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) ||
733 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) {
734 + switch ( vp->magic ) {
735 + case DOT11WEPKEYMAPPINGADDRESS:
736 + if ( km->haveWEPKeyMappingAddress ) found = TRUE; break;
737 + case DOT11WEPKEYMAPPINGWEPON:
738 + if ( km->haveWEPKeyMappingWEPOn ) found = TRUE; break;
739 + case DOT11WEPKEYMAPPINGVALUE:
740 + if ( km->haveWEPKeyMappingValue ) found = TRUE; break;
741 + case DOT11WEPKEYMAPPINGSTATUS:
742 + if ( km->haveWEPKeyMappingStatus ) found = TRUE; break;
752 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
753 + *length = vp->namelen + 2;
754 + *var_len = sizeof ( long );
755 + *write_method = NULL;
757 + switch ( vp->magic ) {
759 + case DOT11WEPKEYMAPPINGADDRESS:
760 +// *write_method = write_dot11WEPKeyMappingAddress;
761 + MACWork[ 0] = km->WEPKeyMappingAddress[ 0];
762 + MACWork[ 1] = km->WEPKeyMappingAddress[ 1];
763 + MACWork[ 2] = km->WEPKeyMappingAddress[ 3];
764 + MACWork[ 3] = km->WEPKeyMappingAddress[ 4];
765 + MACWork[ 4] = km->WEPKeyMappingAddress[ 6];
766 + MACWork[ 5] = km->WEPKeyMappingAddress[ 7];
767 + MACWork[ 6] = km->WEPKeyMappingAddress[ 9];
768 + MACWork[ 7] = km->WEPKeyMappingAddress[10];
769 + MACWork[ 8] = km->WEPKeyMappingAddress[12];
770 + MACWork[ 9] = km->WEPKeyMappingAddress[13];
771 + MACWork[10] = km->WEPKeyMappingAddress[15];
772 + MACWork[11] = km->WEPKeyMappingAddress[16];
773 + MACWork[12] = '\0';
775 + return ( UCHAR * ) htob ( MACWork );
777 + case DOT11WEPKEYMAPPINGWEPON:
778 +// *write_method = write_dot11WEPKeyMappingWEPOn;
779 + return ( UCHAR * ) &km->WEPKeyMappingWEPOn;
781 + case DOT11WEPKEYMAPPINGVALUE:
782 +// *write_method = write_dot11WEPKeyMappingValue;
783 + *var_len = strlen ( km->WEPKeyMappingValue );
784 + return ( UCHAR * ) km->WEPKeyMappingValue;
786 + case DOT11WEPKEYMAPPINGSTATUS:
787 +// *write_method = write_dot11WEPKeyMappingStatus;
788 + return ( UCHAR * ) &km->WEPKeyMappingStatus;
796 +/****************************************************************************
798 +* var_dot11PrivacyTable() - *
800 +****************************************************************************/
802 +var_dot11PrivacyTable ( struct variable *vp,
807 + WriteMethod **write_method )
810 + oid rName [ MAX_OID_LEN ]; // OID to be returned
813 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
814 + for ( np = LIST_FIRST ( &prList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
815 + pr = ( struct prTbl_data * ) np->data;
816 + rName[vp->namelen] = pr->ifIndex;
817 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
818 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
819 + switch ( vp->magic ) {
820 + case DOT11PRIVACYINVOKED:
821 + if ( pr->havePrivacyInvoked ) found = TRUE; break;
822 + case DOT11WEPDEFAULTKEYID:
823 + if ( pr->haveWEPDefaultKeyID ) found = TRUE; break;
824 + case DOT11WEPKEYMAPPINGLENGTH:
825 + if ( pr->haveWEPKeyMappingLength ) found = TRUE; break;
826 + case DOT11EXCLUDEUNENCRYPTED:
827 + if ( pr->haveExcludeUnencrypted ) found = TRUE; break;
828 + case DOT11WEPICVERRORCOUNT:
829 + if ( pr->haveWEPICVErrorCount ) found = TRUE; break;
830 + case DOT11WEPEXCLUDEDCOUNT:
831 + if ( pr->haveWEPExcludedCount ) found = TRUE; break;
841 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
842 + *length = vp->namelen + 1;
843 + *var_len = sizeof ( long );
844 + *write_method = NULL;
846 + switch ( vp->magic ) {
848 + case DOT11PRIVACYINVOKED:
849 +// *write_method = write_dot11PrivacyInvoked;
850 + return ( UCHAR * ) &pr->privacyInvoked;
852 + case DOT11WEPDEFAULTKEYID:
853 +// *write_method = write_dot11WEPDefaultKeyID;
854 + return ( UCHAR * ) &pr->WEPDefaultKeyID;
856 + case DOT11WEPKEYMAPPINGLENGTH:
857 +// *write_method = write_dot11WEPKeyMappingLength;
858 + return ( UCHAR * ) &pr->WEPKeyMappingLength;
860 + case DOT11EXCLUDEUNENCRYPTED:
861 +// *write_method = write_dot11ExcludeUnencrypted;
862 + return ( UCHAR * ) &pr->excludeUnencrypted;
864 + case DOT11WEPICVERRORCOUNT:
865 + return ( UCHAR * ) &pr->WEPICVErrorCount;
867 + case DOT11WEPEXCLUDEDCOUNT:
868 + return ( UCHAR * ) &pr->WEPExcludedCount;
877 +/****************************************************************************
879 +* var_dot11OperationTable() - *
881 +****************************************************************************/
883 +var_dot11OperationTable ( struct variable *vp,
888 + WriteMethod **write_method )
891 + oid rName [ MAX_OID_LEN ]; // OID to be returned
892 + static char MACWork[17];
895 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
896 + for ( np = LIST_FIRST ( &opList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
897 + op = ( struct opTbl_data * ) np->data;
898 + rName[vp->namelen] = op->ifIndex;
899 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
900 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
902 + switch ( vp->magic ) { // found requested OID, now check for requested variable
903 + case DOT11MACADDRESS:
904 + if ( op->haveMACAddress ) found = TRUE; break;
905 + case DOT11RTSTHRESHOLD:
906 + if ( op->haveRTSThreshold ) found = TRUE; break;
907 + case DOT11SHORTRETRYLIMIT:
908 + if ( op->haveShortRetryLimit ) found = TRUE; break;
909 + case DOT11LONGRETRYLIMIT:
910 + if ( op->haveLongRetryLimit ) found = TRUE; break;
911 + case DOT11FRAGMENTATIONTHRESHOLD:
912 + if ( op->haveFragmentationThreshold ) found = TRUE; break;
913 + case DOT11MAXTRANSMITMSDULIFETIME:
914 + if ( op->haveMaxTransmitMSDULifetime ) found = TRUE; break;
915 + case DOT11MAXRECEIVELIFETIME:
916 + if ( op->haveMaxReceiveLifetime ) found = TRUE; break;
917 + case DOT11MANUFACTURERID:
918 + if ( op->haveManufacturerID ) found = TRUE; break;
919 + case DOT11PRODUCTID:
920 + if ( op->haveProductID ) found = TRUE; break;
930 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
931 + *length = vp->namelen + 1;
932 + *var_len = sizeof ( long );
933 + *write_method = NULL;
935 + switch ( vp->magic ) {
937 + case DOT11MACADDRESS:
938 + MACWork[ 0] = op->MACAddress[ 0];
939 + MACWork[ 1] = op->MACAddress[ 1];
940 + MACWork[ 2] = op->MACAddress[ 3];
941 + MACWork[ 3] = op->MACAddress[ 4];
942 + MACWork[ 4] = op->MACAddress[ 6];
943 + MACWork[ 5] = op->MACAddress[ 7];
944 + MACWork[ 6] = op->MACAddress[ 9];
945 + MACWork[ 7] = op->MACAddress[10];
946 + MACWork[ 8] = op->MACAddress[12];
947 + MACWork[ 9] = op->MACAddress[13];
948 + MACWork[10] = op->MACAddress[15];
949 + MACWork[11] = op->MACAddress[16];
950 + MACWork[12] = '\0';
952 + return ( UCHAR * ) htob ( MACWork );
954 + case DOT11RTSTHRESHOLD:
955 +// *write_method = write_dot11RTSThreshold;
956 + return ( UCHAR * ) &op->RTSThreshold;
958 + case DOT11SHORTRETRYLIMIT:
959 +// *write_method = write_dot11ShortRetryLimit;
960 + return ( UCHAR * ) &op->shortRetryLimit;
962 + case DOT11LONGRETRYLIMIT:
963 +// *write_method = write_dot11LongRetryLimit;
964 + return ( UCHAR * ) &op->longRetryLimit;
966 + case DOT11FRAGMENTATIONTHRESHOLD:
967 +// *write_method = write_dot11FragmentationThreshold;
968 + return ( UCHAR * ) &op->fragmentationThreshold;
970 + case DOT11MAXTRANSMITMSDULIFETIME:
971 +// *write_method = write_dot11MaxTransmitMSDULifetime;
972 + return ( UCHAR * ) &op->maxTransmitMSDULifetime;
974 + case DOT11MAXRECEIVELIFETIME:
975 +// *write_method = write_dot11MaxReceiveLifetime;
976 + return ( UCHAR * ) &op->maxReceiveLifetime;
978 + case DOT11MANUFACTURERID:
979 + *var_len = strlen ( op->manufacturerID );
980 + return ( UCHAR * ) op->manufacturerID;
982 + case DOT11PRODUCTID:
983 + *var_len = strlen ( op->productID );
984 + return ( UCHAR * ) op->productID;
993 +/****************************************************************************
995 +* var_dot11CountersTable() - *
997 +****************************************************************************/
999 +var_dot11CountersTable(struct variable *vp,
1004 + WriteMethod **write_method)
1006 + int found = FALSE;
1007 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1010 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1011 + for ( np = LIST_FIRST ( &coList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1012 + co = ( struct coTbl_data * ) np->data;
1013 + rName[vp->namelen] = co->ifIndex;
1014 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
1015 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
1016 + switch ( vp->magic ) {
1017 + case DOT11TRANSMITTEDFRAGMENTCOUNT:
1018 + if ( co->haveTransmittedFragmentCount ) found = TRUE; break;
1019 + case DOT11MULTICASTTRANSMITTEDFRAMECOUNT:
1020 + if ( co->haveTransmittedFrameCount ) found = TRUE; break;
1021 + case DOT11FAILEDCOUNT:
1022 + if ( co->haveFailedCount ) found = TRUE; break;
1023 + case DOT11RETRYCOUNT:
1024 + if ( co->haveRetryCount ) found = TRUE; break;
1025 + case DOT11MULTIPLERETRYCOUNT:
1026 + if ( co->haveMultipleRetryCount ) found = TRUE; break;
1027 + case DOT11FRAMEDUPLICATECOUNT:
1028 + if ( co->haveFrameDuplicateCount ) found = TRUE; break;
1029 + case DOT11RTSSUCCESSCOUNT:
1030 + if ( co->haveRTSSuccessCount ) found = TRUE; break;
1031 + case DOT11RTSFAILURECOUNT:
1032 + if ( co->haveRTSFailureCount ) found = TRUE; break;
1033 + case DOT11ACKFAILURECOUNT:
1034 + if ( co->haveACKFailureCount ) found = TRUE; break;
1035 + case DOT11RECEIVEDFRAGMENTCOUNT:
1036 + if ( co->haveReceivedFragmentCount ) found = TRUE; break;
1037 + case DOT11MULTICASTRECEIVEDFRAMECOUNT:
1038 + if ( co->haveMulticastReceivedFrameCount ) found = TRUE; break;
1039 + case DOT11FCSERRORCOUNT:
1040 + if ( co->haveFCSErrorCount ) found = TRUE; break;
1041 + case DOT11TRANSMITTEDFRAMECOUNT:
1042 + if ( co->haveTransmittedFrameCount ) found = TRUE; break;
1043 + case DOT11WEPUNDECRYPTABLECOUNT:
1044 + if ( co->haveWEPUndecryptableCount ) found = TRUE; break;
1054 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
1055 + *length = vp->namelen + 1;
1056 + *var_len = sizeof ( long );
1057 + *write_method = NULL;
1059 + switch ( vp->magic ) {
1061 + case DOT11TRANSMITTEDFRAGMENTCOUNT: return ( UCHAR * ) &co->transmittedFragmentCount;
1062 + case DOT11MULTICASTTRANSMITTEDFRAMECOUNT: return ( UCHAR * ) &co->transmittedFrameCount;
1063 + case DOT11FAILEDCOUNT: return ( UCHAR * ) &co->failedCount;
1064 + case DOT11RETRYCOUNT: return ( UCHAR * ) &co->retryCount;
1065 + case DOT11MULTIPLERETRYCOUNT: return ( UCHAR * ) &co->multipleRetryCount;
1066 + case DOT11FRAMEDUPLICATECOUNT: return ( UCHAR * ) &co->frameDuplicateCount;
1067 + case DOT11RTSSUCCESSCOUNT: return ( UCHAR * ) &co->RTSSuccessCount;
1068 + case DOT11RTSFAILURECOUNT: return ( UCHAR * ) &co->RTSFailureCount;
1069 + case DOT11ACKFAILURECOUNT: return ( UCHAR * ) &co->ACKFailureCount;
1070 + case DOT11RECEIVEDFRAGMENTCOUNT: return ( UCHAR * ) &co->receivedFragmentCount;
1071 + case DOT11MULTICASTRECEIVEDFRAMECOUNT: return ( UCHAR * ) &co->multicastReceivedFrameCount;
1072 + case DOT11FCSERRORCOUNT: return ( UCHAR * ) &co->FCSErrorCount;
1073 + case DOT11TRANSMITTEDFRAMECOUNT: return ( UCHAR * ) &co->transmittedFrameCount;
1074 + case DOT11WEPUNDECRYPTABLECOUNT: return ( UCHAR * ) &co->WEPUndecryptableCount;
1083 +/****************************************************************************
1085 +* var_dot11GroupAddressesTable() - *
1087 +****************************************************************************/
1089 +var_dot11GroupAddressesTable(struct variable *vp,
1094 + WriteMethod **write_method)
1096 + static char MACWork[17];
1097 + int found = FALSE;
1098 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1101 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1102 + for ( np = LIST_FIRST ( &gaList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1103 + ga = ( struct gaTbl_data * ) np->data;
1104 + rName[vp->namelen + 0] = ga->ifIndex;
1105 + rName[vp->namelen + 1] = ga->groupAddressesIndex;
1106 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) ||
1107 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) {
1108 + switch ( vp->magic ) {
1109 + case DOT11ADDRESS:
1110 + if ( ga->haveAddress ) found = TRUE; break;
1111 + case DOT11GROUPADDRESSESSTATUS:
1112 + if ( ga->haveGroupAddressesStatus ) found = TRUE; break;
1122 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
1123 + *length = vp->namelen + 2;
1124 + *var_len = sizeof ( long );
1125 + *write_method = NULL;
1127 + switch ( vp->magic ) {
1129 + case DOT11ADDRESS:
1130 +// *write_method = write_dot11Address;
1131 + MACWork[ 0] = ga->address[ 0];
1132 + MACWork[ 1] = ga->address[ 1];
1133 + MACWork[ 2] = ga->address[ 3];
1134 + MACWork[ 3] = ga->address[ 4];
1135 + MACWork[ 4] = ga->address[ 6];
1136 + MACWork[ 5] = ga->address[ 7];
1137 + MACWork[ 6] = ga->address[ 9];
1138 + MACWork[ 7] = ga->address[10];
1139 + MACWork[ 8] = ga->address[12];
1140 + MACWork[ 9] = ga->address[13];
1141 + MACWork[10] = ga->address[15];
1142 + MACWork[11] = ga->address[16];
1143 + MACWork[12] = '\0';
1145 + return ( UCHAR * ) htob ( MACWork );
1147 + case DOT11GROUPADDRESSESSTATUS:
1148 +// *write_method = write_dot11GroupAddressesStatus;
1149 + return ( UCHAR * ) &ga->groupAddressesStatus;
1157 +/****************************************************************************
1159 +* var_dot11ResourceInfoTable() - *
1161 +****************************************************************************/
1163 +var_dot11ResourceInfoTable ( struct variable *vp,
1168 + WriteMethod **write_method )
1170 + int found = FALSE;
1171 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1174 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1175 + for ( np = LIST_FIRST ( &riList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1176 + ri = ( struct riTbl_data * ) np->data;
1177 + rName[vp->namelen] = ri->ifIndex;
1178 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
1179 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
1180 + switch ( vp->magic ) {
1181 + case DOT11MANUFACTUREROUI:
1182 + if ( ri->haveManufacturerOUI ) found = TRUE; break;
1183 + case DOT11MANUFACTURERNAME:
1184 + if ( ri->haveManufacturerName ) found = TRUE; break;
1185 + case DOT11MANUFACTURERPRODUCTNAME:
1186 + if ( ri->haveManufacturerProductName ) found = TRUE; break;
1187 + case DOT11MANUFACTURERPRODUCTVERSION:
1188 + if ( ri->haveManufacturerProductVersion ) found = TRUE; break;
1198 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
1199 + *length = vp->namelen + 1;
1200 + *var_len = sizeof ( long );
1201 + *write_method = NULL;
1203 + switch ( vp->magic ) {
1205 + case DOT11MANUFACTUREROUI:
1206 + *var_len = strlen ( ri->manufacturerOUI );
1207 + return ( UCHAR * ) ri->manufacturerOUI;
1209 + case DOT11MANUFACTURERNAME:
1210 + *var_len = strlen ( ri->manufacturerName );
1211 + return ( UCHAR * ) ri->manufacturerName;
1213 + case DOT11MANUFACTURERPRODUCTNAME:
1214 + *var_len = strlen ( ri->manufacturerProductName );
1215 + return ( UCHAR * ) ri->manufacturerProductName;
1217 + case DOT11MANUFACTURERPRODUCTVERSION:
1218 + *var_len = strlen ( ri->manufacturerProductVersion );
1219 + return ( UCHAR * ) ri->manufacturerProductVersion;
1228 +/****************************************************************************
1230 +* var_dot11PhyOperationTable() - *
1232 +****************************************************************************/
1234 +var_dot11PhyOperationTable ( struct variable *vp,
1239 + WriteMethod **write_method )
1241 + int found = FALSE;
1242 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1245 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1246 + for ( np = LIST_FIRST ( &poList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1247 + po = ( struct poTbl_data * ) np->data;
1248 + rName[vp->namelen] = po->ifIndex;
1249 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
1250 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
1251 + switch ( vp->magic ) {
1252 + case DOT11PHYTYPE:
1253 + if ( po->havePHYType ) found = TRUE; break;
1254 + case DOT11CURRENTREGDOMAIN:
1255 + if ( po->haveCurrentRegDomain ) found = TRUE; break;
1256 + case DOT11TEMPTYPE:
1257 + if ( po->haveTempType ) found = TRUE; break;
1267 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
1268 + *length = vp->namelen + 1;
1269 + *var_len = sizeof ( long );
1270 + *write_method = NULL;
1272 + switch ( vp->magic ) {
1274 + case DOT11PHYTYPE:
1275 + return ( UCHAR * ) &po->PHYType;
1277 + case DOT11CURRENTREGDOMAIN:
1278 +// *write_method = write_dot11CurrentRegDomain;
1279 + return ( UCHAR * ) &po->currentRegDomain;
1281 + case DOT11TEMPTYPE:
1282 + return ( UCHAR * ) &po->tempType;
1291 +/****************************************************************************
1293 +* var_dot11PhyAntennaTable() - *
1295 +****************************************************************************/
1297 +var_dot11PhyAntennaTable ( struct variable *vp,
1302 + WriteMethod **write_method )
1304 + int found = FALSE;
1305 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1308 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1309 + for ( np = LIST_FIRST ( &paList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1310 + pa = ( struct paTbl_data * ) np->data;
1311 + rName[vp->namelen] = pa->ifIndex;
1312 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
1313 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
1314 + switch ( vp->magic ) {
1315 + case DOT11CURRENTTXANTENNA:
1316 + if ( pa->haveCurrentTxAntenna ) found = TRUE; break;
1317 + case DOT11DIVERSITYSUPPORT:
1318 + if ( pa->haveDiversitySupport ) found = TRUE; break;
1319 + case DOT11CURRENTRXANTENNA:
1320 + if ( pa->haveCurrentRxAntenna ) found = TRUE; break;
1330 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
1331 + *length = vp->namelen + 1;
1332 + *var_len = sizeof ( long );
1333 + *write_method = NULL;
1335 + switch ( vp->magic ) {
1337 + case DOT11CURRENTTXANTENNA:
1338 +// *write_method = write_dot11CurrentTxAntenna;
1339 + return ( UCHAR * ) &pa->currentTxAntenna;
1341 + case DOT11DIVERSITYSUPPORT:
1342 + return ( UCHAR * ) &pa->diversitySupport;
1344 + case DOT11CURRENTRXANTENNA:
1345 +// *write_method = write_dot11CurrentRxAntenna;
1346 + return ( UCHAR * ) &pa->currentRxAntenna;
1354 +/****************************************************************************
1356 +* var_dot11PhyTxPowerTable() - *
1358 +****************************************************************************/
1360 +var_dot11PhyTxPowerTable ( struct variable *vp,
1365 + WriteMethod **write_method )
1367 + int found = FALSE;
1368 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1371 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1372 + for ( np = LIST_FIRST ( &ptList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1373 + pt = ( struct ptTbl_data * ) np->data;
1374 + rName[vp->namelen] = pt->ifIndex;
1375 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
1376 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
1377 + switch ( vp->magic ) {
1378 + case DOT11NUMBERSUPPORTEDPOWERLEVELS:
1379 + if ( pt->haveNumberSupportedPowerLevels ) found = TRUE; break;
1380 + case DOT11TXPOWERLEVEL1:
1381 + if ( pt->haveTxPowerLevel1 ) found = TRUE; break;
1382 + case DOT11TXPOWERLEVEL2:
1383 + if ( pt->haveTxPowerLevel2 ) found = TRUE; break;
1384 + case DOT11TXPOWERLEVEL3:
1385 + if ( pt->haveTxPowerLevel3 ) found = TRUE; break;
1386 + case DOT11TXPOWERLEVEL4:
1387 + if ( pt->haveTxPowerLevel4 ) found = TRUE; break;
1388 + case DOT11TXPOWERLEVEL5:
1389 + if ( pt->haveTxPowerLevel5 ) found = TRUE; break;
1390 + case DOT11TXPOWERLEVEL6:
1391 + if ( pt->haveTxPowerLevel6 ) found = TRUE; break;
1392 + case DOT11TXPOWERLEVEL7:
1393 + if ( pt->haveTxPowerLevel7 ) found = TRUE; break;
1394 + case DOT11TXPOWERLEVEL8:
1395 + if ( pt->haveTxPowerLevel8 ) found = TRUE; break;
1396 + case DOT11CURRENTTXPOWERLEVEL:
1397 + if ( pt->currentTxPowerLevel ) found = TRUE; break;
1407 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
1408 + *length = vp->namelen + 1;
1409 + *var_len = sizeof ( long );
1410 + *write_method = NULL;
1412 + switch ( vp->magic ) {
1414 + case DOT11NUMBERSUPPORTEDPOWERLEVELS:
1415 + return ( UCHAR * ) &pt->numberSupportedPowerLevels;
1417 + case DOT11TXPOWERLEVEL1: return ( UCHAR * ) &pt->TxPowerLevel1;
1418 + case DOT11TXPOWERLEVEL2: return ( UCHAR * ) &pt->TxPowerLevel2;
1419 + case DOT11TXPOWERLEVEL3: return ( UCHAR * ) &pt->TxPowerLevel3;
1420 + case DOT11TXPOWERLEVEL4: return ( UCHAR * ) &pt->TxPowerLevel4;
1421 + case DOT11TXPOWERLEVEL5: return ( UCHAR * ) &pt->TxPowerLevel5;
1422 + case DOT11TXPOWERLEVEL6: return ( UCHAR * ) &pt->TxPowerLevel6;
1423 + case DOT11TXPOWERLEVEL7: return ( UCHAR * ) &pt->TxPowerLevel7;
1424 + case DOT11TXPOWERLEVEL8: return ( UCHAR * ) &pt->TxPowerLevel8;
1426 + case DOT11CURRENTTXPOWERLEVEL:
1427 +// *write_method = write_dot11CurrentTxPowerLevel;
1428 + return ( UCHAR * ) &pt->currentTxPowerLevel;
1437 +/****************************************************************************
1439 +* var_dot11PhyFHSSTable() - *
1441 +****************************************************************************/
1443 +var_dot11PhyFHSSTable ( struct variable *vp,
1448 + WriteMethod **write_method )
1450 + int found = FALSE;
1451 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1454 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1455 + for ( np = LIST_FIRST ( &pfList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1456 + pf = ( struct pfTbl_data * ) np->data;
1457 + rName[vp->namelen] = pf->ifIndex;
1458 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
1459 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
1460 + switch ( vp->magic ) {
1461 + case DOT11HOPTIME:
1462 + if ( pf->haveHopTime ) found = TRUE; break;
1463 + case DOT11CURRENTCHANNELNUMBER:
1464 + if ( pf->haveCurrentChannelNumber ) found = TRUE; break;
1465 + case DOT11MAXDWELLTIME:
1466 + if ( pf->haveMaxDwellTime ) found = TRUE; break;
1467 + case DOT11CURRENTDWELLTIME:
1468 + if ( pf->haveCurrentDwellTime ) found = TRUE; break;
1469 + case DOT11CURRENTSET:
1470 + if ( pf->haveCurrentSet ) found = TRUE; break;
1471 + case DOT11CURRENTPATTERN:
1472 + if ( pf->haveCurrentPattern ) found = TRUE; break;
1473 + case DOT11CURRENTINDEX:
1474 + if ( pf->haveCurrentIndex ) found = TRUE; break;
1484 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
1485 + *length = vp->namelen + 1;
1486 + *var_len = sizeof ( long );
1487 + *write_method = NULL;
1489 + switch ( vp->magic ) {
1491 + case DOT11HOPTIME:
1492 + return ( UCHAR * ) &pf->hopTime;
1494 + case DOT11CURRENTCHANNELNUMBER:
1495 +// *write_method = write_dot11CurrentChannelNumber;
1496 + return ( UCHAR * ) &pf->currentChannelNumber;
1498 + case DOT11MAXDWELLTIME:
1499 + return ( UCHAR * ) &pf->maxDwellTime;
1501 + case DOT11CURRENTDWELLTIME:
1502 +// *write_method = write_dot11CurrentDwellTime;
1503 + return ( UCHAR * ) &pf->currentDwellTime;
1505 + case DOT11CURRENTSET:
1506 +// *write_method = write_dot11CurrentSet;
1507 + return ( UCHAR * ) &pf->currentSet;
1509 + case DOT11CURRENTPATTERN:
1510 +// *write_method = write_dot11CurrentPattern;
1511 + return ( UCHAR * ) &pf->currentPattern;
1513 + case DOT11CURRENTINDEX:
1514 +// *write_method = write_dot11CurrentIndex;
1515 + return ( UCHAR * ) &pf->currentIndex;
1524 +/****************************************************************************
1526 +* var_dot11PhyDSSSTable() - *
1528 +****************************************************************************/
1530 +var_dot11PhyDSSSTable ( struct variable *vp,
1535 + WriteMethod **write_method )
1537 + int found = FALSE;
1538 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1541 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1542 + for ( np = LIST_FIRST ( &pdList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1543 + pd = ( struct pdTbl_data * ) np->data;
1544 + rName[vp->namelen] = pd->ifIndex;
1545 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
1546 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
1547 + switch ( vp->magic ) {
1548 + case DOT11CURRENTCHANNEL:
1549 + if ( pd->haveCurrentChannel ) found = TRUE; break;
1550 + case DOT11CCAMODESUPPORTED:
1551 + if ( pd->haveCCAModeSupported ) found = TRUE; break;
1552 + case DOT11CURRENTCCAMODE:
1553 + if ( pd->haveCurrentCCAMode ) found = TRUE; break;
1554 + case DOT11EDTHRESHOLD:
1555 + if ( pd->haveEDThreshold ) found = TRUE; break;
1565 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
1566 + *length = vp->namelen + 1;
1567 + *var_len = sizeof ( long );
1568 + *write_method = NULL;
1570 + switch ( vp->magic ) {
1572 + case DOT11CURRENTCHANNEL:
1573 +// *write_method = write_dot11CurrentChannel;
1574 + return ( UCHAR * ) &pd->currentChannel;
1576 + case DOT11CCAMODESUPPORTED:
1577 + return ( UCHAR * ) &pd->CCAModeSupported;
1579 + case DOT11CURRENTCCAMODE:
1580 +// *write_method = write_dot11CurrentCCAMode;
1581 + return ( UCHAR * ) &pd->currentCCAMode;
1583 + case DOT11EDTHRESHOLD:
1584 +// *write_method = write_dot11EDThreshold;
1585 + return ( UCHAR * ) &pd->EDThreshold;
1594 +/****************************************************************************
1596 +* var_dot11PhyIRTable() - *
1598 +****************************************************************************/
1600 +var_dot11PhyIRTable ( struct variable *vp,
1605 + WriteMethod **write_method)
1608 + int found = FALSE;
1609 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1612 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1613 + for ( np = LIST_FIRST ( &piList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1614 + pi = ( struct piTbl_data * ) np->data;
1615 + rName[vp->namelen] = pi->ifIndex;
1616 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) == 0 )) ||
1617 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 1, name, *length ) > 0 ))) {
1618 + switch ( vp->magic ) {
1619 + case DOT11CCAWATCHDOGTIMERMAX:
1620 + if ( pi->CCAWatchdogTimerMax ) found = TRUE; break;
1621 + case DOT11CCAWATCHDOGCOUNTMAX:
1622 + if ( pi->CCAWatchdogCountMax ) found = TRUE; break;
1623 + case DOT11CCAWATCHDOGTIMERMIN:
1624 + if ( pi->CCAWatchdogTimerMin ) found = TRUE; break;
1625 + case DOT11CCAWATCHDOGCOUNTMIN:
1626 + if ( pi->CCAWatchdogCountMin ) found = TRUE; break;
1636 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 1 ) * sizeof ( oid ));
1637 + *length = vp->namelen + 1;
1638 + *var_len = sizeof ( long );
1639 + *write_method = NULL;
1641 + switch ( vp->magic ) {
1643 + case DOT11CCAWATCHDOGTIMERMAX:
1644 +// *write_method = write_dot11CCAWatchdogTimerMax;
1645 + return ( UCHAR * ) &pi->CCAWatchdogTimerMax;
1647 + case DOT11CCAWATCHDOGCOUNTMAX:
1648 +// *write_method = write_dot11CCAWatchdogCountMax;
1649 + return ( UCHAR * ) &pi->CCAWatchdogCountMax;
1651 + case DOT11CCAWATCHDOGTIMERMIN:
1652 +// *write_method = write_dot11CCAWatchdogTimerMin;
1653 + return ( UCHAR * ) &pi->CCAWatchdogTimerMin;
1655 + case DOT11CCAWATCHDOGCOUNTMIN:
1656 +// *write_method = write_dot11CCAWatchdogCountMin;
1657 + return ( UCHAR * ) &pi->CCAWatchdogCountMin;
1666 +/****************************************************************************
1668 +* var_dot11RegDomainsSupportedTable() - *
1670 +****************************************************************************/
1672 +var_dot11RegDomainsSupportedTable ( struct variable *vp,
1677 + WriteMethod **write_method)
1679 + int found = FALSE;
1680 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1683 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1684 + for ( np = LIST_FIRST ( &rdList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1685 + rd = ( struct rdTbl_data * ) np->data;
1686 + rName[vp->namelen + 0] = rd->ifIndex;
1687 + rName[vp->namelen + 1] = rd->regDomainsSupportIndex;
1688 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) ||
1689 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) {
1690 + switch ( vp->magic ) {
1691 + case DOT11REGDOMAINSSUPPORTVALUE:
1692 + if ( rd->haveRegDomainsSupportValue ) found = TRUE; break;
1702 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
1703 + *length = vp->namelen + 2;
1704 + *var_len = sizeof ( long );
1705 + *write_method = NULL;
1707 + switch ( vp->magic ) {
1709 + case DOT11REGDOMAINSSUPPORTVALUE:
1710 + return ( UCHAR * ) &rd->regDomainsSupportValue;
1719 +/****************************************************************************
1721 +* var_dot11AntennasListTable() - *
1723 +****************************************************************************/
1725 +var_dot11AntennasListTable(struct variable *vp,
1730 + WriteMethod **write_method)
1732 + int found = FALSE;
1733 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1736 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1737 + for ( np = LIST_FIRST ( &alList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1738 + al = ( struct alTbl_data * ) np->data;
1739 + rName[vp->namelen + 0] = al->ifIndex;
1740 + rName[vp->namelen + 1] = al->antennaListIndex;
1741 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) ||
1742 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) {
1743 + switch ( vp->magic ) {
1744 + case DOT11SUPPORTEDTXANTENNA:
1745 + if ( al->haveSupportedTxAntenna ) found = TRUE; break;
1746 + case DOT11SUPPORTEDRXANTENNA:
1747 + if ( al->haveSupportedRxAntenna ) found = TRUE; break;
1748 + case DOT11DIVERSITYSELECTIONRX:
1749 + if ( al->haveDiversitySelectionRx ) found = TRUE; break;
1759 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
1760 + *length = vp->namelen + 2;
1761 + *var_len = sizeof ( long );
1762 + *write_method = NULL;
1764 + switch ( vp->magic ) {
1766 + case DOT11SUPPORTEDTXANTENNA:
1767 +// *write_method = write_dot11SupportedTxAntenna;
1768 + return ( UCHAR * ) &al->supportedTxAntenna;
1770 + case DOT11SUPPORTEDRXANTENNA:
1771 +// *write_method = write_dot11SupportedRxAntenna;
1772 + return ( UCHAR * ) &al->supportedRxAntenna;
1774 + case DOT11DIVERSITYSELECTIONRX:
1775 +// *write_method = write_dot11DiversitySelectionRx;
1776 + return ( UCHAR * ) &al->diversitySelectionRx;
1785 +/****************************************************************************
1787 +* var_dot11SupportedDataRatesTxTable() - *
1789 +****************************************************************************/
1791 +var_dot11SupportedDataRatesTxTable ( struct variable *vp,
1796 + WriteMethod **write_method )
1798 + int found = FALSE;
1799 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1802 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1803 + for ( np = LIST_FIRST ( &rtList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1804 + rt = ( struct rtTbl_data * ) np->data;
1805 + rName[vp->namelen + 0] = rt->ifIndex;
1806 + rName[vp->namelen + 1] = rt->supportedDataRatesTxIndex;
1807 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) ||
1808 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) {
1809 + switch ( vp->magic ) {
1810 + case DOT11SUPPORTEDDATARATESTXVALUE:
1811 + if ( rt->haveSupportedDataRatesTxValue ) found = TRUE; break;
1821 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
1822 + *length = vp->namelen + 2;
1823 + *var_len = sizeof ( long );
1824 + *write_method = NULL;
1826 + switch ( vp->magic ) {
1828 + case DOT11SUPPORTEDDATARATESTXVALUE:
1829 + return ( UCHAR * ) &rt->supportedDataRatesTxValue;
1838 +/****************************************************************************
1840 +* var_dot11SupportedDataRatesRxTable() - *
1842 +****************************************************************************/
1844 +var_dot11SupportedDataRatesRxTable ( struct variable *vp,
1849 + WriteMethod **write_method )
1851 + int found = FALSE;
1852 + oid rName [ MAX_OID_LEN ]; // OID to be returned
1855 + memcpy (( char * ) rName, ( char * ) vp->name, ( int ) vp->namelen * sizeof ( oid ));
1856 + for ( np = LIST_FIRST ( &rrList ); np != NULL; np = LIST_NEXT ( np, nodes )) {
1857 + rr = ( struct rrTbl_data * ) np->data;
1858 + rName[vp->namelen + 0] = rr->ifIndex;
1859 + rName[vp->namelen + 1] = rr->supportedDataRatesRxIndex;
1860 + if (( exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) == 0 )) ||
1861 + ( !exact && ( snmp_oid_compare ( rName, vp->namelen + 2, name, *length ) > 0 ))) {
1862 + switch ( vp->magic ) {
1863 + case DOT11SUPPORTEDDATARATESRXVALUE:
1864 + if ( rr->haveSupportedDataRatesRxValue ) found = TRUE; break;
1874 + memcpy (( char * ) name, ( char * ) rName, ( vp->namelen + 2 ) * sizeof ( oid ));
1875 + *length = vp->namelen + 2;
1876 + *var_len = sizeof ( long );
1877 + *write_method = NULL;
1879 + switch ( vp->magic ) {
1881 + case DOT11SUPPORTEDDATARATESRXVALUE:
1882 + return ( UCHAR * ) &rr->supportedDataRatesRxValue;
1891 +/****************************************************************************
1893 +****************************************************************************/
1895 +write_dot11StationID(int action,
1897 + u_char var_val_type,
1898 + size_t var_val_len,
1903 + static unsigned char string[SPRINT_MAX_LEN];
1906 + switch ( action ) {
1909 + if ( var_val_type != ASN_OCTET_STR ) {
1910 + fprintf ( stderr, "write to dot11StationID not ASN_OCTET_STR\n" );
1911 + return SNMP_ERR_WRONGTYPE;
1913 + if ( var_val_len > sizeof ( string )) {
1914 + fprintf ( stderr,"write to dot11StationID: bad length\n" );
1915 + return SNMP_ERR_WRONGLENGTH;
1929 + return SNMP_ERR_NOERROR;
1932 +/****************************************************************************
1934 +****************************************************************************/
1936 +write_dot11MediumOccupancyLimit(int action,
1938 + u_char var_val_type,
1939 + size_t var_val_len,
1944 + static long *long_ret;
1947 + switch ( action ) {
1950 + if ( var_val_type != ASN_INTEGER ) {
1951 + fprintf ( stderr, "write to dot11MediumOccupancyLimit not ASN_INTEGER\n" );
1952 + return SNMP_ERR_WRONGTYPE;
1954 + if ( var_val_len > sizeof ( long_ret )){
1955 + fprintf ( stderr,"write to dot11MediumOccupancyLimit: bad length\n" );
1956 + return SNMP_ERR_WRONGLENGTH;
1970 + return SNMP_ERR_NOERROR;
1973 +/****************************************************************************
1975 +****************************************************************************/
1977 +write_dot11CFPPeriod(int action,
1979 + u_char var_val_type,
1980 + size_t var_val_len,
1985 + static long *long_ret;
1988 + switch ( action ) {
1991 + if ( var_val_type != ASN_INTEGER ) {
1992 + fprintf ( stderr, "write to dot11CFPPeriod not ASN_INTEGER\n" );
1993 + return SNMP_ERR_WRONGTYPE;
1995 + if ( var_val_len > sizeof ( long_ret )){
1996 + fprintf ( stderr, "write to dot11CFPPeriod: bad length\n" );
1997 + return SNMP_ERR_WRONGLENGTH;
2011 + return SNMP_ERR_NOERROR;
2014 +/****************************************************************************
2016 +****************************************************************************/
2018 +write_dot11CFPMaxDuration(int action,
2020 + u_char var_val_type,
2021 + size_t var_val_len,
2026 + static long *long_ret;
2029 + switch ( action ) {
2032 + if ( var_val_type != ASN_INTEGER ) {
2033 + fprintf ( stderr, "write to dot11CFPMaxDuration not ASN_INTEGER\n" );
2034 + return SNMP_ERR_WRONGTYPE;
2036 + if ( var_val_len > sizeof ( long_ret )){
2037 + fprintf ( stderr, "write to dot11CFPMaxDuration: bad length\n" );
2038 + return SNMP_ERR_WRONGLENGTH;
2052 + return SNMP_ERR_NOERROR;
2055 +/****************************************************************************
2057 +****************************************************************************/
2059 +write_dot11AuthenticationResponseTimeOut(int action,
2061 + u_char var_val_type,
2062 + size_t var_val_len,
2067 + static long *long_ret;
2070 + switch ( action ) {
2073 + if ( var_val_type != ASN_INTEGER ) {
2074 + fprintf ( stderr, "write to dot11AuthenticationResponseTimeOut not ASN_INTEGER\n" );
2075 + return SNMP_ERR_WRONGTYPE;
2077 + if ( var_val_len > sizeof ( long_ret )){
2078 + fprintf ( stderr, "write to dot11AuthenticationResponseTimeOut: bad length\n" );
2079 + return SNMP_ERR_WRONGLENGTH;
2093 + return SNMP_ERR_NOERROR;
2096 +/****************************************************************************
2098 +****************************************************************************/
2100 +write_dot11PowerManagementMode(int action,
2102 + u_char var_val_type,
2103 + size_t var_val_len,
2108 + static long *long_ret;
2111 + switch ( action ) {
2114 + if ( var_val_type != ASN_INTEGER ) {
2115 + fprintf ( stderr, "write to dot11PowerManagementMode not ASN_INTEGER\n" );
2116 + return SNMP_ERR_WRONGTYPE;
2118 + if ( var_val_len > sizeof ( long_ret )) {
2119 + fprintf ( stderr, "write to dot11PowerManagementMode: bad length\n" );
2120 + return SNMP_ERR_WRONGLENGTH;
2134 + return SNMP_ERR_NOERROR;
2137 +/****************************************************************************
2139 +****************************************************************************/
2141 +write_dot11DesiredSSID(int action,
2143 + u_char var_val_type,
2144 + size_t var_val_len,
2149 + static unsigned char string[SPRINT_MAX_LEN];
2152 + switch ( action ) {
2155 + if ( var_val_type != ASN_OCTET_STR ) {
2156 + fprintf ( stderr, "write to dot11DesiredSSID not ASN_OCTET_STR\n" );
2157 + return SNMP_ERR_WRONGTYPE;
2159 + if ( var_val_len > sizeof ( string )){
2160 + fprintf ( stderr, "write to dot11DesiredSSID: bad length\n" );
2161 + return SNMP_ERR_WRONGLENGTH;
2175 + return SNMP_ERR_NOERROR;
2178 +/****************************************************************************
2180 +****************************************************************************/
2182 +write_dot11DesiredBSSType(int action,
2184 + u_char var_val_type,
2185 + size_t var_val_len,
2190 + static long *long_ret;
2193 + switch ( action ) {
2196 + if ( var_val_type != ASN_INTEGER ) {
2197 + fprintf ( stderr, "write to dot11DesiredBSSType not ASN_INTEGER\n" );
2198 + return SNMP_ERR_WRONGTYPE;
2200 + if ( var_val_len > sizeof ( long_ret )){
2201 + fprintf ( stderr, "write to dot11DesiredBSSType: bad length\n" );
2202 + return SNMP_ERR_WRONGLENGTH;
2216 + return SNMP_ERR_NOERROR;
2219 +/****************************************************************************
2221 +****************************************************************************/
2223 +write_dot11OperationalRateSet(int action,
2225 + u_char var_val_type,
2226 + size_t var_val_len,
2231 + static unsigned char string[SPRINT_MAX_LEN];
2234 + switch ( action ) {
2237 + if ( var_val_type != ASN_OCTET_STR ) {
2238 + fprintf ( stderr, "write to dot11OperationalRateSet not ASN_OCTET_STR\n" );
2239 + return SNMP_ERR_WRONGTYPE;
2241 + if ( var_val_len > sizeof ( string )){
2242 + fprintf ( stderr, "write to dot11OperationalRateSet: bad length\n" );
2243 + return SNMP_ERR_WRONGLENGTH;
2257 + return SNMP_ERR_NOERROR;
2260 +/****************************************************************************
2262 +****************************************************************************/
2264 +write_dot11BeaconPeriod(int action,
2266 + u_char var_val_type,
2267 + size_t var_val_len,
2272 + static long *long_ret;
2275 + switch ( action ) {
2278 + if ( var_val_type != ASN_INTEGER ) {
2279 + fprintf ( stderr, "write to dot11BeaconPeriod not ASN_INTEGER\n" );
2280 + return SNMP_ERR_WRONGTYPE;
2282 + if ( var_val_len > sizeof ( long_ret )){
2283 + fprintf ( stderr,"write to dot11BeaconPeriod: bad length\n" );
2284 + return SNMP_ERR_WRONGLENGTH;
2298 + return SNMP_ERR_NOERROR;
2301 +/****************************************************************************
2303 +****************************************************************************/
2305 +write_dot11DTIMPeriod(int action,
2307 + u_char var_val_type,
2308 + size_t var_val_len,
2313 + static long *long_ret;
2316 + switch ( action ) {
2319 + if ( var_val_type != ASN_INTEGER ) {
2320 + fprintf ( stderr, "write to dot11DTIMPeriod not ASN_INTEGER\n" );
2321 + return SNMP_ERR_WRONGTYPE;
2323 + if ( var_val_len > sizeof ( long_ret )){
2324 + fprintf ( stderr,"write to dot11DTIMPeriod: bad length\n" );
2325 + return SNMP_ERR_WRONGLENGTH;
2339 + return SNMP_ERR_NOERROR;
2342 +/****************************************************************************
2344 +****************************************************************************/
2346 +write_dot11AssociationResponseTimeOut(int action,
2348 + u_char var_val_type,
2349 + size_t var_val_len,
2354 + static long *long_ret;
2357 + switch ( action ) {
2360 + if ( var_val_type != ASN_INTEGER ) {
2361 + fprintf ( stderr, "write to dot11AssociationResponseTimeOut not ASN_INTEGER\n" );
2362 + return SNMP_ERR_WRONGTYPE;
2364 + if ( var_val_len > sizeof ( long_ret )) {
2365 + fprintf ( stderr,"write to dot11AssociationResponseTimeOut: bad length\n" );
2366 + return SNMP_ERR_WRONGLENGTH;
2380 + return SNMP_ERR_NOERROR;
2383 +/****************************************************************************
2385 +****************************************************************************/
2387 +write_dot11AuthenticationAlgorithmsEnable(int action,
2389 + u_char var_val_type,
2390 + size_t var_val_len,
2395 + static long *long_ret;
2398 + switch ( action ) {
2401 + if ( var_val_type != ASN_INTEGER ) {
2402 + fprintf ( stderr, "write to dot11AuthenticationAlgorithmsEnable not ASN_INTEGER\n" );
2403 + return SNMP_ERR_WRONGTYPE;
2405 + if ( var_val_len > sizeof ( long_ret )){
2406 + fprintf ( stderr,"write to dot11AuthenticationAlgorithmsEnable: bad length\n" );
2407 + return SNMP_ERR_WRONGLENGTH;
2421 + return SNMP_ERR_NOERROR;
2424 +/****************************************************************************
2426 +****************************************************************************/
2428 +write_dot11WEPDefaultKeyValue(int action,
2430 + u_char var_val_type,
2431 + size_t var_val_len,
2436 + static unsigned char string[SPRINT_MAX_LEN];
2439 + switch ( action ) {
2442 + if ( var_val_type != ASN_OCTET_STR ) {
2443 + fprintf ( stderr, "write to dot11WEPDefaultKeyValue not ASN_OCTET_STR\n" );
2444 + return SNMP_ERR_WRONGTYPE;
2446 + if ( var_val_len > sizeof ( string )){
2447 + fprintf ( stderr,"write to dot11WEPDefaultKeyValue: bad length\n" );
2448 + return SNMP_ERR_WRONGLENGTH;
2462 + return SNMP_ERR_NOERROR;
2465 +/****************************************************************************
2467 +****************************************************************************/
2469 +write_dot11WEPKeyMappingAddress(int action,
2471 + u_char var_val_type,
2472 + size_t var_val_len,
2477 + static unsigned char string[SPRINT_MAX_LEN];
2480 + switch ( action ) {
2483 + if ( var_val_type != ASN_OCTET_STR ) {
2484 + fprintf ( stderr, "write to dot11WEPKeyMappingAddress not ASN_OCTET_STR\n" );
2485 + return SNMP_ERR_WRONGTYPE;
2487 + if ( var_val_len > sizeof ( string )) {
2488 + fprintf ( stderr,"write to dot11WEPKeyMappingAddress: bad length\n" );
2489 + return SNMP_ERR_WRONGLENGTH;
2503 + return SNMP_ERR_NOERROR;
2506 +/****************************************************************************
2508 +****************************************************************************/
2510 +write_dot11WEPKeyMappingWEPOn(int action,
2512 + u_char var_val_type,
2513 + size_t var_val_len,
2518 + static long *long_ret;
2521 + switch ( action ) {
2524 + if ( var_val_type != ASN_INTEGER ) {
2525 + fprintf ( stderr, "write to dot11WEPKeyMappingWEPOn not ASN_INTEGER\n" );
2526 + return SNMP_ERR_WRONGTYPE;
2528 + if ( var_val_len > sizeof ( long_ret )){
2529 + fprintf ( stderr, "write to dot11WEPKeyMappingWEPOn: bad length\n" );
2530 + return SNMP_ERR_WRONGLENGTH;
2544 + return SNMP_ERR_NOERROR;
2547 +/****************************************************************************
2549 +****************************************************************************/
2551 +write_dot11WEPKeyMappingValue(int action,
2553 + u_char var_val_type,
2554 + size_t var_val_len,
2559 + static unsigned char string[SPRINT_MAX_LEN];
2562 + switch ( action ) {
2565 + if ( var_val_type != ASN_OCTET_STR ) {
2566 + fprintf ( stderr, "write to dot11WEPKeyMappingValue not ASN_OCTET_STR\n" );
2567 + return SNMP_ERR_WRONGTYPE;
2569 + if ( var_val_len > sizeof ( string )) {
2570 + fprintf ( stderr, "write to dot11WEPKeyMappingValue: bad length\n" );
2571 + return SNMP_ERR_WRONGLENGTH;
2585 + return SNMP_ERR_NOERROR;
2588 +/****************************************************************************
2590 +****************************************************************************/
2592 +write_dot11WEPKeyMappingStatus(int action,
2594 + u_char var_val_type,
2595 + size_t var_val_len,
2600 + static long *long_ret;
2603 + switch ( action ) {
2605 + if ( var_val_type != ASN_INTEGER ) {
2606 + fprintf ( stderr, "write to dot11WEPKeyMappingStatus not ASN_INTEGER\n" );
2607 + return SNMP_ERR_WRONGTYPE;
2609 + if ( var_val_len > sizeof ( long_ret )){
2610 + fprintf ( stderr, "write to dot11WEPKeyMappingStatus: bad length\n" );
2611 + return SNMP_ERR_WRONGLENGTH;
2625 + return SNMP_ERR_NOERROR;
2628 +/****************************************************************************
2630 +****************************************************************************/
2632 +write_dot11PrivacyInvoked(int action,
2634 + u_char var_val_type,
2635 + size_t var_val_len,
2640 + static long *long_ret;
2643 + switch ( action ) {
2646 + if ( var_val_type != ASN_INTEGER ) {
2647 + fprintf ( stderr, "write to dot11PrivacyInvoked not ASN_INTEGER\n" );
2648 + return SNMP_ERR_WRONGTYPE;
2650 + if ( var_val_len > sizeof ( long_ret )){
2651 + fprintf ( stderr, "write to dot11PrivacyInvoked: bad length\n" );
2652 + return SNMP_ERR_WRONGLENGTH;
2666 + return SNMP_ERR_NOERROR;
2669 +/****************************************************************************
2671 +****************************************************************************/
2673 +write_dot11WEPDefaultKeyID(int action,
2675 + u_char var_val_type,
2676 + size_t var_val_len,
2681 + static long *long_ret;
2684 + switch ( action ) {
2687 + if ( var_val_type != ASN_INTEGER ) {
2688 + fprintf ( stderr, "write to dot11WEPDefaultKeyID not ASN_INTEGER\n" );
2689 + return SNMP_ERR_WRONGTYPE;
2691 + if ( var_val_len > sizeof ( long_ret )){
2692 + fprintf ( stderr, "write to dot11WEPDefaultKeyID: bad length\n" );
2693 + return SNMP_ERR_WRONGLENGTH;
2707 + return SNMP_ERR_NOERROR;
2710 +/****************************************************************************
2712 +****************************************************************************/
2714 +write_dot11WEPKeyMappingLength(int action,
2716 + u_char var_val_type,
2717 + size_t var_val_len,
2722 + static long *long_ret;
2725 + switch ( action ) {
2728 + if ( var_val_type != ASN_INTEGER ) {
2729 + fprintf ( stderr, "write to dot11WEPKeyMappingLength not ASN_INTEGER\n" );
2730 + return SNMP_ERR_WRONGTYPE;
2732 + if ( var_val_len > sizeof ( long_ret )){
2733 + fprintf ( stderr, "write to dot11WEPKeyMappingLength: bad length\n" );
2734 + return SNMP_ERR_WRONGLENGTH;
2748 + return SNMP_ERR_NOERROR;
2751 +/****************************************************************************
2753 +****************************************************************************/
2755 +write_dot11ExcludeUnencrypted(int action,
2757 + u_char var_val_type,
2758 + size_t var_val_len,
2763 + static long *long_ret;
2766 + switch ( action ) {
2769 + if ( var_val_type != ASN_INTEGER ) {
2770 + fprintf ( stderr, "write to dot11ExcludeUnencrypted not ASN_INTEGER\n" );
2771 + return SNMP_ERR_WRONGTYPE;
2773 + if ( var_val_len > sizeof ( long_ret )){
2774 + fprintf ( stderr,"write to dot11ExcludeUnencrypted: bad length\n" );
2775 + return SNMP_ERR_WRONGLENGTH;
2789 + return SNMP_ERR_NOERROR;
2792 +/****************************************************************************
2794 +****************************************************************************/
2796 +write_dot11RTSThreshold(int action,
2798 + u_char var_val_type,
2799 + size_t var_val_len,
2804 + static long *long_ret;
2807 + switch ( action ) {
2810 + if ( var_val_type != ASN_INTEGER ){
2811 + fprintf ( stderr, "write to dot11RTSThreshold not ASN_INTEGER\n" );
2812 + return SNMP_ERR_WRONGTYPE;
2814 + if ( var_val_len > sizeof ( long_ret )){
2815 + fprintf ( stderr, "write to dot11RTSThreshold: bad length\n" );
2816 + return SNMP_ERR_WRONGLENGTH;
2830 + return SNMP_ERR_NOERROR;
2833 +/****************************************************************************
2835 +****************************************************************************/
2837 +write_dot11ShortRetryLimit(int action,
2839 + u_char var_val_type,
2840 + size_t var_val_len,
2845 + static long *long_ret;
2848 + switch ( action ) {
2851 + if ( var_val_type != ASN_INTEGER ) {
2852 + fprintf ( stderr, "write to dot11ShortRetryLimit not ASN_INTEGER\n" );
2853 + return SNMP_ERR_WRONGTYPE;
2855 + if ( var_val_len > sizeof ( long_ret )){
2856 + fprintf ( stderr, "write to dot11ShortRetryLimit: bad length\n" );
2857 + return SNMP_ERR_WRONGLENGTH;
2871 + return SNMP_ERR_NOERROR;
2874 +/****************************************************************************
2876 +****************************************************************************/
2878 +write_dot11LongRetryLimit(int action,
2880 + u_char var_val_type,
2881 + size_t var_val_len,
2886 + static long *long_ret;
2889 + switch ( action ) {
2892 + if ( var_val_type != ASN_INTEGER ) {
2893 + fprintf ( stderr, "write to dot11LongRetryLimit not ASN_INTEGER\n" );
2894 + return SNMP_ERR_WRONGTYPE;
2896 + if ( var_val_len > sizeof ( long_ret )){
2897 + fprintf ( stderr,"write to dot11LongRetryLimit: bad length\n" );
2898 + return SNMP_ERR_WRONGLENGTH;
2912 + return SNMP_ERR_NOERROR;
2915 +/****************************************************************************
2917 +****************************************************************************/
2919 +write_dot11FragmentationThreshold(int action,
2921 + u_char var_val_type,
2922 + size_t var_val_len,
2927 + static long *long_ret;
2930 + switch ( action ) {
2933 + if ( var_val_type != ASN_INTEGER ) {
2934 + fprintf ( stderr, "write to dot11FragmentationThreshold not ASN_INTEGER\n" );
2935 + return SNMP_ERR_WRONGTYPE;
2937 + if ( var_val_len > sizeof ( long_ret )){
2938 + fprintf ( stderr,"write to dot11FragmentationThreshold: bad length\n" );
2939 + return SNMP_ERR_WRONGLENGTH;
2953 + return SNMP_ERR_NOERROR;
2956 +/****************************************************************************
2958 +****************************************************************************/
2960 +write_dot11MaxTransmitMSDULifetime(int action,
2962 + u_char var_val_type,
2963 + size_t var_val_len,
2968 + static long *long_ret;
2971 + switch ( action ) {
2974 + if ( var_val_type != ASN_INTEGER ) {
2975 + fprintf ( stderr, "write to dot11MaxTransmitMSDULifetime not ASN_INTEGER\n" );
2976 + return SNMP_ERR_WRONGTYPE;
2978 + if ( var_val_len > sizeof ( long_ret )){
2979 + fprintf ( stderr, "write to dot11MaxTransmitMSDULifetime: bad length\n" );
2980 + return SNMP_ERR_WRONGLENGTH;
2995 + return SNMP_ERR_NOERROR;
2998 +/****************************************************************************
3000 +****************************************************************************/
3002 +write_dot11MaxReceiveLifetime(int action,
3004 + u_char var_val_type,
3005 + size_t var_val_len,
3010 + static long *long_ret;
3013 + switch ( action ) {
3016 + if ( var_val_type != ASN_INTEGER ) {
3017 + fprintf ( stderr, "write to dot11MaxReceiveLifetime not ASN_INTEGER\n" );
3018 + return SNMP_ERR_WRONGTYPE;
3020 + if ( var_val_len > sizeof ( long_ret )){
3021 + fprintf ( stderr, "write to dot11MaxReceiveLifetime: bad length\n" );
3022 + return SNMP_ERR_WRONGLENGTH;
3036 + return SNMP_ERR_NOERROR;
3039 +/****************************************************************************
3041 +****************************************************************************/
3043 +write_dot11Address(int action,
3045 + u_char var_val_type,
3046 + size_t var_val_len,
3051 + static unsigned char string[SPRINT_MAX_LEN];
3054 + switch ( action ) {
3057 + if ( var_val_type != ASN_OCTET_STR ) {
3058 + fprintf ( stderr, "write to dot11Address not ASN_OCTET_STR\n" );
3059 + return SNMP_ERR_WRONGTYPE;
3061 + if ( var_val_len > sizeof ( string )){
3062 + fprintf ( stderr, "write to dot11Address: bad length\n" );
3063 + return SNMP_ERR_WRONGLENGTH;
3077 + return SNMP_ERR_NOERROR;
3080 +/****************************************************************************
3082 +****************************************************************************/
3084 +write_dot11GroupAddressesStatus(int action,
3086 + u_char var_val_type,
3087 + size_t var_val_len,
3092 + static long *long_ret;
3095 + switch ( action ) {
3098 + if ( var_val_type != ASN_INTEGER ) {
3099 + fprintf ( stderr, "write to dot11GroupAddressesStatus not ASN_INTEGER\n" );
3100 + return SNMP_ERR_WRONGTYPE;
3102 + if ( var_val_len > sizeof ( long_ret )){
3103 + fprintf ( stderr,"write to dot11GroupAddressesStatus: bad length\n" );
3104 + return SNMP_ERR_WRONGLENGTH;
3118 + return SNMP_ERR_NOERROR;
3121 +/****************************************************************************
3123 +****************************************************************************/
3125 +write_dot11CurrentRegDomain(int action,
3127 + u_char var_val_type,
3128 + size_t var_val_len,
3133 + static long *long_ret;
3136 + switch ( action ) {
3139 + if ( var_val_type != ASN_INTEGER ) {
3140 + fprintf ( stderr, "write to dot11CurrentRegDomain not ASN_INTEGER\n" );
3141 + return SNMP_ERR_WRONGTYPE;
3143 + if ( var_val_len > sizeof ( long_ret )){
3144 + fprintf ( stderr, "write to dot11CurrentRegDomain: bad length\n" );
3145 + return SNMP_ERR_WRONGLENGTH;
3159 + return SNMP_ERR_NOERROR;
3162 +/****************************************************************************
3164 +****************************************************************************/
3166 +write_dot11CurrentTxAntenna(int action,
3168 + u_char var_val_type,
3169 + size_t var_val_len,
3174 + static long *long_ret;
3177 + switch ( action ) {
3180 + if ( var_val_type != ASN_INTEGER ) {
3181 + fprintf ( stderr, "write to dot11CurrentTxAntenna not ASN_INTEGER\n" );
3182 + return SNMP_ERR_WRONGTYPE;
3184 + if ( var_val_len > sizeof ( long_ret )){
3185 + fprintf ( stderr, "write to dot11CurrentTxAntenna: bad length\n" );
3186 + return SNMP_ERR_WRONGLENGTH;
3200 + return SNMP_ERR_NOERROR;
3203 +/****************************************************************************
3205 +****************************************************************************/
3207 +write_dot11CurrentRxAntenna(int action,
3209 + u_char var_val_type,
3210 + size_t var_val_len,
3215 + static long *long_ret;
3218 + switch ( action ) {
3221 + if ( var_val_type != ASN_INTEGER ) {
3222 + fprintf ( stderr, "write to dot11CurrentRxAntenna not ASN_INTEGER\n" );
3223 + return SNMP_ERR_WRONGTYPE;
3225 + if ( var_val_len > sizeof ( long_ret )){
3226 + fprintf ( stderr,"write to dot11CurrentRxAntenna: bad length\n" );
3227 + return SNMP_ERR_WRONGLENGTH;
3242 + return SNMP_ERR_NOERROR;
3245 +/****************************************************************************
3247 +****************************************************************************/
3249 +write_dot11CurrentTxPowerLevel(int action,
3251 + u_char var_val_type,
3252 + size_t var_val_len,
3257 + static long *long_ret;
3260 + switch ( action ) {
3263 + if ( var_val_type != ASN_INTEGER ) {
3264 + fprintf ( stderr, "write to dot11CurrentTxPowerLevel not ASN_INTEGER\n" );
3265 + return SNMP_ERR_WRONGTYPE;
3267 + if ( var_val_len > sizeof ( long_ret )){
3268 + fprintf ( stderr, "write to dot11CurrentTxPowerLevel: bad length\n" );
3269 + return SNMP_ERR_WRONGLENGTH;
3283 + return SNMP_ERR_NOERROR;
3286 +/****************************************************************************
3288 +****************************************************************************/
3290 +write_dot11CurrentChannelNumber(int action,
3292 + u_char var_val_type,
3293 + size_t var_val_len,
3298 + static long *long_ret;
3301 + switch ( action ) {
3304 + if ( var_val_type != ASN_INTEGER ) {
3305 + fprintf ( stderr, "write to dot11CurrentChannelNumber not ASN_INTEGER\n" );
3306 + return SNMP_ERR_WRONGTYPE;
3308 + if ( var_val_len > sizeof ( long_ret )){
3309 + fprintf ( stderr,"write to dot11CurrentChannelNumber: bad length\n" );
3310 + return SNMP_ERR_WRONGLENGTH;
3324 + return SNMP_ERR_NOERROR;
3327 +/****************************************************************************
3329 +****************************************************************************/
3331 +write_dot11CurrentDwellTime(int action,
3333 + u_char var_val_type,
3334 + size_t var_val_len,
3339 + static long *long_ret;
3342 + switch ( action ) {
3345 + if ( var_val_type != ASN_INTEGER ) {
3346 + fprintf ( stderr, "write to dot11CurrentDwellTime not ASN_INTEGER\n" );
3347 + return SNMP_ERR_WRONGTYPE;
3349 + if ( var_val_len > sizeof ( long_ret )){
3350 + fprintf ( stderr, "write to dot11CurrentDwellTime: bad length\n" );
3351 + return SNMP_ERR_WRONGLENGTH;
3365 + return SNMP_ERR_NOERROR;
3368 +/****************************************************************************
3370 +****************************************************************************/
3372 +write_dot11CurrentSet(int action,
3374 + u_char var_val_type,
3375 + size_t var_val_len,
3380 + static long *long_ret;
3383 + switch ( action ) {
3386 + if ( var_val_type != ASN_INTEGER ) {
3387 + fprintf ( stderr, "write to dot11CurrentSet not ASN_INTEGER\n" );
3388 + return SNMP_ERR_WRONGTYPE;
3390 + if ( var_val_len > sizeof ( long_ret )){
3391 + fprintf ( stderr, "write to dot11CurrentSet: bad length\n" );
3392 + return SNMP_ERR_WRONGLENGTH;
3406 + return SNMP_ERR_NOERROR;
3409 +/****************************************************************************
3411 +****************************************************************************/
3413 +write_dot11CurrentPattern(int action,
3415 + u_char var_val_type,
3416 + size_t var_val_len,
3421 + static long *long_ret;
3424 + switch ( action ) {
3427 + if ( var_val_type != ASN_INTEGER ) {
3428 + fprintf ( stderr, "write to dot11CurrentPattern not ASN_INTEGER\n" );
3429 + return SNMP_ERR_WRONGTYPE;
3431 + if ( var_val_len > sizeof ( long_ret )){
3432 + fprintf ( stderr, "write to dot11CurrentPattern: bad length\n" );
3433 + return SNMP_ERR_WRONGLENGTH;
3447 + return SNMP_ERR_NOERROR;
3450 +/****************************************************************************
3452 +****************************************************************************/
3454 +write_dot11CurrentIndex(int action,
3456 + u_char var_val_type,
3457 + size_t var_val_len,
3462 + static long *long_ret;
3465 + switch ( action ) {
3468 + if ( var_val_type != ASN_INTEGER ) {
3469 + fprintf ( stderr, "write to dot11CurrentIndex not ASN_INTEGER\n" );
3470 + return SNMP_ERR_WRONGTYPE;
3472 + if ( var_val_len > sizeof ( long_ret )){
3473 + fprintf ( stderr, "write to dot11CurrentIndex: bad length\n" );
3474 + return SNMP_ERR_WRONGLENGTH;
3488 + return SNMP_ERR_NOERROR;
3491 +/****************************************************************************
3493 +****************************************************************************/
3495 +write_dot11CurrentChannel(int action,
3497 + u_char var_val_type,
3498 + size_t var_val_len,
3503 + static long *long_ret;
3506 + switch ( action ) {
3509 + if ( var_val_type != ASN_INTEGER ) {
3510 + fprintf ( stderr, "write to dot11CurrentChannel not ASN_INTEGER\n" );
3511 + return SNMP_ERR_WRONGTYPE;
3513 + if ( var_val_len > sizeof ( long_ret )){
3514 + fprintf ( stderr, "write to dot11CurrentChannel: bad length\n" );
3515 + return SNMP_ERR_WRONGLENGTH;
3529 + return SNMP_ERR_NOERROR;
3532 +/****************************************************************************
3534 +****************************************************************************/
3536 +write_dot11CurrentCCAMode(int action,
3538 + u_char var_val_type,
3539 + size_t var_val_len,
3544 + static long *long_ret;
3547 + switch ( action ) {
3550 + if ( var_val_type != ASN_INTEGER ) {
3551 + fprintf ( stderr, "write to dot11CurrentCCAMode not ASN_INTEGER\n" );
3552 + return SNMP_ERR_WRONGTYPE;
3554 + if ( var_val_len > sizeof ( long_ret )){
3555 + fprintf ( stderr,"write to dot11CurrentCCAMode: bad length\n" );
3556 + return SNMP_ERR_WRONGLENGTH;
3570 + return SNMP_ERR_NOERROR;
3573 +/****************************************************************************
3575 +****************************************************************************/
3577 +write_dot11EDThreshold(int action,
3579 + u_char var_val_type,
3580 + size_t var_val_len,
3585 + static long *long_ret;
3588 + switch ( action ) {
3591 + if ( var_val_type != ASN_INTEGER ) {
3592 + fprintf ( stderr, "write to dot11EDThreshold not ASN_INTEGER\n" );
3593 + return SNMP_ERR_WRONGTYPE;
3595 + if ( var_val_len > sizeof ( long_ret )){
3596 + fprintf ( stderr, "write to dot11EDThreshold: bad length\n" );
3597 + return SNMP_ERR_WRONGLENGTH;
3611 + return SNMP_ERR_NOERROR;
3614 +/****************************************************************************
3616 +****************************************************************************/
3618 +write_dot11CCAWatchdogTimerMax(int action,
3620 + u_char var_val_type,
3621 + size_t var_val_len,
3626 + static long *long_ret;
3629 + switch ( action ) {
3632 + if ( var_val_type != ASN_INTEGER ) {
3633 + fprintf ( stderr, "write to dot11CCAWatchdogTimerMax not ASN_INTEGER\n" );
3634 + return SNMP_ERR_WRONGTYPE;
3636 + if ( var_val_len > sizeof ( long_ret )){
3637 + fprintf ( stderr, "write to dot11CCAWatchdogTimerMax: bad length\n" );
3638 + return SNMP_ERR_WRONGLENGTH;
3652 + return SNMP_ERR_NOERROR;
3655 +/****************************************************************************
3657 +****************************************************************************/
3659 +write_dot11CCAWatchdogCountMax(int action,
3661 + u_char var_val_type,
3662 + size_t var_val_len,
3667 + static long *long_ret;
3670 + switch ( action ) {
3673 + if ( var_val_type != ASN_INTEGER ) {
3674 + fprintf ( stderr, "write to dot11CCAWatchdogCountMax not ASN_INTEGER\n" );
3675 + return SNMP_ERR_WRONGTYPE;
3677 + if ( var_val_len > sizeof ( long_ret )){
3678 + fprintf ( stderr, "write to dot11CCAWatchdogCountMax: bad length\n" );
3679 + return SNMP_ERR_WRONGLENGTH;
3693 + return SNMP_ERR_NOERROR;
3696 +/****************************************************************************
3698 +****************************************************************************/
3700 +write_dot11CCAWatchdogTimerMin(int action,
3702 + u_char var_val_type,
3703 + size_t var_val_len,
3708 + static long *long_ret;
3711 + switch ( action ) {
3714 + if ( var_val_type != ASN_INTEGER ) {
3715 + fprintf ( stderr, "write to dot11CCAWatchdogTimerMin not ASN_INTEGER\n" );
3716 + return SNMP_ERR_WRONGTYPE;
3718 + if ( var_val_len > sizeof ( long_ret )){
3719 + fprintf ( stderr, "write to dot11CCAWatchdogTimerMin: bad length\n" );
3720 + return SNMP_ERR_WRONGLENGTH;
3734 + return SNMP_ERR_NOERROR;
3737 +/****************************************************************************
3739 +****************************************************************************/
3741 +write_dot11CCAWatchdogCountMin(int action,
3743 + u_char var_val_type,
3744 + size_t var_val_len,
3749 + static long *long_ret;
3752 + switch ( action ) {
3755 + if ( var_val_type != ASN_INTEGER ) {
3756 + fprintf ( stderr, "write to dot11CCAWatchdogCountMin not ASN_INTEGER\n" );
3757 + return SNMP_ERR_WRONGTYPE;
3759 + if ( var_val_len > sizeof ( long_ret )){
3760 + fprintf ( stderr, "write to dot11CCAWatchdogCountMin: bad length\n" );
3761 + return SNMP_ERR_WRONGLENGTH;
3775 + return SNMP_ERR_NOERROR;
3778 +/****************************************************************************
3780 +****************************************************************************/
3782 +write_dot11SupportedTxAntenna(int action,
3784 + u_char var_val_type,
3785 + size_t var_val_len,
3790 + static long *long_ret;
3793 + switch ( action ) {
3796 + if ( var_val_type != ASN_INTEGER ) {
3797 + fprintf ( stderr, "write to dot11SupportedTxAntenna not ASN_INTEGER\n" );
3798 + return SNMP_ERR_WRONGTYPE;
3800 + if ( var_val_len > sizeof ( long_ret )){
3801 + fprintf ( stderr, "write to dot11SupportedTxAntenna: bad length\n" );
3802 + return SNMP_ERR_WRONGLENGTH;
3816 + return SNMP_ERR_NOERROR;
3819 +/****************************************************************************
3821 +****************************************************************************/
3823 +write_dot11SupportedRxAntenna(int action,
3825 + u_char var_val_type,
3826 + size_t var_val_len,
3831 + static long *long_ret;
3834 + switch ( action ) {
3837 + if ( var_val_type != ASN_INTEGER ) {
3838 + fprintf ( stderr, "write to dot11SupportedRxAntenna not ASN_INTEGER\n" );
3839 + return SNMP_ERR_WRONGTYPE;
3841 + if ( var_val_len > sizeof ( long_ret )){
3842 + fprintf ( stderr,"write to dot11SupportedRxAntenna: bad length\n" );
3843 + return SNMP_ERR_WRONGLENGTH;
3857 + return SNMP_ERR_NOERROR;
3860 +/****************************************************************************
3862 +****************************************************************************/
3864 +write_dot11DiversitySelectionRx(int action,
3866 + u_char var_val_type,
3867 + size_t var_val_len,
3872 + static long *long_ret;
3875 + switch ( action ) {
3878 + if ( var_val_type != ASN_INTEGER ) {
3879 + fprintf ( stderr, "write to dot11DiversitySelectionRx not ASN_INTEGER\n" );
3880 + return SNMP_ERR_WRONGTYPE;
3882 + if ( var_val_len > sizeof ( long_ret )){
3883 + fprintf ( stderr, "write to dot11DiversitySelectionRx: bad length\n" );
3884 + return SNMP_ERR_WRONGLENGTH;
3898 + return SNMP_ERR_NOERROR;
3901 +/****************************************************************************
3903 +* loadTables() - Load the Tables *
3905 +****************************************************************************/
3906 +static void loadTables()
3908 + int skfd; // generic raw socket desc
3909 + struct iwreq wrq; // ioctl request structure
3911 + struct timeval et; // elapsed time
3912 + struct wireless_info info; // workarea for wireless ioctl information
3914 + char bfr[1024], ifName[1024];
3917 + gettimeofday ( &et, ( struct timezone * ) 0 ); // get time-of-day
3918 + if ( et.tv_sec < lastLoad + MINLOADFREQ ) // only reload so often
3920 + lastLoad = et.tv_sec;
3922 + skfd = openSocket(); // open socket
3924 + syslog ( LOG_ERR, "SNMP ieee802dot11.loadTables() - %s\n", "socket open failure" );
3930 + // find interfaces in /proc/net/dev and find the wireless interfaces
3931 + fp = fopen ( PROC_NET_DEV, "r" );
3933 + while ( fgets ( bfr, sizeof ( bfr ), fp )) {
3934 + if ( strstr ( bfr, ":" )) {
3935 + s = bfr; t = ifName;
3936 + while ( isspace ( *s )) // discard white space
3938 + while ( *s != ':' ) // get interface name
3942 + // verify as a wireless device
3943 + memset (( char * ) &info, 0, sizeof ( struct wireless_info ));
3944 + strncpy ( wrq.ifr_name, ifName, IFNAMSIZ );
3945 + if ( ioctl ( skfd, SIOCGIWNAME, &wrq ) >= 0 ) {
3946 + printf ( "%s ifName: %s\n", "loadTables() -", ifName );
3948 + loadWiExt( skfd, ifName, &info );
3949 + displayWiExt ( info );
3950 + load80211Structs ( skfd, ifName, &info );
3960 +/****************************************************************************
3962 +* load80211Structs() - load the 802.11 structures *
3964 +****************************************************************************/
3966 +load80211Structs ( int skfd, char *ifName, struct wireless_info *wi )
3968 + int rc, ifIndex = 0;
3970 + char MACAddress [ MACADDR_LEN + 1 ];
3972 + strcpy ( ifr.ifr_name, ifName );
3973 + rc = ioctl ( skfd, SIOCGIFHWADDR, &ifr );
3976 + sprintf ( MACAddress, "%02X:%02X:%02X:%02X:%02X:%02X\0",
3977 + ( UCHAR ) ifr.ifr_hwaddr.sa_data[0], ( UCHAR ) ifr.ifr_hwaddr.sa_data[1],
3978 + ( UCHAR ) ifr.ifr_hwaddr.sa_data[2], ( UCHAR ) ifr.ifr_hwaddr.sa_data[3],
3979 + ( UCHAR ) ifr.ifr_hwaddr.sa_data[4], ( UCHAR ) ifr.ifr_hwaddr.sa_data[5] );
3981 + nSc.haveStationID = TRUE;
3982 + strcpy ( nSc.stationID, MACAddress );
3983 + nOp.haveMACAddress = TRUE;
3984 + strcpy ( nOp.MACAddress, MACAddress );
3985 + nRi.haveManufacturerOUI = TRUE;
3986 + strncpy ( nRi.manufacturerOUI, MACAddress, MAN_OUI_LEN );
3988 + ifIndex = if_nametoindex ( ifName );
3990 + syslog ( LOG_ERR, "SNMP %s - %s %s\n",
3991 + "ieee802dot11.load80211Structs()", ifName, "has no ifIndex" );
3995 + loadWiExtTo80211Structs ( ifIndex, ifName, wi );
3997 + if ( hasChanged (( char * ) &nSc, sizeof ( nSc ))) {
3998 + nSc.ifIndex = ifIndex;
3999 + sprintf ( nSc.UID, "%04d\0", nSc.ifIndex );
4000 + strcpy ( nSc.ifName, ifName );
4001 + addList (( char * ) &scList, ( char * ) &nSc, sizeof ( nSc ));
4004 + if ( hasChanged (( char * ) &nPr, sizeof ( nPr ))) {
4005 + nPr.ifIndex = ifIndex;
4006 + sprintf ( nPr.UID, "%04d\0", nPr.ifIndex );
4007 + strcpy ( nPr.ifName, ifName );
4008 + addList (( char * ) &prList, ( char * ) &nPr, sizeof ( nPr ));
4011 + if ( hasChanged (( char * ) &nOp, sizeof ( nOp ))) {
4012 + nOp.ifIndex = ifIndex;
4013 + sprintf ( nOp.UID, "%04d\0", nOp.ifIndex );
4014 + strcpy ( nOp.ifName, ifName );
4015 + addList (( char * ) &opList, ( char * ) &nOp, sizeof ( nOp ));
4018 + if ( hasChanged (( char * ) &nCo, sizeof ( nCo ))) {
4019 + nCo.ifIndex = ifIndex;
4020 + sprintf ( nCo.UID, "%04d\0", nCo.ifIndex );
4021 + strcpy ( nCo.ifName, ifName );
4022 + addList (( char * ) &coList, ( char * ) &nCo, sizeof ( nCo ));
4025 + if ( hasChanged (( char * ) &nRi, sizeof ( nRi ))) {
4026 + nRi.ifIndex = ifIndex;
4027 + sprintf ( nRi.UID, "%04d\0", nRi.ifIndex );
4028 + strcpy ( nRi.ifName, ifName );
4029 + addList (( char * ) &riList, ( char * ) &nRi, sizeof ( nRi ));
4032 + if ( hasChanged (( char * ) &nPo, sizeof ( nPo ))) {
4033 + nPo.ifIndex = ifIndex;
4034 + sprintf ( nPo.UID, "%04d\0", nPo.ifIndex );
4035 + strcpy ( nPo.ifName, ifName );
4036 + addList (( char * ) &poList, ( char * ) &nPo, sizeof ( nPo ));
4039 + if ( hasChanged (( char * ) &nPa, sizeof ( nPa ))) {
4040 + nPa.ifIndex = ifIndex;
4041 + sprintf ( nPa.UID, "%04d\0", nPa.ifIndex );
4042 + strcpy ( nPa.ifName, ifName );
4043 + addList (( char * ) &paList, ( char * ) &nPa, sizeof ( nPa ));
4046 + if ( hasChanged (( char * ) &nPt, sizeof ( nPt ))) {
4047 + nPt.ifIndex = ifIndex;
4048 + sprintf ( nPt.UID, "%04d\0", nPt.ifIndex );
4049 + strcpy ( nPt.ifName, ifName );
4050 + addList (( char * ) &ptList, ( char * ) &nPt, sizeof ( nPt ));
4053 + if ( hasChanged (( char * ) &nPf, sizeof ( nPf ))) {
4054 + nPf.ifIndex = ifIndex;
4055 + sprintf ( nPf.UID, "%04d\0", nPf.ifIndex );
4056 + strcpy ( nPf.ifName, ifName );
4057 + addList (( char * ) &pfList, ( char * ) &nPf, sizeof ( nPf ));
4060 + if ( hasChanged (( char * ) &nPd, sizeof ( nPd ))) {
4061 + nPd.ifIndex = ifIndex;
4062 + sprintf ( nPd.UID, "%04d\0", nPd.ifIndex );
4063 + strcpy ( nPd.ifName, ifName );
4064 + addList (( char * ) &pdList, ( char * ) &nPd, sizeof ( nPd ));
4067 + if ( hasChanged (( char * ) &nPi, sizeof ( nPi ))) {
4068 + nPi.ifIndex = ifIndex;
4069 + sprintf ( nPi.UID, "%04d\0", nPi.ifIndex );
4070 + strcpy ( nPi.ifName, ifName );
4071 + addList (( char * ) &piList, ( char * ) &nPi, sizeof ( nPi ));
4075 +//printf ( "%s - ifIndex: %d ifName: %s UID: %s\n",
4076 +// "load80211Structs() - HASCHANGED", ifIndex, ifName, nSc.UID );
4079 +/****************************************************************************
4081 +* initStructs() - initialize structures *
4083 +****************************************************************************/
4084 +static void initStructs()
4088 + // 802.11 MIB Stuctures
4089 + memset (( char * ) &nSc, 0, sizeof ( nSc )); memset (( char * ) &nAa, 0, sizeof ( nAa ));
4090 + memset (( char * ) &nDf, 0, sizeof ( nDf )); memset (( char * ) &nKm, 0, sizeof ( nKm ));
4091 + memset (( char * ) &nPr, 0, sizeof ( nPr )); memset (( char * ) &nOp, 0, sizeof ( nOp ));
4092 + memset (( char * ) &nCo, 0, sizeof ( nCo )); memset (( char * ) &nGa, 0, sizeof ( nGa ));
4093 + memset (( char * ) &nRi, 0, sizeof ( nRi )); memset (( char * ) &nPo, 0, sizeof ( nPo ));
4094 + memset (( char * ) &nPa, 0, sizeof ( nPa )); memset (( char * ) &nPt, 0, sizeof ( nPt ));
4095 + memset (( char * ) &nPf, 0, sizeof ( nPf )); memset (( char * ) &nPd, 0, sizeof ( nPd ));
4096 + memset (( char * ) &nPi, 0, sizeof ( nPi )); memset (( char * ) &nRd, 0, sizeof ( nRd ));
4097 + memset (( char * ) &nAl, 0, sizeof ( nAl )); memset (( char * ) &nRt, 0, sizeof ( nRt ));
4098 + memset (( char * ) &nRr, 0, sizeof ( nRr ));
4100 + // Wireless Extensions
4101 + wepCurrentKey = 0;
4102 + haveWepCurrentKey = FALSE;
4103 + for ( i = 0; i < MAX_WEP_KEYS; i++ ) {
4105 + wep[i].key[0] = '\0';
4106 + wep[i].haveKey = FALSE;
4110 +/****************************************************************************
4112 +* Wireless Extensions Specific Functions *
4114 +****************************************************************************/
4115 +/****************************************************************************
4117 +* loadWiExtTo80211Structs() - load wireless extensions to 802.11 structures *
4119 +****************************************************************************/
4121 +loadWiExtTo80211Structs ( int ifIndex, char *ifName, struct wireless_info *wi )
4126 + // dot11StationConfigTable
4127 + nSc.havePrivacyOptionImplemented = TRUE;
4128 + nSc.privacyOptionImplemented = 1; // assume we support WEP
4130 + if ( wi->has_power ) {
4131 + nSc.havePowerManagementMode = TRUE;
4132 + nSc.powerManagementMode = 1; // assume power is active
4133 + if ( !wi->power.disabled &&
4134 + wi->power.flags & IW_POWER_MIN )
4135 + nSc.powerManagementMode = 2; // power save mode
4138 + if ( wi->has_essid && strlen ( wi->essid )) {
4139 + nSc.haveDesiredSSID = TRUE;
4140 + strcpy ( nSc.desiredSSID, wi->essid );
4143 + if ( wi->has_mode ) {
4144 + nSc.haveDesiredBSSType = TRUE;
4145 + if ( wi->mode == IW_MODE_ADHOC )
4146 + nSc.desiredBSSType = 2; // independent
4147 + else if ( wi->has_ap_addr )
4148 + nSc.desiredBSSType = 1; // infrastructure
4150 + nSc.desiredBSSType = 3; // any
4153 + if ( wi->has_range ) {
4154 + for ( i = 0; i < wi->range.num_bitrates && j < 126; i++ ) {
4155 + nSc.haveOperationalRateSet = TRUE;
4156 + nSc.operationalRateSet[j++] = ( char ) ( wi->range.bitrate[i] / 500000L );
4160 + // dot11AuthenticationAlgorithmsTable
4161 + nAa.haveAuthenticationAlgorithm = TRUE; // it's a rule to always have
4162 + nAa.haveAuthenticationAlgorithmsEnable = TRUE; // 'open' supported
4163 + nAa.ifIndex = ifIndex;
4164 + nAa.authenticationAlgorithmsIndex = 1; // index number one
4165 + nAa.authenticationAlgorithm = 1; // 1 => open key
4166 + sprintf ( nAa.UID, "%04d%04d\0", nAa.ifIndex, nAa.authenticationAlgorithmsIndex );
4167 + nAa.authenticationAlgorithmsEnable = 1; // enabled by default
4168 + if ( ( wi->has_key ) &&
4169 + ( wi->key_size != 0 ) &&
4170 + !( wi->key_flags & IW_ENCODE_DISABLED ))
4171 + nAa.authenticationAlgorithmsEnable = 2;
4172 + addList (( char * ) &aaList, ( char * ) &nAa, sizeof ( nAa ));
4174 + nAa.haveAuthenticationAlgorithm = TRUE; // I'm gonna assume we always support WEP
4175 + nAa.haveAuthenticationAlgorithmsEnable = TRUE;
4176 + nAa.ifIndex = ifIndex;
4177 + nAa.authenticationAlgorithmsIndex = 2; // index number 2
4178 + nAa.authenticationAlgorithm = 2; // 2 => shared key
4179 + sprintf ( nAa.UID, "%04d%04d\0", nAa.ifIndex, nAa.authenticationAlgorithmsIndex );
4180 + nAa.authenticationAlgorithmsEnable = 2;
4181 + if ( ( wi->has_key ) &&
4182 + ( wi->key_size != 0 ) &&
4183 + !( wi->key_flags & IW_ENCODE_DISABLED ))
4184 + nAa.authenticationAlgorithmsEnable = 1; // disabled by default
4185 + addList (( char * ) &aaList, ( char * ) &nAa, sizeof ( nAa ));
4187 + //dot11WEPDefaultKeysTable
4188 + if ( wi->has_range ) {
4189 + for ( i = 0; i < MAX_WEP_KEYS; i++ ) {
4190 + nDf.haveWEPDefaultKeyValue = TRUE;
4191 + nDf.ifIndex = ifIndex;
4192 + nDf.WEPDefaultKeyIndex = i + 1; // index number
4193 + sprintf ( nDf.UID, "%04d%04d\0", nDf.ifIndex, nDf.WEPDefaultKeyIndex );
4194 + if ( wep[i].haveKey )
4195 + strcpy ( nDf.WEPDefaultKeyValue, "*****" );
4197 + nDf.WEPDefaultKeyValue[0] = '\0';
4198 + addList (( char * ) &dfList, ( char * ) &nDf, sizeof ( nDf ));
4202 + // dot11PrivacyTable
4203 + nPr.havePrivacyInvoked = TRUE;
4204 + nPr.privacyInvoked = 2; // 2 => FALSE
4205 + nPr.haveWEPDefaultKeyID = TRUE;
4206 + nPr.WEPDefaultKeyID = 0;
4207 + nPr.haveExcludeUnencrypted = TRUE;
4208 + nPr.excludeUnencrypted = 2; // 2 => FALSE
4209 + if ( wi->has_range ) {
4210 + if ( ( wi->key_size != 0 ) &&
4211 + !( wi->key_flags & IW_ENCODE_DISABLED )) {
4212 + nPr.privacyInvoked = 1;
4213 + if ( wi->key_flags & IW_ENCODE_RESTRICTED )
4214 + nPr.excludeUnencrypted = 1;
4215 + nPr.WEPDefaultKeyID = wepCurrentKey;
4220 + // dot11OperationTable
4221 + if ( wi->has_range ) {
4222 + nOp.haveRTSThreshold = TRUE;
4223 + nOp.RTSThreshold = wi->range.max_rts;
4226 + if ( wi->has_frag && wi->frag.value ) {
4227 + nOp.haveFragmentationThreshold = TRUE;
4228 + nOp.fragmentationThreshold = wi->frag.value;
4232 + // dot11PhyOperationTable
4233 + if ( strstr ( wi->name, "IEEE 802.11-FS" )) nPo.PHYType = 1; // So what if I
4234 + if ( strstr ( wi->name, "IEEE 802.11-DS" )) nPo.PHYType = 2; // made up a couple?
4235 + if ( strstr ( wi->name, "IEEE 802.11-IR" )) nPo.PHYType = 3;
4236 + if ( strstr ( wi->name, "IEEE 802.11-OFDM" )) nPo.PHYType = 4; // 802.11a
4237 + if ( strstr ( wi->name, "IEEE 802.11-OFDM/DS" )) nPo.PHYType = 5; // 802.11g
4238 + if ( strstr ( wi->name, "IEEE 802.11-TURBO" )) nPo.PHYType = 6; // Atheros TURBO mode
4239 + if ( nPo.PHYType ) nPo.havePHYType = TRUE;
4241 + // dot11PhyDSSSTable
4242 + if ( wi->has_range ) { // && wi->freq <= ( double ) 2483000000 ) { // DSSS frequencies only
4243 + for ( i = 0; i < wi->range.num_frequency; i++ ) {
4244 + if ((( double ) ( wi->range.freq[i].e * 10 ) * ( double ) wi->range.freq[i].m ) == wi->freq ) {
4245 + nPd.haveCurrentChannel = TRUE;
4246 + nPd.currentChannel = wi->range.freq[i].i;
4251 + // dot11SupportedDataRatesTxTable
4252 + if ( wi->has_range ) {
4253 + for ( i = 0; i < wi->range.num_bitrates; i++ ) {
4254 + nRt.ifIndex = ifIndex;
4255 + nRt.supportedDataRatesTxIndex = i + 1;
4256 + nRt.supportedDataRatesTxValue = wi->range.bitrate[i] / 500000L;
4257 + nRt.haveSupportedDataRatesTxValue = TRUE;
4258 + sprintf ( nRt.UID, "%04d%04d\0", nRt.ifIndex, nRt.supportedDataRatesTxIndex );
4259 + strcpy ( nRt.ifName, ifName );
4260 + addList (( char * ) &rtList, ( char * ) &nRt, sizeof ( nRt ));
4264 + // dot11SupportedDataRatesRxTable
4265 + if ( wi->has_range ) {
4266 + for ( i = 0; i < wi->range.num_bitrates; i++ ) {
4267 + nRr.ifIndex = ifIndex;
4268 + nRr.supportedDataRatesRxIndex = i + 1;
4269 + nRr.supportedDataRatesRxValue = wi->range.bitrate[i] / 500000L;
4270 + nRr.haveSupportedDataRatesRxValue = TRUE;
4271 + sprintf ( nRr.UID, "%04d%04d\0", nRr.ifIndex, nRr.supportedDataRatesRxIndex );
4272 + strcpy ( nRr.ifName, ifName );
4273 + addList (( char * ) &rrList, ( char * ) &nRr, sizeof ( nRr ));
4277 +//printf ( "%s max_encoding_tokens: %d\n",
4278 +// "loadWiExtTo80211Structs() - ", wi->range.max_encoding_tokens );
4281 +/****************************************************************************
4283 +* loadWiExt() - load wireless extensions structures; *
4284 +* use ioctl calls and read /proc/net/wireless *
4286 +****************************************************************************/
4287 +static void loadWiExt ( int skfd, char *ifname, struct wireless_info *wi )
4289 + struct iwreq wrq; // ioctl request structure
4292 + char buffer[sizeof ( iwrange ) * 2]; /* Large enough */
4296 + strncpy ( wrq.ifr_name, ifname, IFNAMSIZ );
4298 + /* Get wireless name */
4299 + if ( ioctl ( skfd, SIOCGIWNAME, &wrq ) >= 0 ) {
4300 + strncpy ( wi->name, wrq.u.name, IFNAMSIZ );
4301 + wi->name[IFNAMSIZ] = '\0';
4304 + /* Get ranges */ // NOTE: some version checking in iwlib.c
4305 + memset ( buffer, 0, sizeof ( buffer ));
4306 + wrq.u.data.pointer = ( caddr_t ) &buffer;
4307 + wrq.u.data.length = sizeof ( buffer );
4308 + wrq.u.data.flags = 0;
4309 + if ( ioctl ( skfd, SIOCGIWRANGE, &wrq ) >= 0 ) {
4310 + memcpy (( char * ) &wi->range, buffer, sizeof ( iwrange ));
4311 + wi->has_range = 1;
4314 + /* Get network ID */
4315 + if ( ioctl ( skfd, SIOCGIWNWID, &wrq ) >= 0 ) {
4316 + memcpy ( &wi->nwid, &wrq.u.nwid, sizeof ( iwparam ));
4320 + /* Get frequency / channel */ // THIS NUMBER LOOKS FUNNY
4321 + if ( ioctl ( skfd, SIOCGIWFREQ, &wrq ) >= 0 ) {
4323 + wi->freq = (( double ) wrq.u.freq.m ) * pow ( 10, wrq.u.freq.e );
4326 + /* Get sensitivity */
4327 + if ( ioctl ( skfd, SIOCGIWSENS, &wrq ) >= 0 ) {
4329 + memcpy ( &wi->sens, &wrq.u.sens, sizeof ( iwparam ));
4332 + /* Get encryption information */
4333 + wrq.u.data.pointer = ( caddr_t ) &wi->key;
4334 + wrq.u.data.length = IW_ENCODING_TOKEN_MAX;
4335 + wrq.u.data.flags = 0;
4336 + if ( ioctl ( skfd, SIOCGIWENCODE, &wrq ) >= 0 ) {
4338 + wi->key_size = wrq.u.data.length;
4339 + wi->key_flags = wrq.u.data.flags;
4340 + wepCurrentKey = wrq.u.data.flags & IW_ENCODE_INDEX;
4343 + for ( i = 0; i < wi->range.max_encoding_tokens; i++ ) {
4344 + wrq.u.data.pointer = ( caddr_t ) &wi->key;
4345 + wrq.u.data.length = IW_ENCODING_TOKEN_MAX;
4346 + wrq.u.data.flags = i;
4347 + if ( ioctl ( skfd, SIOCGIWENCODE, &wrq ) >= 0 ) {
4348 + if ( ( wrq.u.data.length != 0 ) &&
4349 + !( wrq.u.data.flags & IW_ENCODE_DISABLED )) {
4350 + wep[i].len = wrq.u.data.length;
4351 + wep[i].haveKey = TRUE;
4353 + for ( j = 0; j < wrq.u.data.length; j++ ) {
4354 + if (( j & 0x1 ) == 0 && j != 0 )
4355 + strcpy ( t++, "-");
4356 + sprintf ( t, "%.2X", wi->key[j] );
4365 + wrq.u.essid.pointer = ( caddr_t ) &wi->essid;
4366 + wrq.u.essid.length = IW_ESSID_MAX_SIZE + 1;
4367 + wrq.u.essid.flags = 0;
4368 + if ( ioctl ( skfd, SIOCGIWESSID, &wrq ) >= 0 ) {
4369 + wi->has_essid = 1;
4370 + wi->essid_on = wrq.u.data.flags;
4373 + /* Get AP address */
4374 + if ( ioctl ( skfd, SIOCGIWAP, &wrq ) >= 0 ) {
4375 + wi->has_ap_addr = 1;
4376 + memcpy ( &wi->ap_addr, &wrq.u.ap_addr, sizeof ( sockaddr ));
4379 + /* Get NickName */
4380 + wrq.u.essid.pointer = ( caddr_t ) &wi->nickname;
4381 + wrq.u.essid.length = IW_ESSID_MAX_SIZE + 1;
4382 + wrq.u.essid.flags = 0;
4383 + if ( ioctl ( skfd, SIOCGIWNICKN, &wrq ) >= 0 ) {
4384 + if ( wrq.u.data.length > 1 )
4385 + wi->has_nickname = 1;
4388 + /* Get bit rate */
4389 + if ( ioctl ( skfd, SIOCGIWRATE, &wrq ) >= 0 ) {
4390 + wi->has_bitrate = 1;
4391 + memcpy ( &wi->bitrate, &wrq.u.bitrate, sizeof ( iwparam ));
4394 + /* Get RTS threshold */
4395 + if ( ioctl ( skfd, SIOCGIWRTS, &wrq ) >= 0 ) {
4397 + memcpy ( &wi->rts, &wrq.u.rts, sizeof ( iwparam ));
4400 + /* Get fragmentation threshold */
4401 + if ( ioctl ( skfd, SIOCGIWFRAG, &wrq ) >= 0 ) {
4403 + memcpy ( &wi->frag, &wrq.u.frag, sizeof ( iwparam ));
4406 + /* Get operation mode */
4407 + if ( ioctl ( skfd, SIOCGIWMODE, &wrq ) >= 0 ) {
4408 + wi->mode = wrq.u.mode;
4409 + if ( wi->mode < IW_NUM_OPER_MODE && wi->mode >= 0 )
4413 + /* Get Power Management settings */ // #if WIRELESS_EXT > 9
4414 + wrq.u.power.flags = 0;
4415 + if ( ioctl ( skfd, SIOCGIWPOWER, &wrq ) >= 0 ) {
4416 + wi->has_power = 1;
4417 + memcpy ( &wi->power, &wrq.u.power, sizeof ( iwparam ));
4420 + /* Get retry limit/lifetime */ // #if WIRELESS_EXT > 10
4421 + if ( ioctl ( skfd, SIOCGIWRETRY, &wrq ) >= 0 ) {
4422 + wi->has_retry = 1;
4423 + memcpy ( &wi->retry, &wrq.u.retry, sizeof ( iwparam ));
4426 + /* Get stats */ // #if WIRELESS_EXT > 11
4427 + wrq.u.data.pointer = ( caddr_t ) &wi->stats;
4428 + wrq.u.data.length = 0;
4429 + wrq.u.data.flags = 1; /* Clear updated flag */
4430 + if ( ioctl ( skfd, SIOCGIWSTATS, &wrq ) < 0 )
4431 + wi->has_stats = 1;
4433 + if ( !wi->has_stats ) { // no ioctl support, go to file
4434 + fp = fopen ( PROC_NET_WIRELESS, "r" );
4436 + while ( fgets ( bfr, sizeof ( bfr ), fp )) {
4437 + bfr [ sizeof ( bfr ) - 1 ] = '\0'; // no buffer overruns here!
4438 + strtok (( char * ) &bfr, "\n" ); // '\n' => '\0'
4439 + if ( strstr ( bfr, ifname ) && strstr ( bfr, ":" )) {
4440 + wi->has_stats = 1;
4442 + s = strchr ( s, ':' ); s++; /* Skip ethX: */
4443 + s = strtok ( s, " " ); /* ' ' => '\0' */
4444 + sscanf ( s, "%X", &wi->stats.status ); // status
4446 + s = strtok ( NULL, " " ); // link quality
4447 + if ( strchr ( s, '.' ) != NULL )
4448 + wi->stats.qual.updated |= 1;
4449 + sscanf ( s, "%d", &wi->stats.qual.qual );
4451 + s = strtok ( NULL, " " ); // signal level
4452 + if ( strchr ( s,'.' ) != NULL )
4453 + wi->stats.qual.updated |= 2;
4454 + sscanf ( s, "%d", &wi->stats.qual.level );
4456 + s = strtok ( NULL, " " ); // noise level
4457 + if ( strchr ( s, '.' ) != NULL )
4458 + wi->stats.qual.updated += 4;
4459 + sscanf ( s, "%d", &wi->stats.qual.noise );
4461 + s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.nwid );
4462 + s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.code );
4463 + s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.fragment );
4464 + s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.retries );
4465 + s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.misc );
4466 + s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.miss.beacon );
4473 +// printf ( "%s bfr: %s\n", "loadTables()", bfr );
4476 +/****************************************************************************
4478 +* displayWiExt() - show what I got from Wireless Extensions *
4480 +****************************************************************************/
4481 +static void displayWiExt ( struct wireless_info info )
4483 +#ifdef DISPLAYWIEXT
4485 + char title[] = "displayWiExt() -";
4487 + printf ( "========================================\n" );
4488 + printf ( "===> Wireless Extension IOCTL calls <===\n" );
4489 + printf ( "========================================\n" );
4491 + if ( strlen ( info.name ))
4492 + printf ( "%s name: %s\n", "SIOCGIWNAME", info.name );
4494 + printf ( "%s\n", "no info.name support" );
4496 + if ( info.has_nickname = 1 )
4497 + printf ( "%s nickname: %s\n", "SIOCGIWNICKN", info.nickname );
4499 + printf ( "%s %s\n", "SIOCGIWNICKN", " ===> no info.nickname support" );
4501 + if ( info.has_essid )
4502 + printf ( "%s essid_on: %d essid: %s\n", "SIOCGIWESSID", info.essid_on, info.essid );
4504 + printf ( "%s %s\n", "SIOCGIWESSID", " ===> no info.essid support" );
4506 + if ( info.has_range ) {
4507 + printf ( "%s throughput: %d\n", "SIOCGIWRANGE", info.range.throughput );
4508 + printf ( "%s min_nwid: %d\n", "SIOCGIWRANGE", info.range.min_nwid );
4509 + printf ( "%s max_nwid: %d\n", "SIOCGIWRANGE", info.range.max_nwid );
4510 + printf ( "%s sensitivity: %d\n", "SIOCGIWRANGE", info.range.sensitivity );
4511 + printf ( "%s num_bitrates: %d\n", "SIOCGIWRANGE", info.range.num_bitrates );
4512 + for ( i = 0; i < info.range.num_bitrates; i++ )
4513 + printf ( "%s bitrate[%d]: %d\n", "SIOCGIWRANGE", i, info.range.bitrate[i] );
4514 + printf ( "%s min_rts: %d\n", "SIOCGIWRANGE", info.range.min_rts );
4515 + printf ( "%s max_rts: %d\n", "SIOCGIWRANGE", info.range.max_rts );
4516 + printf ( "%s min_frag: %d\n", "SIOCGIWRANGE", info.range.min_frag );
4517 + printf ( "%s max_frag: %d\n", "SIOCGIWRANGE", info.range.max_frag );
4518 + printf ( "%s min_pmp: %d\n", "SIOCGIWRANGE", info.range.min_pmp );
4519 + printf ( "%s max_pmp: %d\n", "SIOCGIWRANGE", info.range.max_pmp );
4520 + printf ( "%s min_pmt: %d\n", "SIOCGIWRANGE", info.range.min_pmt );
4521 + printf ( "%s max_pmt: %d\n", "SIOCGIWRANGE", info.range.max_pmt );
4522 + printf ( "%s pmp_flags: %d\n", "SIOCGIWRANGE", info.range.pmp_flags );
4523 + printf ( "%s pmt_flags: %d\n", "SIOCGIWRANGE", info.range.pmt_flags );
4524 + printf ( "%s pm_capa: %d\n", "SIOCGIWRANGE", info.range.pm_capa );
4525 + printf ( "%s num_encoding_sizes: %d\n", "SIOCGIWRANGE", info.range.num_encoding_sizes );
4526 + for ( i = 0; i < info.range.num_encoding_sizes; i++ )
4527 + printf ( "%s encoding_size[%d]: %d\n", "SIOCGIWRANGE", i, info.range.encoding_size[i] );
4528 + printf ( "%s max_encoding_tokens: %d\n", "SIOCGIWRANGE", info.range.max_encoding_tokens );
4529 +// printf ( "%s encoding_login_index: %d\n", "SIOCGIWRANGE", info.range.encoding_login_index );
4530 + printf ( "%s txpower_capa: %d\n", "SIOCGIWRANGE", info.range.txpower_capa );
4531 + printf ( "%s num_txpower: %d dBm\n", "SIOCGIWRANGE", info.range.num_txpower );
4532 + for ( i = 0; i < info.range.num_txpower; i++ )
4533 + printf ( "%s txpower[%d]: %d\n", "SIOCGIWRANGE", i, info.range.txpower[i] );
4534 + printf ( "%s we_version_compiled: %d\n", "SIOCGIWRANGE", info.range.we_version_compiled );
4535 + printf ( "%s we_version_source: %d\n", "SIOCGIWRANGE", info.range.we_version_source );
4536 + printf ( "%s retry_capa: %d\n", "SIOCGIWRANGE", info.range.retry_capa );
4537 + printf ( "%s retry_flags: %d\n", "SIOCGIWRANGE", info.range.retry_flags );
4538 + printf ( "%s r_time_flags: %d\n", "SIOCGIWRANGE", info.range.r_time_flags );
4539 + printf ( "%s min_retry: %d\n", "SIOCGIWRANGE", info.range.min_retry );
4540 + printf ( "%s max_retry: %d\n", "SIOCGIWRANGE", info.range.max_retry );
4541 + printf ( "%s min_r_time: %d\n", "SIOCGIWRANGE", info.range.min_r_time );
4542 + printf ( "%s max_r_time: %d\n", "SIOCGIWRANGE", info.range.max_r_time );
4543 + printf ( "%s num_channels: %d\n", "SIOCGIWRANGE", info.range.num_channels );
4544 + printf ( "%s num_frequency: %d\n", "SIOCGIWRANGE", info.range.num_frequency );
4545 + for ( i = 0; i < info.range.num_frequency; i++ )
4546 + printf ( "%s freq[%d].i: %d freq[%d].e: %d freq[%d].m: %d\n", "SIOCGIWRANGE",
4547 + i, info.range.freq[i].i, i, info.range.freq[i].e, i, info.range.freq[i].m );
4550 + printf ( "%s %s\n", "SIOCGIWRANGE", " ===> no info.range support" );
4552 + if ( info.has_nwid )
4553 + printf ( "%s nwid - disabled: %d value: %X\n", "SIOCGIWNWID", info.nwid.disabled, info.nwid.value );
4555 + printf ( "%s %s\n", "SIOCGIWNWID", " ===> no info.nwid support" );
4557 + if ( info.has_freq ) {
4558 +// printf ( "%s freq: %g\n", "SIOCGIWFREQ", info.freq / GIGA );
4559 + printf ( "%s freq: %g\n", "SIOCGIWFREQ", info.freq );
4562 + printf ( "%s %s\n", "SIOCGIWFREQ", " ===> no info.freq support" );
4564 + if ( info.has_sens )
4565 + printf ( "%s sens: %d\n", "SIOCGIWSENS", info.sens );
4567 + printf ( "%s %s\n", "SIOCGIWSENS", " ===> no info.sens support" );
4569 + if ( info.has_key ) {
4570 + printf ( "%s key_size: %d key_flags: %d wepCurrentKey: %d\n",
4571 + "SIOCGIWENCODE", info.key_size, info.key_flags, wepCurrentKey );
4572 + printf ( "%s MODE: %d DISABLED: %d INDEX: %d OPEN: %d RESTRICTED: %d NOKEY: %d TEMP: %d\n",
4573 + "SIOCGIWENCODE", info.key_flags & IW_ENCODE_MODE,
4574 + info.key_flags & IW_ENCODE_DISABLED ? 1:0, info.key_flags & IW_ENCODE_INDEX,
4575 + info.key_flags & IW_ENCODE_OPEN ? 1:0, info.key_flags & IW_ENCODE_RESTRICTED ? 1:0,
4576 + info.key_flags & IW_ENCODE_NOKEY ? 1:0, info.key_flags & IW_ENCODE_TEMP ? 1:0 );
4579 + printf ( "%s %s\n", "SIOCGIWENCODE", " ===> no info.key support" );
4581 + for ( i = 0; i < MAX_WEP_KEYS; i++ ) {
4582 + if ( wep[i].haveKey )
4583 + printf ( "%s wep[%d].len: %d wep[%d].key: %s\n",
4584 + "SIOCGIWENCODE", i, wep[i].len, i, wep[i].key );
4587 + if ( info.has_ap_addr )
4588 + printf ( "%s ap_addr.sa_data: %02X:%02X:%02X:%02X:%02X:%02X ap_addr.sa_family: %d\n",
4589 + "SIOCGIWAP", ( UCHAR ) info.ap_addr.sa_data[0], ( UCHAR ) info.ap_addr.sa_data[1],
4590 + ( UCHAR ) info.ap_addr.sa_data[2], ( UCHAR ) info.ap_addr.sa_data[3],
4591 + ( UCHAR ) info.ap_addr.sa_data[4], ( UCHAR ) info.ap_addr.sa_data[5],
4592 + info.ap_addr.sa_family );
4594 + printf ( "%s %s\n", "SIOCGIWAP", " ===> no ap_addr information" );
4596 + if ( info.has_bitrate )
4597 + printf ( "%s bitrate: %d value: %d fixed: %d disabled: %d flags: %d\n",
4598 + "SIOCGIWRATE", info.bitrate, info.bitrate.value, info.bitrate.fixed,
4599 + info.bitrate.disabled, info.bitrate.flags );
4601 + printf ( "%s %s\n", "SIOCGIWRATE", " ===> no info.bitrate support" );
4603 + if ( info.has_rts )
4604 + printf ( "%s rts: %d\n", "SIOCGIWRTS", info.rts );
4606 + printf ( "%s %s\n", "SIOCGIWRTS", " ===> no info.rts support" );
4608 + if ( info.has_frag )
4609 + printf ( "%s frag: %d\n", "SIOCGIWFRAG", info.frag );
4611 + printf ( "%s %s\n", "SIOCGIWFRAG", " ===> no info.frag support" );
4613 + if ( info.has_mode )
4614 + printf ( "%s mode: %d\n", "SIOCGIWMODE", info.mode );
4616 + printf ( "%s %s\n", "SIOCGIWMODE", " ===> no info.mode support" );
4618 + if ( info.has_power ) {
4619 + printf ( "%s power: %d\n", "SIOCGIWPOWER", info.power );
4620 + printf ( "%s disabled: %d MIN: %d MAX: %d TIMEOUT: %d RELATIVE: %d\n",
4622 + info.power.disabled ? 1:0,
4623 + info.power.flags & IW_POWER_MIN ? 1:0,
4624 + info.power.flags & IW_POWER_MAX ? 1:0,
4625 + info.power.flags & IW_POWER_TIMEOUT ? 1:0,
4626 + info.power.flags & IW_POWER_RELATIVE ? 1:0 );
4627 + printf ( "%s UNICAST: %d MULTICAST: %d ALL: %d FORCE: %d REPEATER: %d\n",
4629 + info.power.flags & IW_POWER_UNICAST_R ? 1:0,
4630 + info.power.flags & IW_POWER_MULTICAST_R ? 1:0,
4631 + info.power.flags & IW_POWER_ALL_R ? 1:0,
4632 + info.power.flags & IW_POWER_FORCE_S ? 1:0,
4633 + info.power.flags & IW_POWER_REPEATER ? 1:0 );
4636 + printf ( "%s %s\n", "SIOCGIWPOWER", " ===> no info.power support" );
4638 + if ( info.has_retry )
4639 + printf ( "%s retry: %d\n", "SIOCGIWRETRY", info.retry );
4641 + printf ( "%s %s\n", "SIOCGIWRETRY", " ===> no info.retry support" );
4643 + if ( info.has_stats ) {
4644 + printf ( "%s status: %d\n", "SIOCGIWSTATS", info.stats.status );
4645 + printf ( "%s qual.level: %d\n", "SIOCGIWSTATS", info.stats.qual.level );
4646 + printf ( "%s qual.noise: %d\n", "SIOCGIWSTATS", info.stats.qual.noise );
4647 + printf ( "%s qual.qual: %d\n", "SIOCGIWSTATS", info.stats.qual.qual );
4648 + printf ( "%s qual.updated: %d\n", "SIOCGIWSTATS", info.stats.qual.updated );
4649 + printf ( "%s discard.code: %d\n", "SIOCGIWSTATS", info.stats.discard.code );
4650 + printf ( "%s discard.fragment: %d\n", "SIOCGIWSTATS", info.stats.discard.fragment );
4651 + printf ( "%s discard.misc: %d\n", "SIOCGIWSTATS", info.stats.discard.misc );
4652 + printf ( "%s discard.nwid: %d\n", "SIOCGIWSTATS", info.stats.discard.nwid );
4653 + printf ( "%s discard.retries: %d\n", "SIOCGIWSTATS", info.stats.discard.retries );
4654 + printf ( "%s miss.beacon: %d\n", "SIOCGIWSTATS", info.stats.miss.beacon );
4657 + printf ( "%s %s\n", "SIOCGIWSTATS", " ===> no info.stats support" );
4659 + if ( info.txpower.flags & IW_TXPOW_MWATT )
4660 + printf ( "%s txpower1: %d dBm disabled: %d fixed: %d flags: %d\n", "SIOCGIWRANGE",
4661 + mWatt2dbm ( info.txpower.value ), info.txpower.disabled, info.txpower.fixed, info.txpower.flags);
4663 + 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 );
4665 + if ( info.has_range )
4666 + if ( info.sens.value < 0 )
4667 + printf ( "%s sens: %d dBm\n", "SIOCGIWRANGE", info.sens.value );
4669 + printf ( "%s sens: %d/%d\n", "SIOCGIWRANGE", info.sens.value, info.range.sensitivity );
4671 + if ( info.has_range && ( info.stats.qual.level != 0 ))
4672 + if ( info.stats.qual.level > info.range.max_qual.level )
4673 + /* Statistics are in dBm (absolute power measurement) */
4674 + printf ( "%s Quality: %d/%d Signal level: %d dBm Noise level: %d dBm\n",
4676 + info.stats.qual.qual, info.range.max_qual.qual,
4677 + info.stats.qual.level - 0x100,
4678 + info.stats.qual.noise - 0x100 );
4680 + printf ( "%s Quality: %d/%d Signal level: %d/%d Noise level: %d/%d",
4682 + info.stats.qual.qual, info.range.max_qual.qual,
4683 + info.stats.qual.level, info.range.max_qual.level,
4684 + info.stats.qual.noise, info.range.max_qual.noise );
4686 +#endif // #ifdef DISPLAYWIEXT
4689 +/****************************************************************************
4691 +* Linked List Functions *
4693 +****************************************************************************/
4694 +/****************************************************************************
4696 +* addList() - add an entry to a linked list *
4698 +****************************************************************************/
4700 +addList ( char *l, char *data, int len )
4703 + LIST_HEAD ( , avNode ) *list;
4705 + // NOTE: this assumes the UID is at the begining of the
4706 + // data structure and that UIDs are strings
4708 + list = ( LIST_HEAD ( , avNode ) * ) l; // NOTE: don't know how to get
4709 + strcpy ( uid, data ); // rid of compiler warning on
4710 + // LISTHEAD typecast
4711 + // create a new node and the data that goes in it
4712 + newNode = malloc ( sizeof ( struct avNode ));
4713 + newNode->data = malloc ( len );
4714 + memcpy ( newNode->data, data, len );
4716 + // this deals with an empty list
4717 + if ( LIST_EMPTY ( list )) {
4718 + LIST_INSERT_HEAD ( list, newNode, nodes );
4722 + // this deals with UIDs that match
4723 + for ( np = LIST_FIRST ( list ); np != NULL; np = LIST_NEXT ( np, nodes )) {
4724 + if ( strncmp ( uid, np->data, strlen ( uid )) == 0 ) { // found matching UID
4725 + LIST_INSERT_AFTER ( np, newNode, nodes );
4727 + free ( np->data );
4728 + LIST_REMOVE ( np, nodes );
4734 + // this deals with inserting a new UID in the list
4735 + for ( np = LIST_FIRST ( list ); np != NULL; np = LIST_NEXT ( np, nodes )) {
4737 + if ( strncmp ( np->data, uid, strlen ( uid )) > 0 ) { // old ID > new ID AND
4738 + LIST_INSERT_BEFORE ( np, newNode, nodes );
4743 + // this deals with a UID that needs to go on the end of the list
4744 + LIST_INSERT_AFTER ( lastNode, newNode, nodes );
4749 +/****************************************************************************
4751 +* initLists() - initialize all the linked lists *
4753 +****************************************************************************/
4754 +static void initLists()
4756 + LIST_INIT ( &scList ); LIST_INIT ( &aaList ); LIST_INIT ( &dfList );
4757 + LIST_INIT ( &kmList ); LIST_INIT ( &prList );
4758 + LIST_INIT ( &opList ); LIST_INIT ( &coList );
4759 + LIST_INIT ( &gaList ); LIST_INIT ( &riList ); LIST_INIT ( &poList );
4760 + LIST_INIT ( &paList ); LIST_INIT ( &ptList ); LIST_INIT ( &pfList );
4761 + LIST_INIT ( &pdList ); LIST_INIT ( &piList ); LIST_INIT ( &rdList );
4762 + LIST_INIT ( &alList ); LIST_INIT ( &rtList ); LIST_INIT ( &rrList );
4764 +/****************************************************************************
4766 +* flushLists() - flush all linked lists *
4768 +****************************************************************************/
4769 +static void flushLists()
4771 + flushList (( char * ) &scList ); flushList (( char * ) &aaList );
4772 + flushList (( char * ) &dfList ); flushList (( char * ) &kmList );
4773 + flushList (( char * ) &prList );
4774 + flushList (( char * ) &opList ); flushList (( char * ) &coList );
4775 + flushList (( char * ) &gaList ); flushList (( char * ) &riList );
4776 + flushList (( char * ) &poList ); flushList (( char * ) &paList );
4777 + flushList (( char * ) &ptList ); flushList (( char * ) &pfList );
4778 + flushList (( char * ) &pdList ); flushList (( char * ) &piList );
4779 + flushList (( char * ) &rdList ); flushList (( char * ) &alList );
4780 + flushList (( char * ) &rtList ); flushList (( char * ) &rrList );
4783 +/****************************************************************************
4785 +* flushList() - flush a linked list *
4787 +****************************************************************************/
4788 +static void flushList ( char *l )
4790 + LIST_HEAD ( , avNode ) *list;
4792 + list = ( LIST_HEAD ( , avNode ) * ) l; // NOTE: don't know how to get
4793 + while ( !LIST_EMPTY ( list )) { // rid of compiler warning on
4794 + np = LIST_FIRST ( list ); // LISTHEAD typecast
4796 + free ( np->data );
4797 + LIST_REMOVE ( np, nodes );
4802 +/****************************************************************************
4804 +* Utility Functions *
4806 +****************************************************************************/
4807 +/****************************************************************************
4809 +* The following two routines were taken directly from iwlib.c *
4811 +****************************************************************************/
4814 + * Depending on the protocol present, open the right socket. The socket
4815 + * will allow us to talk to the driver.
4817 +static int openSocket ( void )
4819 + static const int families[] = {
4820 + AF_INET, AF_IPX, AF_AX25, AF_APPLETALK
4826 + * Now pick any (exisiting) useful socket family for generic queries
4827 + * Note : don't open all the socket, only returns when one matches,
4828 + * all protocols might not be valid.
4829 + * Workaround by Jim Kaba <jkaba@sarnoff.com>
4830 + * Note : in 99% of the case, we will just open the inet_sock.
4831 + * The remaining 1% case are not fully correct...
4834 + /* Try all families we support */
4835 + for(i = 0; i < sizeof(families)/sizeof(int); ++i) {
4836 + /* Try to open the socket, if success returns it */
4837 + sock = socket(families[i], SOCK_DGRAM, 0);
4845 +/*------------------------------------------------------------------*/
4847 + * Convert a value in milliWatt to a value in dBm.
4849 +static int mWatt2dbm ( int in )
4852 + /* Version without libm : slower */
4853 + double fin = (double) in;
4856 + /* Split integral and floating part to avoid accumulating rounding errors */
4862 + while(fin > 1.000001) /* Eliminate rounding errors, take ceil */
4865 + fin /= LOG10_MAGIC;
4868 +#else /* WE_NOLIBM */
4869 + /* Version with libm : faster */
4870 + return((int) (ceil(10.0 * log10((double) in))));
4871 +#endif /* WE_NOLIBM */
4874 +/****************************************************************************
4876 +* htob - converts hex string to binary *
4878 +****************************************************************************/
4879 +static char *htob ( char *s )
4882 + static char bin[20];
4886 + while ((nibl = *s++) && nibl != ' ') { /* While not end of string. */
4887 + nibl -= ( nibl > '9') ? ('A' - 10): '0';
4888 + *byt = nibl << 4; /* place high nibble */
4889 + if((nibl = *s++) && nibl != ' ') {
4890 + nibl -= ( nibl > '9') ? ('A' - 10): '0';
4891 + *byt |= nibl; /* place low nibble */
4900 +/****************************************************************************
4902 +* hasChanged() - see if area has been changed from NULLs *
4904 +****************************************************************************/
4905 +static int hasChanged ( char *loc, int len )
4908 + int changed = TRUE;
4910 + wrk = malloc ( len );
4911 + memset ( wrk, 0, len );
4912 + if ( memcmp ( loc, wrk, len ) == 0 )
4916 + return ( changed );
4919 --- net-snmp-5.1.2-orig/agent/mibgroup/ieee802dot11.h 1970-01-01 01:00:00.000000000 +0100
4920 +++ net-snmp-5.1.2-5/agent/mibgroup/ieee802dot11.h 2005-03-13 16:17:21.000000000 +0100
4922 +/****************************************************************************
4924 +* File Name: ieee802dot11.h *
4927 +* Operating System: *
4932 +* Author: Larry Simmons *
4933 +* lsimmons@avantcom.com *
4934 +* www.avantcom.com *
4936 +* Creation Date: 09/02/03 *
4938 +* Ver Date Inits Modification *
4939 +* ----- -------- ----- ------------ *
4940 +* 0.0.1 09/02/03 LRS created *
4941 +* 0.0.2 09/24/03 LRS wouldn't build after fresh ./configure *
4942 +****************************************************************************/
4943 +/* This file was generated by mib2c and is intended for use as a mib module
4944 + for the ucd-snmp snmpd agent. */
4945 +#ifndef _MIBGROUP_IEEE802DOT11_H
4946 +#define _MIBGROUP_IEEE802DOT11_H
4947 +/* we may use header_generic and header_simple_table from the util_funcs module */
4949 +/****************************************************************************
4951 +****************************************************************************/
4952 +#include <sys/queue.h>
4954 +/****************************************************************************
4955 +* Linked List Defines *
4956 +****************************************************************************/
4957 +// here are some Linked List MACROS I wanted to use,
4958 +// but curiously were not in /usr/includes/sys/queue.h
4961 + #define LIST_EMPTY(head) ((head)->lh_first == NULL)
4965 + #define LIST_NEXT(elm, field) ((elm)->field.le_next)
4968 +#ifndef LIST_INSERT_BEFORE
4969 + #define LIST_INSERT_BEFORE(listelm, elm, field) do { \
4970 + (elm)->field.le_prev = (listelm)->field.le_prev; \
4971 + LIST_NEXT((elm), field) = (listelm); \
4972 + *(listelm)->field.le_prev = (elm); \
4973 + (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
4978 + #define LIST_FIRST(head) ((head)->lh_first)
4981 +/****************************************************************************
4982 +* 802.11 MIB Defines *
4983 +****************************************************************************/
4984 +#define SYS_STRING_LEN 256
4985 +#define MACADDR_LEN ( 6 * 2 ) + 5
4986 +#define OPER_RATE_SET_LEN 126
4987 +#define MAN_OUI_LEN ( 3 * 2 ) + 2
4988 +#define WEP_STR_LEN 64
4989 +#define SNMP_STR_LEN 128
4990 +#define TEXT_LEN 80
4991 +#define IFINDEX_LEN 4
4992 +#define IFNAME_LEN 16
4993 +#define MAX_WEP_KEYS 4
4995 +#define AUTHENICATION_ALGORITHMS_INDEX_LEN 4
4996 +#define WEP_DEFAULT_KEY_INDEX_LEN 4
4997 +#define WEP_KEY_MAPPING_INDEX_LEN 4
4998 +#define GROUP_ADDRESS_INDEX_LEN 4
4999 +#define REG_DOMAIN_SUPPORT_INDEX_LEN 4
5000 +#define ANTENNA_LIST_INDEX_LEN 4
5001 +#define SUPPORTED_DATA_RATES_TX_INDEX_LEN 4
5002 +#define SUPPORTED_DATA_RATES_RX_INDEX_LEN 4
5004 +#define SC_UID_LEN IFINDEX_LEN
5005 +#define AA_UID_LEN IFINDEX_LEN + AUTHENICATION_ALGORITHMS_INDEX_LEN
5006 +#define DF_UID_LEN IFINDEX_LEN + WEP_DEFAULT_KEY_INDEX_LEN
5007 +#define KM_UID_LEN IFINDEX_LEN + WEP_KEY_MAPPING_INDEX_LEN
5008 +#define PR_UID_LEN IFINDEX_LEN
5009 +#define OP_UID_LEN IFINDEX_LEN
5010 +#define CO_UID_LEN IFINDEX_LEN
5011 +#define GA_UID_LEN IFINDEX_LEN + GROUP_ADDRESS_INDEX_LEN
5012 +#define RI_UID_LEN IFINDEX_LEN
5013 +#define PO_UID_LEN IFINDEX_LEN
5014 +#define PA_UID_LEN IFINDEX_LEN
5015 +#define PT_UID_LEN IFINDEX_LEN
5016 +#define PF_UID_LEN IFINDEX_LEN
5017 +#define PD_UID_LEN IFINDEX_LEN
5018 +#define PI_UID_LEN IFINDEX_LEN
5019 +#define RD_UID_LEN IFINDEX_LEN + REG_DOMAIN_SUPPORT_INDEX_LEN
5020 +#define AL_UID_LEN IFINDEX_LEN + ANTENNA_LIST_INDEX_LEN
5021 +#define RT_UID_LEN IFINDEX_LEN + SUPPORTED_DATA_RATES_TX_INDEX_LEN
5022 +#define RR_UID_LEN IFINDEX_LEN + SUPPORTED_DATA_RATES_RX_INDEX_LEN
5024 +/****************************************************************************
5025 +* Linked List Structure *
5026 +****************************************************************************/
5027 +static struct avNode {
5028 + LIST_ENTRY ( avNode ) nodes;
5029 + char *data; // pointer to data
5032 +typedef LIST_HEAD ( , avNode ) avList_t;
5034 +/****************************************************************************
5035 +* 802.11 MIB structures *
5036 +****************************************************************************/
5037 +/****************************************************************************
5039 +****************************************************************************/
5040 +/****************************************************************************
5041 +* dot11StationConfigTable *
5042 +****************************************************************************/
5043 +static struct scTbl_data {
5045 + char UID [ SC_UID_LEN + 1 ]; // unique ID
5046 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5048 + long ifIndex; // ifindex of card
5050 + char stationID [ MACADDR_LEN + 1 ]; // Default actual MacAddr
5051 + long mediumOccupancyLimit;
5055 + long authenticationResponseTimeOut;
5056 + long privacyOptionImplemented;
5057 + long powerManagementMode;
5058 + char desiredSSID [ SNMP_STR_LEN + 1 ];
5059 + long desiredBSSType;
5060 + char operationalRateSet [ OPER_RATE_SET_LEN + 1];
5061 + long beaconPeriod;
5063 + long associationResponseTimeOut;
5064 + long disAssociationReason;
5065 + char disAssociationStation [ MACADDR_LEN + 1 ];
5066 + long deAuthenticationReason;
5067 + char deAuthenticationStation [ MACADDR_LEN + 1 ];
5068 + long authenticateFailStatus;
5069 + char authenticateFailStation [ MACADDR_LEN + 1 ];
5071 + long haveStationID;
5072 + long haveMediumOccupancyLimit;
5073 + long haveCFPPollable;
5074 + long haveCFPPeriod;
5075 + long haveMaxDuration;
5076 + long haveAuthenticationResponseTimeOut;
5077 + long havePrivacyOptionImplemented;
5078 + long havePowerManagementMode;
5079 + long haveDesiredSSID;
5080 + long haveDesiredBSSType;
5081 + long haveOperationalRateSet;
5082 + long haveBeaconPeriod;
5083 + long haveDTIMPeriod;
5084 + long haveAssociationResponseTimeOut;
5085 + long haveDisAssociationReason;
5086 + long haveDisAssociationStation;
5087 + long haveDeAuthenticationReason;
5088 + long haveDeAuthenticationStation;
5089 + long haveAuthenticateFailStatus;
5090 + long haveAuthenticateFailStation;
5094 +static avList_t scList;
5096 +/****************************************************************************
5097 +* dot11AuthenticationAlgorithmsTable *
5098 +****************************************************************************/
5099 +static struct aaTbl_data {
5101 + char UID [ AA_UID_LEN + 1 ];
5102 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5104 + long ifIndex; // ifindex of card
5105 + long authenticationAlgorithmsIndex;
5107 + long authenticationAlgorithm;
5108 + long authenticationAlgorithmsEnable;
5110 + long haveAuthenticationAlgorithm;
5111 + long haveAuthenticationAlgorithmsEnable;
5115 +static avList_t aaList;
5117 +/****************************************************************************
5118 +* dot11WEPDefaultKeysTable *
5119 +****************************************************************************/
5120 +static struct dfTbl_data {
5122 + char UID [ DF_UID_LEN + 1 ];
5123 + char ifName [ IFNAME_LEN + 1 ];
5125 + long ifIndex; // ifindex of card
5126 + long WEPDefaultKeyIndex;
5128 + char WEPDefaultKeyValue [ WEP_STR_LEN + 1 ];
5129 + long haveWEPDefaultKeyValue;
5133 +static avList_t dfList;
5135 +/****************************************************************************
5136 +* dot11WEPKeyMappingsTable *
5137 +****************************************************************************/
5138 +static struct kmTbl_data {
5140 + char UID [ KM_UID_LEN + 1 ];
5141 + char ifName [ IFNAME_LEN + 1 ];
5144 + long WEPKeyMappingIndex;
5146 + char WEPKeyMappingAddress [ MACADDR_LEN + 1 ];
5147 + long WEPKeyMappingWEPOn;
5148 + char WEPKeyMappingValue [ WEP_STR_LEN + 1 ];
5149 + long WEPKeyMappingStatus;
5151 + long haveWEPKeyMappingIndex;
5152 + long haveWEPKeyMappingAddress;
5153 + long haveWEPKeyMappingWEPOn;
5154 + long haveWEPKeyMappingValue;
5155 + long haveWEPKeyMappingStatus;
5159 +static avList_t kmList;
5161 +/****************************************************************************
5162 +* dot11PrivacyTable *
5163 +****************************************************************************/
5164 +static struct prTbl_data {
5166 + char UID [ PR_UID_LEN + 1 ];
5167 + char ifName [ IFNAME_LEN + 1 ];
5171 + long privacyInvoked;
5172 + long WEPDefaultKeyID;
5173 + long WEPKeyMappingLength;
5174 + long excludeUnencrypted;
5175 + unsigned long WEPICVErrorCount;
5176 + unsigned long WEPExcludedCount;
5178 + long havePrivacyInvoked;
5179 + long haveWEPDefaultKeyID;
5180 + long haveWEPKeyMappingLength;
5181 + long haveExcludeUnencrypted;
5182 + long haveWEPICVErrorCount;
5183 + long haveWEPExcludedCount;
5187 +static avList_t prList;
5189 +/****************************************************************************
5191 +****************************************************************************/
5192 +/****************************************************************************
5193 +* dot11OperationTable *
5194 +****************************************************************************/
5195 +static struct opTbl_data {
5197 + char UID [ OP_UID_LEN + 1 ]; // unique ID
5198 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5200 + long ifIndex; // ifindex of card
5202 + char MACAddress [ MACADDR_LEN + 1 ];
5203 + long RTSThreshold;
5204 + long shortRetryLimit;
5205 + long longRetryLimit;
5206 + long fragmentationThreshold;
5207 + long maxTransmitMSDULifetime;
5208 + long maxReceiveLifetime;
5209 + char manufacturerID [ SNMP_STR_LEN + 1 ];
5210 + char productID [ SNMP_STR_LEN + 1 ];
5212 + long haveMACAddress;
5213 + long haveRTSThreshold;
5214 + long haveShortRetryLimit;
5215 + long haveLongRetryLimit;
5216 + long haveFragmentationThreshold;
5217 + long haveMaxTransmitMSDULifetime;
5218 + long haveMaxReceiveLifetime;
5219 + long haveManufacturerID;
5220 + long haveProductID;
5224 +static avList_t opList;
5226 +/****************************************************************************
5227 +* dot11CountersTable *
5228 +****************************************************************************/
5229 +static struct coTbl_data {
5231 + char UID [ CO_UID_LEN + 1 ]; // unique ID
5232 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5234 + long ifIndex; // ifindex of card
5236 + unsigned long transmittedFragmentCount;
5237 + unsigned long multicastTransmittedFrameCount;
5238 + unsigned long failedCount;
5239 + unsigned long retryCount;
5240 + unsigned long multipleRetryCount;
5241 + unsigned long frameDuplicateCount;
5242 + unsigned long RTSSuccessCount;
5243 + unsigned long RTSFailureCount;
5244 + unsigned long ACKFailureCount;
5245 + unsigned long receivedFragmentCount;
5246 + unsigned long multicastReceivedFrameCount;
5247 + unsigned long FCSErrorCount;
5248 + unsigned long transmittedFrameCount;
5249 + unsigned long WEPUndecryptableCount;
5251 + long haveTransmittedFragmentCount;
5252 + long haveMulticastTransmittedFrameCount;
5253 + long haveFailedCount;
5254 + long haveRetryCount;
5255 + long haveMultipleRetryCount;
5256 + long haveFrameDuplicateCount;
5257 + long haveRTSSuccessCount;
5258 + long haveRTSFailureCount;
5259 + long haveACKFailureCount;
5260 + long haveReceivedFragmentCount;
5261 + long haveMulticastReceivedFrameCount;
5262 + long haveFCSErrorCount;
5263 + long haveTransmittedFrameCount;
5264 + long haveWEPUndecryptableCount;
5268 +static avList_t coList;
5270 +/****************************************************************************
5271 +* dot11GroupAddressesTable *
5272 +****************************************************************************/
5273 +static struct gaTbl_data {
5275 + char UID [ GA_UID_LEN + 1 ];
5276 + char ifName [ IFNAME_LEN + 1 ];
5278 + long ifIndex; // ifindex of card
5279 + long groupAddressesIndex;
5281 + char address [ MACADDR_LEN + 1 ];
5282 + long groupAddressesStatus;
5285 + long haveGroupAddressesStatus;
5289 +static avList_t gaList;
5291 +/****************************************************************************
5293 +****************************************************************************/
5294 +static char resourceTypeIDName[] = "RTID";
5295 +static long haveResourceTypeIDName = 1;
5297 +/****************************************************************************
5298 +* dot11ResourceInfoTable *
5299 +****************************************************************************/
5300 +static struct riTbl_data {
5302 + char UID [ RI_UID_LEN + 1 ]; // unique ID
5303 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5305 + long ifIndex; // ifindex of card
5307 + char manufacturerOUI [ MAN_OUI_LEN + 1 ];
5308 + char manufacturerName [ SYS_STRING_LEN + 1 ];
5309 + char manufacturerProductName [ SYS_STRING_LEN + 1 ];
5310 + char manufacturerProductVersion [ SYS_STRING_LEN + 1 ];
5312 + char haveManufacturerOUI;
5313 + char haveManufacturerName;
5314 + char haveManufacturerProductName;
5315 + char haveManufacturerProductVersion;
5319 +static avList_t riList;
5321 +/****************************************************************************
5323 +****************************************************************************/
5324 +/****************************************************************************
5325 +* dot11PhyOperationTable *
5326 +****************************************************************************/
5327 +static struct poTbl_data {
5329 + char UID [ PO_UID_LEN + 1 ]; // unique ID
5330 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5332 + long ifIndex; // ifindex of card
5335 + long currentRegDomain;
5339 + long haveCurrentRegDomain;
5340 + long haveTempType;
5344 +static avList_t poList;
5346 +/****************************************************************************
5347 +* dot11PhyAntennaEntry *
5348 +****************************************************************************/
5349 +static struct paTbl_data {
5351 + char UID [ PA_UID_LEN + 1 ]; // unique ID
5352 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5354 + long ifIndex; // ifindex of card
5356 + long currentTxAntenna;
5357 + long diversitySupport;
5358 + long currentRxAntenna;
5360 + long haveCurrentTxAntenna;
5361 + long haveDiversitySupport;
5362 + long haveCurrentRxAntenna;
5366 +static avList_t paList;
5368 +/****************************************************************************
5369 +* dot11PhyTxPowerTable *
5370 +****************************************************************************/
5371 +static struct ptTbl_data {
5373 + char UID [ PT_UID_LEN + 1 ]; // unique ID
5374 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5376 + long ifIndex; // ifindex of card
5378 + long numberSupportedPowerLevels;
5379 + long TxPowerLevel1;
5380 + long TxPowerLevel2;
5381 + long TxPowerLevel3;
5382 + long TxPowerLevel4;
5383 + long TxPowerLevel5;
5384 + long TxPowerLevel6;
5385 + long TxPowerLevel7;
5386 + long TxPowerLevel8;
5387 + long currentTxPowerLevel;
5389 + long haveNumberSupportedPowerLevels;
5390 + long haveTxPowerLevel1;
5391 + long haveTxPowerLevel2;
5392 + long haveTxPowerLevel3;
5393 + long haveTxPowerLevel4;
5394 + long haveTxPowerLevel5;
5395 + long haveTxPowerLevel6;
5396 + long haveTxPowerLevel7;
5397 + long haveTxPowerLevel8;
5398 + long haveCurrentTxPowerLevel ;
5402 +static avList_t ptList;
5404 +/****************************************************************************
5405 +* dot11PhyFHSSTable *
5406 +****************************************************************************/
5407 +static struct pfTbl_data {
5409 + char UID [ PF_UID_LEN + 1 ]; // unique ID
5410 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5412 + long ifIndex; // ifindex of card
5415 + long currentChannelNumber;
5416 + long maxDwellTime;
5417 + long currentDwellTime;
5419 + long currentPattern;
5420 + long currentIndex;
5423 + long haveCurrentChannelNumber;
5424 + long haveMaxDwellTime;
5425 + long haveCurrentDwellTime;
5426 + long haveCurrentSet;
5427 + long haveCurrentPattern;
5428 + long haveCurrentIndex;
5432 +static avList_t pfList;
5434 +/****************************************************************************
5435 +* dot11PhyDSSSTable *
5436 +****************************************************************************/
5437 +static struct pdTbl_data {
5439 + char UID [ PD_UID_LEN + 1 ]; // unique ID
5440 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5442 + long ifIndex; // ifindex of card
5444 + long currentChannel;
5445 + long CCAModeSupported;
5446 + long currentCCAMode;
5449 + long haveCurrentChannel;
5450 + long haveCCAModeSupported ;
5451 + long haveCurrentCCAMode;
5452 + long haveEDThreshold;
5456 +static avList_t pdList;
5458 +/****************************************************************************
5459 +* dot11PhyIRTable *
5460 +****************************************************************************/
5461 +static struct piTbl_data {
5463 + char UID [ PI_UID_LEN + 1 ]; // unique ID
5464 + char ifName [ IFNAME_LEN + 1 ]; // ifName of card
5466 + long ifIndex; // ifindex of card
5468 + long CCAWatchdogTimerMax;
5469 + long CCAWatchdogCountMax;
5470 + long CCAWatchdogTimerMin;
5471 + long CCAWatchdogCountMin;
5473 + long haveCCAWatchdogTimerMax;
5474 + long haveCCAWatchdogCountMax;
5475 + long haveCCAWatchdogTimerMin;
5476 + long haveCCAWatchdogCountMin;
5480 +static avList_t piList;
5482 +/****************************************************************************
5483 +* dot11RegDomainsSupportedTable *
5484 +****************************************************************************/
5485 +static struct rdTbl_data {
5487 + char UID [ RD_UID_LEN + 1 ];
5488 + char ifName [ IFNAME_LEN + 1 ];
5490 + long ifIndex; // ifindex of card
5491 + long regDomainsSupportIndex;
5493 + long regDomainsSupportValue;
5494 + long haveRegDomainsSupportValue;
5498 +static avList_t rdList;
5500 +/****************************************************************************
5501 +* dot11AntennasListTable *
5502 +****************************************************************************/
5503 +static struct alTbl_data {
5505 + char UID [ AL_UID_LEN + 1 ];
5506 + char ifName [ IFNAME_LEN + 1 ];
5508 + long ifIndex; // ifindex of card
5509 + long antennaListIndex;
5511 + long supportedTxAntenna;
5512 + long supportedRxAntenna;
5513 + long diversitySelectionRx ;
5515 + long haveSupportedTxAntenna;
5516 + long haveSupportedRxAntenna;
5517 + long haveDiversitySelectionRx ;
5521 +static avList_t alList;
5523 +/****************************************************************************
5524 +* dot11SupportedDataRatesTxTable *
5525 +****************************************************************************/
5526 +static struct rtTbl_data {
5528 + char UID [ RT_UID_LEN + 1 ];
5529 + char ifName [ IFNAME_LEN + 1 ];
5531 + long ifIndex; // ifindex of card
5532 + long supportedDataRatesTxIndex;
5534 + long supportedDataRatesTxValue;
5535 + long haveSupportedDataRatesTxValue;
5539 +static avList_t rtList;
5541 +/****************************************************************************
5542 +* dot11SupportedDataRatesRxTable *
5543 +****************************************************************************/
5544 +static struct rrTbl_data {
5546 + char UID [ RR_UID_LEN + 1 ];
5547 + char ifName [ IFNAME_LEN + 1 ];
5549 + long ifIndex; // ifindex of card
5550 + long supportedDataRatesRxIndex;
5552 + long supportedDataRatesRxValue;
5553 + long haveSupportedDataRatesRxValue;
5557 +static avList_t rrList;
5559 +/****************************************************************************
5560 +* Wireless Extensions Structures *
5561 +****************************************************************************/
5562 +static long wepCurrentKey;
5563 +static long haveWepCurrentKey;
5564 +static struct wepTbl_data {
5567 + char key [ WEP_STR_LEN + 1 ];
5572 +/****************************************************************************
5574 +****************************************************************************/
5575 +config_require(util_funcs)
5577 +/* function prototypes */
5579 +void init_ieee802dot11 ( void );
5580 +FindVarMethod var_ieee802dot11;
5581 +FindVarMethod var_dot11StationConfigTable;
5582 +FindVarMethod var_dot11AuthenticationAlgorithmsTable;
5583 +FindVarMethod var_dot11WEPDefaultKeysTable;
5584 +FindVarMethod var_dot11WEPKeyMappingsTable;
5585 +FindVarMethod var_dot11PrivacyTable;
5586 +FindVarMethod var_dot11OperationTable;
5587 +FindVarMethod var_dot11CountersTable;
5588 +FindVarMethod var_dot11GroupAddressesTable;
5589 +FindVarMethod var_dot11ResourceInfoTable;
5590 +FindVarMethod var_dot11PhyOperationTable;
5591 +FindVarMethod var_dot11PhyAntennaTable;
5592 +FindVarMethod var_dot11PhyTxPowerTable;
5593 +FindVarMethod var_dot11PhyFHSSTable;
5594 +FindVarMethod var_dot11PhyDSSSTable;
5595 +FindVarMethod var_dot11PhyIRTable;
5596 +FindVarMethod var_dot11RegDomainsSupportedTable;
5597 +FindVarMethod var_dot11AntennasListTable;
5598 +FindVarMethod var_dot11SupportedDataRatesTxTable;
5599 +FindVarMethod var_dot11SupportedDataRatesRxTable;
5601 +WriteMethod write_dot11StationID;
5602 +WriteMethod write_dot11MediumOccupancyLimit;
5603 +WriteMethod write_dot11CFPPeriod;
5604 +WriteMethod write_dot11CFPMaxDuration;
5605 +WriteMethod write_dot11AuthenticationResponseTimeOut;
5606 +WriteMethod write_dot11PowerManagementMode;
5607 +WriteMethod write_dot11DesiredSSID;
5608 +WriteMethod write_dot11DesiredBSSType;
5609 +WriteMethod write_dot11OperationalRateSet;
5610 +WriteMethod write_dot11BeaconPeriod;
5611 +WriteMethod write_dot11DTIMPeriod;
5612 +WriteMethod write_dot11AssociationResponseTimeOut;
5613 +WriteMethod write_dot11AuthenticationAlgorithmsEnable;
5614 +WriteMethod write_dot11WEPDefaultKeyValue;
5615 +WriteMethod write_dot11WEPKeyMappingAddress;
5616 +WriteMethod write_dot11WEPKeyMappingWEPOn;
5617 +WriteMethod write_dot11WEPKeyMappingValue;
5618 +WriteMethod write_dot11WEPKeyMappingStatus;
5619 +WriteMethod write_dot11PrivacyInvoked;
5620 +WriteMethod write_dot11WEPDefaultKeyID;
5621 +WriteMethod write_dot11WEPKeyMappingLength;
5622 +WriteMethod write_dot11ExcludeUnencrypted;
5623 +WriteMethod write_dot11RTSThreshold;
5624 +WriteMethod write_dot11ShortRetryLimit;
5625 +WriteMethod write_dot11LongRetryLimit;
5626 +WriteMethod write_dot11FragmentationThreshold;
5627 +WriteMethod write_dot11MaxTransmitMSDULifetime;
5628 +WriteMethod write_dot11MaxReceiveLifetime;
5629 +WriteMethod write_dot11Address;
5630 +WriteMethod write_dot11GroupAddressesStatus;
5631 +WriteMethod write_dot11CurrentRegDomain;
5632 +WriteMethod write_dot11CurrentTxAntenna;
5633 +WriteMethod write_dot11CurrentRxAntenna;
5634 +WriteMethod write_dot11CurrentTxPowerLevel;
5635 +WriteMethod write_dot11CurrentChannelNumber;
5636 +WriteMethod write_dot11CurrentDwellTime;
5637 +WriteMethod write_dot11CurrentSet;
5638 +WriteMethod write_dot11CurrentPattern;
5639 +WriteMethod write_dot11CurrentIndex;
5640 +WriteMethod write_dot11CurrentChannel;
5641 +WriteMethod write_dot11CurrentCCAMode;
5642 +WriteMethod write_dot11EDThreshold;
5643 +WriteMethod write_dot11CCAWatchdogTimerMax;
5644 +WriteMethod write_dot11CCAWatchdogCountMax;
5645 +WriteMethod write_dot11CCAWatchdogTimerMin;
5646 +WriteMethod write_dot11CCAWatchdogCountMin;
5647 +WriteMethod write_dot11SupportedTxAntenna;
5648 +WriteMethod write_dot11SupportedRxAntenna;
5649 +WriteMethod write_dot11DiversitySelectionRx;
5651 +#endif /* _MIBGROUP_IEEE802DOT11_H */
5652 --- net-snmp-5.1.2-orig/agent/mibgroup/iwlib.h 1970-01-01 01:00:00.000000000 +0100
5653 +++ net-snmp-5.1.2-5/agent/mibgroup/iwlib.h 2005-03-13 16:17:21.000000000 +0100
5658 + * Jean II - HPLB 97->99 - HPL 99->02
5660 + * Common header for the Wireless Extension library...
5662 + * This file is released under the GPL license.
5663 + * Copyright (c) 1997-2002 Jean Tourrilhes <jt@hpl.hp.com>
5669 +/*#include "CHANGELOG.h"*/
5671 +/***************************** INCLUDES *****************************/
5673 +/* Standard headers */
5674 +#include <sys/types.h>
5675 +#include <sys/ioctl.h>
5681 +#include <stdlib.h>
5682 +#include <string.h>
5683 +#include <unistd.h>
5684 +#include <netdb.h> /* gethostbyname, getnetbyname */
5685 +#include <net/ethernet.h> /* struct ether_addr */
5686 +#include <sys/time.h> /* struct timeval */
5687 +#include <unistd.h>
5689 +/* This is our header selection. Try to hide the mess and the misery :-(
5690 + * Don't look, you would go blind ;-) */
5692 +#ifndef LINUX_VERSION_CODE
5693 +#include <linux/version.h>
5696 +/* Kernel headers 2.4.X + Glibc 2.2 - Mandrake 8.0, Debian 2.3, RH 7.1
5697 + * Kernel headers 2.2.X + Glibc 2.2 - Slackware 8.0 */
5698 +#if defined(__GLIBC__) \
5699 + && __GLIBC__ == 2 \
5700 + && __GLIBC_MINOR__ >= 2 \
5701 + && LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
5702 +//#define GLIBC22_HEADERS
5703 +#define GENERIC_HEADERS
5705 +/* Kernel headers 2.4.X + Glibc 2.1 - Debian 2.2 upgraded, RH 7.0
5706 + * Kernel headers 2.2.X + Glibc 2.1 - Debian 2.2, RH 6.1 */
5707 +#elif defined(__GLIBC__) \
5708 + && __GLIBC__ == 2 \
5709 + && __GLIBC_MINOR__ == 1 \
5710 + && LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
5711 +//#define GLIBC_HEADERS
5712 +#define GENERIC_HEADERS
5714 +/* Kernel headers 2.2.X + Glibc 2.0 - Debian 2.1 */
5715 +#elif defined(__GLIBC__) \
5716 + && __GLIBC__ == 2 \
5717 + && __GLIBC_MINOR__ == 0 \
5718 + && LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0) \
5719 + && LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
5720 +#define GLIBC_HEADERS
5721 +#define KLUDGE_HEADERS
5723 +/* Note : is it really worth supporting kernel 2.0.X, knowing that
5724 + * we require WE v9, which is only available in 2.2.X and higher ?
5725 + * I guess one could use 2.0.x with an upgraded wireless.h... */
5727 +/* Kernel headers 2.0.X + Glibc 2.0 - Debian 2.0, RH 5 */
5728 +#elif defined(__GLIBC__) \
5729 + && __GLIBC__ == 2 \
5730 + && __GLIBC_MINOR__ == 0 \
5731 + && LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) \
5732 + && LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)
5733 +#define GLIBC_HEADERS
5735 +/* Kernel headers 2.0.X + libc5 - old systems */
5736 +#elif defined(_LINUX_C_LIB_VERSION_MAJOR) \
5737 + && _LINUX_C_LIB_VERSION_MAJOR == 5 \
5738 + && LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0) \
5739 + && LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
5740 +#define LIBC5_HEADERS
5742 +/* Unsupported combination */
5744 +#error "Your kernel/libc combination is not supported"
5747 +#ifdef GENERIC_HEADERS
5748 +/* Proposed by Dr. Michael Rietz <rietz@mail.amps.de>, 27.3.2 */
5749 +/* If this works for all, it might be more stable on the long term - Jean II */
5750 +#include <net/if_arp.h> /* For ARPHRD_ETHER */
5751 +#include <sys/socket.h> /* For AF_INET & struct sockaddr */
5752 +#include <netinet/in.h> /* For struct sockaddr_in */
5753 +#include <netinet/if_ether.h>
5754 +#endif /* GENERIC_HEADERS */
5756 +#ifdef GLIBC22_HEADERS
5757 +/* Added by Ross G. Miller <Ross_Miller@baylor.edu>, 3/28/01 */
5758 +#include <linux/if_arp.h> /* For ARPHRD_ETHER */
5759 +#include <linux/socket.h> /* For AF_INET & struct sockaddr */
5760 +#include <sys/socket.h>
5761 +#endif /* GLIBC22_HEADERS */
5763 +#ifdef KLUDGE_HEADERS
5764 +#include <socketbits.h>
5765 +#endif /* KLUDGE_HEADERS */
5767 +#ifdef GLIBC_HEADERS
5768 +#include <linux/if_arp.h> /* For ARPHRD_ETHER */
5769 +#include <linux/socket.h> /* For AF_INET & struct sockaddr */
5770 +#include <linux/in.h> /* For struct sockaddr_in */
5771 +#endif /* KLUDGE_HEADERS || GLIBC_HEADERS */
5773 +#ifdef LIBC5_HEADERS
5774 +#include <sys/socket.h> /* For AF_INET & struct sockaddr & socket() */
5775 +#include <linux/if_arp.h> /* For ARPHRD_ETHER */
5776 +#include <linux/in.h> /* For struct sockaddr_in */
5777 +#endif /* LIBC5_HEADERS */
5779 +/* Those 3 headers were previously included in wireless.h */
5780 +#include <linux/types.h> /* for "caddr_t" et al */
5781 +#include <linux/socket.h> /* for "struct sockaddr" et al */
5782 +#include <linux/if.h> /* for IFNAMSIZ and co... */
5785 +/* Private copy of Wireless extensions */
5786 +#include WEXT_HEADER
5787 +#else /* !WEXT_HEADER */
5788 +/* System wide Wireless extensions */
5789 +#include <linux/wireless.h>
5790 +#endif /* !WEXT_HEADER */
5796 +/****************************** DEBUG ******************************/
5799 +/************************ CONSTANTS & MACROS ************************/
5802 +#define PROC_NET_WIRELESS "/proc/net/wireless"
5803 +#define PROC_NET_DEV "/proc/net/dev"
5805 +/* Some usefull constants */
5809 +/* For doing log10/exp10 without libm */
5810 +#define LOG10_MAGIC 1.25892541179
5812 +/* Backward compatibility for Wireless Extension 9 */
5813 +#ifndef IW_POWER_MODIFIER
5814 +#define IW_POWER_MODIFIER 0x000F /* Modify a parameter */
5815 +#define IW_POWER_MIN 0x0001 /* Value is a minimum */
5816 +#define IW_POWER_MAX 0x0002 /* Value is a maximum */
5817 +#define IW_POWER_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
5818 +#endif /* IW_POWER_MODIFIER */
5820 +#ifndef IW_ENCODE_NOKEY
5821 +#define IW_ENCODE_NOKEY 0x0800 /* Key is write only, so not here */
5822 +#define IW_ENCODE_MODE 0xF000 /* Modes defined below */
5823 +#endif /* IW_ENCODE_NOKEY */
5824 +#ifndef IW_ENCODE_TEMP
5825 +#define IW_ENCODE_TEMP 0x0400 /* Temporary key */
5826 +#endif /* IW_ENCODE_TEMP */
5828 +/* More backward compatibility */
5829 +#ifndef SIOCSIWCOMMIT
5830 +#define SIOCSIWCOMMIT SIOCSIWNAME
5831 +#endif /* SIOCSIWCOMMIT */
5833 +/****************************** TYPES ******************************/
5836 +typedef struct iw_statistics iwstats;
5837 +typedef struct iw_range iwrange;
5838 +typedef struct iw_param iwparam;
5839 +typedef struct iw_freq iwfreq;
5840 +typedef struct iw_quality iwqual;
5841 +typedef struct iw_priv_args iwprivargs;
5842 +typedef struct sockaddr sockaddr;
5844 +/* Structure for storing all wireless information for each device
5845 + * This is pretty exhaustive... */
5846 +typedef struct wireless_info
5848 + char name[IFNAMSIZ + 1]; /* Wireless/protocol name */
5850 + iwparam nwid; /* Network ID */
5852 + double freq; /* Frequency/channel */
5854 + iwparam sens; /* sensitivity */
5856 + unsigned char key[IW_ENCODING_TOKEN_MAX]; /* Encoding key used */
5857 + int key_size; /* Number of bytes */
5858 + int key_flags; /* Various flags */
5861 + char essid[IW_ESSID_MAX_SIZE + 1]; /* ESSID (extended network) */
5863 + char nickname[IW_ESSID_MAX_SIZE + 1]; /* NickName */
5865 + sockaddr ap_addr; /* Access point address */
5867 + iwparam bitrate; /* Bit rate in bps */
5869 + iwparam rts; /* RTS threshold in bytes */
5871 + iwparam frag; /* Fragmentation threshold in bytes */
5873 + int mode; /* Operation mode */
5875 + iwparam power; /* Power management parameters */
5877 + iwparam txpower; /* Transmit Power in dBm */
5879 + iwparam retry; /* Retry limit or lifetime */
5888 +/* Structure for storing all wireless information for each device
5889 + * This is a cut down version of the one above, containing only
5890 + * the things *truly* needed to configure a card.
5891 + * Don't add other junk, I'll remove it... */
5892 +typedef struct wireless_config
5894 + char name[IFNAMSIZ + 1]; /* Wireless/protocol name */
5896 + iwparam nwid; /* Network ID */
5898 + double freq; /* Frequency/channel */
5900 + unsigned char key[IW_ENCODING_TOKEN_MAX]; /* Encoding key used */
5901 + int key_size; /* Number of bytes */
5902 + int key_flags; /* Various flags */
5905 + char essid[IW_ESSID_MAX_SIZE + 1]; /* ESSID (extended network) */
5907 + int mode; /* Operation mode */
5910 +typedef struct stream_descr
5912 + char * end; /* End of the stream */
5913 + char * current; /* Current event in stream of events */
5914 + char * value; /* Current value in event */
5917 +/* Prototype for handling display of each single interface on the
5918 + * system - see iw_enum_devices() */
5919 +typedef int (*iw_enum_handler)(int skfd,
5924 +/**************************** PROTOTYPES ****************************/
5926 + * All the functions in iwcommon.c
5929 +/* ---------------------- SOCKET SUBROUTINES -----------------------*/
5931 + iw_sockets_open(void);
5933 + iw_enum_devices(int skfd,
5934 + iw_enum_handler fn,
5937 +/* --------------------- WIRELESS SUBROUTINES ----------------------*/
5939 + iw_get_range_info(int skfd,
5943 + iw_print_version_info(char * toolname);
5945 + iw_get_priv_info(int skfd,
5947 + iwprivargs * priv,
5950 + iw_get_basic_config(int skfd,
5952 + wireless_config * info);
5954 + iw_set_basic_config(int skfd,
5956 + wireless_config * info);
5957 +/* --------------------- PROTOCOL SUBROUTINES --------------------- */
5959 + iw_protocol_compare(char * protocol1,
5960 + char * protocol2);
5961 +/* -------------------- FREQUENCY SUBROUTINES --------------------- */
5963 + iw_float2freq(double in,
5966 + iw_freq2float(iwfreq * in);
5968 + iw_print_freq(char * buffer,
5971 + iw_freq_to_channel(double freq,
5972 + struct iw_range * range);
5974 + iw_print_bitrate(char * buffer,
5976 +/* ---------------------- POWER SUBROUTINES ----------------------- */
5978 + iw_dbm2mwatt(int in);
5980 + iw_mwatt2dbm(int in);
5981 +/* -------------------- STATISTICS SUBROUTINES -------------------- */
5983 + iw_get_stats(int skfd,
5987 + iw_print_stats(char * buffer,
5991 +/* --------------------- ENCODING SUBROUTINES --------------------- */
5993 + iw_print_key(char * buffer,
5994 + unsigned char * key,
5998 + iw_in_key(char * input,
5999 + unsigned char * key);
6001 + iw_in_key_full(int skfd,
6004 + unsigned char * key,
6006 +/* ----------------- POWER MANAGEMENT SUBROUTINES ----------------- */
6008 + iw_print_pm_value(char * buffer,
6012 + iw_print_pm_mode(char * buffer,
6014 +/* --------------- RETRY LIMIT/LIFETIME SUBROUTINES --------------- */
6015 +#if WIRELESS_EXT > 10
6017 + iw_print_retry_value(char * buffer,
6021 +/* ----------------------- TIME SUBROUTINES ----------------------- */
6023 + iw_print_timeval(char * buffer,
6024 + const struct timeval * time);
6025 +/* --------------------- ADDRESS SUBROUTINES ---------------------- */
6027 + iw_check_mac_addr_type(int skfd,
6030 + iw_check_if_addr_type(int skfd,
6034 + iw_check_addr_type(int skfd,
6038 + iw_ether_ntop(const struct ether_addr* eth, char* buf);
6040 + iw_ether_ntoa(const struct ether_addr* eth);
6042 + iw_ether_aton(const char* bufp, struct ether_addr* eth);
6044 + iw_in_inet(char *bufp, struct sockaddr *sap);
6046 + iw_in_addr(int skfd,
6049 + struct sockaddr * sap);
6050 +/* ----------------------- MISC SUBROUTINES ------------------------ */
6052 + iw_get_priv_size(int args);
6054 +#if WIRELESS_EXT > 13
6055 +/* ---------------------- EVENT SUBROUTINES ---------------------- */
6057 + iw_init_event_stream(struct stream_descr * stream,
6061 + iw_extract_event_stream(struct stream_descr * stream,
6062 + struct iw_event * iwe);
6063 +#endif /* WIRELESS_EXT > 13 */
6065 +/**************************** VARIABLES ****************************/
6067 +extern const char * const iw_operation_mode[];
6068 +#define IW_NUM_OPER_MODE 7
6070 +/************************* INLINE FUNTIONS *************************/
6072 + * Functions that are so simple that it's more efficient inlining them
6076 + * Note : I've defined wrapper for the ioctl request so that
6077 + * it will be easier to migrate to other kernel API if needed
6080 +/*------------------------------------------------------------------*/
6082 + * Wrapper to push some Wireless Parameter in the driver
6085 +iw_set_ext(int skfd, /* Socket to the kernel */
6086 + char * ifname, /* Device name */
6087 + int request, /* WE ID */
6088 + struct iwreq * pwrq) /* Fixed part of the request */
6090 + /* Set device name */
6091 + strncpy(pwrq->ifr_name, ifname, IFNAMSIZ);
6092 + /* Do the request */
6093 + return(ioctl(skfd, request, pwrq));
6096 +/*------------------------------------------------------------------*/
6098 + * Wrapper to extract some Wireless Parameter out of the driver
6101 +iw_get_ext(int skfd, /* Socket to the kernel */
6102 + char * ifname, /* Device name */
6103 + int request, /* WE ID */
6104 + struct iwreq * pwrq) /* Fixed part of the request */
6106 + /* Set device name */
6107 + strncpy(pwrq->ifr_name, ifname, IFNAMSIZ);
6108 + /* Do the request */
6109 + return(ioctl(skfd, request, pwrq));
6112 +/*------------------------------------------------------------------*/
6113 +/* Backwards compatability
6114 + * Actually, those form are much easier to use when dealing with
6115 + * struct sockaddr... */
6116 +static inline char*
6117 +iw_pr_ether(char* bufp, const unsigned char* addr)
6119 + iw_ether_ntop((const struct ether_addr *) addr, bufp);
6122 +/* Backwards compatability */
6124 +iw_in_ether(const char *bufp, struct sockaddr *sap)
6126 + sap->sa_family = ARPHRD_ETHER;
6127 + return iw_ether_aton(bufp, (struct ether_addr *) sap->sa_data) ? 0 : -1;
6130 +/*------------------------------------------------------------------*/
6132 + * Create an Ethernet broadcast address
6135 +iw_broad_ether(struct sockaddr *sap)
6137 + sap->sa_family = ARPHRD_ETHER;
6138 + memset((char *) sap->sa_data, 0xFF, ETH_ALEN);
6141 +/*------------------------------------------------------------------*/
6143 + * Create an Ethernet NULL address
6146 +iw_null_ether(struct sockaddr *sap)
6148 + sap->sa_family = ARPHRD_ETHER;
6149 + memset((char *) sap->sa_data, 0x00, ETH_ALEN);
6156 +#endif /* IWLIB_H */