1981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* 2981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * keyParserExternal.h 3981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 4981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved. 5981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * All rights reserved. 6981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 7981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * Redistribution and use in source and binary forms, with or without 8981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * modification, are permitted provided that the following conditions 9981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * are met: 10981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 11981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * * Redistributions of source code must retain the above copyright 12981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * notice, this list of conditions and the following disclaimer. 13981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * * Redistributions in binary form must reproduce the above copyright 14981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * notice, this list of conditions and the following disclaimer in 15981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * the documentation and/or other materials provided with the 16981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * distribution. 17981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * * Neither the name Texas Instruments nor the names of its 18981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * contributors may be used to endorse or promote products derived 19981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * from this software without specific prior written permission. 20981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 21981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt */ 33981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 34981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/** \file keyParserExternal.h 35981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * \brief WEP Key PArser Header file 36981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * 37981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * \see keyParser.h 38981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt */ 39981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 40981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 41981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/***************************************************************************/ 42981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* */ 43981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* MODULE: keyParserExternal.h */ 44981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* PURPOSE: External key parser */ 45981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* */ 46981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/***************************************************************************/ 47981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 48981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#ifndef _KEY_PARSER_EXTERNAL_H 49981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define _KEY_PARSER_EXTERNAL_H 50981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 51981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "fsm.h" 52981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "keyParser.h" 53981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 54981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* Constants */ 55981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define MAX_EXT_KEY_DATA_LENGTH 32 56981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 57981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 58981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define EXT_KEY_TRANSMIT_MASK 0x80000000 /*< bit 31 of key index field */ 59981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define EXT_KEY_PAIRWISE_GROUP_MASK 0x40000000 /*< bit 30 of key index field */ 60981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define EXT_KEY_RSC_KEY_MASK 0x20000000 /*< bit 29 of key index field */ 61981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define EXT_KEY_SUPP_AUTHENTICATOR_MASK 0x10000000 /*< bit 28 of key index field */ 62981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define EXT_KEY_REMAIN_BITS_MASK 0x0FFFFF00 /*< remaining 20 bits in external key index */ 63981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 64981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define WEP_KEY_LEN_40 5 /* 40 bit (5 byte) key */ 65981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define WEP_KEY_LEN_104 13 /* 104 bit (13 byte) key */ 66981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define WEP_KEY_LEN_232 29 /* 232 bit (29 byte) key */ 67981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 68981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 69981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* Enumerations */ 70981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 71981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* Typedefs */ 72981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 73981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 74981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 75981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 76981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidttypedef struct 77981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt{ 78981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt TI_UINT32 Length; /* The length of the whole structure */ 79981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt TI_UINT32 KeyIndex; /* The key index to add or remove */ 80981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt TI_UINT8 macAddress[MAC_ADDR_LEN]; /**< Remote station MAC address*/ 81981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt} keyParserExternal_keyRemoveDesc_t; 82981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 83981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* External data definitions */ 84981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 85981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* External functions definitions */ 86981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 87981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/* Function prototypes */ 88981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 89981801b95b81e6d1c7a2085967406e86af0f08fcDmitry ShmidtTI_STATUS keyParserExternal_config(struct _keyParser_t *pKeyParser); 90981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 91981801b95b81e6d1c7a2085967406e86af0f08fcDmitry ShmidtTI_STATUS keyParserExternal_recv(struct _keyParser_t *pKeyParser, 92981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt TI_UINT8 *pPacket, TI_UINT32 packetLen); 93981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 94981801b95b81e6d1c7a2085967406e86af0f08fcDmitry ShmidtTI_STATUS keyParserExternal_remove(struct _keyParser_t *pKeyParser, TI_UINT8 *pKeyData, TI_UINT32 keyDataLen); 95981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 96981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#endif /*_KEY_PARSER_EXTERNAL_H*/ 97981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt 98