3 * Macros, constants, types, and funcs for p80211 metadata
5 * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
6 * --------------------------------------------------------------------
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/
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.
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.
31 * --------------------------------------------------------------------
33 * Inquiries regarding the linux-wlan Open Source project can be
36 * AbsoluteValue Systems Inc.
38 * http://www.linux-wlan.com
40 * --------------------------------------------------------------------
42 * Portions of the development of this software were funded by
43 * Intersil Corporation as part of PRISM(R) chipset product development.
45 * --------------------------------------------------------------------
47 * This file declares some of the constants and types used in various
48 * parts of the linux-wlan system.
51 * - Constant values are always in HOST byte order.
53 * All functions and statics declared here are implemented in p80211types.c
54 * --------------------------------------------------------------------
60 /*================================================================*/
61 /* Project Includes */
63 #ifndef _WLAN_COMPAT_H
64 #include "wlan_compat.h"
67 /*================================================================*/
70 /*----------------------------------------------------------------*/
71 /* The following macros are used to ensure consistent naming */
72 /* conventions for all the different metadata lists. */
74 #define MKREQMETANAME(name) p80211meta_ ## req ## _ ## name
75 #define MKINDMETANAME(name) p80211meta_ ## ind ## _ ## name
76 #define MKMIBMETANAME(name) p80211meta_ ## mib ## _ ## name
77 #define MKGRPMETANAME(name) p80211meta_ ## grp ## _ ## name
79 #define MKREQMETASIZE(name) p80211meta_ ## req ## _ ## name ## _ ## size
80 #define MKINDMETASIZE(name) p80211meta_ ## ind ## _ ## name ## _ ## size
81 #define MKMIBMETASIZE(name) p80211meta_ ## mib ## _ ## name ## _ ## size
82 #define MKGRPMETASIZE(name) p80211meta_ ## grp ## _ ## name ## _ ## size
84 #define GETMETASIZE(aptr) (**((u32**)(aptr)))
86 /*----------------------------------------------------------------*/
87 /* The following ifdef depends on the following defines: */
88 /* P80211_NOINCLUDESTRINGS - if defined, all metadata name fields */
89 /* are empty strings */
91 #ifdef P80211_NOINCLUDESTRINGS
92 #define MKITEMNAME(s) ("")
94 #define MKITEMNAME(s) (s)
97 /*================================================================*/
100 /*----------------------------------------------------------------*/
101 /* The following structure types are used for the metadata */
102 /* representation of category list metadata, group list metadata, */
103 /* and data item metadata for both Mib and Messages. */
105 typedef struct p80211meta
107 char *name; /* data item name */
108 u32 did; /* partial did */
109 u32 flags; /* set of various flag bits */
110 u32 min; /* min value of a BOUNDEDint */
111 u32 max; /* max value of a BOUNDEDint */
113 u32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */
114 u32 minlen; /* minlen of a OCTETSTR or DISPLAYSTR */
115 p80211enum_t *enumptr; /* ptr to the enum type for ENUMint */
116 p80211_totext_t totextptr; /* ptr to totext conversion function */
117 p80211_fromtext_t fromtextptr; /* ptr to totext conversion function */
118 p80211_valid_t validfunptr; /* ptr to totext conversion function */
121 typedef struct grplistitem
124 p80211meta_t *itemlist;
127 typedef struct catlistitem
130 grplistitem_t *grplist;
133 /*================================================================*/
134 /* Function Declarations */
136 /*----------------------------------------------------------------*/
138 u32 p80211_text2did(catlistitem_t *catlist, char *catname, char *grpname, char *itemname);
139 u32 p80211_text2catdid(catlistitem_t *list, char *name );
140 u32 p80211_text2grpdid(grplistitem_t *list, char *name );
141 u32 p80211_text2itemdid(p80211meta_t *list, char *name );
142 u32 p80211_isvalid_did( catlistitem_t *catlist, u32 did );
143 u32 p80211_isvalid_catdid( catlistitem_t *catlist, u32 did );
144 u32 p80211_isvalid_grpdid( catlistitem_t *catlist, u32 did );
145 u32 p80211_isvalid_itemdid( catlistitem_t *catlist, u32 did );
146 catlistitem_t *p80211_did2cat( catlistitem_t *catlist, u32 did );
147 grplistitem_t *p80211_did2grp( catlistitem_t *catlist, u32 did );
148 p80211meta_t *p80211_did2item( catlistitem_t *catlist, u32 did );
149 u32 p80211item_maxdatalen( struct catlistitem *metalist, u32 did );
150 u32 p80211_metaname2did(struct catlistitem *metalist, char *itemname);
151 u32 p80211item_getoffset( struct catlistitem *metalist, u32 did );
152 int p80211item_gettype(p80211meta_t *meta);
154 #endif /* _P80211META_H */