non-QoS AP state machine More...
#include <nqap-wifi-mac.h>
Public Member Functions | |
NqapWifiMac () | |
~NqapWifiMac () | |
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 |
void | SetBeaconInterval (Time interval) |
Time | GetBeaconInterval (void) const |
void | StartBeaconing (void) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::NqapWifiMac. | |
Private Member Functions | |
void | Receive (Ptr< Packet > packet, WifiMacHeader const *hdr) |
void | ForwardUp (Ptr< Packet > packet, Mac48Address from, Mac48Address to) |
void | ForwardDown (Ptr< const Packet > packet, Mac48Address from, Mac48Address to) |
void | TxOk (WifiMacHeader const &hdr) |
void | TxFailed (WifiMacHeader const &hdr) |
void | SendProbeResp (Mac48Address to) |
void | SendAssocResp (Mac48Address to, bool success) |
void | SendOneBeacon (void) |
SupportedRates | GetSupportedRates (void) const |
void | SetBeaconGeneration (bool enable) |
bool | GetBeaconGeneration (void) const |
virtual void | DoDispose (void) |
NqapWifiMac (const NqapWifiMac &ctor_arg) | |
NqapWifiMac & | operator= (const NqapWifiMac &o) |
Private Attributes | |
Ptr< DcaTxop > | m_dca |
Ptr< DcaTxop > | m_beaconDca |
Ptr< WifiRemoteStationManager > | m_stationManager |
Ptr< WifiPhy > | m_phy |
Callback< void, Ptr< Packet > , Mac48Address, Mac48Address > | m_upCallback |
Time | m_beaconInterval |
DcfManager * | m_dcfManager |
MacRxMiddle * | m_rxMiddle |
Ptr< MacLow > | m_low |
Ssid | m_ssid |
EventId | m_beaconEvent |
Time | m_eifsNoDifs |
non-QoS AP state machine
Handle association, dis-association and authentication, of STAs within an IBSS. This class uses two output queues, each of which is server by a single DCF
Definition at line 53 of file nqap-wifi-mac.h.
ns3::NqapWifiMac::NqapWifiMac | ( | ) |
Definition at line 63 of file nqap-wifi-mac.cc.
References m_beaconDca, m_dca, m_dcfManager, m_low, m_rxMiddle, ns3::MakeCallback(), NS_LOG_FUNCTION, ns3::MacRxMiddle::Receive(), Receive(), ns3::MacRxMiddle::SetForwardCallback(), ns3::DcfManager::SetupLowListener(), TxFailed(), and TxOk().
ns3::NqapWifiMac::~NqapWifiMac | ( | ) |
Definition at line 88 of file nqap-wifi-mac.cc.
References NS_LOG_FUNCTION.
ns3::NqapWifiMac::NqapWifiMac | ( | const NqapWifiMac & | ctor_arg | ) | [private] |
void ns3::NqapWifiMac::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 94 of file nqap-wifi-mac.cc.
References ns3::EventId::Cancel(), m_beaconDca, m_beaconEvent, m_dca, m_dcfManager, m_low, m_phy, m_rxMiddle, and NS_LOG_FUNCTION.
void ns3::NqapWifiMac::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 305 of file nqap-wifi-mac.cc.
References ForwardDown(), m_low, and NS_LOG_FUNCTION.
void ns3::NqapWifiMac::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 299 of file nqap-wifi-mac.cc.
References ForwardDown(), and NS_LOG_FUNCTION.
void ns3::NqapWifiMac::ForwardDown | ( | Ptr< const Packet > | packet, | |
Mac48Address | from, | |||
Mac48Address | to | |||
) | [private] |
Definition at line 286 of file nqap-wifi-mac.cc.
References GetAddress(), m_dca, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsFrom(), ns3::WifiMacHeader::SetDsNotTo(), and ns3::WifiMacHeader::SetTypeData().
void ns3::NqapWifiMac::ForwardUp | ( | Ptr< Packet > | packet, | |
Mac48Address | from, | |||
Mac48Address | to | |||
) | [private] |
Definition at line 280 of file nqap-wifi-mac.cc.
References m_upCallback, and NS_LOG_FUNCTION.
Referenced by Receive().
Time ns3::NqapWifiMac::GetAckTimeout | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 186 of file nqap-wifi-mac.cc.
References m_low.
Mac48Address ns3::NqapWifiMac::GetAddress | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 238 of file nqap-wifi-mac.cc.
References m_low.
Referenced by ForwardDown(), Receive(), SendAssocResp(), SendOneBeacon(), and SendProbeResp().
bool ns3::NqapWifiMac::GetBeaconGeneration | ( | void | ) | const [private] |
Definition at line 124 of file nqap-wifi-mac.cc.
References ns3::EventId::IsRunning(), and m_beaconEvent.
Referenced by GetTypeId().
Time ns3::NqapWifiMac::GetBeaconInterval | ( | void | ) | const |
Definition at line 129 of file nqap-wifi-mac.cc.
References m_beaconInterval.
Referenced by GetTypeId().
Mac48Address ns3::NqapWifiMac::GetBssid | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 261 of file nqap-wifi-mac.cc.
References m_low.
Time ns3::NqapWifiMac::GetCtsTimeout | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 191 of file nqap-wifi-mac.cc.
References m_low.
Time ns3::NqapWifiMac::GetEifsNoDifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 181 of file nqap-wifi-mac.cc.
References m_eifsNoDifs.
Time ns3::NqapWifiMac::GetPifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 196 of file nqap-wifi-mac.cc.
References m_low.
Time ns3::NqapWifiMac::GetSifs | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 176 of file nqap-wifi-mac.cc.
References m_low.
Time ns3::NqapWifiMac::GetSlot | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 171 of file nqap-wifi-mac.cc.
References m_low.
Ssid ns3::NqapWifiMac::GetSsid | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 243 of file nqap-wifi-mac.cc.
References m_ssid.
Referenced by SendOneBeacon(), and SendProbeResp().
SupportedRates ns3::NqapWifiMac::GetSupportedRates | ( | void | ) | const [private] |
Definition at line 316 of file nqap-wifi-mac.cc.
References ns3::SupportedRates::AddSupportedRate(), ns3::WifiMode::GetDataRate(), m_phy, m_stationManager, and ns3::SupportedRates::SetBasicRate().
Referenced by SendAssocResp(), SendOneBeacon(), and SendProbeResp().
TypeId ns3::NqapWifiMac::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::NqapWifiMac.
This object is accessible through the following paths with Config::Set and Config::Connect:
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 44 of file nqap-wifi-mac.cc.
References ns3::TypeId::AddAttribute(), GetBeaconGeneration(), GetBeaconInterval(), ns3::Seconds(), SetBeaconGeneration(), SetBeaconInterval(), and ns3::TypeId::SetParent().
NqapWifiMac& ns3::NqapWifiMac::operator= | ( | const NqapWifiMac & | o | ) | [private] |
void ns3::NqapWifiMac::Receive | ( | Ptr< Packet > | packet, | |
WifiMacHeader const * | hdr | |||
) | [private] |
Definition at line 428 of file nqap-wifi-mac.cc.
References ns3::WifiRemoteStation::AddSupportedMode(), ForwardDown(), ForwardUp(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetAddr3(), GetAddress(), ns3::WifiMode::GetDataRate(), ns3::MgtAssocRequestHeader::GetSupportedRates(), ns3::WifiRemoteStation::IsAssociated(), ns3::WifiMacHeader::IsAssocReq(), ns3::WifiMacHeader::IsAuthentication(), ns3::Mac48Address::IsBroadcast(), ns3::WifiMacHeader::IsData(), ns3::WifiMacHeader::IsDeauthentication(), ns3::WifiMacHeader::IsDisassociation(), ns3::WifiMacHeader::IsFromDs(), ns3::WifiMacHeader::IsMgt(), ns3::Mac48Address::IsMulticast(), ns3::WifiMacHeader::IsProbeReq(), ns3::WifiMacHeader::IsReassocReq(), ns3::SupportedRates::IsSupportedRate(), ns3::WifiMacHeader::IsToDs(), m_phy, m_stationManager, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiRemoteStation::RecordDisassociated(), ns3::WifiRemoteStation::RecordWaitAssocTxOk(), SendAssocResp(), and SendProbeResp().
Referenced by NqapWifiMac().
void ns3::NqapWifiMac::SendAssocResp | ( | Mac48Address | to, | |
bool | success | |||
) | [private] |
Definition at line 355 of file nqap-wifi-mac.cc.
References GetAddress(), GetSupportedRates(), m_dca, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetAssocResp(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::StatusCode::SetFailure(), and ns3::StatusCode::SetSuccess().
Referenced by Receive().
void ns3::NqapWifiMac::SendOneBeacon | ( | void | ) | [private] |
Definition at line 383 of file nqap-wifi-mac.cc.
References GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::TimeUnit< 1 >::GetMicroSeconds(), GetSsid(), GetSupportedRates(), m_beaconDca, m_beaconEvent, m_beaconInterval, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetBeacon(), ns3::WifiMacHeader::SetDsNotFrom(), and ns3::WifiMacHeader::SetDsNotTo().
Referenced by SetBeaconGeneration(), and StartBeaconing().
void ns3::NqapWifiMac::SendProbeResp | ( | Mac48Address | to | ) | [private] |
Definition at line 335 of file nqap-wifi-mac.cc.
References GetAddress(), ns3::TimeUnit< 1 >::GetMicroSeconds(), GetSsid(), GetSupportedRates(), m_beaconInterval, m_dca, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), and ns3::WifiMacHeader::SetProbeResp().
Referenced by Receive().
void ns3::NqapWifiMac::SetAckTimeout | ( | Time | ackTimeout | ) | [virtual] |
ackTimeout | the duration of an ACK timeout. |
Implements ns3::WifiMac.
Definition at line 156 of file nqap-wifi-mac.cc.
References m_low.
void ns3::NqapWifiMac::SetAddress | ( | Mac48Address | address | ) | [virtual] |
address | the current address of this MAC layer. |
Implements ns3::WifiMac.
Definition at line 248 of file nqap-wifi-mac.cc.
References m_low, and NS_LOG_FUNCTION.
void ns3::NqapWifiMac::SetBeaconGeneration | ( | bool | enable | ) | [private] |
Definition at line 110 of file nqap-wifi-mac.cc.
References ns3::EventId::Cancel(), m_beaconEvent, NS_LOG_FUNCTION, ns3::Simulator::ScheduleNow(), and SendOneBeacon().
Referenced by GetTypeId().
void ns3::NqapWifiMac::SetBeaconInterval | ( | Time | interval | ) |
interval | the interval between two beacon transmissions. |
Definition at line 268 of file nqap-wifi-mac.cc.
References m_beaconInterval, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::NqapWifiMac::SetCtsTimeout | ( | Time | ctsTimeout | ) | [virtual] |
ctsTimeout | the duration of a CTS timeout. |
Implements ns3::WifiMac.
Definition at line 161 of file nqap-wifi-mac.cc.
References m_low.
void ns3::NqapWifiMac::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 149 of file nqap-wifi-mac.cc.
References m_dcfManager, m_eifsNoDifs, NS_LOG_FUNCTION, and ns3::DcfManager::SetEifsNoDifs().
void ns3::NqapWifiMac::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 218 of file nqap-wifi-mac.cc.
References m_upCallback, and NS_LOG_FUNCTION.
void ns3::NqapWifiMac::SetLinkDownCallback | ( | Callback< void > | linkDown | ) | [virtual] |
linkDown | the callback to invoke when the link becomes down. |
Implements ns3::WifiMac.
Definition at line 233 of file nqap-wifi-mac.cc.
References NS_LOG_FUNCTION.
void ns3::NqapWifiMac::SetLinkUpCallback | ( | Callback< void > | linkUp | ) | [virtual] |
linkUp | the callback to invoke when the link becomes up. |
Implements ns3::WifiMac.
Definition at line 224 of file nqap-wifi-mac.cc.
References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), and NS_LOG_FUNCTION.
void ns3::NqapWifiMac::SetPifs | ( | Time | pifs | ) | [virtual] |
pifs | the pifs duration. |
Implements ns3::WifiMac.
Definition at line 166 of file nqap-wifi-mac.cc.
References m_low.
void ns3::NqapWifiMac::SetSifs | ( | Time | sifs | ) | [virtual] |
sifs | the sifs duration |
Implements ns3::WifiMac.
Definition at line 142 of file nqap-wifi-mac.cc.
References m_dcfManager, m_low, NS_LOG_FUNCTION, and ns3::DcfManager::SetSifs().
void ns3::NqapWifiMac::SetSlot | ( | Time | slotTime | ) | [virtual] |
slotTime | the slot duration |
Implements ns3::WifiMac.
Definition at line 135 of file nqap-wifi-mac.cc.
References m_dcfManager, m_low, NS_LOG_FUNCTION, and ns3::DcfManager::SetSlot().
void ns3::NqapWifiMac::SetSsid | ( | Ssid | ssid | ) | [virtual] |
ssid | the current ssid of this MAC layer. |
Implements ns3::WifiMac.
Definition at line 255 of file nqap-wifi-mac.cc.
References m_ssid, and NS_LOG_FUNCTION.
phy | the physical layer attached to this MAC. |
Implements ns3::WifiMac.
Definition at line 201 of file nqap-wifi-mac.cc.
References m_dcfManager, m_low, m_phy, NS_LOG_FUNCTION, and ns3::DcfManager::SetupPhyListener().
void ns3::NqapWifiMac::SetWifiRemoteStationManager | ( | Ptr< WifiRemoteStationManager > | stationManager | ) | [virtual] |
stationManager | the station manager attached to this MAC. |
Implements ns3::WifiMac.
Definition at line 209 of file nqap-wifi-mac.cc.
References m_beaconDca, m_dca, m_low, m_stationManager, and NS_LOG_FUNCTION.
void ns3::NqapWifiMac::StartBeaconing | ( | void | ) |
Start beacon transmission immediately.
Definition at line 274 of file nqap-wifi-mac.cc.
References NS_LOG_FUNCTION, and SendOneBeacon().
bool ns3::NqapWifiMac::SupportsSendFrom | ( | void | ) | const [virtual] |
Implements ns3::WifiMac.
Definition at line 311 of file nqap-wifi-mac.cc.
void ns3::NqapWifiMac::TxFailed | ( | WifiMacHeader const & | hdr | ) | [private] |
Definition at line 416 of file nqap-wifi-mac.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::IsAssocResp(), ns3::WifiRemoteStation::IsWaitAssocTxOk(), m_stationManager, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::WifiRemoteStation::RecordGotAssocTxFailed().
Referenced by NqapWifiMac().
void ns3::NqapWifiMac::TxOk | ( | WifiMacHeader const & | hdr | ) | [private] |
Definition at line 404 of file nqap-wifi-mac.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::IsAssocResp(), ns3::WifiRemoteStation::IsWaitAssocTxOk(), m_stationManager, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::WifiRemoteStation::RecordGotAssocTxOk().
Referenced by NqapWifiMac().
Ptr<DcaTxop> ns3::NqapWifiMac::m_beaconDca [private] |
Definition at line 118 of file nqap-wifi-mac.h.
Referenced by DoDispose(), NqapWifiMac(), SendOneBeacon(), and SetWifiRemoteStationManager().
EventId ns3::NqapWifiMac::m_beaconEvent [private] |
Definition at line 128 of file nqap-wifi-mac.h.
Referenced by DoDispose(), GetBeaconGeneration(), SendOneBeacon(), and SetBeaconGeneration().
Time ns3::NqapWifiMac::m_beaconInterval [private] |
Definition at line 122 of file nqap-wifi-mac.h.
Referenced by GetBeaconInterval(), SendOneBeacon(), SendProbeResp(), and SetBeaconInterval().
Ptr<DcaTxop> ns3::NqapWifiMac::m_dca [private] |
Definition at line 117 of file nqap-wifi-mac.h.
Referenced by DoDispose(), ForwardDown(), NqapWifiMac(), SendAssocResp(), SendProbeResp(), and SetWifiRemoteStationManager().
DcfManager* ns3::NqapWifiMac::m_dcfManager [private] |
Definition at line 124 of file nqap-wifi-mac.h.
Referenced by DoDispose(), NqapWifiMac(), SetEifsNoDifs(), SetSifs(), SetSlot(), and SetWifiPhy().
Time ns3::NqapWifiMac::m_eifsNoDifs [private] |
Definition at line 129 of file nqap-wifi-mac.h.
Referenced by GetEifsNoDifs(), and SetEifsNoDifs().
Ptr<MacLow> ns3::NqapWifiMac::m_low [private] |
Definition at line 126 of file nqap-wifi-mac.h.
Referenced by DoDispose(), Enqueue(), GetAckTimeout(), GetAddress(), GetBssid(), GetCtsTimeout(), GetPifs(), GetSifs(), GetSlot(), NqapWifiMac(), SetAckTimeout(), SetAddress(), SetCtsTimeout(), SetPifs(), SetSifs(), SetSlot(), SetWifiPhy(), and SetWifiRemoteStationManager().
Ptr<WifiPhy> ns3::NqapWifiMac::m_phy [private] |
Definition at line 120 of file nqap-wifi-mac.h.
Referenced by DoDispose(), GetSupportedRates(), Receive(), and SetWifiPhy().
MacRxMiddle* ns3::NqapWifiMac::m_rxMiddle [private] |
Definition at line 125 of file nqap-wifi-mac.h.
Referenced by DoDispose(), and NqapWifiMac().
Ssid ns3::NqapWifiMac::m_ssid [private] |
Definition at line 127 of file nqap-wifi-mac.h.
Definition at line 119 of file nqap-wifi-mac.h.
Referenced by GetSupportedRates(), Receive(), SetWifiRemoteStationManager(), TxFailed(), and TxOk().
Callback<void, Ptr<Packet>,Mac48Address, Mac48Address> ns3::NqapWifiMac::m_upCallback [private] |
Definition at line 121 of file nqap-wifi-mac.h.
Referenced by ForwardUp(), and SetForwardUpCallback().