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