wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_frame_rsn_ie.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Class for parsing 802.11i (RSN) IEs.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CORE_FRAME_RSN_IE_H
       
    20 #define CORE_FRAME_RSN_IE_H
       
    21 
       
    22 #include "abs_core_wpx_adaptation.h"
       
    23 #include "core_frame_dot11_ie.h"
       
    24 #include "core_types.h"
       
    25 
       
    26 /**
       
    27  * Class for parsing and generating 802.11i (RSN) IEs.
       
    28  *
       
    29  * @since S60 v3.1
       
    30  */
       
    31 NONSHARABLE_CLASS( core_frame_rsn_ie_c ) : public core_frame_dot11_ie_c
       
    32     {
       
    33 
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Factory for creating a parser instance.
       
    38      *
       
    39      * @since S60 v3.1
       
    40      * @param wpx_adaptation WPX adaptation.
       
    41      * @param ie Pointer to the IE data.
       
    42      * @return A pointer to the created IE instance.
       
    43      */
       
    44     static core_frame_rsn_ie_c* instance(
       
    45         abs_core_wpx_adaptation_c& wpx_adaptation,
       
    46         const core_frame_dot11_ie_c& ie );
       
    47 
       
    48     /**
       
    49      * Factory for creating an IE with the given parameters.
       
    50      *
       
    51      * @since S60 v3.1
       
    52      * @param wpx_adaptation WPX adaptation.
       
    53      * @param group_cipher Used group cipher.
       
    54      * @param pairwise_cipher Used pairwise cipher.
       
    55      * @param key_management Used key management suite.
       
    56      * @param pmkid_length Length of optional PMKID data.
       
    57      * @param pmkid_data Pointer to the buffer of optional PMKID data.     
       
    58      * @return A pointer to the created IE instance.
       
    59      */
       
    60     static core_frame_rsn_ie_c* instance(
       
    61         abs_core_wpx_adaptation_c& wpx_adaptation,
       
    62         core_cipher_suite_e group_cipher,
       
    63         core_cipher_suite_e pairwise_cipher,
       
    64         core_key_management_e key_management,
       
    65         u16_t pmkid_length,
       
    66         const u8_t* pmkid_data );
       
    67 
       
    68     /** 
       
    69      * Destructor.
       
    70      */
       
    71     virtual ~core_frame_rsn_ie_c();
       
    72 
       
    73     /**
       
    74      * Return the supported group cipher.
       
    75      * @return The supported group cipher.
       
    76      */
       
    77     u8_t group_cipher_suite() const;
       
    78 
       
    79     /**
       
    80      * Return the supported pairwise ciphers.
       
    81      * @param The supported pairwise ciphers.
       
    82      */
       
    83     u8_t pairwise_cipher_suites() const;
       
    84 
       
    85     /**
       
    86      * Return the supported key management suites.
       
    87      * @param The supported key management suites.
       
    88      */
       
    89     u8_t key_management_suites() const;
       
    90 
       
    91 private:
       
    92 
       
    93     /**
       
    94      * Convert OUI to core_cipher_suite_e type.
       
    95      * @param oui OUI to convert.
       
    96      * @return OUI convert to core_cipher_suite_e type.
       
    97      */    
       
    98     core_cipher_suite_e cipher_oui_to_enum(
       
    99         const u8_t* oui ) const;
       
   100 
       
   101     /**
       
   102      * Convert OUI to core_key_management_e type.
       
   103      * @param oui OUI to convert.
       
   104      * @return OUI converted to core_key_management_e type.
       
   105      */
       
   106     core_key_management_e key_management_oui_to_enum(
       
   107         const u8_t* oui ) const;
       
   108 
       
   109     /**
       
   110      * Return the "raw" value for the given group cipher.
       
   111      * @param cipher The cipher to return the value to.
       
   112      * @return The "raw" value for the given group cipher.
       
   113      */
       
   114     u8_t get_raw_group_cipher(
       
   115         core_cipher_suite_e cipher ) const;
       
   116 
       
   117     /**
       
   118      * Return the "raw" value for the given pairwise cipher.
       
   119      * @param cipher The cipher to return the value to.
       
   120      * @return The "raw" value for the given pairwise cipher.
       
   121      */
       
   122     u8_t get_raw_pairwise_cipher(
       
   123         core_cipher_suite_e cipher ) const;
       
   124 
       
   125     /**
       
   126      * Return the "raw" value for the given key management suite.
       
   127      * @param key_management The key management suite to return the value to.
       
   128      * @return The "raw" value for the given key management suite.
       
   129      */
       
   130     u8_t get_raw_key_management(
       
   131         core_key_management_e key_management ) const;
       
   132 
       
   133     /**
       
   134      * Generate a 802.11i (RSN) IE.
       
   135      *
       
   136      * @param group_cipher Used group cipher.
       
   137      * @param pairwise_cipher Used pairwise cipher.
       
   138      * @param key_management Used key management suite.
       
   139      * @param pmkid_length Length of optional PMKID data.
       
   140      * @param pmkid_data Pointer to the buffer of optional PMKID data.
       
   141      */
       
   142     void generate(
       
   143         core_cipher_suite_e group_cipher,
       
   144         core_cipher_suite_e pairwise_cipher,
       
   145         core_key_management_e key_management,
       
   146         u16_t pmkid_length,
       
   147         const u8_t* pmkid_dat );
       
   148 
       
   149     /**
       
   150      * Constructor
       
   151      *
       
   152      * @param wpx_adaptation WPX adaptation.
       
   153      * @param data_length Length of the IE data.
       
   154      * @param data Pointer to the IE data.     
       
   155      */
       
   156     core_frame_rsn_ie_c(
       
   157         abs_core_wpx_adaptation_c& wpx_adaptation,
       
   158         u16_t data_length,
       
   159         const u8_t* data,
       
   160         u16_t max_data_length );
       
   161 
       
   162 private: // data
       
   163 
       
   164     /** WPX adaptation instance. */
       
   165     abs_core_wpx_adaptation_c& wpx_adaptation_m;
       
   166 
       
   167     };
       
   168 
       
   169 #endif // CORE_FRAME_RSN_IE_H