1 /** \file keyParser.h 2 * \brief key parser API 3 * 4 * \see keyParser.c 5 */ 6 /**************************************************************************** 7 **+-----------------------------------------------------------------------+** 8 **| |** 9 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |** 10 **| All rights reserved. |** 11 **| |** 12 **| Redistribution and use in source and binary forms, with or without |** 13 **| modification, are permitted provided that the following conditions |** 14 **| are met: |** 15 **| |** 16 **| * Redistributions of source code must retain the above copyright |** 17 **| notice, this list of conditions and the following disclaimer. |** 18 **| * Redistributions in binary form must reproduce the above copyright |** 19 **| notice, this list of conditions and the following disclaimer in |** 20 **| the documentation and/or other materials provided with the |** 21 **| distribution. |** 22 **| * Neither the name Texas Instruments nor the names of its |** 23 **| contributors may be used to endorse or promote products derived |** 24 **| from this software without specific prior written permission. |** 25 **| |** 26 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |** 27 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |** 28 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |** 29 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |** 30 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |** 31 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |** 32 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |** 33 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |** 34 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |** 35 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |** 36 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |** 37 **| |** 38 **+-----------------------------------------------------------------------+** 39 ****************************************************************************/ 40 41 /**************************************************************************** 42 * * 43 * MODULE: Key Parser * 44 * PURPOSE: key Parser module API * 45 * * 46 ****************************************************************************/ 47 48 #ifndef _KEY_PARSER_H 49 #define _KEY_PARSER_H 50 51 #include "rsnApi.h" 52 #include "keyTypes.h" 53 54 /* Constants */ 55 #define MAX_REPLAY_COUNTER_LEN 8 56 57 /* Enumerations */ 58 59 /* Typedefs */ 60 61 typedef struct _keyParser_t keyParser_t; 62 63 /* RSN admission control prototypes */ 64 65 typedef TI_STATUS (*keyParser_recv_t)(struct _keyParser_t *pKeyParser, UINT8 *pKeyData, UINT32 keyDataLen); 66 typedef TI_STATUS (*keyParser_config_t)(struct _keyParser_t *pKeyParser, TI_HANDLE hReport, TI_HANDLE hOs); 67 typedef TI_STATUS (*keyParser_replayReset_t)(struct _keyParser_t *pKeyParser); 68 typedef TI_STATUS (*keyParser_remove_t)(struct _keyParser_t *pKeyParser, UINT8 *pKeyData, UINT32 keyDataLen); 69 70 /* Structures */ 71 72 struct _keyParser_t 73 { 74 UINT8 replayCounter[MAX_REPLAY_COUNTER_LEN]; 75 76 struct _mainKeys_t *pParent; 77 struct _unicastKey_t *pUcastKey; 78 struct _broadcastKey_t *pBcastKey; 79 80 rsn_paeConfig_t *pPaeConfig; 81 82 TI_HANDLE hReport; 83 TI_HANDLE hOs; 84 TI_HANDLE hCtrlData; 85 86 keyParser_config_t config; 87 keyParser_recv_t recv; 88 keyParser_replayReset_t replayReset; 89 keyParser_remove_t remove; 90 }; 91 92 /* External data definitions */ 93 94 /* External functions definitions */ 95 96 /* Function prototypes */ 97 98 keyParser_t* keyParser_create(TI_HANDLE hOs); 99 100 TI_STATUS keyParser_config(struct _keyParser_t *pKeyParser, 101 rsn_paeConfig_t *pPaeConfig, 102 struct _unicastKey_t *pUcastKey, 103 struct _broadcastKey_t *pBcastKey, 104 struct _mainKeys_t *pParent, 105 TI_HANDLE hReport, 106 TI_HANDLE hOs, 107 TI_HANDLE hCtrlData); 108 109 TI_STATUS keyParser_unload(struct _keyParser_t *pKeyParser); 110 111 TI_STATUS keyParser_nop(keyParser_t *pKeyParser); 112 113 #endif /* _KEY_PARSER_H*/ 114