A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ap-wifi-mac.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006, 2009 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Author: Mirko Banchi <mk.banchi@gmail.com>
21  */
22 #ifndef AP_WIFI_MAC_H
23 #define AP_WIFI_MAC_H
24 
25 #include "regular-wifi-mac.h"
26 #include "ht-capabilities.h"
27 #include "amsdu-subframe-header.h"
28 #include "supported-rates.h"
29 #include "ns3/random-variable-stream.h"
30 
31 namespace ns3 {
32 
40 class ApWifiMac : public RegularWifiMac
41 {
42 public:
43  static TypeId GetTypeId (void);
44 
45  ApWifiMac ();
46  virtual ~ApWifiMac ();
47 
51  virtual void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager);
52 
56  virtual void SetLinkUpCallback (Callback<void> linkUp);
57 
66  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
67 
79  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
80  virtual bool SupportsSendFrom (void) const;
81 
85  virtual void SetAddress (Mac48Address address);
89  void SetBeaconInterval (Time interval);
93  Time GetBeaconInterval (void) const;
97  void StartBeaconing (void);
98 
107  int64_t AssignStreams (int64_t stream);
108 
109 private:
110  virtual void Receive (Ptr<Packet> packet, const WifiMacHeader *hdr);
111  virtual void TxOk (const WifiMacHeader &hdr);
112  virtual void TxFailed (const WifiMacHeader &hdr);
113 
123  virtual void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket,
124  const WifiMacHeader *hdr);
125 
126  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to);
127  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to, uint8_t tid);
128  void SendProbeResp (Mac48Address to);
129  void SendAssocResp (Mac48Address to, bool success);
130  void SendOneBeacon (void);
131  HtCapabilities GetHtCapabilities (void) const;
132  SupportedRates GetSupportedRates (void) const;
133  void SetBeaconGeneration (bool enable);
134  bool GetBeaconGeneration (void) const;
135  virtual void DoDispose (void);
136  virtual void DoInitialize (void);
137 
144 };
145 
146 } // namespace ns3
147 
148 #endif /* AP_WIFI_MAC_H */
virtual void DoInitialize(void)
Definition: ap-wifi-mac.cc:660
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:166
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
HtCapabilities GetHtCapabilities(void) const
Definition: ap-wifi-mac.cc:326
int64_t AssignStreams(int64_t stream)
Definition: ap-wifi-mac.cc:184
The Ht Capabilities Information ElementThis class knows how to serialise and deserialise the Ht Capab...
void SendAssocResp(Mac48Address to, bool success)
Definition: ap-wifi-mac.cc:370
virtual bool SupportsSendFrom(void) const
Definition: ap-wifi-mac.cc:287
Ptr< DcaTxop > m_beaconDca
Definition: ap-wifi-mac.h:138
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
bool m_enableBeaconGeneration
Definition: ap-wifi-mac.h:140
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Definition: ap-wifi-mac.cc:277
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition: ap-wifi-mac.cc:146
base class for all MAC-level wifi objects.This class encapsulates all the low-level MAC functionality...
static TypeId GetTypeId(void)
Definition: ap-wifi-mac.cc:48
void ForwardDown(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Definition: ap-wifi-mac.cc:192
EventId m_beaconEvent
Definition: ap-wifi-mac.h:141
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
Definition: ap-wifi-mac.cc:465
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
Definition: ap-wifi-mac.cc:634
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition: ap-wifi-mac.cc:154
an EUI-48 address
Definition: mac48-address.h:41
bool GetBeaconGeneration(void) const
Definition: ap-wifi-mac.cc:132
Wi-Fi AP state machineHandle association, dis-association and authentication, of STAs within an infra...
Definition: ap-wifi-mac.h:40
void SendProbeResp(Mac48Address to)
Definition: ap-wifi-mac.cc:340
SupportedRates GetSupportedRates(void) const
Definition: ap-wifi-mac.cc:294
virtual void TxFailed(const WifiMacHeader &hdr)
Definition: ap-wifi-mac.cc:451
void SendOneBeacon(void)
Definition: ap-wifi-mac.cc:409
an identifier for simulation events.
Definition: event-id.h:46
virtual void DoDispose(void)
Definition: ap-wifi-mac.cc:97
virtual void SetAddress(Mac48Address address)
Definition: ap-wifi-mac.cc:107
Ptr< UniformRandomVariable > m_beaconJitter
Definition: ap-wifi-mac.h:142
Time m_beaconInterval
Definition: ap-wifi-mac.h:139
virtual ~ApWifiMac()
Definition: ap-wifi-mac.cc:91
bool m_enableBeaconJitter
Definition: ap-wifi-mac.h:143
Time GetBeaconInterval(void) const
Definition: ap-wifi-mac.cc:139
tuple address
Definition: first.py:37
virtual void TxOk(const WifiMacHeader &hdr)
Definition: ap-wifi-mac.cc:437
a unique identifier for an interface.
Definition: type-id.h:49
void StartBeaconing(void)
Definition: ap-wifi-mac.cc:177
void SetBeaconGeneration(bool enable)
Definition: ap-wifi-mac.cc:117