http://www.hht-eu.com/pls/hht/docs/F3140/bcm963xx_Speedport500V.0.09.04L.300L01.V27_c...
[bcm963xx.git] / userapps / broadcom / cfm / inc / wldefs.h
1 /*****************************************************************************
2 //
3 //  Copyright (c) 2000-2002  Broadcom Corporation
4 //  All Rights Reserved
5 //  No portions of this material may be reproduced in any form without the
6 //  written permission of:
7 //          Broadcom Corporation
8 //          16215 Alton Parkway
9 //          Irvine, California 92619
10 //  All information contained in this document is Broadcom Corporation
11 //  company private, proprietary, and trade secret.
12 //
13 ******************************************************************************
14 //
15 //  Filename:       wldefs.h
16 //  Author:         Peter T. Tran
17 //  Creation Date:  10/17/02
18 //
19 ******************************************************************************
20 //  Description:
21 //      Define the WlDefs functions.
22 //
23 *****************************************************************************/
24
25 #ifndef __WL_DEFS_H__
26 #define __WL_DEFS_H__
27
28 /********************** Include Files ***************************************/
29
30 #include <stdio.h>
31 #include <netinet/in.h>
32
33 /********************** Global Constants ************************************/
34
35 #define WL_SIZE_2_MAX    2  
36 #define WL_SIZE_4_MAX    4  
37 #define WL_SIZE_8_MAX    8  
38 #define WL_SM_SIZE_MAX   16
39 #define WL_MID_SIZE_MAX  32
40 #define WL_SSID_SIZE_MAX 48
41 #define WL_WPA_PSK_SIZE_MAX  72  // max 64 hex or 63 char
42 #define WL_RADIUS_KEY_SIZE_MAX  88 // max is 80, limited by nas_wksp.h.  IAS allow up to 128 char
43 #define WL_LG_SIZE_MAX   1024
44 #define WL_KEY_NUM       4
45 #define WL_WDS_NUM       4
46 #define WL_MIN_FRAGMENTATION_THRESHOLD  256
47 #define WL_MAX_FRAGMENTATION_THRESHOLD  2346
48 #define WL_MIN_RTS_THRESHOLD            0
49 #define WL_MAX_RTS_THRESHOLD            2347
50 #define WL_MIN_DTIM                     1
51 #define WL_MAX_DTIM                     255
52 #define WL_MIN_BEACON_INTERVAL          1
53 #define WL_MAX_BEACON_INTERVAL          65535
54 #define WL_KEY64_SIZE_HEX               10
55 #define WL_KEY64_SIZE_CHAR              5
56 #define WL_KEY128_SIZE_HEX              26
57 #define WL_KEY128_SIZE_CHAR             13
58
59 #define WL_FLT_MAC_OFF   "disabled"             //macfilter disabled
60 #define WL_FLT_MAC_ALLOW "allow"
61 #define WL_FLT_MAC_DENY  "deny"
62
63 #define WL_BRIDGE_RESTRICT_ENABLE      0
64 #define WL_BRIDGE_RESTRICT_ENABLE_SCAN  1
65 #define WL_BRIDGE_RESTRICT_DISABLE      2
66
67 /* authentication mode */
68 #define WL_AUTH_OPEN                    "open"
69 #define WL_AUTH_SHARED                  "shared"        //equals to wep, set wep key
70 #define WL_AUTH_RADIUS                  "radius"        //must have wep enabled
71 #define WL_AUTH_WPA                     "wpa"
72 #define WL_AUTH_WPA_PSK                 "psk"
73 #define WL_AUTH_WPA2                    "wpa2"
74 #define WL_AUTH_WPA2_PSK                "psk2"
75 #define WL_AUTH_WPA2_MIX                "wpa2mix"
76 #define WL_AUTH_WPA2_PSK_MIX    "psk2mix"
77 #ifndef BCMWPA2
78 #define WL_WPA_AUTH_DISABLED            0x00ff  /* Legacy (i.e., non-WPA) */
79 #define WL_WPA_AUTH_NONE                        0x0000  /* none (IBSS) */
80 #define WL_WPA_AUTH_UNSPECIFIED         0x0001  /* over 802.1x */
81 #define WL_WPA_AUTH_PSK                         0x0002  /* Pre-shared key */
82 #define WPA_AUTH_8021X                          0x0020          /* 802.1x, reserved */
83 #define WL_WPA2_AUTH_UNSPECIFIED        WL_WPA_AUTH_UNSPECIFIED /* over 802.1x */
84 #define WL_WPA2_AUTH_PSK                        WL_WPA_AUTH_PSK         /* Pre-shared key */
85 #else
86 #define WL_WPA_AUTH_DISABLED            0x0000  /* Legacy (i.e., non-WPA) */
87 #define WL_WPA_AUTH_NONE                        0x0001  /* none (IBSS) */
88 #define WL_WPA_AUTH_UNSPECIFIED         0x0002  /* over 802.1x */
89 #define WL_WPA_AUTH_PSK                         0x0004  /* Pre-shared key */
90 #define WL_WPA_AUTH_8021X                       0x0020  /* 802.1x, reserved */
91 #define WL_WPA2_AUTH_UNSPECIFIED        0x0040  /* over 802.1x */
92 #define WL_WPA2_AUTH_PSK                        0x0080  /* Pre-shared key */
93 #endif
94
95 /* wireless security bitvec */
96 #define WEP_ENABLED      1
97 #define TKIP_ENABLED     2
98 #define AES_ENABLED      4
99 #define WSEC_SWFLAG      8
100
101 #define WL_BIT_KEY_128   1
102 #define WL_BIT_KEY_64    0
103
104 #define WL_PHY_TYPE_A    "a"
105 #define WL_PHY_TYPE_B    "b"
106 #define WL_PHY_TYPE_G    "g"
107
108 #define WL_BASIC_RATE_DEFAULT    "default"
109 #define WL_BASIC_RATE_ALL        "all"
110 #define WL_BASIC_RATE_1_2        "12"
111
112 #define WL_MODE_G_AUTO           0 //1 auto
113 #define WL_MODE_G_PERFORMANCE    1 //4 performance
114 #define WL_MODE_G_LRS            2 //5 lrs
115 #define WL_MODE_B_ONLY           3 //0 802.11b
116
117 #define WL_AUTO                  "auto"
118 #define WL_OFF                   "off"
119 #define WL_ON                    "on"
120 #define WL_DISABLED              "disabled"
121 #define WL_ENABLED               "enabled"
122
123 #define WL_WME_ON                               1 
124 #define WL_WME_OFF                              0
125
126 #define WL_PREAUTH_ON                   1
127 #define WL_PREAUTH_OFF                  0
128
129 #define BAND_A                   1
130 #define BAND_B                   2
131
132 #define WIRELESS_APPID          "WirelessCfg"
133 #define WL_VARS_ID              1
134 #define WL_FLT_MAC_NUM_ID       2
135 #define WL_FLT_MAC_TBL_ID       3
136 #define WL_WDS_MAC_NUM_ID       4
137 #define WL_WDS_MAC_TBL_ID       5
138 #define WL_SCAN_WDS_MAC_NUM_ID  6
139 #define WL_SCAN_WDS_MAC_TBL_ID  7
140 #define WL_RADIUS_USER_NUM_ID   8
141 #define WL_RADIUS_USER_TBL_ID   9
142 //#define WL_SCAN_WDS_NUM_ID    6
143 //#define WL_SCAN_WDS_TBL_ID    7
144
145
146 #define WL_SCAN_WDS_MAX 10
147 /********************** Global Structs ****************************************/
148
149 typedef enum {
150    WL_STS_OK = 0,
151    WL_STS_ERR_GENERAL,
152    WL_STS_ERR_MEMORY,
153    WL_STS_ERR_OBJECT_NOT_FOUND
154 } WL_STATUS;
155
156 typedef enum {
157    WL_SETUP_ALL = 0,
158    WL_SETUP_BASIC,
159    WL_SETUP_SECURITY,
160    WL_SETUP_MAC_FILTER,
161    WL_SETUP_WDS,
162    WL_SETUP_ADVANCED
163 } WL_SETUP_TYPE;
164
165 typedef struct {
166    char wlSsid[WL_SSID_SIZE_MAX];
167    char wlCountry[WL_SM_SIZE_MAX];
168    char wlKeys128[WL_KEY_NUM][WL_MID_SIZE_MAX];
169    char wlKeys64[WL_KEY_NUM][WL_SM_SIZE_MAX];
170    char wlPreambleType[WL_SM_SIZE_MAX];
171    char wlWpaPsk[WL_WPA_PSK_SIZE_MAX];
172    char mix_wlWpaPsk[WL_WPA_PSK_SIZE_MAX];
173    char wlRadiusKey[WL_RADIUS_KEY_SIZE_MAX];
174    char wlWep[WL_SM_SIZE_MAX];
175    char wlWpa[WL_SM_SIZE_MAX];
176    char wlWds[WL_WDS_NUM][WL_MID_SIZE_MAX];
177    char wlMode[WL_SM_SIZE_MAX];
178    char wlFltMacMode[WL_SM_SIZE_MAX];
179    char wlPhyType[WL_SIZE_2_MAX];
180    char wlBasicRate[WL_SIZE_8_MAX];
181    char wlProtection[WL_SIZE_8_MAX];
182    char wlAfterBurnerEn[WL_SIZE_8_MAX];
183    char wlFrameBurst[WL_SIZE_4_MAX];
184    char wlWlanIfName[WL_SIZE_4_MAX];
185    char wlAuthMode[WL_SIZE_8_MAX];
186    struct in_addr wlRadiusServerIP;
187    int  wlCoreRev;
188    int  wlWpaGTKRekey;
189    int  wlRadiusPort;
190    int  wlAuth;
191    int  wlHide;
192    int  wlEnbl;
193    int  wlKeyMode ;     // 0: ASCII ; 1: HEX
194    int  wlKeyIndex128;
195    int  wlKeyIndex64;
196    int  wlChannel;
197    int  wlFrgThrshld;
198    int  wlRtsThrshld;
199    int  wlDtmIntvl;
200    int  wlBcnIntvl;
201    int  wlKeyBit;
202    long wlRate;
203    int  wlgMode;
204    int  wlLazyWds;
205    int  wlAPIsolation;
206    int  wlBand;
207    int  wlMCastRate;
208    int  ezc_version;
209    int  ezc_enable;
210    int  is_default;
211    int  is_modified;
212    int  wlInfra;
213    int  wlAntDiv;
214    int  wlWme;
215    int  wlWmeNoAck;
216    int  wlPreauth;
217    int  wlNetReauth;
218
219    int  wlRepeaterEnbl ; // add by eric
220    char mix_wlRadiusKey[WL_RADIUS_KEY_SIZE_MAX] ;
221    struct in_addr mix_wlRadiusServerIP ;
222    int  mix_wlRadiusPort;
223    int  wlEnblRadius ;
224    int  wlEnblInternal ;
225    int  wlIdleTimeout ;
226    int  wlAuthRenewIntvl ;
227    int  wlAuthBlockoutIntvl ;
228    char wlNASId[WL_MID_SIZE_MAX] ;
229    char mix_wlNASId[WL_MID_SIZE_MAX];
230    int  wlBasicSpeed;
231    int  wlTxPwr ;
232 } WIRELESS_VAR, *PWIRELESS_VAR;
233
234 typedef struct {
235    char *varName;
236    char *varValue;
237 } WIRELESS_ITEM, *PWIRELESS_ITEM;
238
239 typedef struct {
240    char macAddress[16];
241    char pcName[32] ;
242    int  isActive;
243    int  index ;
244 } WL_FLT_MAC_ENTRY, *PWL_FLT_MAC_ENTRY;
245
246 typedef struct { // don't want store ssid
247    char macAddress[WL_MID_SIZE_MAX];
248 } WL_FLT_MAC_STORE_ENTRY, *PWL_FLT_MAC_STORE_ENTRY;
249
250 typedef struct {
251    char macAddress[WL_MID_SIZE_MAX];
252    char associated;
253    char authorized;
254 } WL_STATION_LIST_ENTRY, *PWL_STATION_LIST_ENTRY;
255
256 /* add by eric */
257 typedef struct {
258    char wdsMac[WL_MID_SIZE_MAX];
259    char wdsSsid[WL_SSID_SIZE_MAX];
260    char wdsType[WL_SM_SIZE_MAX];
261    int  wdsRssi ;
262    int  wdsChannel ;
263    int  wdsSelected;
264 } WL_WDS_MAC_ENTRY, *PWL_WDS_MAC_ENTRY;
265 /* add by eric end */
266
267 #endif