wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_frame_mgmt_ie.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-2009 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.11 management frame IEs.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CORE_FRAME_MGMT_IE_H
       
    20 #define CORE_FRAME_MGMT_IE_H
       
    21 
       
    22 #include "core_frame_dot11_ie.h"
       
    23 #include "core_types.h"
       
    24 
       
    25 const u16_t CORE_FRAME_RADIO_MGMT_IE_LENGTH = 2;
       
    26 const u16_t CORE_FRAME_RADIO_MGMT_IE_MIN_POWER_CAPABILITY = 0;
       
    27 const u16_t CORE_FRAME_RRM_MGMT_IE_LENGTH = 5;
       
    28 
       
    29 const u8_t CORE_FRAME_MGMT_IE_AP_CHANNEL_REPORT_LENGTH = 4;
       
    30 const u8_t CORE_FRAME_MGMT_IE_AP_CHANNEL_REPORT_CLASS_OFFSET = 2;
       
    31 const u8_t CORE_FRAME_MGMT_IE_AP_CHANNEL_REPORT_CHANNEL_OFFSET = 3;
       
    32 
       
    33 /**
       
    34  * Class for parsing 802.11 management frame SSID IE.
       
    35  *
       
    36  * @since S60 v3.1
       
    37  */
       
    38 NONSHARABLE_CLASS( core_frame_mgmt_ie_ssid_c ) : public core_frame_dot11_ie_c
       
    39     {
       
    40 
       
    41 public:
       
    42 
       
    43     /**
       
    44      * Factory for creating a parser instance.
       
    45      *
       
    46      * @since S60 v3.1
       
    47      * @param ie Pointer to the IE data.
       
    48      * @return A pointer to the created IE instance.
       
    49      */
       
    50     static core_frame_mgmt_ie_ssid_c* instance(
       
    51         const core_frame_dot11_ie_c& ie );
       
    52 
       
    53     /** 
       
    54      * Destructor.
       
    55      */
       
    56     virtual ~core_frame_mgmt_ie_ssid_c();
       
    57 
       
    58     /**
       
    59      * Return the SSID.
       
    60      * @return The SSID. BROADCAST_SSID if none or invalid.
       
    61      */
       
    62     core_ssid_s ssid() const;
       
    63 
       
    64 private:
       
    65 
       
    66     /**
       
    67      * Constructor
       
    68      *
       
    69      * @param data_length Length of the IE data.
       
    70      * @param data Pointer to the IE data.     
       
    71      */
       
    72     core_frame_mgmt_ie_ssid_c(
       
    73        u16_t data_length,
       
    74        const u8_t* data,
       
    75        u16_t max_data_length );
       
    76 
       
    77     };
       
    78 
       
    79 /**
       
    80  * Class for parsing 802.11 management frame DS IE.
       
    81  *
       
    82  * @since S60 v3.1
       
    83  */
       
    84 NONSHARABLE_CLASS( core_frame_mgmt_ie_ds_c ) : public core_frame_dot11_ie_c
       
    85     {
       
    86 
       
    87 public:
       
    88 
       
    89     /**
       
    90      * Factory for creating a parser instance.
       
    91      *
       
    92      * @since S60 v3.1
       
    93      * @param ie Pointer to the IE data.
       
    94      * @return A pointer to the created IE instance.
       
    95      */
       
    96     static core_frame_mgmt_ie_ds_c* instance(
       
    97         const core_frame_dot11_ie_c& ie );
       
    98 
       
    99     /** 
       
   100      * Destructor.
       
   101      */
       
   102     virtual ~core_frame_mgmt_ie_ds_c();
       
   103 
       
   104     /**
       
   105      * Return the channel field.
       
   106      * @return The channel field.
       
   107      */
       
   108     u8_t channel() const;
       
   109 
       
   110 private:
       
   111 
       
   112     /**
       
   113      * Constructor
       
   114      *
       
   115      * @param data_length Length of the IE data.
       
   116      * @param data Pointer to the IE data.     
       
   117      */
       
   118     core_frame_mgmt_ie_ds_c(
       
   119        u16_t data_length,
       
   120        const u8_t* data,
       
   121        u16_t max_data_length );
       
   122 
       
   123     };
       
   124 
       
   125 /**
       
   126  * Class for parsing 802.11 management frame country IE.
       
   127  *
       
   128  * @since S60 v3.1
       
   129  */
       
   130 NONSHARABLE_CLASS( core_frame_mgmt_ie_country_c ) : public core_frame_dot11_ie_c
       
   131     {
       
   132 
       
   133 public:
       
   134 
       
   135     /**
       
   136      * Factory for creating a parser instance.
       
   137      *
       
   138      * @since S60 v3.1
       
   139      * @param ie Pointer to the IE data.
       
   140      * @return A pointer to the created IE instance.
       
   141      */
       
   142     static core_frame_mgmt_ie_country_c* instance(
       
   143         const core_frame_dot11_ie_c& ie );
       
   144 
       
   145     /** 
       
   146      * Destructor.
       
   147      */
       
   148     virtual ~core_frame_mgmt_ie_country_c();
       
   149 
       
   150     /**
       
   151      * Return the country string field.
       
   152      * @return The country string field.
       
   153      */
       
   154     core_country_string_s country() const;
       
   155     
       
   156     /**
       
   157      * Return the maximum transmit power level for the given channel.
       
   158      * @param channel Channel to check.
       
   159      * @return The maximum transmit power level for the given channel.
       
   160      */    
       
   161     u8_t max_tx_power_level(
       
   162         u8_t channel ) const;
       
   163 
       
   164 private:
       
   165 
       
   166     /**
       
   167      * Constructor
       
   168      *
       
   169      * @param data_length Length of the IE data.
       
   170      * @param data Pointer to the IE data.     
       
   171      */
       
   172     core_frame_mgmt_ie_country_c(
       
   173        u16_t data_length,
       
   174        const u8_t* data,
       
   175        u16_t max_data_length );
       
   176 
       
   177     };
       
   178 
       
   179 /**
       
   180  * Class for parsing 802.11 management frame power constraint IE.
       
   181  *
       
   182  * @since S60 v5.2
       
   183  */
       
   184 NONSHARABLE_CLASS( core_frame_mgmt_ie_power_constraint_c ) : public core_frame_dot11_ie_c
       
   185     {
       
   186 
       
   187 public:
       
   188 
       
   189     /**
       
   190      * Factory for creating a parser instance.
       
   191      *
       
   192      * @since S60 v5.2
       
   193      * @param ie Pointer to the IE data.
       
   194      * @return A pointer to the created IE instance.
       
   195      */
       
   196     static core_frame_mgmt_ie_power_constraint_c* instance(
       
   197         const core_frame_dot11_ie_c& ie );
       
   198 
       
   199     /** 
       
   200      * Destructor.
       
   201      */
       
   202     virtual ~core_frame_mgmt_ie_power_constraint_c();
       
   203 
       
   204     /**
       
   205      * Return the power constraint value.
       
   206      * @return The power constraint value.
       
   207      */
       
   208     u8_t power_constraint() const;
       
   209 
       
   210 private:
       
   211 
       
   212     /**
       
   213      * Constructor
       
   214      *
       
   215      * @param data_length Length of the IE data.
       
   216      * @param data Pointer to the IE data.     
       
   217      */
       
   218     core_frame_mgmt_ie_power_constraint_c(
       
   219        u16_t data_length,
       
   220        const u8_t* data,
       
   221        u16_t max_data_length );
       
   222 
       
   223     };
       
   224 
       
   225 /**
       
   226  * Class for parsing 802.11 management frame ap channel report IE.
       
   227  *
       
   228  * @since S60 v5.2
       
   229  */
       
   230 NONSHARABLE_CLASS( core_frame_mgmt_ie_ap_channel_report_c ) : public core_frame_dot11_ie_c
       
   231     {
       
   232 
       
   233 public:
       
   234 
       
   235     enum core_frame_mgmt_ie_class_id_e
       
   236         {
       
   237         core_frame_mgmt_ie_class_id_europe_2dot407          = 4,
       
   238         core_frame_mgmt_ie_class_id_usa_5                   = 5,
       
   239         core_frame_mgmt_ie_class_id_usa_2dot407             = 12,
       
   240         core_frame_mgmt_ie_class_id_japan_2dot407           = 30,
       
   241         core_frame_mgmt_ie_class_id_japan_2dot414           = 31,
       
   242         core_frame_mgmt_ie_class_id_japan_5                 = 32
       
   243         };
       
   244     
       
   245     /**
       
   246      * Factory for creating a parser instance.
       
   247      *
       
   248      * @since S60 v5.2
       
   249      * @param ie Pointer to the IE data.
       
   250      * @return A pointer to the created IE instance.
       
   251      */
       
   252     static core_frame_mgmt_ie_ap_channel_report_c* instance(
       
   253         const core_frame_dot11_ie_c& ie );
       
   254 
       
   255     /** 
       
   256      * Destructor.
       
   257      */
       
   258     virtual ~core_frame_mgmt_ie_ap_channel_report_c();
       
   259 
       
   260     /**
       
   261      * Return the class value.
       
   262      * 
       
   263      * @since S60 v5.2
       
   264      * @return The class value.
       
   265      */
       
   266     u8_t ap_channel_report_class() const;
       
   267 
       
   268     /**
       
   269      * Return the channel value.
       
   270      * 
       
   271      * @since S60 v5.2
       
   272      * @return The channel value.
       
   273      */
       
   274     u8_t ap_channel_report_channel(
       
   275         u16_t channel_offset ) const;
       
   276 
       
   277 private:
       
   278 
       
   279     /**
       
   280      * Constructor
       
   281      *
       
   282      * @param data_length Length of the IE data.
       
   283      * @param data Pointer to the IE data.     
       
   284      */
       
   285     core_frame_mgmt_ie_ap_channel_report_c(
       
   286        u16_t data_length,
       
   287        const u8_t* data,
       
   288        u16_t max_data_length );
       
   289 
       
   290     };
       
   291 
       
   292 /**
       
   293  * Class for parsing 802.11 management frame admission capacity IE.
       
   294  *
       
   295  * @since S60 v5.2
       
   296  */
       
   297 NONSHARABLE_CLASS( core_frame_mgmt_ie_admission_capacity_c ) : public core_frame_dot11_ie_c
       
   298     {
       
   299 
       
   300 public:
       
   301 
       
   302     /**
       
   303      * Factory for creating a parser instance.
       
   304      *
       
   305      * @since S60 v5.1
       
   306      * @param ie Pointer to the IE data.
       
   307      * @return A pointer to the created IE instance.
       
   308      */
       
   309     static core_frame_mgmt_ie_admission_capacity_c* instance(
       
   310         const core_frame_dot11_ie_c& ie );
       
   311 
       
   312     /** 
       
   313      * Destructor.
       
   314      */
       
   315     virtual ~core_frame_mgmt_ie_admission_capacity_c();
       
   316 
       
   317     /**
       
   318      * Return the admission capacity bitmask.
       
   319      * 
       
   320      * @since S60 v5.2
       
   321      * @return The admission capacity bitmask.
       
   322      */
       
   323     u16_t admission_capacity_bitmask() const;
       
   324 
       
   325     /**
       
   326      * Get admission capacities.
       
   327      * 
       
   328      * @since S60 v5.2
       
   329      * @param ie_data_length IE data length.
       
   330      * @param admission_capacity_table Admission capacities.
       
   331      */
       
   332     void get_admission_capacity(
       
   333         u16_t ie_data_length,
       
   334         u16_t* admission_capacity_table );
       
   335 
       
   336 private:
       
   337 
       
   338     /**
       
   339      * Constructor
       
   340      *
       
   341      * @param data_length Length of the IE data.
       
   342      * @param data Pointer to the IE data.     
       
   343      */
       
   344     core_frame_mgmt_ie_admission_capacity_c(
       
   345        u16_t data_length,
       
   346        const u8_t* data,
       
   347        u16_t max_data_length );
       
   348 
       
   349     };
       
   350 
       
   351 /**
       
   352  * Class for parsing 802.11 management frame power capability IE.
       
   353  *
       
   354  * @since S60 v5.2
       
   355  */
       
   356 NONSHARABLE_CLASS( core_frame_mgmt_ie_power_capability_c ) : public core_frame_dot11_ie_c
       
   357     {
       
   358 
       
   359 public:
       
   360 
       
   361     /**
       
   362      * Factory for creating a parser instance.
       
   363      *
       
   364      * @since S60 v5.2
       
   365      * @param ie Pointer to the IE data.
       
   366      * @return A pointer to the created IE instance.
       
   367      */
       
   368     static core_frame_mgmt_ie_power_capability_c* instance(
       
   369         const core_frame_dot11_ie_c& ie );
       
   370 
       
   371     /** 
       
   372      * Destructor.
       
   373      */
       
   374     virtual ~core_frame_mgmt_ie_power_capability_c();
       
   375 
       
   376     /**
       
   377      * Return the power capability.
       
   378      * 
       
   379      * @since S60 v5.2
       
   380      * @return The power capability.
       
   381      */
       
   382     u8_t power_capability() const;
       
   383 
       
   384 private:
       
   385 
       
   386     /**
       
   387      * Constructor
       
   388      *
       
   389      * @param data_length Length of the IE data.
       
   390      * @param data Pointer to the IE data.     
       
   391      * @param max_data_length Maximum length of the IE data.
       
   392      */
       
   393     core_frame_mgmt_ie_power_capability_c(
       
   394        u16_t data_length,
       
   395        const u8_t* data,
       
   396        u16_t max_data_length );
       
   397 
       
   398     };
       
   399 
       
   400 /**
       
   401  * Class for parsing 802.11 radio management frame IE.
       
   402  *
       
   403  * @since S60 v5.2
       
   404  */
       
   405 NONSHARABLE_CLASS( core_frame_radio_mgmt_ie_c ) : public core_frame_dot11_ie_c
       
   406     {
       
   407 
       
   408 public:
       
   409 
       
   410     /**
       
   411      * Factory for creating a parser instance.
       
   412      *
       
   413      * @since S60 v5.2
       
   414      * @param max_data_length Maximum length of the data.
       
   415      * @param min_capability Minimum transmit power capability.
       
   416      * @param max_capability Maximum transmit power capability.
       
   417      * @return A pointer to the created IE instance.
       
   418      */
       
   419     static core_frame_radio_mgmt_ie_c* instance(
       
   420         u16_t max_data_length,
       
   421         u8_t min_capability,
       
   422         u8_t max_capability );
       
   423 
       
   424     /** 
       
   425      * Destructor.
       
   426      */
       
   427     virtual ~core_frame_radio_mgmt_ie_c();
       
   428 
       
   429 private:
       
   430 
       
   431     /**
       
   432      * Generate an IE with the given parameters.
       
   433      *
       
   434      * @param min_capability Minimum transmit power capability.
       
   435      * @param max_capability Maximum transmit power capability.
       
   436      */
       
   437     void generate(
       
   438         u8_t min_capability,
       
   439         u8_t max_capability );
       
   440 
       
   441     /**
       
   442      * Constructor
       
   443      *
       
   444      * @param data_length Length of the IE data.
       
   445      * @param data Pointer to the IE data.     
       
   446      * @param max_data_length Maximum length of the IE data.
       
   447      */
       
   448     core_frame_radio_mgmt_ie_c(
       
   449        u16_t data_length,
       
   450        const u8_t* data,
       
   451        u16_t max_data_length );
       
   452 
       
   453     };
       
   454 
       
   455 /**
       
   456  * Class for parsing 802.11 management frame rrm capabilities IE.
       
   457  *
       
   458  * @since S60 v5.2
       
   459  */
       
   460 NONSHARABLE_CLASS( core_frame_mgmt_ie_rrm_capabilities_c ) : public core_frame_dot11_ie_c
       
   461     {
       
   462 
       
   463 public:
       
   464 
       
   465     /**
       
   466      * Factory for creating a parser instance.
       
   467      *
       
   468      * @since S60 v5.2
       
   469      * @param ie Pointer to the IE data.
       
   470      * @return A pointer to the created IE instance.
       
   471      */
       
   472     static core_frame_mgmt_ie_rrm_capabilities_c* instance(
       
   473         const core_frame_dot11_ie_c& ie );
       
   474 
       
   475     /** 
       
   476      * Destructor.
       
   477      */
       
   478     virtual ~core_frame_mgmt_ie_rrm_capabilities_c();
       
   479 
       
   480     /**
       
   481      * Return the rrm capability bits.
       
   482      * 
       
   483      * @since S60 v5.2
       
   484      * @return The rrm capability bits.
       
   485      */
       
   486     u64_t rrm_capabilities() const;
       
   487 
       
   488 private:
       
   489 
       
   490     /**
       
   491      * Constructor
       
   492      *
       
   493      * @param data_length Length of the IE data.
       
   494      * @param data Pointer to the IE data.     
       
   495      * @param max_data_length Maximum length of the IE data.
       
   496      */
       
   497     core_frame_mgmt_ie_rrm_capabilities_c(
       
   498        u16_t data_length,
       
   499        const u8_t* data,
       
   500        u16_t max_data_length );
       
   501 
       
   502     };
       
   503 
       
   504 /**
       
   505  * Class for parsing 802.11 radio management frame IE.
       
   506  *
       
   507  * @since S60 v5.2
       
   508  */
       
   509 NONSHARABLE_CLASS( core_frame_rrm_mgmt_ie_c ) : public core_frame_dot11_ie_c
       
   510     {
       
   511 
       
   512 public:
       
   513 
       
   514     /**
       
   515      * Factory for creating a parser instance.
       
   516      *
       
   517      * @since S60 v5.2
       
   518      * @param rrm_capabilities RRM capabilities.
       
   519      * @return A pointer to the created IE instance.
       
   520      */
       
   521     static core_frame_rrm_mgmt_ie_c* instance(
       
   522         const u8_t* rrm_capabilities );
       
   523 
       
   524     /** 
       
   525      * Destructor.
       
   526      */
       
   527     virtual ~core_frame_rrm_mgmt_ie_c();
       
   528 
       
   529 private:
       
   530 
       
   531     /**
       
   532      * Generate an IE with the given parameters.
       
   533      *
       
   534      * @since S60 v5.2
       
   535      * @param rrm_capabilities RRM capabilities.
       
   536      */
       
   537     void generate( 
       
   538         const u8_t* rrm_capabilities );
       
   539 
       
   540     /**
       
   541      * Constructor
       
   542      *
       
   543      * @param data_length Length of the IE data.
       
   544      * @param data Pointer to the IE data.     
       
   545      * @param max_data_length Maximum length of the IE data.
       
   546      */
       
   547     core_frame_rrm_mgmt_ie_c(
       
   548        u16_t data_length,
       
   549        const u8_t* data,
       
   550        u16_t max_data_length );
       
   551 
       
   552     };
       
   553 
       
   554 /**
       
   555  * Class for parsing 802.11 management frame request IE.
       
   556  *
       
   557  * @since S60 v5.2
       
   558  */
       
   559 NONSHARABLE_CLASS( core_frame_mgmt_ie_request_ie_c ) : public core_frame_dot11_ie_c
       
   560     {
       
   561 
       
   562 public:
       
   563 
       
   564     /**
       
   565      * Factory for creating a parser instance.
       
   566      *
       
   567      * @since S60 v5.2
       
   568      * @param ie Pointer to the IE data.
       
   569      * @return A pointer to the created IE instance.
       
   570      */
       
   571     static core_frame_mgmt_ie_request_ie_c* instance(
       
   572         const core_frame_dot11_ie_c& ie );
       
   573 
       
   574     /** 
       
   575      * Destructor.
       
   576      */
       
   577     virtual ~core_frame_mgmt_ie_request_ie_c();
       
   578 
       
   579     /**
       
   580      * Get information element list.
       
   581      * 
       
   582      * @since S60 v5.2
       
   583      * @param ie_id_list Information element list.
       
   584      * @return Information element list length.
       
   585      */
       
   586     u8_t element_list( u8_t* ie_id_list ) const;
       
   587 
       
   588     /**
       
   589      * Return the element data.
       
   590      * 
       
   591      * @since S60 v5.2
       
   592      * @param request_ie_offset Element data offset.
       
   593      * @return The element data.
       
   594      */
       
   595     u8_t element_data(
       
   596         u16_t element_data_offset ) const;
       
   597 
       
   598 private:
       
   599 
       
   600     /**
       
   601      * Constructor
       
   602      *
       
   603      * @param data_length Length of the IE data.
       
   604      * @param data Pointer to the IE data.     
       
   605      */
       
   606     core_frame_mgmt_ie_request_ie_c(
       
   607        u16_t data_length,
       
   608        const u8_t* data,
       
   609        u16_t max_data_length );
       
   610 
       
   611     };
       
   612 
       
   613 #endif // CORE_FRAME_MGMT_IE_H