Home | History | Annotate | Download | only in inc
      1 /** \file assocSM.h
      2  *  \brief 802.11 Association SM
      3  *
      4  *  \see assocSM.c
      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: assocSM.h                                                  */
     45 /*    PURPOSE:  802.11 Association SM                                      */
     46 /*                                                                         */
     47 /***************************************************************************/
     48 
     49 #ifndef _RSN_H
     50 #define _RSN_H
     51 
     52 #include "rsnApi.h"
     53 #include "memMngrEx.h"
     54 #include "paramOut.h"
     55 #include "siteHash.h"
     56 
     57 /* Constants */
     58 
     59 #define RSN_MAX_NUMBER_OF_EVENTS        6
     60 #define RSN_MAX_NUMBER_OF_BANNED_SITES  16
     61 #define RSN_MIC_FAILURE_REPORT_WAIT     500
     62 #define RSN_MIC_FAILURE_TIMEOUT         (60000 + RSN_MIC_FAILURE_REPORT_WAIT)
     63 #define RSN_MAIN_KEYS_SESSION_TIMEOUT   RSN_AUTH_FAILURE_TIMEOUT
     64 #define RSN_MIC_FAILURE_RE_KEY          3000
     65 
     66 /* Enumerations */
     67 typedef enum
     68 {
     69     MIC_FAILURE_FALSE,
     70     MIC_FAILURE_TRUE,
     71     MIC_FAILURE_BLOCK
     72 } rsn_micFailureStatus_e;
     73 
     74 typedef enum
     75 {
     76     GROUP_KEY_UPDATE_FALSE,
     77     GROUP_KEY_UPDATE_TRUE
     78 } rsn_groupKeyUpdate_e;
     79 
     80 /* Typedefs */
     81 typedef struct _rsn_t   rsn_t;
     82 
     83 typedef TI_STATUS (*rsn_eventCallback_t)(void* pCtx, void *pData);
     84 typedef TI_STATUS (*rsn_setPaeConfig_t)(rsn_t *pRsn, rsn_paeConfig_t *pPaeConfig);
     85 typedef TI_STATUS (*rsn_getNetworkMode_t)(rsn_t *pRsn, rsn_networkMode_t *pNetMode);
     86 
     87 typedef TI_STATUS (*rsn_setKey_t)(rsn_t *pMainSec, securityKeys_t *pKey);
     88 typedef TI_STATUS (*rsn_removeKey_t)(rsn_t *pMainSec, securityKeys_t *pKey);
     89 typedef TI_STATUS (*rsn_setDefaultKeyId_t)(rsn_t *pMainSec, UINT8 keyId);
     90 typedef TI_STATUS (*rsn_reportStatus_t)(rsn_t *pRsn, TI_STATUS rsnStatus);
     91 typedef TI_STATUS (*rsn_sendEapol_t)(rsn_t *pRsn, UINT8 *pPacket, UINT32 length);
     92 typedef TI_STATUS (*rsn_recvEapol_t)(rsn_t *pRsn, mem_MSDU_T *pMsdu);
     93 typedef TI_STATUS (*rsn_getSiteEntry_t)(rsn_t *pRsn, macAddress_t *macAddress, siteEntry_t *curSiteEntry);
     94 
     95 typedef struct
     96 {
     97     rsn_eventCallback_t     eventFunc;
     98     void                    *pCtx;
     99 } rsn_eventStruct_t;
    100 
    101 typedef struct
    102 {
    103     char                id[MAX_IDENTITY_LEN];           /**< User identity string */
    104     UINT8               idLength;                       /**< User identity string length */
    105     char                password[MAX_PASSWD_LEN];       /**< User password string */
    106     UINT8               pwdLength;                      /**< User password string length */
    107 } authIdentity_t;
    108 
    109 typedef struct
    110 {
    111     rsn_siteBanLevel_e      banLevel;
    112     UINT32                  banStartedMs;
    113     UINT32                  banDurationMs;
    114     macAddress_t            siteBssid;
    115 } rsn_siteBanEntry_t;
    116 
    117 struct _rsn_t
    118 {
    119     rsn_eventStruct_t       events[RSN_MAX_NUMBER_OF_EVENTS];
    120     rsn_paeConfig_t         paeConfig;
    121     BOOL                    PrivacyOptionImplemented;
    122 
    123     securityKeys_t          keys[MAX_KEYS_NUM];
    124     BOOL                    keys_en [MAX_KEYS_NUM];
    125     UINT8                   defaultKeyId;
    126     BOOL                    defaultKeysOn;
    127     BOOL                    wepDefaultKeys[MAX_KEYS_NUM];
    128     BOOL                    wepStaticKey;
    129     rsn_groupKeyUpdate_e    groupKeyUpdate;
    130     OS_802_11_EAP_TYPES     eapType;
    131 
    132     rsn_siteBanEntry_t      bannedSites[RSN_MAX_NUMBER_OF_BANNED_SITES];
    133     UINT8                   numOfBannedSites;
    134 
    135     TI_HANDLE               micFailureReportWaitTimer;
    136     TI_HANDLE               micFailureReKeyTimer;
    137 
    138     struct _admCtrl_t       *pAdmCtrl;
    139     struct _mainSec_t       *pMainSecSm;
    140 
    141     struct _keyParser_t     *pKeyParser;
    142 
    143     TI_HANDLE               hTx;
    144     TI_HANDLE               hRx;
    145     TI_HANDLE               hConn;
    146     TI_HANDLE               hCtrlData;
    147     TI_HANDLE               hWhalCtrl;
    148     TI_HANDLE               hMemMgr;
    149     TI_HANDLE               hSiteMgr;
    150     TI_HANDLE               hReport;
    151     TI_HANDLE               hOs;
    152     TI_HANDLE               hExcMngr;
    153     TI_HANDLE               hEvHandler;
    154     TI_HANDLE               hSmeSm;
    155     TI_HANDLE               hAPConn;
    156 
    157     rsn_setPaeConfig_t      setPaeConfig;
    158     rsn_getNetworkMode_t    getNetworkMode;
    159     rsn_setKey_t            setKey;
    160     rsn_removeKey_t         removeKey;
    161     rsn_setDefaultKeyId_t   setDefaultKeyId;
    162     rsn_reportStatus_t      reportStatus;
    163 
    164     UINT32                  rsnStartedTs;
    165     UINT32                  rsnCompletedTs;
    166 };
    167 
    168 /* Structures */
    169 
    170 /* External data definitions */
    171 
    172 /* External functions definitions */
    173 
    174 /* Function prototypes */
    175 
    176 TI_STATUS rsn_reportStatus(rsn_t *pRsn, TI_STATUS status);
    177 
    178 TI_STATUS rsn_setPaeConfig(rsn_t *pRsn, rsn_paeConfig_t *pPaeConfig);
    179 
    180 TI_STATUS rsn_getNetworkMode(rsn_t *pRsn, rsn_networkMode_t *pNetMode);
    181 
    182 TI_STATUS rsn_setKey(rsn_t *pMainSec, securityKeys_t *pKey);
    183 
    184 TI_STATUS rsn_removeKey(rsn_t *pMainSec, securityKeys_t *pKey);
    185 
    186 TI_STATUS rsn_setDefaultKeyId(rsn_t *pMainSec, UINT8 keyId);
    187 
    188 TI_STATUS rsn_setDefaultKeys(rsn_t *pHandle);
    189 
    190 
    191 #endif
    192 
    193