Home | History | Annotate | Download | only in Connection_Managment
      1 /*
      2  * keyParser.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 keyParser.h
     35  *  \brief key parser API
     36  *
     37  *  \see keyParser.c
     38  */
     39 
     40 /****************************************************************************
     41  *                                                                          *
     42  *   MODULE:  Key Parser	                                            *
     43  *   PURPOSE: key Parser module API                                    *
     44  *                                                                          *
     45  ****************************************************************************/
     46 
     47 #ifndef _KEY_PARSER_H
     48 #define _KEY_PARSER_H
     49 
     50 #include "rsnApi.h"
     51 #include "keyTypes.h"
     52 
     53 /* Constants */
     54 #define MAX_REPLAY_COUNTER_LEN		8
     55 
     56 /* Enumerations */
     57 
     58 /* Typedefs */
     59 
     60 typedef struct _keyParser_t	keyParser_t;
     61 
     62 /* RSN admission control prototypes */
     63 
     64 typedef TI_STATUS (*keyParser_recv_t)(struct _keyParser_t *pKeyParser, TI_UINT8 *pKeyData, TI_UINT32 keyDataLen);
     65 typedef TI_STATUS (*keyParser_config_t)(struct _keyParser_t *pKeyParser, TI_HANDLE hReport, TI_HANDLE hOs);
     66 typedef TI_STATUS (*keyParser_replayReset_t)(struct _keyParser_t *pKeyParser);
     67 typedef TI_STATUS (*keyParser_remove_t)(struct _keyParser_t *pKeyParser, TI_UINT8 *pKeyData, TI_UINT32 keyDataLen);
     68 
     69 /* Structures */
     70 
     71 struct _keyParser_t
     72 {
     73 	TI_UINT8					replayCounter[MAX_REPLAY_COUNTER_LEN];
     74 
     75 	struct _mainKeys_t		*pParent;
     76 	struct _unicastKey_t	*pUcastKey;
     77 	struct _broadcastKey_t	*pBcastKey;
     78 
     79 	TRsnPaeConfig         *pPaeConfig;
     80 
     81 	TI_HANDLE 				hReport;
     82 	TI_HANDLE 				hOs;
     83     TI_HANDLE               hCtrlData;
     84 
     85 	keyParser_config_t		config;
     86 	keyParser_recv_t		recv;
     87 	keyParser_replayReset_t replayReset;
     88 	keyParser_remove_t		remove;
     89 };
     90 
     91 /* External data definitions */
     92 
     93 /* External functions definitions */
     94 
     95 /* Function prototypes */
     96 
     97 keyParser_t* keyParser_create(TI_HANDLE hOs);
     98 
     99 TI_STATUS keyParser_config(struct _keyParser_t *pKeyParser,
    100 						TRsnPaeConfig *pPaeConfig,
    101                         struct _unicastKey_t *pUcastKey,
    102                         struct _broadcastKey_t *pBcastKey,
    103                         struct _mainKeys_t *pParent,
    104 						TI_HANDLE hReport,
    105 						TI_HANDLE hOs,
    106                         TI_HANDLE hCtrlData);
    107 
    108 TI_STATUS keyParser_unload(struct _keyParser_t *pKeyParser);
    109 
    110 TI_STATUS keyParser_nop(keyParser_t *pKeyParser);
    111 
    112 #endif /*  _KEY_PARSER_H*/
    113