the Adhoc state machine More...
#include <adhoc-wifi-mac.h>
Public Types | |
typedef Callback< void, Ptr < Packet >, const Mac48Address & > | ForwardCallback |
Public Member Functions | |
AdhocWifiMac () | |
~AdhocWifiMac () | |
virtual void | SetSlot (Time slotTime) |
virtual void | SetSifs (Time sifs) |
virtual void | SetEifsNoDifs (Time eifsNoDifs) |
virtual void | SetAckTimeout (Time ackTimeout) |
virtual void | SetCtsTimeout (Time ctsTimeout) |
virtual void | SetPifs (Time pifs) |
virtual Time | GetSlot (void) const |
virtual Time | GetSifs (void) const |
virtual Time | GetEifsNoDifs (void) const |
virtual Time | GetAckTimeout (void) const |
virtual Time | GetCtsTimeout (void) const |
virtual Time | GetPifs (void) const |
virtual void | SetWifiPhy (Ptr< WifiPhy > phy) |
virtual void | SetWifiRemoteStationManager (Ptr< WifiRemoteStationManager > stationManager) |
virtual void | Enqueue (Ptr< const Packet > packet, Mac48Address to, Mac48Address from) |
virtual void | Enqueue (Ptr< const Packet > packet, Mac48Address to) |
virtual bool | SupportsSendFrom (void) const |
virtual void | SetForwardUpCallback (Callback< void, Ptr< Packet >, Mac48Address, Mac48Address > upCallback) |
virtual void | SetLinkUpCallback (Callback< void > linkUp) |
virtual void | SetLinkDownCallback (Callback< void > linkDown) |
virtual Mac48Address | GetAddress (void) const |
virtual Ssid | GetSsid (void) const |
virtual void | SetAddress (Mac48Address address) |
virtual void | SetSsid (Ssid ssid) |
virtual Mac48Address | GetBssid (void) const |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::AdhocWifiMac. | |
Private Member Functions | |
virtual void | DoDispose (void) |
void | ForwardUp (Ptr< Packet > packet, WifiMacHeader const *hdr) |
AdhocWifiMac (const AdhocWifiMac &ctor_arg) | |
AdhocWifiMac & | operator= (const AdhocWifiMac &o) |
Private Attributes | |
Ptr< DcaTxop > | m_dca |
Callback< void, Ptr< Packet > , Mac48Address, Mac48Address > | m_upCallback |
Ptr< WifiRemoteStationManager > | m_stationManager |
Ptr< WifiPhy > | m_phy |
DcfManager * | m_dcfManager |
MacRxMiddle * | m_rxMiddle |
Ptr< MacLow > | m_low |
Ssid | m_ssid |
Time | m_eifsNoDifs |
the Adhoc state machine
For now, this class is really empty but it should contain the code for the distributed generation of beacons in an adhoc network.
Definition at line 45 of file adhoc-wifi-mac.h.
typedef Callback<void, Ptr<Packet>, const Mac48Address &> ns3::AdhocWifiMac::ForwardCallback |
Definition at line 48 of file adhoc-wifi-mac.h.
ns3::AdhocWifiMac::AdhocWifiMac | ( | ) |
Definition at line 49 of file adhoc-wifi-mac.cc.
References ForwardUp(), GetBssid(), m_dca, m_dcfManager, m_low, m_rxMiddle, ns3::MakeCallback(), ns3::MacRxMiddle::Receive(), ns3::MacRxMiddle::SetForwardCallback(), and ns3::DcfManager::SetupLowListener().
ns3::AdhocWifiMac::~AdhocWifiMac | ( | ) |
Definition at line 65 of file adhoc-wifi-mac.cc.
ns3::AdhocWifiMac::AdhocWifiMac | ( | const AdhocWifiMac & | ctor_arg | ) | [private] |
void ns3::AdhocWifiMac::DoDispose | ( | void | ) | [private, virtual] |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
Reimplemented from ns3::Object.
Definition at line 69 of file adhoc-wifi-mac.cc.
References m_dca, m_dcfManager, m_low, m_phy, m_rxMiddle, and m_stationManager.
void ns3::AdhocWifiMac::Enqueue | ( | Ptr< const Packet > | packet, | |
Mac48Address | to | |||
) | [virtual] |
packet | the packet to send. | |
to | the address to which the packet should be sent. |
The packet should be enqueued in a tx queue, and should be dequeued as soon as the DCF function determines that access it granted to this MAC.
Implements ns3::WifiMac.
Definition at line 209 of file adhoc-wifi-mac.cc.
References ns3::WifiRemoteStation::AddSupportedMode(), GetBssid(), ns3::WifiRemoteStation::IsBrandNew(), m_dca, m_low, m_phy, m_stationManager, NS_LOG_FUNCTION, ns3::WifiRemoteStation::RecordDisassociated(), and ns3::WIFI_MAC_DATA.
void ns3::AdhocWifiMac::Enqueue | ( | Ptr< const Packet > | packet, | |
Mac48Address | to, | |||
Mac48Address | from | |||
) | [virtual] |
packet | the packet to send. | |
to | the address to which the packet should be sent. | |
from | the address from which the packet should be sent. |
The packet should be enqueued in a tx queue, and should be dequeued as soon as the DCF function determines that access it granted to this MAC. The extra parameter "from" allows this device to operate in a bridged mode, forwarding received frames without altering the source addresss.
Implements ns3::WifiMac.
Definition at line 204 of file adhoc-wifi-mac.cc.
References NS_FATAL_ERROR.
void ns3::AdhocWifiMac::ForwardUp | ( | Ptr< Packet > | packet, | |
WifiMacHeader const * | hdr | |||
) | [private] |
Definition at line 241 of file adhoc-wifi-mac.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), m_upCallback, and NS_LOG_DEBUG.
Referenced by AdhocWifiMac().
Time ns3::AdhocWifiMac::GetAckTimeout | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 131 of file adhoc-wifi-mac.cc.
References m_low.
Mac48Address ns3::AdhocWifiMac::GetAddress | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 174 of file adhoc-wifi-mac.cc.
References m_low.
Mac48Address ns3::AdhocWifiMac::GetBssid | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 184 of file adhoc-wifi-mac.cc.
References m_low.
Referenced by AdhocWifiMac(), and Enqueue().
Time ns3::AdhocWifiMac::GetCtsTimeout | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 136 of file adhoc-wifi-mac.cc.
References m_low.
Time ns3::AdhocWifiMac::GetEifsNoDifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 126 of file adhoc-wifi-mac.cc.
References m_eifsNoDifs.
Time ns3::AdhocWifiMac::GetPifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 141 of file adhoc-wifi-mac.cc.
References m_low.
Time ns3::AdhocWifiMac::GetSifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 121 of file adhoc-wifi-mac.cc.
References m_low.
Time ns3::AdhocWifiMac::GetSlot | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 116 of file adhoc-wifi-mac.cc.
References m_low.
Ssid ns3::AdhocWifiMac::GetSsid | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 179 of file adhoc-wifi-mac.cc.
References m_ssid.
TypeId ns3::AdhocWifiMac::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::AdhocWifiMac.
This object is accessible through the following paths with Config::Set and Config::Connect:
No Attributes defined for this type.
Attributes defined in parent class ns3::WifiMac:
No TraceSources defined for this type.
Reimplemented from ns3::WifiMac.
Definition at line 40 of file adhoc-wifi-mac.cc.
References ns3::TypeId::SetParent().
AdhocWifiMac& ns3::AdhocWifiMac::operator= | ( | const AdhocWifiMac & | o | ) | [private] |
void ns3::AdhocWifiMac::SetAckTimeout | ( | Time | ackTimeout | ) | [virtual] |
ackTimeout | the duration of an ACK timeout. |
Implements ns3::WifiMac.
Definition at line 101 of file adhoc-wifi-mac.cc.
References m_low.
void ns3::AdhocWifiMac::SetAddress | ( | Mac48Address | address | ) | [virtual] |
address | the current address of this MAC layer. |
Implements ns3::WifiMac.
Definition at line 189 of file adhoc-wifi-mac.cc.
References m_low.
void ns3::AdhocWifiMac::SetCtsTimeout | ( | Time | ctsTimeout | ) | [virtual] |
ctsTimeout | the duration of a CTS timeout. |
Implements ns3::WifiMac.
Definition at line 106 of file adhoc-wifi-mac.cc.
References m_low.
void ns3::AdhocWifiMac::SetEifsNoDifs | ( | Time | eifsNoDifs | ) | [virtual] |
eifsNoDifs | the duration of an EIFS minus DIFS. |
This value is used to calculate the EIFS depending on AIFSN.
Implements ns3::WifiMac.
Definition at line 95 of file adhoc-wifi-mac.cc.
References m_dcfManager, m_eifsNoDifs, and ns3::DcfManager::SetEifsNoDifs().
void ns3::AdhocWifiMac::SetForwardUpCallback | ( | Callback< void, Ptr< Packet >, Mac48Address, Mac48Address > | upCallback | ) | [virtual] |
upCallback | the callback to invoke when a packet must be forwarded up the stack. |
Implements ns3::WifiMac.
Definition at line 160 of file adhoc-wifi-mac.cc.
References m_upCallback.
void ns3::AdhocWifiMac::SetLinkDownCallback | ( | Callback< void > | linkDown | ) | [virtual] |
linkDown | the callback to invoke when the link becomes down. |
Implements ns3::WifiMac.
Definition at line 171 of file adhoc-wifi-mac.cc.
void ns3::AdhocWifiMac::SetLinkUpCallback | ( | Callback< void > | linkUp | ) | [virtual] |
linkUp | the callback to invoke when the link becomes up. |
Implements ns3::WifiMac.
Definition at line 165 of file adhoc-wifi-mac.cc.
void ns3::AdhocWifiMac::SetPifs | ( | Time | pifs | ) | [virtual] |
pifs | the pifs duration. |
Implements ns3::WifiMac.
Definition at line 111 of file adhoc-wifi-mac.cc.
References m_low.
void ns3::AdhocWifiMac::SetSifs | ( | Time | sifs | ) | [virtual] |
sifs | the sifs duration |
Implements ns3::WifiMac.
Definition at line 89 of file adhoc-wifi-mac.cc.
References m_dcfManager, m_low, and ns3::DcfManager::SetSifs().
void ns3::AdhocWifiMac::SetSlot | ( | Time | slotTime | ) | [virtual] |
slotTime | the slot duration |
Implements ns3::WifiMac.
Definition at line 83 of file adhoc-wifi-mac.cc.
References m_dcfManager, m_low, and ns3::DcfManager::SetSlot().
void ns3::AdhocWifiMac::SetSsid | ( | Ssid | ssid | ) | [virtual] |
ssid | the current ssid of this MAC layer. |
Implements ns3::WifiMac.
Definition at line 197 of file adhoc-wifi-mac.cc.
References m_ssid.
phy | the physical layer attached to this MAC. |
Implements ns3::WifiMac.
Definition at line 146 of file adhoc-wifi-mac.cc.
References m_dcfManager, m_low, m_phy, and ns3::DcfManager::SetupPhyListener().
void ns3::AdhocWifiMac::SetWifiRemoteStationManager | ( | Ptr< WifiRemoteStationManager > | stationManager | ) | [virtual] |
stationManager | the station manager attached to this MAC. |
Implements ns3::WifiMac.
Definition at line 153 of file adhoc-wifi-mac.cc.
References m_dca, m_low, and m_stationManager.
bool ns3::AdhocWifiMac::SupportsSendFrom | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 235 of file adhoc-wifi-mac.cc.
Ptr<DcaTxop> ns3::AdhocWifiMac::m_dca [private] |
Definition at line 90 of file adhoc-wifi-mac.h.
Referenced by AdhocWifiMac(), DoDispose(), Enqueue(), and SetWifiRemoteStationManager().
DcfManager* ns3::AdhocWifiMac::m_dcfManager [private] |
Definition at line 94 of file adhoc-wifi-mac.h.
Referenced by AdhocWifiMac(), DoDispose(), SetEifsNoDifs(), SetSifs(), SetSlot(), and SetWifiPhy().
Time ns3::AdhocWifiMac::m_eifsNoDifs [private] |
Definition at line 98 of file adhoc-wifi-mac.h.
Referenced by GetEifsNoDifs(), and SetEifsNoDifs().
Ptr<MacLow> ns3::AdhocWifiMac::m_low [private] |
Definition at line 96 of file adhoc-wifi-mac.h.
Referenced by AdhocWifiMac(), DoDispose(), Enqueue(), GetAckTimeout(), GetAddress(), GetBssid(), GetCtsTimeout(), GetPifs(), GetSifs(), GetSlot(), SetAckTimeout(), SetAddress(), SetCtsTimeout(), SetPifs(), SetSifs(), SetSlot(), SetWifiPhy(), and SetWifiRemoteStationManager().
Ptr<WifiPhy> ns3::AdhocWifiMac::m_phy [private] |
Definition at line 93 of file adhoc-wifi-mac.h.
Referenced by DoDispose(), Enqueue(), and SetWifiPhy().
MacRxMiddle* ns3::AdhocWifiMac::m_rxMiddle [private] |
Definition at line 95 of file adhoc-wifi-mac.h.
Referenced by AdhocWifiMac(), and DoDispose().
Ssid ns3::AdhocWifiMac::m_ssid [private] |
Definition at line 97 of file adhoc-wifi-mac.h.
Definition at line 92 of file adhoc-wifi-mac.h.
Referenced by DoDispose(), Enqueue(), and SetWifiRemoteStationManager().
Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> ns3::AdhocWifiMac::m_upCallback [private] |
Definition at line 91 of file adhoc-wifi-mac.h.
Referenced by ForwardUp(), and SetForwardUpCallback().