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 /*================================================================*/
63 /*================================================================*/
64 /* Project Includes */
66 #ifndef _WLAN_COMPAT_H
67 #include "wlan_compat.h"
70 /*================================================================*/
73 /*----------------------------------------------------------------*/
76 /*================================================================*/
79 /*----------------------------------------------------------------*/
80 /* The following macros are used to ensure consistent naming */
81 /* conventions for all the different metadata lists. */
83 #define MKREQMETANAME(name) p80211meta_ ## req ## _ ## name
84 #define MKINDMETANAME(name) p80211meta_ ## ind ## _ ## name
85 #define MKMIBMETANAME(name) p80211meta_ ## mib ## _ ## name
86 #define MKGRPMETANAME(name) p80211meta_ ## grp ## _ ## name
88 #define MKREQMETASIZE(name) p80211meta_ ## req ## _ ## name ## _ ## size
89 #define MKINDMETASIZE(name) p80211meta_ ## ind ## _ ## name ## _ ## size
90 #define MKMIBMETASIZE(name) p80211meta_ ## mib ## _ ## name ## _ ## size
91 #define MKGRPMETASIZE(name) p80211meta_ ## grp ## _ ## name ## _ ## size
93 #define GETMETASIZE(aptr) (**((UINT32**)(aptr)))
95 /*----------------------------------------------------------------*/
96 /* The following ifdef depends on the following defines: */
97 /* P80211_NOINCLUDESTRINGS - if defined, all metadata name fields */
98 /* are empty strings */
100 #ifdef P80211_NOINCLUDESTRINGS
101 #define MKITEMNAME(s) ("")
103 #define MKITEMNAME(s) (s)
106 /*================================================================*/
109 /*----------------------------------------------------------------*/
110 /* The following structure types are used for the metadata */
111 /* representation of category list metadata, group list metadata, */
112 /* and data item metadata for both Mib and Messages. */
114 typedef struct p80211meta
116 char *name; /* data item name */
117 UINT32 did; /* partial did */
118 UINT32 flags; /* set of various flag bits */
119 UINT32 min; /* min value of a BOUNDEDINT */
120 UINT32 max; /* max value of a BOUNDEDINT */
122 UINT32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */
123 UINT32 minlen; /* minlen of a OCTETSTR or DISPLAYSTR */
124 p80211enum_t *enumptr; /* ptr to the enum type for ENUMINT */
125 p80211_totext_t totextptr; /* ptr to totext conversion function */
126 p80211_fromtext_t fromtextptr; /* ptr to totext conversion function */
127 p80211_valid_t validfunptr; /* ptr to totext conversion function */
130 typedef struct grplistitem
133 p80211meta_t *itemlist;
136 typedef struct catlistitem
139 grplistitem_t *grplist;
142 /*================================================================*/
143 /* Extern Declarations */
145 /*----------------------------------------------------------------*/
148 /*================================================================*/
149 /* Function Declarations */
151 /*----------------------------------------------------------------*/
153 UINT32 p80211_text2did(catlistitem_t *catlist, char *catname, char *grpname, char *itemname);
154 UINT32 p80211_text2catdid(catlistitem_t *list, char *name );
155 UINT32 p80211_text2grpdid(grplistitem_t *list, char *name );
156 UINT32 p80211_text2itemdid(p80211meta_t *list, char *name );
157 UINT32 p80211_isvalid_did( catlistitem_t *catlist, UINT32 did );
158 UINT32 p80211_isvalid_catdid( catlistitem_t *catlist, UINT32 did );
159 UINT32 p80211_isvalid_grpdid( catlistitem_t *catlist, UINT32 did );
160 UINT32 p80211_isvalid_itemdid( catlistitem_t *catlist, UINT32 did );
161 catlistitem_t *p80211_did2cat( catlistitem_t *catlist, UINT32 did );
162 grplistitem_t *p80211_did2grp( catlistitem_t *catlist, UINT32 did );
163 p80211meta_t *p80211_did2item( catlistitem_t *catlist, UINT32 did );
164 UINT32 p80211item_maxdatalen( struct catlistitem *metalist, UINT32 did );
165 UINT32 p80211_metaname2did(struct catlistitem *metalist, char *itemname);
166 UINT32 p80211item_getoffset( struct catlistitem *metalist, UINT32 did );
167 int p80211item_gettype(p80211meta_t *meta);
169 #endif /* _P80211META_H */