1 /* 2 * mainKeysSmInternal.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 mainKeysSm.h 35 * \brief RSN main security SM 36 * 37 * \see mainKeysSm.c 38 */ 39 40 41 /***************************************************************************/ 42 /* */ 43 /* MODULE: mainKeysSm.h */ 44 /* PURPOSE: RSN main security SM */ 45 /* */ 46 /***************************************************************************/ 47 48 #ifndef _MAIN_KEYS_INTERNAL_H 49 #define _MAIN_KEYS_INTERNAL_H 50 51 #include "paramOut.h" 52 #include "rsnApi.h" 53 54 #include "mainKeysSm.h" 55 56 /* Constants */ 57 58 59 /* Enumerations */ 60 61 /* Typedefs */ 62 63 /** state machine states */ 64 typedef enum 65 { 66 MAIN_KEYS_STATE_IDLE = 0, 67 MAIN_KEYS_STATE_START = 1, 68 MAIN_KEYS_STATE_UNICAST_COMPLETE = 2, 69 MAIN_KEYS_STATE_BROADCAST_COMPLETE = 3, 70 MAIN_KEYS_STATE_COMPLETE = 4, 71 MAIN_KEYS_NUM_STATES 72 } mainKeys_smStates; 73 74 /** State machine events */ 75 typedef enum 76 { 77 MAIN_KEYS_EVENT_START = 0, 78 MAIN_KEYS_EVENT_STOP = 1, 79 MAIN_KEYS_EVENT_UCAST_COMPLETE = 2, 80 MAIN_KEYS_EVENT_BCAST_COMPLETE = 3, 81 MAIN_KEYS_EVENT_SESSION_TIMEOUOT = 4, 82 MAIN_KEYS_NUM_EVENTS 83 } mainKeys_smEvents; 84 85 86 /* Main Sec SM functions */ 87 88 /* Structures */ 89 90 91 /* External data definitions */ 92 93 /* External functions definitions */ 94 95 /* Function prototypes */ 96 97 TI_STATUS mainKeys_start(struct _mainKeys_t *pMainKeys); 98 TI_STATUS mainKeys_stop(struct _mainKeys_t *pMainKeys); 99 TI_STATUS mainKeys_reportUcastStatus(struct _mainKeys_t *pMainKeys, TI_STATUS ucastStatus); 100 TI_STATUS mainKeys_reportBcastStatus(struct _mainKeys_t *pMainKeys, TI_STATUS bcastStatus); 101 void mainKeys_sessionTimeout(void *pMainKeys, TI_BOOL bTwdInitOccured); 102 TI_STATUS mainKeys_setKey(struct _mainKeys_t *pMainKeys, TSecurityKeys *pKey); 103 TI_STATUS mainKeys_removeKey(struct _mainKeys_t *pMainKeys, TSecurityKeys *pKey); 104 TI_STATUS mainKeys_setDefaultKeyId(struct _mainKeys_t *pMainKeys, TI_UINT8 keyId); 105 TI_STATUS mainKeys_getSessionKey(struct _mainKeys_t *pMainKeys, TI_UINT8 *pKey, TI_UINT32 *pKeyLen); 106 107 TI_STATUS mainKeys_startIdle(struct _mainKeys_t *pMainKeys); 108 TI_STATUS mainKeys_stopStart(struct _mainKeys_t *pMainKeys); 109 TI_STATUS mainKeys_stopUcastComplete(struct _mainKeys_t *pMainKeys); 110 TI_STATUS mainKeys_bcastCompleteUcastComplete(struct _mainKeys_t *pMainKeys); 111 TI_STATUS mainKeys_smTimeOut(void* data); 112 TI_STATUS mainKeys_stopBcastComplete(struct _mainKeys_t *pMainKeys); 113 TI_STATUS mainKeys_ucastCompleteBcastComplete(struct _mainKeys_t *pMainKeys); 114 TI_STATUS mainKeys_stopComplete(struct _mainKeys_t *pMainKeys); 115 TI_STATUS mainKeySmUnexpected(struct _mainKeys_t *pMainKeys); 116 TI_STATUS mainKeySmNop(struct _mainKeys_t *pMainKeys); 117 TI_STATUS mainKeySmSetKeyCompleted(struct _mainKeys_t *pMainKeys); 118 119 120 121 122 #endif 123 124