Home | History | Annotate | Download | only in rsn
      1 /** \file keyParserExternal.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:	keyParserExternal.h											   */
     45 /*    PURPOSE:	External key parser											   */
     46 /*																	 	   */
     47 /***************************************************************************/
     48 
     49 #ifndef _KEY_PARSER_EXTERNAL_H
     50 #define _KEY_PARSER_EXTERNAL_H
     51 
     52 #include "fsm.h"
     53 #include "keyParser.h"
     54 
     55 /* Constants */
     56 #define MAX_EXT_KEY_DATA_LENGTH   32
     57 
     58 
     59 #define EXT_KEY_TRANSMIT_MASK				0x80000000		/*< bit 31 of key index field */
     60 #define EXT_KEY_PAIRWISE_GROUP_MASK			0x40000000		/*< bit 30 of key index field */
     61 #define EXT_KEY_RSC_KEY_MASK				0x20000000		/*< bit 29 of key index field */
     62 #define EXT_KEY_SUPP_AUTHENTICATOR_MASK		0x10000000		/*< bit 28 of key index field */
     63 #define EXT_KEY_REMAIN_BITS_MASK			0x0FFFFF00		/*< remaining 20 bits in external key index */
     64 
     65 #define WEP_KEY_LEN_40	 5  /* 40 bit (5 byte) key */
     66 #define WEP_KEY_LEN_104	 13 /* 104 bit (13 byte) key */
     67 #define WEP_KEY_LEN_232	 29 /* 232 bit (29 byte) key */
     68 
     69 
     70 /* Enumerations */
     71 
     72 /* Typedefs */
     73 
     74 
     75 
     76 
     77 typedef struct
     78 {
     79 	UINT32		Length;						    		/* The length of the whole structure */
     80 	UINT32		KeyIndex;								/* The key index to add or remove */
     81 	UINT8		macAddress[MAC_ADDR_LEN];	/**< Remote station MAC address*/
     82 } keyParserExternal_keyRemoveDesc_t;
     83 
     84 /* External data definitions */
     85 
     86 /* External functions definitions */
     87 
     88 /* Function prototypes */
     89 
     90 TI_STATUS keyParserExternal_config(struct _keyParser_t *pKeyParser);
     91 
     92 TI_STATUS keyParserExternal_recv(struct _keyParser_t *pKeyParser,
     93 						  UINT8 *pPacket, UINT32 packetLen);
     94 
     95 TI_STATUS keyParserExternal_remove(struct _keyParser_t *pKeyParser, UINT8 *pKeyData, UINT32 keyDataLen);
     96 
     97 #endif /*_KEY_PARSER_EXTERNAL_H*/
     98 
     99