Home | History | Annotate | Download | only in Connection_Managment
      1 /*
      2  * admCtrlWpa.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 admCtrlWpa.h
     35  *  \brief Admission control API
     36  *
     37  *  \see admCtrl.c
     38  */
     39 
     40 /****************************************************************************
     41  *                                                                          *
     42  *   MODULE:  Admission Control	    		                                *
     43  *   PURPOSE: Admission Control Module API                              	*
     44  *                                                                          *
     45  ****************************************************************************/
     46 
     47 #ifndef _ADM_CTRL_WPA_H_
     48 #define _ADM_CTRL_WPA_H_
     49 
     50 /* Constants */
     51 
     52 /* Enumerations */
     53 
     54 /* Typedefs */
     55 
     56 
     57 /* RSN admission control prototypes */
     58 
     59 
     60 /* Structures */
     61 
     62 
     63 
     64 #define MAX_WPA_UNICAST_SUITES        (TWD_CIPHER_CKIP+1)
     65 
     66 #define WPA_OUI_MAX_VERSION           0x1
     67 #define WPA_OUI_DEF_TYPE              0x1
     68 #define WPA_OUI_MAX_TYPE			  0x2
     69 
     70 #define WPA_GROUP_4_UNICAST_CAPABILITY_MASK  	0x0002
     71 #define WPA_REPLAY_COUNTERS_CAPABILITY_MASK 	0x000c
     72 #define WPA_REPLAY_GROUP4UNI_CAPABILITY_SHIFT 	1
     73 #define WPA_REPLAY_COUNTERS_CAPABILITY_SHIFT 	2
     74 
     75 #define WPA_IE_MIN_LENGTH 				 	6
     76 #define WPA_IE_GROUP_SUITE_LENGTH 		 	10
     77 #define WPA_IE_MIN_PAIRWISE_SUITE_LENGTH 	16
     78 #define WPA_IE_MIN_DEFAULT_LENGTH 			24
     79 #define WPA_IE_MIN_KEY_MNG_SUITE_LENGTH(pairwiseCnt) (18+4*pairwiseCnt)
     80 
     81 typedef enum
     82 {
     83 	WPA_IE_KEY_MNG_NONE				= 0,		/**< no key management available */
     84 	WPA_IE_KEY_MNG_801_1X			= 1,		/**< "802.1X" key management - WPA default*/
     85 	WPA_IE_KEY_MNG_PSK_801_1X		= 2,		/**< "WPA PSK */
     86 	WPA_IE_KEY_MNG_CCKM			    = 3,		/**< WPA CCKM */
     87 	WPA_IE_KEY_MNG_NA			    = 4			/**< NA */
     88 } keyMngSuite_e;
     89 
     90 
     91 #define	MAX_WPA_KEY_MNG_SUITES   	(WPA_IE_KEY_MNG_CCKM+1)
     92 
     93 
     94 typedef struct
     95 {
     96 
     97 	TI_UINT8  				elementid;	   /* WPA information element id is 0xDD */
     98 	TI_UINT8  				length;
     99     TI_UINT8  				oui[DOT11_OUI_LEN];
    100 	TI_UINT8  				ouiType;
    101     TI_UINT16 				version;
    102     TI_UINT8 				groupSuite[DOT11_OUI_LEN+1];
    103     TI_UINT16 				pairwiseSuiteCnt;
    104 	TI_UINT8				pairwiseSuite[DOT11_OUI_LEN+1];
    105 	TI_UINT16 				authKeyMngSuiteCnt;
    106 	TI_UINT8				authKeyMngSuite[DOT11_OUI_LEN+1];
    107     TI_UINT16				capabilities;
    108 } wpaIePacket_t;
    109 
    110 
    111 /* WPA capabilities structure */
    112 typedef struct
    113 {
    114     ECipherSuite 		broadcastSuite;
    115     TI_UINT16 			unicastSuiteCnt;
    116 	ECipherSuite		unicastSuite[MAX_WPA_UNICAST_SUITES];
    117 	TI_UINT16 			KeyMngSuiteCnt;
    118 	ERsnKeyMngSuite	    KeyMngSuite[MAX_WPA_KEY_MNG_SUITES];
    119     TI_UINT8			bcastForUnicatst;
    120 	TI_UINT8			replayCounters;
    121     TI_BOOL             XCCKp;
    122     TI_BOOL             XCCMic;
    123 
    124 } wpaIeData_t;
    125 
    126 
    127 /* External data definitions */
    128 
    129 /* External functions definitions */
    130 
    131 /* Function prototypes */
    132 
    133 TI_STATUS admCtrlWpa_getInfoElement(admCtrl_t *pAdmCtrl, TI_UINT8 *pIe, TI_UINT32 *pLength);
    134 
    135 TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, TRsnData *pRsnData, TI_UINT8 *pAssocIe, TI_UINT8 *pAssocIeLen);
    136 
    137 TI_STATUS admCtrlWpa_evalSite(admCtrl_t *pAdmCtrl, TRsnData *pRsnData, TRsnSiteParams *pRsnSiteParams, TI_UINT32 *pEvaluation);
    138 
    139 #endif /*  _ADM_CTRL_WPA_H_*/
    140 
    141