1 /* 2 * authSm.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 assocSm.h 35 * \brief 802.11 authentication SM 36 * 37 * \see assocSm.c 38 */ 39 40 41 /***************************************************************************/ 42 /* */ 43 /* MODULE: assocSm.h */ 44 /* PURPOSE: 802.11 authentication SM */ 45 /* */ 46 /***************************************************************************/ 47 48 #ifndef _AUTH_SM_H 49 #define _AUTH_SM_H 50 51 #include "fsm.h" 52 #include "mlmeApi.h" 53 54 /* Constants */ 55 56 #define AUTH_MSG_HEADER_LEN 6 57 #define MAX_CHALLANGE_LEN 256 58 #define MAX_AUTH_MSG_LEN MAX_CHALLANGE_LEN + AUTH_MSG_HEADER_LEN 59 60 /* Enumerations */ 61 62 /* Typedefs */ 63 64 typedef struct 65 { 66 TI_UINT16 status; 67 char *pChalange; 68 TI_UINT8 challangeLen; 69 } authData_t; 70 71 typedef struct 72 { 73 legacyAuthType_e authType; 74 fsm_stateMachine_t *pAuthSm; 75 TI_UINT8 currentState; 76 TI_UINT32 maxCount; 77 TI_UINT8 retryCount; 78 TI_UINT32 authRejectCount; 79 TI_UINT32 authTimeoutCount; 80 TI_UINT32 timeout; 81 authData_t authData; 82 TI_HANDLE hAuthSmTimer; 83 84 TI_HANDLE hMlme; 85 TI_HANDLE hRsn; 86 TI_HANDLE hReport; 87 TI_HANDLE hOs; 88 TI_HANDLE hTimer; 89 } auth_t; 90 91 /* Structures */ 92 93 /* External data definitions */ 94 95 /* External functions definitions */ 96 97 /* Function prototypes */ 98 99 TI_STATUS auth_start(TI_HANDLE hAuth); 100 101 TI_STATUS auth_stop(TI_HANDLE hpAuth, TI_BOOL sendDeAuth, mgmtStatus_e reason ); 102 103 TI_STATUS auth_recv(TI_HANDLE hAuth, mlmeFrameInfo_t *pFrame); 104 105 void auth_smTimeout(TI_HANDLE hAssoc, TI_BOOL bTwdInitOccured); 106 107 TI_STATUS auth_smMsgBuild(auth_t *pCtx, 108 TI_UINT16 seq, 109 TI_UINT16 statusCode, 110 TI_UINT8* pChallange, 111 TI_UINT8 challangeLen); 112 113 /* local functions */ 114 115 #endif 116 117