Initial revision

This commit is contained in:
mark 1999-08-21 16:51:49 +00:00
parent 784747ba9e
commit b6cac7486c
34 changed files with 8429 additions and 0 deletions

0
README Normal file
View file

0
doc/README Normal file
View file

0
man/README Normal file
View file

0
scripts/README Normal file
View file

0
src/README Normal file
View file

0
src/am930/README Normal file
View file

6
src/config.mk Normal file
View file

@ -0,0 +1,6 @@
LINUX = /usr/src/linux
PCMCIA = /usr/src/pcmcia-cs-3.0.13
MODULES_DIR=/lib/modules/2.2.5-15
UTS_RELEASE=2.2.5
INST_EXEDIR=/sbin
DESTDIR=

0
src/include/README Normal file
View file

0
src/include/wlan/README Normal file
View file

View file

@ -0,0 +1,220 @@
/* p80211hdr.h: Macros, types, and functions for handling 802.11 MAC headers
* --------------------------------------------------------------------
* Linux WLAN
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
*
* This file declares the constants and types used in the interface
* between a wlan driver and the user mode utilities.
*
* Note: Constant values are always in HOST byte order. To assign
* values to multi-byte fields they _must_ be converted to
* ieee byte order. To retrieve multi-byte values from incoming
* frames, they must be converted to host order.
*
* All functions declared here are implemented in p80211.c
* --------------------------------------------------------------------
*/
#ifndef _P80211HDR_H
#define _P80211HDR_H
#ifndef _WLAN_COMPAT_H
#include <wlan/wlan_compat.h>
#endif
/*=============================================================*/
/*--- Constants -----------------------------------------------*/
/*=============================================================*/
/*--- Sizes -----------------------------------------------*/
#define WLAN_ADDR_LEN 6
#define WLAN_CRC_LEN 4
#define WLAN_BSSID_LEN 6
#define WLAN_BSS_TS_LEN 8
#define WLAN_HDR_A3_LEN 24
#define WLAN_HDR_A4_LEN 30
#define WLAN_SSID_MAXLEN 32
#define WLAN_DATA_MAXLEN 2312
#define WLAN_A3FR_MAXLEN (WLAN_HDR_A3_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN)
#define WLAN_BEACON_FR_MAXLEN (WLAN_HDR_A3_LEN + 334)
#define WLAN_ATIM_FR_MAXLEN (WLAN_HDR_A3_LEN + 0)
#define WLAN_DISASSOC_FR_MAXLEN (WLAN_HDR_A3_LEN + 2)
#define WLAN_ASSOCREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 48)
#define WLAN_ASSOCRESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 16)
#define WLAN_REASSOCREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 54)
#define WLAN_REASSOCRESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 16)
#define WLAN_PROBEREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 44)
#define WLAN_PROBERESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 78)
#define WLAN_AUTHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 261)
#define WLAN_DEATHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 2)
#define WLAN_WEP_NKEYS 4
#define WLAN_WEP_KEYLEN 5
#define WLAN_CHALLENGE_IE_LEN 130
#define WLAN_CHALLENGE_LEN 128
#define WLAN_WEP_IV_LEN 4
#define WLAN_WEP_ICV_LEN 4
/*--- Frame Control Field -------------------------------------*/
/* Frame Types */
#define WLAN_FTYPE_MGMT 0x00
#define WLAN_FTYPE_CTL 0x01
#define WLAN_FTYPE_DATA 0x02
/* Frame subtypes */
/* Management */
#define WLAN_FSTYPE_ASSOCREQ 0x00
#define WLAN_FSTYPE_ASSOCRESP 0x01
#define WLAN_FSTYPE_REASSOCREQ 0x02
#define WLAN_FSTYPE_REASSOCRESP 0x03
#define WLAN_FSTYPE_PROBEREQ 0x04
#define WLAN_FSTYPE_PROBERESP 0x05
#define WLAN_FSTYPE_BEACON 0x08
#define WLAN_FSTYPE_ATIM 0x09
#define WLAN_FSTYPE_DISASSOC 0x0a
#define WLAN_FSTYPE_AUTHEN 0x0b
#define WLAN_FSTYPE_DEAUTHEN 0x0c
/* Control */
#define WLAN_FSTYPE_PSPOLL 0x0a
#define WLAN_FSTYPE_RTS 0x0b
#define WLAN_FSTYPE_CTS 0x0c
#define WLAN_FSTYPE_ACK 0x0d
#define WLAN_FSTYPE_CFEND 0x0e
#define WLAN_FSTYPE_CFENDCFACK 0x0f
/* Data */
#define WLAN_FSTYPE_DATAONLY 0x00
#define WLAN_FSTYPE_DATA_CFACK 0x01
#define WLAN_FSTYPE_DATA_CFPOLL 0x02
#define WLAN_FSTYPE_DATA_CFACK_CFPOLL 0x03
#define WLAN_FSTYPE_NULL 0x04
#define WLAN_FSTYPE_CFACK 0x05
#define WLAN_FSTYPE_CFPOLL 0x06
#define WLAN_FSTYPE_CFACK_CFPOLL 0x07
/*--- FC Macros ----------------------------------------------*/
/* Macros to get/set the bitfields of the Frame Control Field */
/* GET_FC_??? - takes the host byte-order value of an FC */
/* and retrieves the value of one of the */
/* bitfields and moves that value so its lsb is */
/* in bit 0. */
/* SET_FC_??? - takes a host order value for one of the FC */
/* bitfields and moves it to the proper bit */
/* location for ORing into a host order FC. */
/* To send the FC produced from SET_FC_???, */
/* one must put the bytes in IEEE order. */
/* e.g. */
/* printf("the frame subtype is %x", */
/* GET_FC_FTYPE( ieee2host( rx.fc ))) */
/* */
/* tx.fc = host2ieee( SET_FC_FTYPE(WLAN_FTYP_CTL) | */
/* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */
/*------------------------------------------------------------*/
#define WLAN_GET_FC_PVER(n) (((UINT16)(n)) & (BIT0 | BIT1))
#define WLAN_GET_FC_FTYPE(n) ((((UINT16)(n)) & (BIT2 | BIT3)) >> 2)
#define WLAN_GET_FC_FSTYPE(n) ((((UINT16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4)
#define WLAN_GET_FC_TODS(n) ((((UINT16)(n)) & (BIT8)) >> 8)
#define WLAN_GET_FC_FROMDS(n) ((((UINT16)(n)) & (BIT9)) >> 9)
#define WLAN_GET_FC_MOREFRAG(n) ((((UINT16)(n)) & (BIT10)) >> 10)
#define WLAN_GET_FC_RETRY(n) ((((UINT16)(n)) & (BIT11)) >> 11)
#define WLAN_GET_FC_PWRMGT(n) ((((UINT16)(n)) & (BIT12)) >> 12)
#define WLAN_GET_FC_MOREDATA(n) ((((UINT16)(n)) & (BIT13)) >> 13)
#define WLAN_GET_FC_ISWEP(n) ((((UINT16)(n)) & (BIT14)) >> 14)
#define WLAN_GET_FC_ORDER(n) ((((UINT16)(n)) & (BIT15)) >> 15)
#define WLAN_SET_FC_PVER(n) ((UINT16)(n))
#define WLAN_SET_FC_FTYPE(n) (((UINT16)(n)) << 2)
#define WLAN_SET_FC_FSTYPE(n) (((UINT16)(n)) << 4)
#define WLAN_SET_FC_TODS(n) (((UINT16)(n)) << 8)
#define WLAN_SET_FC_FROMDS(n) (((UINT16)(n)) << 9)
#define WLAN_SET_FC_MOREFRAG(n) (((UINT16)(n)) << 10)
#define WLAN_SET_FC_RETRY(n) (((UINT16)(n)) << 11)
#define WLAN_SET_FC_PWRMGT(n) (((UINT16)(n)) << 12)
#define WLAN_SET_FC_MOREDATA(n) (((UINT16)(n)) << 13)
#define WLAN_SET_FC_ISWEP(n) (((UINT16)(n)) << 14)
#define WLAN_SET_FC_ORDER(n) (((UINT16)(n)) << 15)
/*--- Duration Macros ----------------------------------------*/
/* Macros to get/set the bitfields of the Duration Field */
/* - the duration value is only valid when bit15 is zero */
/* - the firmware handles these values, so I'm not going */
/* these macros right now. */
/*------------------------------------------------------------*/
/*--- Sequence Control Macros -------------------------------*/
/* Macros to get/set the bitfields of the Sequence Control */
/* Field. */
/*------------------------------------------------------------*/
#define WLAN_GET_SEQ_FRGNUM(n) (((UINT16)(n)) & (BIT0|BIT1|BIT2|BIT3))
#define WLAN_GET_SEQ_SEQNUM(n) ((((UINT16)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4)
/*--- Data ptr macro -----------------------------------------*/
/* Creates a UINT8* to the data portion of a frame */
/* Assumes you're passing in a ptr to the beginning of the hdr*/
/*------------------------------------------------------------*/
#define WLAN_HDR_A3_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A3_LEN)
#define WLAN_HDR_A4_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A4_LEN)
/*=============================================================*/
/*--- Types and Structures ------------------------------------*/
/*=============================================================*/
/* BSS Timestamp */
typedef UINT8 wlan_bss_ts_t[WLAN_BSS_TS_LEN];
/* Generic 802.11 Header types */
__WLAN_PRAGMA_PACK1__
typedef struct p80211_hdr_a3
{
UINT16 fc __WLAN_ATTRIB_PACK__;
UINT16 dur __WLAN_ATTRIB_PACK__;
UINT8 a1[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT8 a2[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT8 a3[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT16 seq __WLAN_ATTRIB_PACK__;
} p80211_hdr_a3_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211_hdr_a4
{
UINT16 fc __WLAN_ATTRIB_PACK__;
UINT16 dur __WLAN_ATTRIB_PACK__;
UINT8 a1[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT8 a2[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT8 a3[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT16 seq __WLAN_ATTRIB_PACK__;
UINT8 a4[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
} p80211_hdr_a4_t;
__WLAN_PRAGMA_PACKDFLT__
typedef union p80211_hdr
{
p80211_hdr_a3_t a3;
p80211_hdr_a4_t a4;
} p80211_hdr_t;
/*=============================================================*/
/*--- Functions -----------------------------------------------*/
/*=============================================================*/
void p802addr_to_str( char *buf, UINT8 *addr);
#endif /* _P80211HDR_H */

View file

@ -0,0 +1,61 @@
/* p80211ioctl.h: Declares constants and types for the p80211 ioctls
* --------------------------------------------------------------------
* Linux WLAN
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
*
* --------------------------------------------------------------------
*/
#ifndef _P80211IOCTL_H
#define _P80211IOCTL_H
/*====================================================================*/
/*----- Constants ----------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* p80211 ioctl "request" codes. See argument 2 of ioctl(2). */
/*--------------------------------------------------------------------*/
#define P80211_IFTEST (SIOCDEVPRIVATE + 0)
#define P80211_IFREQ (SIOCDEVPRIVATE + 1)
/*====================================================================*/
/*----- Macros -------------------------------------------------------*/
/*====================================================================*/
/*----- Types --------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* A ptr to the following structure type is passed as the third */
/* argument to the ioctl system call when issuing a request to the */
/* p80211 module. */
/*--------------------------------------------------------------------*/
typedef struct p80211ioctl_req
{
char name[16] __WLAN_ATTRIB_PACK__;
void *data __WLAN_ATTRIB_PACK__;
UINT16 result __WLAN_ATTRIB_PACK__;
UINT16 len __WLAN_ATTRIB_PACK__;
} p80211ioctl_req_t;
/*====================================================================*/
/*----- External Declarations ----------------------------------------*/
/*====================================================================*/
/*----- Function Prototypes ------------------------------------------*/
#endif /* _P80211IOCTL_H */

View file

@ -0,0 +1,522 @@
/* p80211mgmt.h: Macros, types, and functions to handle 802.11 mgmt frames
* --------------------------------------------------------------------
* Linux WLAN
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
*
* This file declares the constants and types used in the interface
* between a wlan driver and the user mode utilities.
*
* Note: Constant values are always in HOST byte order. To assign
* values to multi-byte fields they _must_ be converted to
* ieee byte order. To retrieve multi-byte values from incoming
* frames, they must be converted to host order.
*
* Note: The len member of the frame structure does NOT!!! include
* the MAC CRC. Therefore, the len field on rx'd frames should
* have 4 subtracted from it.
*
* All functions declared here are implemented in p80211.c
*
* The types, macros, and functions defined here are primarily
* used for encoding and decoding management frames. They are
* designed to follow these patterns of use:
*
* DECODE:
* 1) a frame of length len is received into buffer b
* 2) using the hdr structure and macros, we determine the type
* 3) an appropriate mgmt frame structure, mf, is allocated and zeroed
* 4) mf.hdr = b
* mf.buf = b
* mf.len = len
* 5) call mgmt_decode( mf )
* 6) the frame field pointers in mf are now set. Note that any
* multi-byte frame field values accessed using the frame field
* pointers are in ieee byte order and will have to be converted
* to host order.
*
* ENCODE:
* 1) Library client allocates buffer space for maximum length
* frame of the desired type
* 2) Library client allocates a mgmt frame structure, called mf,
* of the desired type
* 3) Set the following:
* mf.type = <desired type>
* mf.buf = <allocated buffer address>
* 4) call mgmt_encode( mf )
* 5) all of the fixed field pointers and fixed length information element
* pointers in mf are now set to their respective locations in the
* allocated space (fortunately, all variable length information elements
* fall at the end of their respective frames).
* 5a) The length field is set to include the last of the fixed and fixed
* length fields. It may have to be updated for optional or variable
* length information elements.
* 6) Optional and variable length information elements are special cases
* and must be handled individually by the client code.
* --------------------------------------------------------------------
*/
#ifndef _P80211MGMT_H
#define _P80211MGMT_H
#ifndef _WLAN_COMPAT_H
#include <wlan_compat.h>
#endif
#ifndef _P80211HDR_H
#include <p80211hdr.h>
#endif
/*=============================================================*/
/*--- Constants & Macros --------------------------------------*/
/*=============================================================*/
/*== Information Element IDs ====================*/
#define WLAN_EID_SSID 0
#define WLAN_EID_SUPP_RATES 1
#define WLAN_EID_FH_PARMS 2
#define WLAN_EID_DS_PARMS 3
#define WLAN_EID_CF_PARMS 4
#define WLAN_EID_TIM 5
#define WLAN_EID_IBSS_PARMS 6
/*-- values 7-15 reserved --*/
#define WLAN_EID_CHALLENGE 16
/*-- values 17-31 reserved for challenge text extension --*/
/*-- values 32-255 reserved --*/
/*== Reason Codes ===============================*/
#define WLAN_MGMT_REASON_RSVD 0
#define WLAN_MGMT_REASON_UNSPEC 1
#define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2
#define WLAN_MGMT_REASON_DEAUTH_LEAVING 3
#define WLAN_MGMT_REASON_DISASSOC_INACTIVE 4
#define WLAN_MGMT_REASON_DISASSOC_AP_BUSY 5
#define WLAN_MGMT_REASON_CLASS2_NONAUTH 6
#define WLAN_MGMT_REASON_CLASS3_NONASSOC 7
#define WLAN_MGMT_REASON_DISASSOC_STA_HASLEFT 8
#define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9
/*== Status Codes ===============================*/
#define WLAN_MGMT_STATUS_SUCCESS 0
#define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1
#define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10
#define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC 11
#define WLAN_MGMT_STATUS_ASSOC_DENIED_UNSPEC 12
#define WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG 13
#define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ 14
#define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15
#define WLAN_MGMT_STATUS_AUTH_TIMEOUT 16
#define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY 17
#define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18
/*== Capability Field ===========================*/
#define WLAN_GET_MGMT_CAP_INFO_ESS(n) ((n) & BIT0)
#define WLAN_GET_MGMT_CAP_INFO_IBSS(n) (((n) & BIT1) >> 1)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(n) (((n) & BIT2) >> 2)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(n) (((n) & BIT3) >> 3)
#define WLAN_GET_MGMT_CAP_INFO_PRIVACY(n) (((n) & BIT4) >> 4)
#define WLAN_SET_MGMT_CAP_INFO_ESS(n) (n)
#define WLAN_SET_MGMT_CAP_INFO_IBSS(n) ((n) << 1)
#define WLAN_SET_MGMT_CAP_INFO_CFPOLLABLE(n) ((n) << 2)
#define WLAN_SET_MGMT_CAP_INFO_CFPOLLREQ(n) ((n) << 3)
#define WLAN_SET_MGMT_CAP_INFO_PRIVACY(n) ((n) << 4)
/*== Auth Algorithm Field ===========================*/
#define WLAN_AUTH_ALG_OPENSYSTEM 0
#define WLAN_AUTH_ALG_SHAREDKEY 1
/*== Management Frame Field Offsets =============*/
/* Note: Not all fields are listed because of variable lengths, */
/* see the code in p80211.c to see how we search for fields */
/* Note: These offsets are from the start of the frame data */
#define WLAN_BEACON_OFF_TS 0
#define WLAN_BEACON_OFF_BCN_INT 8
#define WLAN_BEACON_OFF_CAPINFO 10
#define WLAN_BEACON_OFF_SSID 12
#define WLAN_DISASSOC_OFF_REASON 0
#define WLAN_ASSOCREQ_OFF_CAP_INFO 0
#define WLAN_ASSOCREQ_OFF_LISTEN_INT 2
#define WLAN_ASSOCREQ_OFF_SSID 4
#define WLAN_ASSOCRESP_OFF_CAP_INFO 0
#define WLAN_ASSOCRESP_OFF_STATUS 2
#define WLAN_ASSOCRESP_OFF_AID 4
#define WLAN_ASSOCRESP_OFF_SUPP_RATES 6
#define WLAN_REASSOCREQ_OFF_CAP_INFO 0
#define WLAN_REASSOCREQ_OFF_LISTEN_INT 2
#define WLAN_REASSOCREQ_OFF_CURR_AP 4
#define WLAN_REASSOCREQ_OFF_SSID 10
#define WLAN_REASSOCRESP_OFF_CAP_INFO 0
#define WLAN_REASSOCRESP_OFF_STATUS 2
#define WLAN_REASSOCRESP_OFF_AID 4
#define WLAN_REASSOCRESP_OFF_SUPP_RATES 6
#define WLAN_PROBEREQ_OFF_SSID 0
#define WLAN_PROBERESP_OFF_TS 0
#define WLAN_PROBERESP_OFF_BCN_INT 8
#define WLAN_PROBERESP_OFF_CAP_INFO 10
#define WLAN_PROBERESP_OFF_SSID 12
#define WLAN_AUTHEN_OFF_AUTH_ALG 0
#define WLAN_AUTHEN_OFF_AUTH_SEQ 2
#define WLAN_AUTHEN_OFF_STATUS 4
#define WLAN_AUTHEN_OFF_CHALLENGE 6
#define WLAN_DEAUTHEN_OFF_REASON 0
/*=============================================================*/
/*--- Types and Structures ------------------------------------*/
/*=============================================================*/
/*== Information Element Types ====================*/
/* prototype structure, all IEs start with these members */
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
} wlan_ie_t;
__WLAN_PRAGMA_PACKDFLT__
/*-- Service Set Identity (SSID) -----------------*/
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_ssid
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 ssid[1] __WLAN_ATTRIB_PACK__; /* may be zero, ptrs may overlap */
} wlan_ie_ssid_t;
__WLAN_PRAGMA_PACKDFLT__
/*-- Supported Rates -----------------------------*/
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_supp_rates
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 rates[1] __WLAN_ATTRIB_PACK__; /* had better be at LEAST one! */
} wlan_ie_supp_rates_t;
__WLAN_PRAGMA_PACKDFLT__
/*-- FH Parameter Set ----------------------------*/
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_fh_parms
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT16 dwell __WLAN_ATTRIB_PACK__;
UINT8 hopset __WLAN_ATTRIB_PACK__;
UINT8 hoppattern __WLAN_ATTRIB_PACK__;
UINT8 hopindex __WLAN_ATTRIB_PACK__;
} wlan_ie_fh_parms_t;
__WLAN_PRAGMA_PACKDFLT__
/*-- DS Parameter Set ----------------------------*/
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_ds_parms
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 curr_ch __WLAN_ATTRIB_PACK__;
} wlan_ie_ds_parms_t;
__WLAN_PRAGMA_PACKDFLT__
/*-- CF Parameter Set ----------------------------*/
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_cf_parms
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 cfp_cnt __WLAN_ATTRIB_PACK__;
UINT8 cfp_period __WLAN_ATTRIB_PACK__;
UINT16 cfp_maxdur __WLAN_ATTRIB_PACK__;
UINT16 cfp_durremaining __WLAN_ATTRIB_PACK__;
} wlan_ie_cf_parms_t;
__WLAN_PRAGMA_PACKDFLT__
/*-- TIM ------------------------------------------*/
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_tim
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 dtim_cnt __WLAN_ATTRIB_PACK__;
UINT8 dtim_period __WLAN_ATTRIB_PACK__;
UINT8 bitmap_ctl __WLAN_ATTRIB_PACK__;
UINT8 virt_bm[1] __WLAN_ATTRIB_PACK__;
} wlan_ie_tim_t;
__WLAN_PRAGMA_PACKDFLT__
/*-- IBSS Parameter Set ---------------------------*/
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_ibss_parms
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT16 atim_win __WLAN_ATTRIB_PACK__;
} wlan_ie_ibss_parms_t;
__WLAN_PRAGMA_PACKDFLT__
/*-- Challenge Text ------------------------------*/
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_challenge
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 challenge[1] __WLAN_ATTRIB_PACK__;
} wlan_ie_challenge_t;
__WLAN_PRAGMA_PACKDFLT__
/*=================================================*/
/*== Frame Types ==================================*/
/* prototype structure, all mgmt frame types will start with these members */
typedef struct wlan_fr_mgmt
{
UINT16 type;
UINT16 len; /* DOES NOT include CRC !!!!*/
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
/*-- info elements ----------*/
} wlan_fr_mgmt_t;
/*-- Beacon ---------------------------------------*/
typedef struct wlan_fr_beacon
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT64 *ts;
UINT16 *bcn_int;
UINT16 *cap_info;
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
wlan_ie_fh_parms_t *fh_parms;
wlan_ie_ds_parms_t *ds_parms;
wlan_ie_cf_parms_t *cf_parms;
wlan_ie_ibss_parms_t *ibss_parms;
wlan_ie_tim_t *tim;
} wlan_fr_beacon_t;
/*-- IBSS ATIM ------------------------------------*/
typedef struct wlan_fr_ibssatim
{
UINT16 type;
UINT16 len;
UINT8* buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
/*-- info elements ----------*/
/* this frame type has a null body */
} wlan_fr_ibssatim_t;
/*-- Disassociation -------------------------------*/
typedef struct wlan_fr_disassoc
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT16 *reason;
/*-- info elements ----------*/
} wlan_fr_disassoc_t;
/*-- Association Request --------------------------*/
typedef struct wlan_fr_assocreq
{
UINT16 type;
UINT16 len;
UINT8* buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT16 *cap_info;
UINT16 *listen_int;
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
} wlan_fr_assocreq_t;
/*-- Association Response -------------------------*/
typedef struct wlan_fr_assocresp
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT16 *cap_info;
UINT16 *status;
UINT16 *aid;
/*-- info elements ----------*/
wlan_ie_supp_rates_t *supp_rates;
} wlan_fr_assocresp_t;
/*-- Reassociation Request ------------------------*/
typedef struct wlan_fr_reassocreq
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT16 *cap_info;
UINT16 *listen_int;
UINT8 *curr_ap;
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
} wlan_fr_reassocreq_t;
/*-- Reassociation Response -----------------------*/
typedef struct wlan_fr_reassocresp
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT16 *cap_info;
UINT16 *status;
UINT16 *aid;
/*-- info elements ----------*/
wlan_ie_supp_rates_t *supp_rates;
} wlan_fr_reassocresp_t;
/*-- Probe Request --------------------------------*/
typedef struct wlan_fr_probereq
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
} wlan_fr_probereq_t;
/*-- Probe Response -------------------------------*/
typedef struct wlan_fr_proberesp
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT64 *ts;
UINT16 *bcn_int;
UINT16 *cap_info;
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
wlan_ie_fh_parms_t *fh_parms;
wlan_ie_ds_parms_t *ds_parms;
wlan_ie_cf_parms_t *cf_parms;
wlan_ie_ibss_parms_t *ibss_parms;
} wlan_fr_proberesp_t;
/*-- Authentication -------------------------------*/
typedef struct wlan_fr_authen
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT16 *auth_alg;
UINT16 *auth_seq;
UINT16 *status;
/*-- info elements ----------*/
wlan_ie_challenge_t *challenge;
} wlan_fr_authen_t;
/*-- Deauthenication -----------------------------*/
typedef struct wlan_fr_deauthen
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
/*-- fixed fields -----------*/
UINT16 *reason;
/*-- info elements ----------*/
} wlan_fr_deauthen_t;
void wlan_mgmt_encode_beacon( wlan_fr_beacon_t *f );
void wlan_mgmt_decode_beacon( wlan_fr_beacon_t *f );
void wlan_mgmt_encode_disassoc( wlan_fr_disassoc_t *f );
void wlan_mgmt_decode_disassoc( wlan_fr_disassoc_t *f );
void wlan_mgmt_encode_assocreq( wlan_fr_assocreq_t *f );
void wlan_mgmt_decode_assocreq( wlan_fr_assocreq_t *f );
void wlan_mgmt_encode_assocresp( wlan_fr_assocresp_t *f );
void wlan_mgmt_decode_assocresp( wlan_fr_assocresp_t *f );
void wlan_mgmt_encode_reassocreq( wlan_fr_reassocreq_t *f );
void wlan_mgmt_decode_reassocreq( wlan_fr_reassocreq_t *f );
void wlan_mgmt_encode_reassocresp( wlan_fr_reassocresp_t *f );
void wlan_mgmt_decode_reassocresp( wlan_fr_reassocresp_t *f );
void wlan_mgmt_encode_probereq( wlan_fr_probereq_t *f );
void wlan_mgmt_decode_probereq( wlan_fr_probereq_t *f );
void wlan_mgmt_encode_proberesp( wlan_fr_proberesp_t *f );
void wlan_mgmt_decode_proberesp( wlan_fr_proberesp_t *f );
void wlan_mgmt_encode_authen( wlan_fr_authen_t *f );
void wlan_mgmt_decode_authen( wlan_fr_authen_t *f );
void wlan_mgmt_encode_deauthen( wlan_fr_deauthen_t *f );
void wlan_mgmt_decode_deauthen( wlan_fr_deauthen_t *f );
#endif /* _P80211MGMT_H */

View file

@ -0,0 +1,321 @@
/* p80211msg.h: Macros, constants, types, and funcs for req and ind messages
* --------------------------------------------------------------------
* Linux WLAN
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
*
* Note: Constant values are always in HOST byte order.
*
* All functions and statics declared here are implemented in p80211msg.c
* --------------------------------------------------------------------
*/
#ifndef _P80211MSG_H
#define _P80211MSG_H
#ifndef _WLAN_COMPAT_H
#include <wlan/wlan_compat.h>
#endif
/*====================================================================*/
/*----- Macros -------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* The following macros are used to manipulate the 'offset' field in */
/* the metadata. These are only used when the metadata is for */
/* command arguments to determine if the data item is required, and */
/* whether the metadata item is for a request command, confirm */
/* command or both. Additionally, there's a macro to get the actual */
/* offset value of the field. */
/*--------------------------------------------------------------------*/
#define ISREQUIRED (0x80000000UL)
#define ISREQUEST (0x40000000UL)
#define ISCONFIRM (0x20000000UL)
#define P80211ITEM_ISREQUIRED(offset) (((UINT32)(offset & ISREQUIRED)) \
>> 31 )
#define P80211ITEM_ISREQUEST(offset) (((UINT32)(offset & ISREQUEST)) \
>> 30 )
#define P80211ITEM_ISCONFIRM(offset) (((UINT32)(offset & ISCONFIRM)) \
>> 29 )
#define P80211ITEM_GET_OFFSET(offset) ( ((UINT32)(offset)) & \
(~(ISREQUIRED | ISREQUEST | \
ISCONFIRM)) )
#define P80211ITEM_MKOFFSET(d, r, c, offset) ( (d|r|c) | ((UINT32)(offset)) )
/*====================================================================*/
/*----- Constants ----------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* Request messages */
/*--------------------------------------------------------------------*/
#define P80211MSG_REQ_MIB_GET 1 /* 802.11 */
#define P80211MSG_REQ_MIB_SET 2 /* 802.11 */
#define P80211MSG_REQ_POWERMGMT 3 /* 802.11 */
#define P80211MSG_REQ_SCAN 4 /* 802.11 */
#define P80211MSG_REQ_JOIN 5 /* 802.11 */
#define P80211MSG_REQ_AUTHENTICATE 6 /* 802.11 */
#define P80211MSG_REQ_DEAUTHENTICATE 7 /* 802.11 */
#define P80211MSG_REQ_ASSOCIATE 8 /* 802.11 */
#define P80211MSG_REQ_REASSOCIATE 9 /* 802.11 */
#define P80211MSG_REQ_DISASSOCIATE 10 /* 802.11 */
#define P80211MSG_REQ_RESET 11 /* 802.11 */
#define P80211MSG_REQ_START 12 /* 802.11 */
/* 13-20 reserved */
/*--------------------------------------------------------------------*/
/* Indication messages */
/*--------------------------------------------------------------------*/
#define P80211MSG_IND_AUTHENTICATE 21 /* 802.11 */
#define P80211MSG_IND_DEAUTHENTICATE 22 /* 802.11 */
#define P80211MSG_IND_ASSOCIATE 23 /* 802.11 */
#define P80211MSG_IND_REASSOCIATE 24 /* 802.11 */
#define P80211MSG_IND_DISASSOCIATE 25 /* 802.11 */
/* 26-40 reserved */
/*--------------------------------------------------------------------*/
/* Confirm messages */
/*--------------------------------------------------------------------*/
/* For now, these are embedded in the REQ messages. Just in case, 41-60 reserved */
/*====================================================================*/
/*----- Types --------------------------------------------------------*/
/*====================================================================*/
/*----- Message Structure Types --------------------------------------*/
/* The following structures are definitions for request/confirm */
/* messages followed by all the indication definitions. */
/*--------------------------------------------------------------------*/
/* Request/Confirm structures */
/*--------------------------------------------------------------------*/
typedef struct p80211msg_req_mib_get
{
UINT32 msgcode;
p80211item_uint32_t mibid;
p80211item_uint32_t resultcode;
p80211item_coll_t mibvalue;
p80211item_uint32_t uint32val;
p80211item_pstr255_t pstrval;
} p80211msg_req_mib_get_t;
typedef struct p80211msg_req_mib_set
{
UINT32 msgcode;
p80211item_uint32_t mibid;
p80211item_uint32_t resultcode;
p80211item_coll_t mibvalue;
p80211item_uint32_t uint32val;
p80211item_pstr255_t pstrval;
} p80211msg_req_mib_set_t;
typedef struct p80211msg_req_powermgmt
{
UINT32 msgcode;
p80211item_uint32_t mode;
p80211item_uint32_t wakeup;
p80211item_uint32_t rxdtims;
p80211item_uint32_t resultcode;
} p80211msg_req_powermgmt_t;
#define MAX_BSSDESC 10
typedef struct p80211msg_req_scan
{
UINT32 msgcode;
p80211item_uint32_t bsstype;
p80211item_pstr6_t bssid;
p80211item_pstr32_t ssid;
p80211item_uint32_t scantype;
p80211item_uint32_t probedelay;
p80211item_pstr14_t channellist;
p80211item_uint32_t minchanneltime;
p80211item_uint32_t maxchanneltime;
p80211item_uint32_t resultcode;
p80211item_bssdesc_t bssdesc[MAX_BSSDESC];
} p80211msg_req_scan_t;
typedef struct p80211msg_req_join
{
UINT32 msgcode;
p80211item_pstr6_t bssid;
p80211item_uint32_t joinfailtimeout;
p80211item_uint32_t basicrate1;
p80211item_uint32_t basicrate2;
p80211item_uint32_t basicrate3;
p80211item_uint32_t basicrate4;
p80211item_uint32_t basicrate5;
p80211item_uint32_t basicrate6;
p80211item_uint32_t basicrate7;
p80211item_uint32_t basicrate8;
p80211item_uint32_t operationalrate1;
p80211item_uint32_t operationalrate2;
p80211item_uint32_t operationalrate3;
p80211item_uint32_t operationalrate4;
p80211item_uint32_t operationalrate5;
p80211item_uint32_t operationalrate6;
p80211item_uint32_t operationalrate7;
p80211item_uint32_t operationalrate8;
p80211item_uint32_t resultcode;
} p80211msg_req_join_t;
typedef struct p80211msg_req_authenticate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
p80211item_uint32_t authtype;
p80211item_uint32_t authfailtimeout;
p80211item_uint32_t resultcode;
} p80211msg_req_authenticate_t;
typedef struct p80211msg_req_deauthenticate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
p80211item_uint32_t reasoncode;
p80211item_uint32_t resultcode;
} p80211msg_req_deauthenticate_t;
typedef struct p80211msg_req_associate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
p80211item_uint32_t assocfailtimeout;
p80211item_uint32_t cfpollable;
p80211item_uint32_t cfpollreq;
p80211item_uint32_t privacy;
p80211item_uint32_t listeninterval;
p80211item_uint32_t resultcode;
} p80211msg_req_associate_t;
typedef struct p80211msg_req_reassociate
{
UINT32 msgcode;
p80211item_pstr6_t newapaddr;
p80211item_uint32_t reassocfailtimeout;
p80211item_uint32_t cfpollable;
p80211item_uint32_t cfpollreq;
p80211item_uint32_t privacy;
p80211item_uint32_t listeninterval;
p80211item_uint32_t resultcode;
} p80211msg_req_reassociate_t;
typedef struct p80211msg_req_disassociate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
p80211item_uint32_t reasoncode;
p80211item_uint32_t resultcode;
} p80211msg_req_disassociate_t;
typedef struct p80211msg_req_reset
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
p80211item_uint32_t setdefaultmib;
p80211item_uint32_t resultcode;
} p80211msg_req_reset_t;
typedef struct p80211msg_req_start
{
UINT32 msgcode;
p80211item_pstr32_t ssid;
p80211item_uint32_t bsstype;
p80211item_uint32_t beaconperiod;
p80211item_uint32_t dtimperiod;
p80211item_uint32_t cfpperiod;
p80211item_uint32_t cfpmaxdur;
p80211item_uint32_t fhdwelltime;
p80211item_uint32_t fhhopset;
p80211item_uint32_t fhhoppattern;
p80211item_uint32_t dschannel;
p80211item_uint32_t ibssatimwin;
p80211item_uint32_t probedelay;
p80211item_uint32_t cfpollable;
p80211item_uint32_t cfpollreq;
p80211item_uint32_t basicrate1;
p80211item_uint32_t basicrate2;
p80211item_uint32_t basicrate3;
p80211item_uint32_t basicrate4;
p80211item_uint32_t basicrate5;
p80211item_uint32_t basicrate6;
p80211item_uint32_t basicrate7;
p80211item_uint32_t basicrate8;
p80211item_uint32_t operationalrate1;
p80211item_uint32_t operationalrate2;
p80211item_uint32_t operationalrate3;
p80211item_uint32_t operationalrate4;
p80211item_uint32_t operationalrate5;
p80211item_uint32_t operationalrate6;
p80211item_uint32_t operationalrate7;
p80211item_uint32_t operationalrate8;
p80211item_uint32_t resultcode;
} p80211msg_req_start_t;
/*--------------------------------------------------------------------*/
/* Indication structures */
/*--------------------------------------------------------------------*/
typedef struct p80211msg_ind_authenticate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
p80211item_uint32_t authtype;
} p80211msg_ind_authenticate_t;
typedef struct p80211msg_ind_deauthenticate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
p80211item_uint32_t reasoncode;
} p80211msg_ind_deauthenticate_t;
typedef struct p80211msg_ind_associate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
} p80211msg_ind_associate_t;
typedef struct p80211msg_ind_reassociate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
} p80211msg_ind_reassociate_t;
typedef struct p80211msg_ind_disassociate
{
UINT32 msgcode;
p80211item_pstr6_t peerstaaddr;
p80211item_uint32_t reasoncode;
} p80211msg_ind_disassociate_t;
/*====================================================================*/
/*----- External Declarations ----------------------------------------*/
/*====================================================================*/
/*----- Function Prototypes ------------------------------------------*/
#endif /* _P80211MSG_H */

View file

@ -0,0 +1,613 @@
/* p80211types.h: Macros, constants, types, and funcs for p80211 data types
* --------------------------------------------------------------------
* Linux WLAN
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
*
* This file declares some of the constants and types used in various
* parts of the linux-wlan system.
*
* Note: Constant values are always in HOST byte order.
*
* All functions and statics declared here are implemented in p80211types.c
* --------------------------------------------------------------------
*/
#ifndef _P80211TYPES_H
#define _P80211TYPES_H
#ifndef _WLAN_COMPAT_H
#include <wlan/wlan_compat.h>
#endif
/*====================================================================*/
/*----- Constants ----------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* p80211 data type codes, used for MIB items and message arguments. */
/* the various metadata structures provide additional information */
/* about these types. */
/*--------------------------------------------------------------------*/
#define P80211_TYPE_OCTETSTR 1 /* pascal array of bytes */
#define P80211_TYPE_DISPLAYSTR 2 /* pascal array of bytes containing ascii */
#define P80211_TYPE_BOUNDEDINT 3 /* UINT32 w/ min and max values */
#define P80211_TYPE_INT 4 /* UINT32 min and max limited by 32 bits */
#define P80211_TYPE_ENUMINT 5 /* UINT32 holding a numeric code that can be mapped to a textual name */
#define P80211_TYPE_COLLECTION 6 /* Data item containing other data items */
#define P80211_TYPE_MIBITEM 7 /* Data item containing a MIB value, requires the MIB DID for conversion and validation */
/*--------------------------------------------------------------------*/
/* p80211 DID field codes for represent access type and is_table */
/* status. */
/*--------------------------------------------------------------------*/
#define P80211DID_ACCESS_READONLY 0
#define P80211DID_ACCESS_READWRITE 1
#define P80211DID_ISTABLE_FALSE 0
#define P80211DID_ISTABLE_TRUE 1
/*--------------------------------------------------------------------*/
/* p80211 enumeration constants. The value to text mappings for */
/* these is in p80211types.c. These defines were generated from the */
/* mappings. */
/*--------------------------------------------------------------------*/
#define P80211ENUM_truth_false 0
#define P80211ENUM_truth_true 1
#define P80211ENUM_powermgmt_active 1
#define P80211ENUM_powermgmt_powersave 2
#define P80211ENUM_bsstype_infrastructure 1
#define P80211ENUM_bsstype_independent 2
#define P80211ENUM_bsstype_any 3
#define P80211ENUM_authalg_opensystem 1
#define P80211ENUM_authalg_sharedkey 2
#define P80211ENUM_phytype_fhss 1
#define P80211ENUM_phytype_dsss 2
#define P80211ENUM_phytype_irbaseband 3
#define P80211ENUM_temptype_commercial 1
#define P80211ENUM_temptype_industrial 2
#define P80211ENUM_regdomain_fcc 16
#define P80211ENUM_regdomain_doc 32
#define P80211ENUM_regdomain_etsi 48
#define P80211ENUM_regdomain_spain 49
#define P80211ENUM_regdomain_france 50
#define P80211ENUM_regdomain_mkk 64
#define P80211ENUM_ccamode_edonly 1
#define P80211ENUM_ccamode_csonly 2
#define P80211ENUM_ccamode_edandcs 4
#define P80211ENUM_diversity_fixedlist 1
#define P80211ENUM_diversity_notsupported 2
#define P80211ENUM_diversity_dynamic 3
#define P80211ENUM_scantype_active 1
#define P80211ENUM_scantype_passive 2
#define P80211ENUM_resultcode_success 1
#define P80211ENUM_resultcode_invalid_parameters 2
#define P80211ENUM_resultcode_not_supported 3
#define P80211ENUM_resultcode_timeout 4
#define P80211ENUM_resultcode_too_many_req 5
#define P80211ENUM_resultcode_refused 6
#define P80211ENUM_resultcode_bss_already 7
#define P80211ENUM_resultcode_invalid_access 8
#define P80211ENUM_reason_unspec_reason 1
#define P80211ENUM_reason_auth_not_valid 2
#define P80211ENUM_reason_deauth_lv_ss 3
#define P80211ENUM_reason_inactivity 4
#define P80211ENUM_reason_ap_overload 5
#define P80211ENUM_reason_class23_err 6
#define P80211ENUM_reason_class3_err 7
#define P80211ENUM_reason_disas_lv_ss 8
#define P80211ENUM_reason_asoc_not_auth 9
#define P80211ENUM_status_successful 0
#define P80211ENUM_status_unspec_failure 1
#define P80211ENUM_status_unsup_cap 10
#define P80211ENUM_status_reasoc_no_asoc 11
#define P80211ENUM_status_fail_other 12
#define P80211ENUM_status_unspt_alg 13
#define P80211ENUM_status_auth_seq_fail 14
#define P80211ENUM_status_chlng_fail 15
#define P80211ENUM_status_auth_timeout 16
#define P80211ENUM_status_ap_full 17
#define P80211ENUM_status_unsup_rate 18
/*--------------------------------------------------------------------*/
/* p80211 maximum length constants for the different pascal strings. */
/*--------------------------------------------------------------------*/
#define MAXLEN_PSTR6 (6) /* pascal array of 6 bytes */
#define MAXLEN_PSTR14 (14) /* pascal array of 14 bytes */
#define MAXLEN_PSTR32 (32) /* pascal array of 32 bytes */
#define MAXLEN_PSTR255 (255) /* pascal array of 255 bytes */
/*====================================================================*/
/*----- Macros -------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* The following macros are used to ensure consistent naming */
/* conventions for all the different metadata lists. */
/*--------------------------------------------------------------------*/
#define MKREQMETANAME(name) p80211meta_ ## req ## _ ## name
#define MKCOLLMETANAME(name) p80211meta_ ## coll ## _ ## name
#define MKINDMETANAME(name) p80211meta_ ## ind ## _ ## name
#define MKMIBMETANAME(name) p80211meta_ ## mib ## _ ## name
#define MKGRPMETANAME(name) p80211meta_ ## grp ## _ ## name
#define MKREQMETASIZE(name) p80211meta_ ## req ## _ ## name ## _ ## size
#define MKCOLLMETASIZE(name) p80211meta_ ## coll ## _ ## name ## _ ## size
#define MKINDMETASIZE(name) p80211meta_ ## ind ## _ ## name ## _ ## size
#define MKMIBMETASIZE(name) p80211meta_ ## mib ## _ ## name ## _ ## size
#define MKGRPMETASIZE(name) p80211meta_ ## grp ## _ ## name ## _ ## size
#define GETMETASIZE(aptr) (**((UINT32**)(aptr)))
/*--------------------------------------------------------------------*/
/* The following ifdef depends on the following defines */
/* P80211_NOINCLUDESTRINGS - ifdef, all metadata name fields */
/* are empty strings */
/*--------------------------------------------------------------------*/
#ifdef P80211_NOINCLUDESTRINGS
#define MKITEMNAME(s) ("")
#else
#define MKITEMNAME(s) (s)
#endif
/*--------------------------------------------------------------------*/
/* The following macro creates a name for an enum */
/*--------------------------------------------------------------------*/
#define MKENUMNAME(name) p80211enum_ ## name
/*--------------------------------------------------------------------*/
/* The following macros are used to construct and deconstruct the */
/* Data ID codes. */
/*--------------------------------------------------------------------*/
#define P80211DID_LSB_SECTION (0)
#define P80211DID_LSB_GROUP (6)
#define P80211DID_LSB_ITEM (12)
#define P80211DID_LSB_INDEX (18)
#define P80211DID_LSB_ISTABLE (26)
#define P80211DID_LSB_ACCESS (27)
#define P80211DID_LSB_TYPE (28)
#define P80211DID_MASK_SECTION (0x0000003fUL)
#define P80211DID_MASK_GROUP (0x0000003fUL)
#define P80211DID_MASK_ITEM (0x0000003fUL)
#define P80211DID_MASK_INDEX (0x000000ffUL)
#define P80211DID_MASK_ISTABLE (0x00000001UL)
#define P80211DID_MASK_ACCESS (0x00000001UL)
#define P80211DID_MASK_TYPE (0x00000007UL)
#define P80211DID_MK(a,m,l) ((((UINT32)(a)) & (m)) << (l))
#define P80211DID_MKSECTION(a) P80211DID_MK(a, \
P80211DID_MASK_SECTION, \
P80211DID_LSB_SECTION )
#define P80211DID_MKGROUP(a) P80211DID_MK(a, \
P80211DID_MASK_GROUP, \
P80211DID_LSB_GROUP )
#define P80211DID_MKITEM(a) P80211DID_MK(a, \
P80211DID_MASK_ITEM, \
P80211DID_LSB_ITEM )
#define P80211DID_MKINDEX(a) P80211DID_MK(a, \
P80211DID_MASK_INDEX, \
P80211DID_LSB_INDEX )
#define P80211DID_MKISTABLE(a) P80211DID_MK(a, \
P80211DID_MASK_ISTABLE, \
P80211DID_LSB_ISTABLE )
#define P80211DID_MKACCESS(a) P80211DID_MK(a, \
P80211DID_MASK_ACCESS, \
P80211DID_LSB_ACCESS )
#define P80211DID_MKTYPE(a) P80211DID_MK(a, \
P80211DID_MASK_TYPE, \
P80211DID_LSB_TYPE )
#define P80211DID_MKID(s,g,i,n,t,a,d) (P80211DID_MKSECTION(s) | \
P80211DID_MKGROUP(g) | \
P80211DID_MKITEM(i) | \
P80211DID_MKINDEX(n) | \
P80211DID_MKISTABLE(t) | \
P80211DID_MKACCESS(a) | \
P80211DID_MKTYPE(d) )
#define P80211DID_GET(a,m,l) ((((UINT32)(a)) >> (l)) & (m))
#define P80211DID_SECTION(a) P80211DID_GET(a, \
P80211DID_MASK_SECTION, \
P80211DID_LSB_SECTION)
#define P80211DID_GROUP(a) P80211DID_GET(a, \
P80211DID_MASK_GROUP, \
P80211DID_LSB_GROUP)
#define P80211DID_ITEM(a) P80211DID_GET(a, \
P80211DID_MASK_ITEM, \
P80211DID_LSB_ITEM)
#define P80211DID_INDEX(a) P80211DID_GET(a, \
P80211DID_MASK_INDEX, \
P80211DID_LSB_INDEX)
#define P80211DID_ISTABLE(a) P80211DID_GET(a, \
P80211DID_MASK_ISTABLE, \
P80211DID_LSB_ISTABLE)
#define P80211DID_ACCESS(a) P80211DID_GET(a, \
P80211DID_MASK_ACCESS, \
P80211DID_LSB_ACCESS)
#define P80211DID_TYPE(a) P80211DID_GET(a, \
P80211DID_MASK_TYPE, \
P80211DID_LSB_TYPE)
/*====================================================================*/
/*----- Types --------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* The following structure types are used for the represenation of */
/* ENUMINT type metadata. */
/*--------------------------------------------------------------------*/
typedef struct p80211enumpair
{
UINT32 val;
char *name;
} p80211enumpair_t;
typedef struct p80211enum
{
INT nitems;
p80211enumpair_t *list;
} p80211enum_t;
/*--------------------------------------------------------------------*/
/* The following structure types are used to store data items in */
/* messages. */
/*--------------------------------------------------------------------*/
/* Maximum pascal string */
typedef struct p80211pstr255
{
UINT8 len;
UINT8 data[MAXLEN_PSTR255];
} p80211pstr255_t;
/* pascal string for macaddress and bssid */
typedef struct p80211pstr6
{
UINT8 len;
UINT8 data[MAXLEN_PSTR6];
} p80211pstr6_t;
/* pascal string for channel list */
typedef struct p80211pstr14
{
UINT8 len;
UINT8 data[MAXLEN_PSTR14];
} p80211pstr14_t;
/* pascal string for ssid */
typedef struct p80211pstr32
{
UINT8 len;
UINT8 data[MAXLEN_PSTR32];
} p80211pstr32_t;
/* prototype template */
typedef struct p80211item
{
UINT32 did;
UINT32 len;
} p80211item_t;
/* message data iteem for COLLECTION */
typedef struct p80211item_coll
{
UINT32 did;
UINT32 len;
} p80211item_coll_t;
/* message data item for INT, BOUNDEDINT, ENUMINT */
typedef struct p80211item_uint32
{
UINT32 did;
UINT32 len;
UINT32 data;
} p80211item_uint32_t;
/* message data item for OCTETSTR, DISPLAYSTR */
typedef struct p80211item_pstr6
{
UINT32 did;
UINT32 len;
p80211pstr6_t data;
}p80211item_pstr6_t;
/* message data item for OCTETSTR, DISPLAYSTR */
typedef struct p80211item_pstr14
{
UINT32 did;
UINT32 len;
p80211pstr14_t data;
}p80211item_pstr14_t;
/* message data item for OCTETSTR, DISPLAYSTR */
typedef struct p80211item_pstr32
{
UINT32 did;
UINT32 len;
p80211pstr32_t data;
}p80211item_pstr32_t;
/* message data item for OCTETSTR, DISPLAYSTR */
typedef struct p80211item_pstr255
{
UINT32 did;
UINT32 len;
p80211pstr255_t data;
}p80211item_pstr255_t;
/* message data item for the collection in the BSSDescription argument */
/* in the SCAN msg */
typedef struct p80211item_coll_bssdesc
{
p80211item_pstr6_t bssid;
p80211item_pstr32_t ssid;
p80211item_uint32_t bsstype;
p80211item_uint32_t beaconperiod;
p80211item_uint32_t dtimperiod;
p80211item_uint32_t timestamp;
p80211item_uint32_t localtime;
p80211item_uint32_t fhdwelltime;
p80211item_uint32_t fhhopset;
p80211item_uint32_t fhhoppattern;
p80211item_uint32_t fhhopindex;
p80211item_uint32_t dschannel;
p80211item_uint32_t cfpcount;
p80211item_uint32_t cfpperiod;
p80211item_uint32_t cfpmaxdur;
p80211item_uint32_t cfpdurremain;
p80211item_uint32_t ibssatimwin;
p80211item_uint32_t cfpollable;
p80211item_uint32_t cfpollreq;
p80211item_uint32_t privacy;
p80211item_uint32_t basicrate1;
p80211item_uint32_t basicrate2;
p80211item_uint32_t basicrate3;
p80211item_uint32_t basicrate4;
p80211item_uint32_t basicrate5;
p80211item_uint32_t basicrate6;
p80211item_uint32_t basicrate7;
p80211item_uint32_t basicrate8;
}p80211item_coll_bssdesc_t;
/* message data item for the BSSDescription argument in the SCAN msg */
typedef struct p80211item_bssdesc
{
UINT32 did;
UINT32 len;
p80211item_coll_bssdesc_t data;
} p80211item_bssdesc_t;
/*--------------------------------------------------------------------*/
/* The following structure type is used to represent all of the */
/* metadata items. Some components may choose to use more, less or */
/* different metadata items. */
/*--------------------------------------------------------------------*/
typedef struct p80211meta
{
char *name; /* data item name */
UINT32 did; /* partial did */
UINT32 msgoffset; /* offset of this item in data item structure */
UINT32 min; /* min value of a BOUNDEDINT */
UINT32 max; /* max value of a BOUNDEDINT */
UINT32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */
p80211enum_t *enumptr; /* ptr to the enum type for ENUMINT */
struct p80211meta *collptr; /* ptr to array of COLLECTION subitems */
void (*totextptr)(void); /* ptr to totext conversion function */
void (*fromtextptr)(void); /* ptr to totext conversion function */
void (*validfunptr)(void); /* ptr to totext conversion function */
} p80211meta_t;
/*====================================================================*/
/*----- External Declarations ----------------------------------------*/
/*--------------------------------------------------------------------*/
/* Enumeration Lists */
/* The following are the external declarations for all enumerations */
/*--------------------------------------------------------------------*/
extern p80211enum_t MKENUMNAME(truth);
extern p80211enum_t MKENUMNAME(