A Discrete-Event Network Simulator
API
ocb-wifi-mac.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 * Copyright (c) 2013 Dalian University of Technology
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 * Junling Bu <linlinjavaer@gmail.com>
20 */
21#ifndef OCB_WIFI_MAC_H
22#define OCB_WIFI_MAC_H
23
25#include "wave-net-device.h"
26
27#include "ns3/object-factory.h"
28#include "ns3/wifi-mac-queue.h"
29#include "ns3/wifi-mac.h"
30
31namespace ns3
32{
33
34class OrganizationIdentifier;
35class WaveNetDevice;
36
50class OcbWifiMac : public WifiMac
51{
52 public:
57 static TypeId GetTypeId();
58 OcbWifiMac();
59 ~OcbWifiMac() override;
81
88 virtual Ssid GetSsid() const;
95 virtual void SetSsid(Ssid ssid);
101 virtual void SetBssid(Mac48Address bssid);
107 virtual Mac48Address GetBssid(uint8_t /* linkId */) const;
116 void SetLinkUpCallback(Callback<void> linkUp) override;
120 virtual void SetLinkDownCallback(Callback<void> linkDown);
129 void Enqueue(Ptr<Packet> packet, Mac48Address to) override;
130 bool CanForwardPacketsTo(Mac48Address to) const override;
139 void ConfigureEdca(uint32_t cwmin, uint32_t cwmax, uint32_t aifsn, enum AcIndex ac);
140
141 // below six public methods are used for MAC extension defined in IEEE 1609.4
153 void Suspend();
158 void Resume();
165 void MakeVirtualBusy(Time duration);
172 void CancleTx(enum AcIndex ac);
177 void Reset();
184
185 // Inherited from base class
186 void ConfigureStandard(enum WifiStandard standard) override;
187
188 protected:
189 void DoDispose() override;
190
191 private:
192 void Receive(Ptr<const WifiMpdu> mpdu, uint8_t linkId) override;
193 std::optional<uint8_t> GetLinkIdByAddress(const Mac48Address& address) const override;
194
196};
197
198} // namespace ns3
199#endif /* OCB_WIFI_MAC_H */
Callback template class.
Definition: callback.h:443
an EUI-48 address
Definition: mac48-address.h:46
STAs communicate with each directly outside the context of a BSS.
Definition: ocb-wifi-mac.h:51
std::optional< uint8_t > GetLinkIdByAddress(const Mac48Address &address) const override
Get the ID of the link having the given MAC address, if any.
virtual Ssid GetSsid() const
virtual void SetBssid(Mac48Address bssid)
void CancleTx(enum AcIndex ac)
void SetWifiPhy(Ptr< WifiPhy > phy)
Set the PHY.
VendorSpecificContentManager m_vscManager
VSC manager.
Definition: ocb-wifi-mac.h:195
void SetLinkUpCallback(Callback< void > linkUp) override
SetLinkUpCallback and SetLinkDownCallback will be overloaded In OCB mode, stations can send packets d...
void Suspend()
To support MAC extension for multiple channel operation, Suspend the activity in current MAC entity.
void AddReceiveVscCallback(OrganizationIdentifier oi, VscCallback cb)
Definition: ocb-wifi-mac.cc:97
virtual Mac48Address GetBssid(uint8_t) const
This method shall not be used in WAVE environment and here it will overloaded to log warn message.
virtual void SetSsid(Ssid ssid)
void EnableForWave(Ptr< WaveNetDevice > device)
void SendVsc(Ptr< Packet > vsc, Mac48Address peer, OrganizationIdentifier oi)
Definition: ocb-wifi-mac.cc:70
void Enqueue(Ptr< Packet > packet, Mac48Address to) override
virtual void SetLinkDownCallback(Callback< void > linkDown)
void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId) override
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
void DoDispose() override
Destructor implementation.
void Resume()
To support MAC extension for multiple channel operation, Resume the activity of suspended MAC entity.
void MakeVirtualBusy(Time duration)
~OcbWifiMac() override
Definition: ocb-wifi-mac.cc:64
void ConfigureEdca(uint32_t cwmin, uint32_t cwmax, uint32_t aifsn, enum AcIndex ac)
void RemoveReceiveVscCallback(OrganizationIdentifier oi)
static TypeId GetTypeId()
Get the type ID.
Definition: ocb-wifi-mac.cc:48
void ConfigureStandard(enum WifiStandard standard) override
bool CanForwardPacketsTo(Mac48Address to) const override
Return true if packets can be forwarded to the given destination, false otherwise.
void Reset()
To support MAC extension for multiple channel operation, Reset current MAC entity and flush its inter...
the organization identifier is a public organizationally unique identifier assigned by the IEEE.
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:60
VendorSpecificContentManager class.
base class for all MAC-level wifi objects.
Definition: wifi-mac.h:92
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:74
address
Definition: first.py:40
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ssid
Definition: third.py:86
phy
Definition: third.py:82