wlan_bearer/wlanldd/wlan_common/umac_common/src/UmacWsaKeyIndexMapper.cpp
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Implementation of the WlanWsaKeyIndexMapper class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 11 %
       
    20 */
       
    21 
       
    22 #include "config.h"
       
    23 #include "UmacWsaKeyIndexMapper.h"
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 
       
    28 inline TUint32 WlanWsaKeyIndexMapper::HandleWepPairwiseKey()
       
    29     {
       
    30     return KWepPairWiseKey;
       
    31     }
       
    32 
       
    33 inline TUint32 WlanWsaKeyIndexMapper::HandleWepGroupKey( 
       
    34     TUint32 aDefaultKeyNumber )
       
    35     {
       
    36     return aDefaultKeyNumber;
       
    37     }
       
    38 
       
    39 inline TUint32 WlanWsaKeyIndexMapper::HandleTkipGroupKey()
       
    40     {
       
    41     return KTkipGroupKey;
       
    42     }
       
    43 
       
    44 inline TUint32 WlanWsaKeyIndexMapper::HandleTkipPairWiseKey()
       
    45     {
       
    46     return KTkipPairWiseKey;
       
    47     }
       
    48 
       
    49 inline TUint32 WlanWsaKeyIndexMapper::HandleAesPairwiseKey()
       
    50     {
       
    51     return KAesPairWiseKey;
       
    52     }
       
    53 
       
    54 inline TUint32 WlanWsaKeyIndexMapper::HandleAesGroupKey()
       
    55     {
       
    56     return KAesGroupKey;
       
    57     }
       
    58 
       
    59 inline TUint32 WlanWsaKeyIndexMapper::HandleWapiPairwiseKey()
       
    60     {
       
    61     return KWapiPairWiseKey;
       
    62     }
       
    63 
       
    64 inline TUint32 WlanWsaKeyIndexMapper::HandleWapiGroupKey()
       
    65     {
       
    66     return KWapiGroupKey;
       
    67     }
       
    68 
       
    69 TUint8 WlanWsaKeyIndexMapper::Extract( 
       
    70     WHA::TKeyType aKeyType, 
       
    71     TUint32 aDefaultKeyNumber )
       
    72     {
       
    73     TUint32 ret(0);
       
    74 
       
    75     if ( aKeyType == WHA::EWepGroupKey )
       
    76         {
       
    77         ret = HandleWepGroupKey( aDefaultKeyNumber );
       
    78         }
       
    79     else if ( aKeyType == WHA::EWepPairWiseKey )
       
    80         {
       
    81         ret = HandleWepPairwiseKey();
       
    82         }
       
    83     else if ( aKeyType == WHA::ETkipGroupKey )
       
    84         {
       
    85         ret = HandleTkipGroupKey();
       
    86         }
       
    87     else if ( aKeyType == WHA::ETkipPairWiseKey )
       
    88         {
       
    89         ret = HandleTkipPairWiseKey();
       
    90         }
       
    91     else if ( aKeyType == WHA::EAesGroupKey )
       
    92         {
       
    93         ret = HandleAesGroupKey();
       
    94         }
       
    95     else if ( aKeyType == WHA::EAesPairWiseKey )
       
    96         {
       
    97         ret = HandleAesPairwiseKey();
       
    98         }
       
    99     else if ( aKeyType == WHA::EWapiGroupKey )
       
   100         {
       
   101         ret = HandleWapiGroupKey();
       
   102         }
       
   103     else if ( aKeyType == WHA::EWapiPairWiseKey )
       
   104         {
       
   105         ret = HandleWapiPairwiseKey();
       
   106         }
       
   107     else
       
   108         {
       
   109         OsTracePrint( KErrorLevel, (TUint8*)
       
   110             ("UMAC: WlanWsaKeyIndexMapper::Extract(): aKeyType: %d"), aKeyType );    
       
   111         OsAssert( (TUint8*)("UMAC: panic"),(TUint8*)(WLAN_FILE), __LINE__ );
       
   112         }
       
   113 
       
   114     return ret;
       
   115     };