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