blob: 8b61e5fc292bf74b4cfb43954681de5ef9db0ed7 [file] [log] [blame]
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001/* p80211meta.h
2*
3* Macros, constants, types, and funcs for p80211 metadata
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 _P80211META_H
58#define _P80211META_H
59
60/*================================================================*/
61/* System Includes */
62
63/*================================================================*/
64/* Project Includes */
65
66#ifndef _WLAN_COMPAT_H
67#include "wlan_compat.h"
68#endif
69
70/*================================================================*/
71/* Constants */
72
73/*----------------------------------------------------------------*/
74/* */
75
76/*================================================================*/
77/* Macros */
78
79/*----------------------------------------------------------------*/
80/* The following macros are used to ensure consistent naming */
81/* conventions for all the different metadata lists. */
82
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
87
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
92
Solomon Peachyaaad4302008-10-29 10:42:53 -040093#define GETMETASIZE(aptr) (**((u32**)(aptr)))
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -070094
95/*----------------------------------------------------------------*/
96/* The following ifdef depends on the following defines: */
97/* P80211_NOINCLUDESTRINGS - if defined, all metadata name fields */
98/* are empty strings */
99
100#ifdef P80211_NOINCLUDESTRINGS
101 #define MKITEMNAME(s) ("")
102#else
103 #define MKITEMNAME(s) (s)
104#endif
105
106/*================================================================*/
107/* Types */
108
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. */
113
114typedef struct p80211meta
115{
116 char *name; /* data item name */
Solomon Peachyaaad4302008-10-29 10:42:53 -0400117 u32 did; /* partial did */
118 u32 flags; /* set of various flag bits */
119 u32 min; /* min value of a BOUNDEDint */
120 u32 max; /* max value of a BOUNDEDint */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700121
Solomon Peachyaaad4302008-10-29 10:42:53 -0400122 u32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */
123 u32 minlen; /* minlen of a OCTETSTR or DISPLAYSTR */
124 p80211enum_t *enumptr; /* ptr to the enum type for ENUMint */
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700125 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 */
128} p80211meta_t;
129
130typedef struct grplistitem
131{
132 char *name;
133 p80211meta_t *itemlist;
134} grplistitem_t;
135
136typedef struct catlistitem
137{
138 char *name;
139 grplistitem_t *grplist;
140} catlistitem_t;
141
142/*================================================================*/
143/* Extern Declarations */
144
145/*----------------------------------------------------------------*/
146/* */
147
148/*================================================================*/
149/* Function Declarations */
150
151/*----------------------------------------------------------------*/
152/* */
Solomon Peachyaaad4302008-10-29 10:42:53 -0400153u32 p80211_text2did(catlistitem_t *catlist, char *catname, char *grpname, char *itemname);
154u32 p80211_text2catdid(catlistitem_t *list, char *name );
155u32 p80211_text2grpdid(grplistitem_t *list, char *name );
156u32 p80211_text2itemdid(p80211meta_t *list, char *name );
157u32 p80211_isvalid_did( catlistitem_t *catlist, u32 did );
158u32 p80211_isvalid_catdid( catlistitem_t *catlist, u32 did );
159u32 p80211_isvalid_grpdid( catlistitem_t *catlist, u32 did );
160u32 p80211_isvalid_itemdid( catlistitem_t *catlist, u32 did );
161catlistitem_t *p80211_did2cat( catlistitem_t *catlist, u32 did );
162grplistitem_t *p80211_did2grp( catlistitem_t *catlist, u32 did );
163p80211meta_t *p80211_did2item( catlistitem_t *catlist, u32 did );
164u32 p80211item_maxdatalen( struct catlistitem *metalist, u32 did );
165u32 p80211_metaname2did(struct catlistitem *metalist, char *itemname);
166u32 p80211item_getoffset( struct catlistitem *metalist, u32 did );
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700167int p80211item_gettype(p80211meta_t *meta);
168
169#endif /* _P80211META_H */