1 /** \file keyParserWep.h 2 * \brief WEP Key PArser Header file 3 * 4 * \see keyParser.h 5 */ 6 7 /**************************************************************************** 8 **+-----------------------------------------------------------------------+** 9 **| |** 10 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |** 11 **| All rights reserved. |** 12 **| |** 13 **| Redistribution and use in source and binary forms, with or without |** 14 **| modification, are permitted provided that the following conditions |** 15 **| are met: |** 16 **| |** 17 **| * Redistributions of source code must retain the above copyright |** 18 **| notice, this list of conditions and the following disclaimer. |** 19 **| * Redistributions in binary form must reproduce the above copyright |** 20 **| notice, this list of conditions and the following disclaimer in |** 21 **| the documentation and/or other materials provided with the |** 22 **| distribution. |** 23 **| * Neither the name Texas Instruments nor the names of its |** 24 **| contributors may be used to endorse or promote products derived |** 25 **| from this software without specific prior written permission. |** 26 **| |** 27 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |** 28 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |** 29 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |** 30 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |** 31 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |** 32 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |** 33 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |** 34 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |** 35 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |** 36 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |** 37 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |** 38 **| |** 39 **+-----------------------------------------------------------------------+** 40 ****************************************************************************/ 41 42 /***************************************************************************/ 43 /* */ 44 /* MODULE: keyParserWep.h */ 45 /* PURPOSE: WEP key parser */ 46 /* */ 47 /***************************************************************************/ 48 49 #ifndef _KEY_PARSER_WEP_H 50 #define _KEY_PARSER_WEP_H 51 52 #include "fsm.h" 53 #include "keyParser.h" 54 55 /* Constants */ 56 #define MAX_WEP_KEY_DATA_LENGTH 32 57 58 #define WEP_KEY_TRANSMIT_MASK 0x80000000 /*< bit 31 of key index field */ 59 #define WEP_KEY_PER_CLIENT_MASK 0x40000000 /*< bit 30 of key index field */ 60 #define WEP_KEY_REMAIN_BITS_MASK 0x3FFFFF00 /*< bits 8-29 of key index field */ 61 62 63 64 #define WEP_KEY_LEN_40 5 /* 40 bit (5 byte) key */ 65 #define WEP_KEY_LEN_104 13 /* 104 bit (13 byte) key */ 66 #define WEP_KEY_LEN_232 29 /* 232 bit (29 byte) key */ 67 68 69 /* Enumerations */ 70 71 /* Typedefs */ 72 #pragma pack(1) 73 typedef struct 74 { 75 UINT32 Length; /* The length of the whole structure */ 76 UINT32 KeyIndex; /* The key index to add or remove */ 77 UINT32 KeyLength; /* The length of the key data */ 78 UINT8 KeyData [MAX_WEP_KEY_DATA_LENGTH]; /* WEP key data */ 79 } keyParserWep_keyDesc_t; 80 #pragma pack() 81 82 83 /* External data definitions */ 84 85 /* External functions definitions */ 86 87 /* Function prototypes */ 88 89 TI_STATUS keyParserWep_config(struct _keyParser_t *pKeyParser); 90 91 TI_STATUS keyParserWep_recv(struct _keyParser_t *pKeyParser, 92 UINT8 *pPacket, UINT32 packetLen); 93 94 TI_STATUS keyParserWep_remove(struct _keyParser_t *pKeyParser, UINT8 *pKeyData, UINT32 keyDataLen); 95 96 #endif /*_KEY_PARSER_WEP_H*/ 97 98