A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ap-wifi-mac.h
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 
27 #include "amsdu-subframe-header.h"
28 #include "supported-rates.h"
29 
30 namespace ns3 {
31 
39 class ApWifiMac : public RegularWifiMac
40 {
41 public:
42  static TypeId GetTypeId (void);
43 
44  ApWifiMac ();
45  virtual ~ApWifiMac ();
46 
50  virtual void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager);
51 
55  virtual void SetLinkUpCallback (Callback<void> linkUp);
56 
65  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
66 
78  virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
79  virtual bool SupportsSendFrom (void) const;
80 
84  virtual void SetAddress (Mac48Address address);
88  void SetBeaconInterval (Time interval);
92  Time GetBeaconInterval (void) const;
96  void StartBeaconing (void);
97 
98 private:
99  virtual void Receive (Ptr<Packet> packet, const WifiMacHeader *hdr);
100  virtual void TxOk (const WifiMacHeader &hdr);
101  virtual void TxFailed (const WifiMacHeader &hdr);
102 
112  virtual void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket,
113  const WifiMacHeader *hdr);
114 
115  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to);
116  void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to, uint8_t tid);
117  void SendProbeResp (Mac48Address to);
118  void SendAssocResp (Mac48Address to, bool success);
119  void SendOneBeacon (void);
120  SupportedRates GetSupportedRates (void) const;
121  void SetBeaconGeneration (bool enable);
122  bool GetBeaconGeneration (void) const;
123  virtual void DoDispose (void);
124  virtual void DoInitialize (void);
125 
126  Ptr<DcaTxop> m_beaconDca;
127  Time m_beaconInterval;
128  bool m_enableBeaconGeneration;
129  EventId m_beaconEvent;
130 };
131 
132 } // namespace ns3
133 
134 #endif /* AP_WIFI_MAC_H */
virtual void DoInitialize(void)
Definition: ap-wifi-mac.cc:575
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:158
keep track of time unit.
Definition: nstime.h:149
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Definition: ap-wifi-mac.cc:259
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition: ap-wifi-mac.cc:138
base class for all MAC-level wifi objects.This class encapsulates all the low-level MAC functionality...
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
Definition: ap-wifi-mac.cc:407
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
Definition: ap-wifi-mac.cc:549
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition: ap-wifi-mac.cc:146
an EUI-48 address
Definition: mac48-address.h:41
Wi-Fi AP state machineHandle association, dis-association and authentication, of STAs within an infra...
Definition: ap-wifi-mac.h:39
an identifier for simulation events.
Definition: event-id.h:46
virtual void DoDispose(void)
Definition: ap-wifi-mac.cc:89
virtual void SetAddress(Mac48Address address)
Definition: ap-wifi-mac.cc:99
Time GetBeaconInterval(void) const
Definition: ap-wifi-mac.cc:131
a unique identifier for an interface.
Definition: type-id.h:44
void StartBeaconing(void)
Definition: ap-wifi-mac.cc:169