A Discrete-Event Network Simulator
API
qos-wifi-mac-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 MIRKO BANCHI
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mirko Banchi <mk.banchi@gmail.com>
19  */
20 
21 #ifndef QOS_WIFI_MAC_HELPER_H
22 #define QOS_WIFI_MAC_HELPER_H
23 
24 #include "wifi-helper.h"
25 #include "ns3/qos-utils.h"
26 
27 #include <map>
28 
29 
30 namespace ns3 {
31 
41 {
42 public:
48 
52  virtual ~QosWifiMacHelper ();
53 
58  static QosWifiMacHelper Default (void);
59 
90  virtual void SetType (std::string type,
91  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
92  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
93  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
94  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
95  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
96  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
97  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
98  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue (),
99  std::string n8 = "", const AttributeValue &v8 = EmptyAttributeValue (),
100  std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue (),
101  std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue ());
120  void SetMsduAggregatorForAc (AcIndex ac, std::string type,
121  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
122  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
123  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
124  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
143  void SetMpduAggregatorForAc (enum AcIndex ac, std::string type,
144  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
145  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
146  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
147  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
157  void SetBlockAckThresholdForAc (enum AcIndex ac, uint8_t threshold);
169  void SetBlockAckInactivityTimeoutForAc (enum AcIndex ac, uint16_t timeout);
170 
171 
172 protected:
174 
175 
176 private:
182  virtual Ptr<WifiMac> Create (void) const;
189  void Setup (Ptr<WifiMac> mac, enum AcIndex ac, std::string edcaAttrName) const;
190 
191  std::map<AcIndex, ObjectFactory> m_msduAggregators;
192  std::map<AcIndex, ObjectFactory> m_mpduAggregators;
193  /*
194  * Next maps contain, for every access category, the values for
195  * block ack threshold and block ack inactivity timeout.
196  */
197  std::map<AcIndex, uint8_t> m_bAckThresholds;
198  std::map<AcIndex, uint16_t> m_bAckInactivityTimeouts;
199 };
200 
201 } //namespace ns3
202 
203 #endif /* QOS_WIFI_MAC_HELPER_H */
std::map< AcIndex, ObjectFactory > m_mpduAggregators
A-MPDU aggregators.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
std::map< AcIndex, ObjectFactory > m_msduAggregators
A-MSDU aggregators.
Hold a value for an Attribute.
Definition: attribute.h:68
void Setup(Ptr< WifiMac > mac, enum AcIndex ac, std::string edcaAttrName) const
Setup function.
void SetMsduAggregatorForAc(AcIndex ac, std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue())
Set the class, type and attributes for the Msdu aggregator.
std::map< AcIndex, uint8_t > m_bAckThresholds
Block ACK thresholds.
ns3::Time timeout
void SetBlockAckThresholdForAc(enum AcIndex ac, uint8_t threshold)
This method sets value of block ack threshold for a specific access class.
ObjectFactory m_mac
MAC object.
A class for an empty attribute value.
Definition: attribute.h:232
std::map< AcIndex, uint16_t > m_bAckInactivityTimeouts
Block ACK inactivity timeouts.
void SetMpduAggregatorForAc(enum AcIndex ac, std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue())
Set the class, type and attributes for the Mpdu aggregator.
QosWifiMacHelper()
Create a QosWifiMacHelper that is used to make life easier when working with Wifi devices using a QOS...
static QosWifiMacHelper Default(void)
Create a mac helper in a default working state.
tuple mac
Definition: third.py:92
create QoS-enabled MAC layers for a ns3::WifiNetDevice.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual ~QosWifiMacHelper()
Destroy a QosWifiMacHelper.
virtual Ptr< WifiMac > Create(void) const
create MAC layers for a ns3::WifiNetDevice.
virtual void SetType(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue())
Set the underlying type of the MAC and its attributes.
Instantiate subclasses of ns3::Object.
void SetBlockAckInactivityTimeoutForAc(enum AcIndex ac, uint16_t timeout)
Sets value of block ack inactivity timeout for a specific access class.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:38