wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/core_frame_action_wmm.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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 and generating 802.11 action frames in WMM category.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CORE_FRAME_ACTION_WMM_H
       
    20 #define CORE_FRAME_ACTION_WMM_H
       
    21 
       
    22 #include "am_platform_libraries.h"
       
    23 #include "core_types.h"
       
    24 #include "core_frame_action.h"
       
    25 
       
    26 class core_frame_wmm_ie_tspec_c;
       
    27 
       
    28 /**
       
    29  * Class for parsing and generating 802.11 action frames in WMM category.
       
    30  *
       
    31  * @lib wlmserversrv.lib
       
    32  * @since S60 v3.1
       
    33  */
       
    34 NONSHARABLE_CLASS( core_frame_action_wmm_c ) : public core_frame_action_c
       
    35     {
       
    36 
       
    37 public:
       
    38 
       
    39     /**
       
    40      * Defines the possible Type values.
       
    41      */
       
    42     enum core_dot11_action_wmm_type_e
       
    43         {
       
    44         core_dot11_action_wmm_type_addts_req  = 0,
       
    45         core_dot11_action_wmm_type_addts_resp = 1,
       
    46         core_dot11_action_wmm_type_delts      = 2
       
    47         };
       
    48 
       
    49     /**
       
    50      * Defines the possible Status Code values.
       
    51      */
       
    52     enum core_dot11_action_wmm_status_e
       
    53         {
       
    54         core_dot11_action_wmm_status_admission_accepted = 0,
       
    55         core_dot11_action_wmm_status_invalid_parameters = 1,
       
    56         core_dot11_action_wmm_status_refused            = 3
       
    57         /** 2, 4 - 255 reserved */        
       
    58         };    
       
    59 
       
    60     /**
       
    61      * Factory for creating a parser for the given frame.
       
    62      *
       
    63      * @since S60 v3.2
       
    64      * @param frame Frame to be parsed.
       
    65      * @return Pointer to the created parser instance.
       
    66      */
       
    67     static core_frame_action_wmm_c* instance(
       
    68         const core_frame_action_c& frame );
       
    69 
       
    70     /**
       
    71      * Generate a 802.11 action frame in WWMM category.
       
    72      *
       
    73      * @since S60 v3.2
       
    74      * @param duration The Duration field of the frame.
       
    75      * @param destination The destination MAC field of the frame.
       
    76      * @param source The source MAC field of the frame.
       
    77      * @param bssid The BSSID field of the frame.
       
    78      * @param sequence_control The Sequence Control field of the frame.
       
    79      * @param action_type Action Type field of the frame.
       
    80      * @param dialog_token The Dialog Token field of the frame.
       
    81      * @param status The Status field of the frame.
       
    82      * @param tspec The TSPEC element of the frame.
       
    83      * @return Pointer to the created frame instance.
       
    84      */
       
    85     static core_frame_action_wmm_c* instance(
       
    86         u16_t duration,
       
    87         const core_mac_address_s& destination,
       
    88         const core_mac_address_s& source,
       
    89         const core_mac_address_s& bssid,
       
    90         u16_t sequence_control,
       
    91         u8_t action_type,
       
    92         u8_t dialog_token,
       
    93         u8_t status,
       
    94         const core_frame_wmm_ie_tspec_c* tspec );
       
    95 
       
    96     /**
       
    97      * Destructor.
       
    98      */
       
    99     virtual ~core_frame_action_wmm_c();
       
   100 
       
   101     /**
       
   102      * Return the Action Type field of the header.
       
   103      */
       
   104     u8_t action_type() const;
       
   105 
       
   106     /**
       
   107      * Return the Dialog Token field of the header.
       
   108      */
       
   109     u8_t dialog_token() const;
       
   110 
       
   111     /**
       
   112      * Return the Status field of the header.
       
   113      */
       
   114     u8_t status() const;
       
   115 
       
   116 private:
       
   117 
       
   118     /**
       
   119      * Return the offset of the first IE.
       
   120      * @return The offset of the first IE. 0 if the frame doesn't support IEs.
       
   121      */
       
   122     u16_t first_ie_offset() const;
       
   123 
       
   124     /**
       
   125      * Generate a 802.11 ADDTS request frame.
       
   126      *
       
   127      * @param duration The Duration field of the frame.
       
   128      * @param destination The destination MAC field of the frame.
       
   129      * @param source The source MAC field of the frame.
       
   130      * @param bssid The BSSID field of the frame.
       
   131      * @param sequence_control The Sequence Control field of the frame.
       
   132      * @param action_type Action Type field of the frame.
       
   133      * @param dialog_token The Dialog Token field of the frame.
       
   134      * @param status The Status field of the frame.
       
   135      * @param tspec The TSPEC element of the frame.
       
   136      */
       
   137     void generate(
       
   138         u16_t duration,
       
   139         const core_mac_address_s& destination,
       
   140         const core_mac_address_s& source,
       
   141         const core_mac_address_s& bssid,
       
   142         u16_t sequence_control,
       
   143         u8_t action_type,
       
   144         u8_t dialog_token,
       
   145         u8_t status,
       
   146         const core_frame_wmm_ie_tspec_c* tspec );
       
   147 
       
   148     /**
       
   149      * Constructor.
       
   150      *
       
   151      * @param data_length Length of the frame.
       
   152      * @param data Pointer to the frame data.
       
   153      * @param max_data_length The maximum size of the frame buffer.    
       
   154      */
       
   155     core_frame_action_wmm_c(
       
   156         u16_t data_length,
       
   157         const u8_t* data,
       
   158         u16_t max_data_length );
       
   159 
       
   160     };
       
   161 
       
   162 #endif // CORE_FRAME_ACTION_WMM_H