Staging: add wlan-ng prism2 usb driver
[deliverable/linux.git] / drivers / staging / wlan-ng / p80211types.h
1 /* p80211types.h
2 *
3 * Macros, constants, types, and funcs for p80211 data types
4 *
5 * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
6 * --------------------------------------------------------------------
7 *
8 * linux-wlan
9 *
10 * The contents of this file are subject to the Mozilla Public
11 * License Version 1.1 (the "License"); you may not use this file
12 * except in compliance with the License. You may obtain a copy of
13 * the License at http://www.mozilla.org/MPL/
14 *
15 * Software distributed under the License is distributed on an "AS
16 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17 * implied. See the License for the specific language governing
18 * rights and limitations under the License.
19 *
20 * Alternatively, the contents of this file may be used under the
21 * terms of the GNU Public License version 2 (the "GPL"), in which
22 * case the provisions of the GPL are applicable instead of the
23 * above. If you wish to allow the use of your version of this file
24 * only under the terms of the GPL and not to allow others to use
25 * your version of this file under the MPL, indicate your decision
26 * by deleting the provisions above and replace them with the notice
27 * and other provisions required by the GPL. If you do not delete
28 * the provisions above, a recipient may use your version of this
29 * file under either the MPL or the GPL.
30 *
31 * --------------------------------------------------------------------
32 *
33 * Inquiries regarding the linux-wlan Open Source project can be
34 * made directly to:
35 *
36 * AbsoluteValue Systems Inc.
37 * info@linux-wlan.com
38 * http://www.linux-wlan.com
39 *
40 * --------------------------------------------------------------------
41 *
42 * Portions of the development of this software were funded by
43 * Intersil Corporation as part of PRISM(R) chipset product development.
44 *
45 * --------------------------------------------------------------------
46 *
47 * This file declares some of the constants and types used in various
48 * parts of the linux-wlan system.
49 *
50 * Notes:
51 * - Constant values are always in HOST byte order.
52 *
53 * All functions and statics declared here are implemented in p80211types.c
54 * --------------------------------------------------------------------
55 */
56
57 #ifndef _P80211TYPES_H
58 #define _P80211TYPES_H
59
60 /*================================================================*/
61 /* System Includes */
62 /*================================================================*/
63
64 /*================================================================*/
65 /* Project Includes */
66 /*================================================================*/
67
68 #ifndef _WLAN_COMPAT_H
69 #include "wlan_compat.h"
70 #endif
71
72 /*================================================================*/
73 /* Constants */
74 /*================================================================*/
75
76 /*----------------------------------------------------------------*/
77 /* p80211 data type codes used for MIB items and message */
78 /* arguments. The various metadata structures provide additional */
79 /* information about these types. */
80
81 #define P80211_TYPE_OCTETSTR 1 /* pascal array of bytes */
82 #define P80211_TYPE_DISPLAYSTR 2 /* pascal array of bytes containing ascii */
83 #define P80211_TYPE_INT 4 /* UINT32 min and max limited by 32 bits */
84 #define P80211_TYPE_ENUMINT 5 /* UINT32 holding a numeric
85 code that can be mapped
86 to a textual name */
87 #define P80211_TYPE_UNKDATA 6 /* Data item containing an
88 unknown data type */
89 #define P80211_TYPE_INTARRAY 7 /* Array of 32-bit integers. */
90 #define P80211_TYPE_BITARRAY 8 /* Array of bits. */
91 #define P80211_TYPE_MACARRAY 9 /* Array of MAC addresses. */
92
93 /*----------------------------------------------------------------*/
94 /* The following constants are indexes into the Mib Category List */
95 /* and the Message Category List */
96
97 /* Mib Category List */
98 #define P80211_MIB_CAT_DOT11SMT 1
99 #define P80211_MIB_CAT_DOT11MAC 2
100 #define P80211_MIB_CAT_DOT11PHY 3
101
102 #define P80211SEC_DOT11SMT P80211_MIB_CAT_DOT11SMT
103 #define P80211SEC_DOT11MAC P80211_MIB_CAT_DOT11MAC
104 #define P80211SEC_DOT11PHY P80211_MIB_CAT_DOT11PHY
105
106 /* Message Category List */
107 #define P80211_MSG_CAT_DOT11REQ 1
108 #define P80211_MSG_CAT_DOT11IND 2
109 /* #define P80211_MSG_CAT_DOT11CFM 3 (doesn't exist at this time) */
110
111 #define P80211SEC_DOT11REQ P80211_MSG_CAT_DOT11REQ
112 #define P80211SEC_DOT11IND P80211_MSG_CAT_DOT11IND
113 /* #define P80211SEC_DOT11CFM P80211_MSG_CAT_DOT11CFM (doesn't exist at this time */
114
115
116
117 /*----------------------------------------------------------------*/
118 /* p80211 DID field codes that represent access type and */
119 /* is_table status. */
120
121 #define P80211DID_ACCESS_READ 0x10000000
122 #define P80211DID_ACCESS_WRITE 0x08000000
123 #define P80211DID_WRITEONLY 0x00000001
124 #define P80211DID_READONLY 0x00000002
125 #define P80211DID_READWRITE 0x00000003
126 #define P80211DID_ISTABLE_FALSE 0
127 #define P80211DID_ISTABLE_TRUE 1
128
129 /*----------------------------------------------------------------*/
130 /* p80211 enumeration constants. The value to text mappings for */
131 /* these is in p80211types.c. These defines were generated */
132 /* from the mappings. */
133
134 /* error codes for lookups */
135 #define P80211ENUM_BAD 0xffffffffUL
136 #define P80211ENUM_BADSTR "P80211ENUM_BAD"
137
138 #define P80211ENUM_truth_false 0
139 #define P80211ENUM_truth_true 1
140 #define P80211ENUM_ifstate_disable 0
141 #define P80211ENUM_ifstate_fwload 1
142 #define P80211ENUM_ifstate_enable 2
143 #define P80211ENUM_powermgmt_active 1
144 #define P80211ENUM_powermgmt_powersave 2
145 #define P80211ENUM_bsstype_infrastructure 1
146 #define P80211ENUM_bsstype_independent 2
147 #define P80211ENUM_bsstype_any 3
148 #define P80211ENUM_authalg_opensystem 1
149 #define P80211ENUM_authalg_sharedkey 2
150 #define P80211ENUM_phytype_fhss 1
151 #define P80211ENUM_phytype_dsss 2
152 #define P80211ENUM_phytype_irbaseband 3
153 #define P80211ENUM_temptype_commercial 1
154 #define P80211ENUM_temptype_industrial 2
155 #define P80211ENUM_regdomain_fcc 16
156 #define P80211ENUM_regdomain_doc 32
157 #define P80211ENUM_regdomain_etsi 48
158 #define P80211ENUM_regdomain_spain 49
159 #define P80211ENUM_regdomain_france 50
160 #define P80211ENUM_regdomain_mkk 64
161 #define P80211ENUM_ccamode_edonly 1
162 #define P80211ENUM_ccamode_csonly 2
163 #define P80211ENUM_ccamode_edandcs 4
164 #define P80211ENUM_ccamode_cswithtimer 8
165 #define P80211ENUM_ccamode_hrcsanded 16
166 #define P80211ENUM_diversity_fixedlist 1
167 #define P80211ENUM_diversity_notsupported 2
168 #define P80211ENUM_diversity_dynamic 3
169 #define P80211ENUM_scantype_active 1
170 #define P80211ENUM_scantype_passive 2
171 #define P80211ENUM_scantype_both 3
172 #define P80211ENUM_resultcode_success 1
173 #define P80211ENUM_resultcode_invalid_parameters 2
174 #define P80211ENUM_resultcode_not_supported 3
175 #define P80211ENUM_resultcode_timeout 4
176 #define P80211ENUM_resultcode_too_many_req 5
177 #define P80211ENUM_resultcode_refused 6
178 #define P80211ENUM_resultcode_bss_already 7
179 #define P80211ENUM_resultcode_invalid_access 8
180 #define P80211ENUM_resultcode_invalid_mibattribute 9
181 #define P80211ENUM_resultcode_cant_set_readonly_mib 10
182 #define P80211ENUM_resultcode_implementation_failure 11
183 #define P80211ENUM_resultcode_cant_get_writeonly_mib 12
184 #define P80211ENUM_reason_unspec_reason 1
185 #define P80211ENUM_reason_auth_not_valid 2
186 #define P80211ENUM_reason_deauth_lv_ss 3
187 #define P80211ENUM_reason_inactivity 4
188 #define P80211ENUM_reason_ap_overload 5
189 #define P80211ENUM_reason_class23_err 6
190 #define P80211ENUM_reason_class3_err 7
191 #define P80211ENUM_reason_disas_lv_ss 8
192 #define P80211ENUM_reason_asoc_not_auth 9
193 #define P80211ENUM_status_successful 0
194 #define P80211ENUM_status_unspec_failure 1
195 #define P80211ENUM_status_unsup_cap 10
196 #define P80211ENUM_status_reasoc_no_asoc 11
197 #define P80211ENUM_status_fail_other 12
198 #define P80211ENUM_status_unspt_alg 13
199 #define P80211ENUM_status_auth_seq_fail 14
200 #define P80211ENUM_status_chlng_fail 15
201 #define P80211ENUM_status_auth_timeout 16
202 #define P80211ENUM_status_ap_full 17
203 #define P80211ENUM_status_unsup_rate 18
204 #define P80211ENUM_status_unsup_shortpreamble 19
205 #define P80211ENUM_status_unsup_pbcc 20
206 #define P80211ENUM_status_unsup_agility 21
207 #define P80211ENUM_msgitem_status_data_ok 0
208 #define P80211ENUM_msgitem_status_no_value 1
209 #define P80211ENUM_msgitem_status_invalid_itemname 2
210 #define P80211ENUM_msgitem_status_invalid_itemdata 3
211 #define P80211ENUM_msgitem_status_missing_itemdata 4
212 #define P80211ENUM_msgitem_status_incomplete_itemdata 5
213 #define P80211ENUM_msgitem_status_invalid_msg_did 6
214 #define P80211ENUM_msgitem_status_invalid_mib_did 7
215 #define P80211ENUM_msgitem_status_missing_conv_func 8
216 #define P80211ENUM_msgitem_status_string_too_long 9
217 #define P80211ENUM_msgitem_status_data_out_of_range 10
218 #define P80211ENUM_msgitem_status_string_too_short 11
219 #define P80211ENUM_msgitem_status_missing_valid_func 12
220 #define P80211ENUM_msgitem_status_unknown 13
221 #define P80211ENUM_msgitem_status_invalid_did 14
222 #define P80211ENUM_msgitem_status_missing_print_func 15
223
224 #define P80211ENUM_lnxroam_reason_unknown 0
225 #define P80211ENUM_lnxroam_reason_beacon 1
226 #define P80211ENUM_lnxroam_reason_signal 2
227 #define P80211ENUM_lnxroam_reason_txretry 3
228 #define P80211ENUM_lnxroam_reason_notjoined 4
229
230 #define P80211ENUM_p2preamble_long 0
231 #define P80211ENUM_p2preamble_short 2
232 #define P80211ENUM_p2preamble_mixed 3
233
234 /*----------------------------------------------------------------*/
235 /* p80211 max length constants for the different pascal strings. */
236
237 #define MAXLEN_PSTR6 (6) /* pascal array of 6 bytes */
238 #define MAXLEN_PSTR14 (14) /* pascal array of 14 bytes */
239 #define MAXLEN_PSTR32 (32) /* pascal array of 32 bytes */
240 #define MAXLEN_PSTR255 (255) /* pascal array of 255 bytes */
241 #define MAXLEN_MIBATTRIBUTE (392) /* maximum mibattribute */
242 /* where the size of the DATA itself */
243 /* is a DID-LEN-DATA triple */
244 /* with a max size of 4+4+384 */
245
246 #define P80211_SET_INT(item, value) do { \
247 (item).data = (value); \
248 (item).status = P80211ENUM_msgitem_status_data_ok; \
249 } while(0)
250 /*----------------------------------------------------------------*/
251 /* string constants */
252
253 #define NOT_SET "NOT_SET"
254 #define NOT_SUPPORTED "NOT_SUPPORTED"
255 #define UNKNOWN_DATA "UNKNOWN_DATA"
256
257
258 /*--------------------------------------------------------------------*/
259 /* Metadata flags */
260
261 /* MSM: Do these belong in p80211meta.h? I'm not sure. */
262
263 #define ISREQUIRED (0x80000000UL)
264 #define ISREQUEST (0x40000000UL)
265 #define ISCONFIRM (0x20000000UL)
266
267
268 /*================================================================*/
269 /* Macros */
270
271 /*--------------------------------------------------------------------*/
272 /* The following macros are used to manipulate the 'flags' field in */
273 /* the metadata. These are only used when the metadata is for */
274 /* command arguments to determine if the data item is required, and */
275 /* whether the metadata item is for a request command, confirm */
276 /* command or both. */
277 /*--------------------------------------------------------------------*/
278 /* MSM: Do these belong in p80211meta.h? I'm not sure */
279
280 #define P80211ITEM_SETFLAGS(q, r, c) ( q | r | c )
281
282 #define P80211ITEM_ISREQUIRED(flags) (((UINT32)(flags & ISREQUIRED)) >> 31 )
283 #define P80211ITEM_ISREQUEST(flags) (((UINT32)(flags & ISREQUEST)) >> 30 )
284 #define P80211ITEM_ISCONFIRM(flags) (((UINT32)(flags & ISCONFIRM)) >> 29 )
285
286 /*----------------------------------------------------------------*/
287 /* The following macro creates a name for an enum */
288
289 #define MKENUMNAME(name) p80211enum_ ## name
290
291 /*----------------------------------------------------------------
292 * The following constants and macros are used to construct and
293 * deconstruct the Data ID codes. The coding is as follows:
294 *
295 * ...rwtnnnnnnnniiiiiiggggggssssss s - Section
296 * g - Group
297 * i - Item
298 * n - Index
299 * t - Table flag
300 * w - Write flag
301 * r - Read flag
302 * . - Unused
303 */
304
305 #define P80211DID_INVALID 0xffffffffUL
306 #define P80211DID_VALID 0x00000000UL
307
308 #define P80211DID_LSB_SECTION (0)
309 #define P80211DID_LSB_GROUP (6)
310 #define P80211DID_LSB_ITEM (12)
311 #define P80211DID_LSB_INDEX (18)
312 #define P80211DID_LSB_ISTABLE (26)
313 #define P80211DID_LSB_ACCESS (27)
314
315 #define P80211DID_MASK_SECTION (0x0000003fUL)
316 #define P80211DID_MASK_GROUP (0x0000003fUL)
317 #define P80211DID_MASK_ITEM (0x0000003fUL)
318 #define P80211DID_MASK_INDEX (0x000000ffUL)
319 #define P80211DID_MASK_ISTABLE (0x00000001UL)
320 #define P80211DID_MASK_ACCESS (0x00000003UL)
321
322
323 #define P80211DID_MK(a,m,l) ((((UINT32)(a)) & (m)) << (l))
324
325 #define P80211DID_MKSECTION(a) P80211DID_MK(a, \
326 P80211DID_MASK_SECTION, \
327 P80211DID_LSB_SECTION )
328 #define P80211DID_MKGROUP(a) P80211DID_MK(a, \
329 P80211DID_MASK_GROUP, \
330 P80211DID_LSB_GROUP )
331 #define P80211DID_MKITEM(a) P80211DID_MK(a, \
332 P80211DID_MASK_ITEM, \
333 P80211DID_LSB_ITEM )
334 #define P80211DID_MKINDEX(a) P80211DID_MK(a, \
335 P80211DID_MASK_INDEX, \
336 P80211DID_LSB_INDEX )
337 #define P80211DID_MKISTABLE(a) P80211DID_MK(a, \
338 P80211DID_MASK_ISTABLE, \
339 P80211DID_LSB_ISTABLE )
340
341
342 #define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \
343 P80211DID_MKGROUP(g) | \
344 P80211DID_MKITEM(i) | \
345 P80211DID_MKINDEX(n) | \
346 P80211DID_MKISTABLE(t) | \
347 (a) )
348
349
350 #define P80211DID_GET(a,m,l) ((((UINT32)(a)) >> (l)) & (m))
351
352 #define P80211DID_SECTION(a) P80211DID_GET(a, \
353 P80211DID_MASK_SECTION, \
354 P80211DID_LSB_SECTION)
355 #define P80211DID_GROUP(a) P80211DID_GET(a, \
356 P80211DID_MASK_GROUP, \
357 P80211DID_LSB_GROUP)
358 #define P80211DID_ITEM(a) P80211DID_GET(a, \
359 P80211DID_MASK_ITEM, \
360 P80211DID_LSB_ITEM)
361 #define P80211DID_INDEX(a) P80211DID_GET(a, \
362 P80211DID_MASK_INDEX, \
363 P80211DID_LSB_INDEX)
364 #define P80211DID_ISTABLE(a) P80211DID_GET(a, \
365 P80211DID_MASK_ISTABLE, \
366 P80211DID_LSB_ISTABLE)
367 #define P80211DID_ACCESS(a) P80211DID_GET(a, \
368 P80211DID_MASK_ACCESS, \
369 P80211DID_LSB_ACCESS)
370
371 /*================================================================*/
372 /* Types */
373
374 /*----------------------------------------------------------------*/
375 /* The following structure types are used for the represenation */
376 /* of ENUMINT type metadata. */
377
378 typedef struct p80211enumpair
379 {
380 UINT32 val;
381 char *name;
382 } p80211enumpair_t;
383
384 typedef struct p80211enum
385 {
386 INT nitems;
387 p80211enumpair_t *list;
388 } p80211enum_t;
389
390 /*----------------------------------------------------------------*/
391 /* The following structure types are used to store data items in */
392 /* messages. */
393
394 /* Template pascal string */
395 typedef struct p80211pstr
396 {
397 UINT8 len;
398 } __WLAN_ATTRIB_PACK__ p80211pstr_t;
399
400 typedef struct p80211pstrd
401 {
402 UINT8 len;
403 UINT8 data[0];
404 } __WLAN_ATTRIB_PACK__ p80211pstrd_t;
405
406 /* Maximum pascal string */
407 typedef struct p80211pstr255
408 {
409 UINT8 len;
410 UINT8 data[MAXLEN_PSTR255];
411 } __WLAN_ATTRIB_PACK__ p80211pstr255_t;
412
413 /* pascal string for macaddress and bssid */
414 typedef struct p80211pstr6
415 {
416 UINT8 len;
417 UINT8 data[MAXLEN_PSTR6];
418 } __WLAN_ATTRIB_PACK__ p80211pstr6_t;
419
420 /* pascal string for channel list */
421 typedef struct p80211pstr14
422 {
423 UINT8 len;
424 UINT8 data[MAXLEN_PSTR14];
425 } __WLAN_ATTRIB_PACK__ p80211pstr14_t;
426
427 /* pascal string for ssid */
428 typedef struct p80211pstr32
429 {
430 UINT8 len;
431 UINT8 data[MAXLEN_PSTR32];
432 } __WLAN_ATTRIB_PACK__ p80211pstr32_t;
433
434 /* MAC address array */
435 typedef struct p80211macarray
436 {
437 UINT32 cnt;
438 UINT8 data[1][MAXLEN_PSTR6];
439 } __WLAN_ATTRIB_PACK__ p80211macarray_t;
440
441 /* prototype template */
442 typedef struct p80211item
443 {
444 UINT32 did;
445 UINT16 status;
446 UINT16 len;
447 } __WLAN_ATTRIB_PACK__ p80211item_t;
448
449 /* prototype template w/ data item */
450 typedef struct p80211itemd
451 {
452 UINT32 did;
453 UINT16 status;
454 UINT16 len;
455 UINT8 data[0];
456 } __WLAN_ATTRIB_PACK__ p80211itemd_t;
457
458 /* message data item for INT, BOUNDEDINT, ENUMINT */
459 typedef struct p80211item_uint32
460 {
461 UINT32 did;
462 UINT16 status;
463 UINT16 len;
464 UINT32 data;
465 } __WLAN_ATTRIB_PACK__ p80211item_uint32_t;
466
467 /* message data item for OCTETSTR, DISPLAYSTR */
468 typedef struct p80211item_pstr6
469 {
470 UINT32 did;
471 UINT16 status;
472 UINT16 len;
473 p80211pstr6_t data;
474 } __WLAN_ATTRIB_PACK__ p80211item_pstr6_t;
475
476 /* message data item for OCTETSTR, DISPLAYSTR */
477 typedef struct p80211item_pstr14
478 {
479 UINT32 did;
480 UINT16 status;
481 UINT16 len;
482 p80211pstr14_t data;
483 } __WLAN_ATTRIB_PACK__ p80211item_pstr14_t;
484
485 /* message data item for OCTETSTR, DISPLAYSTR */
486 typedef struct p80211item_pstr32
487 {
488 UINT32 did;
489 UINT16 status;
490 UINT16 len;
491 p80211pstr32_t data;
492 } __WLAN_ATTRIB_PACK__ p80211item_pstr32_t;
493
494 /* message data item for OCTETSTR, DISPLAYSTR */
495 typedef struct p80211item_pstr255
496 {
497 UINT32 did;
498 UINT16 status;
499 UINT16 len;
500 p80211pstr255_t data;
501 } __WLAN_ATTRIB_PACK__ p80211item_pstr255_t;
502
503 /* message data item for UNK 392, namely mib items */
504 typedef struct p80211item_unk392
505 {
506 UINT32 did;
507 UINT16 status;
508 UINT16 len;
509 UINT8 data[MAXLEN_MIBATTRIBUTE];
510 } __WLAN_ATTRIB_PACK__ p80211item_unk392_t;
511
512 /* message data item for UNK 1025, namely p2 pdas */
513 typedef struct p80211item_unk1024
514 {
515 UINT32 did;
516 UINT16 status;
517 UINT16 len;
518 UINT8 data[1024];
519 } __WLAN_ATTRIB_PACK__ p80211item_unk1024_t;
520
521 /* message data item for UNK 4096, namely p2 download chunks */
522 typedef struct p80211item_unk4096
523 {
524 UINT32 did;
525 UINT16 status;
526 UINT16 len;
527 UINT8 data[4096];
528 } __WLAN_ATTRIB_PACK__ p80211item_unk4096_t;
529
530 struct catlistitem;
531
532 /*----------------------------------------------------------------*/
533 /* The following structure type is used to represent all of the */
534 /* metadata items. Some components may choose to use more, */
535 /* less or different metadata items. */
536
537 typedef void (*p80211_totext_t)( struct catlistitem *, UINT32 did, UINT8* itembuf, char *textbuf);
538 typedef void (*p80211_fromtext_t)( struct catlistitem *, UINT32 did, UINT8* itembuf, char *textbuf);
539 typedef UINT32 (*p80211_valid_t)( struct catlistitem *, UINT32 did, UINT8* itembuf);
540
541
542 /*================================================================*/
543 /* Extern Declarations */
544
545 /*----------------------------------------------------------------*/
546 /* Enumeration Lists */
547 /* The following are the external declarations */
548 /* for all enumerations */
549
550 extern p80211enum_t MKENUMNAME(truth);
551 extern p80211enum_t MKENUMNAME(ifstate);
552 extern p80211enum_t MKENUMNAME(powermgmt);
553 extern p80211enum_t MKENUMNAME(bsstype);
554 extern p80211enum_t MKENUMNAME(authalg);
555 extern p80211enum_t MKENUMNAME(phytype);
556 extern p80211enum_t MKENUMNAME(temptype);
557 extern p80211enum_t MKENUMNAME(regdomain);
558 extern p80211enum_t MKENUMNAME(ccamode);
559 extern p80211enum_t MKENUMNAME(diversity);
560 extern p80211enum_t MKENUMNAME(scantype);
561 extern p80211enum_t MKENUMNAME(resultcode);
562 extern p80211enum_t MKENUMNAME(reason);
563 extern p80211enum_t MKENUMNAME(status);
564 extern p80211enum_t MKENUMNAME(msgcode);
565 extern p80211enum_t MKENUMNAME(msgitem_status);
566
567 extern p80211enum_t MKENUMNAME(lnxroam_reason);
568
569 extern p80211enum_t MKENUMNAME(p2preamble);
570
571 /*================================================================*/
572 /* Function Declarations */
573
574 /*----------------------------------------------------------------*/
575 /* The following declare some utility functions for use with the */
576 /* p80211enum_t type. */
577
578 UINT32 p80211enum_text2int(p80211enum_t *ep, char *text);
579 UINT32 p80211enum_int2text(p80211enum_t *ep, UINT32 val, char *text);
580 void p80211_error2text(int err_code, char *err_str);
581
582 /*----------------------------------------------------------------*/
583 /* The following declare some utility functions for use with the */
584 /* p80211item_t and p80211meta_t types. */
585
586 /*----------------------------------------------------------------*/
587 /* The following declare functions that perform validation and */
588 /* text to binary conversions based on the metadata for interface */
589 /* and MIB data items. */
590 /*----------------------------------------------------------------*/
591
592 /*-- DISPLAYSTR ------------------------------------------------------*/
593 /* pstr ==> cstr */
594 void p80211_totext_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
595
596 /* cstr ==> pstr */
597 void p80211_fromtext_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
598
599 /* function that checks validity of a displaystr binary value */
600 UINT32 p80211_isvalid_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
601
602 /*-- OCTETSTR --------------------------------------------------------*/
603 /* pstr ==> "xx:xx:...." */
604 void p80211_totext_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
605
606 /* "xx:xx:...." ==> pstr */
607 void p80211_fromtext_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
608
609 /* function that checks validity of an octetstr binary value */
610 UINT32 p80211_isvalid_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
611
612 /*-- INT -------------------------------------------------------------*/
613 /* UINT32 ==> %d */
614 void p80211_totext_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
615
616 /* %d ==> UINT32 */
617 void p80211_fromtext_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
618
619 /* function that checks validity of an int's binary value (always successful) */
620 UINT32 p80211_isvalid_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
621
622 /*-- ENUMINT ---------------------------------------------------------*/
623 /* UINT32 ==> <valuename> */
624 void p80211_totext_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
625
626 /* <valuename> ==> UINT32 */
627 void p80211_fromtext_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
628
629 /* function that checks validity of an enum's binary value */
630 UINT32 p80211_isvalid_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
631
632 /*-- INTARRAY --------------------------------------------------------*/
633 /* UINT32[] => %d,%d,%d,... */
634 void p80211_totext_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
635
636 /* %d,%d,%d,... ==> UINT32[] */
637 void p80211_fromtext_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
638
639 /* function that checks validity of an integer array's value */
640 UINT32 p80211_isvalid_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
641
642 /*-- BITARRAY --------------------------------------------------------*/
643 /* UINT32 ==> %d,%d,%d,... */
644 void p80211_totext_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
645
646 /* %d,%d,%d,... ==> UINT32 */
647 void p80211_fromtext_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
648
649 /* function that checks validity of a bit array's value */
650 UINT32 p80211_isvalid_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
651
652 /*-- MACARRAY --------------------------------------------------------*/
653 void p80211_totext_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
654
655 void p80211_fromtext_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
656
657 /* function that checks validity of a MAC address array's value */
658 UINT32 p80211_isvalid_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
659
660 /*-- MIBATTRIUBTE ------------------------------------------------------*/
661 /* <mibvalue> ==> <textual representation identified in MIB metadata> */
662 void p80211_totext_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
663 void p80211_totext_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
664
665
666 /* <textual representation identified in MIB metadata> ==> <mibvalue> */
667 void p80211_fromtext_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
668 void p80211_fromtext_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
669
670 /* function that checks validity of a mibitem's binary value */
671 UINT32 p80211_isvalid_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
672 UINT32 p80211_isvalid_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
673
674 #endif /* _P80211TYPES_H */
675
This page took 0.058173 seconds and 5 git commands to generate.