This is plugin to Mesh WiFi MAC, which implements interface to dot11s peer management protocol: it takes proper frames from MAC-layer, extracts peer link management information element and mesh configuration element and passes it to main part of protocol. More...
#include <peer-management-protocol-mac.h>
Inheritance diagram for ns3::dot11s::PeerManagementProtocolMac:
Collaboration diagram for ns3::dot11s::PeerManagementProtocolMac:Classes | |
| struct | PlinkFrameStart |
| This structure keeps all fields in peer link management frame, which are not subclasses of WifiInformationElement. More... | |
| struct | Statistics |
Public Member Functions | |
| PeerManagementProtocolMac (uint32_t interface, Ptr< PeerManagementProtocol > protocol) | |
| ~PeerManagementProtocolMac () | |
| int64_t | AssignStreams (int64_t stream) |
| Assign a fixed random variable stream number to the random variables used by this model. More... | |
| bool | Receive (Ptr< Packet > packet, const WifiMacHeader &header) |
| Process received frame. More... | |
| void | SetParent (Ptr< MeshWifiInterfaceMac > parent) |
| Each plugin must be installed on interface to work. More... | |
| void | UpdateBeacon (MeshWifiBeacon &beacon) const |
| Update beacon before it will be formed and sent. More... | |
| bool | UpdateOutcomingFrame (Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to) |
| Update frame before it will be forwarded down. More... | |
Public Member Functions inherited from ns3::MeshWifiInterfaceMacPlugin | |
| virtual | ~MeshWifiInterfaceMacPlugin () |
| This is for subclasses. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< MeshWifiInterfaceMacPlugin > | |
| SimpleRefCount () | |
| Constructor. More... | |
| SimpleRefCount (const SimpleRefCount &o) | |
| Copy constructor. More... | |
| uint32_t | GetReferenceCount (void) const |
| Get the reference count of the object. More... | |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| Assignment. More... | |
| void | Ref (void) const |
| Increment the reference count. More... | |
| void | Unref (void) const |
| Decrement the reference count. More... | |
Private Member Functions | |
| PeerManagementProtocolMac (const PeerManagementProtocolMac &) | |
| Mac48Address | GetAddress () const |
| debug only, used to print established links More... | |
| PeerManagementProtocolMac & | operator= (const PeerManagementProtocolMac &) |
| void | SendPeerLinkManagementFrame (Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig) |
| void | SetBeaconShift (Time shift) |
| BCA functionality. More... | |
| void | SetPeerManagerProtcol (Ptr< PeerManagementProtocol > protocol) |
| void | TxError (WifiMacHeader const &hdr) |
| Closes link when a proper number of successive transmissions have failed. More... | |
| void | TxOk (WifiMacHeader const &hdr) |
Create peer link management frames | |
| Ptr< Packet > | CreatePeerLinkOpenFrame () |
| Parses the start of the frame, where no WifiInformationElements exist. More... | |
| Ptr< Packet > | CreatePeerLinkConfirmFrame () |
| Parses the start of the frame, where no WifiInformationElements exist. More... | |
| Ptr< Packet > | CreatePeerLinkCloseFrame () |
| Parses the start of the frame, where no WifiInformationElements exist. More... | |
| PlinkFrameStart | ParsePlinkFrame (Ptr< const Packet > packet) |
| Parses the start of the frame, where no WifiInformationElements exist. More... | |
Private Attributes | |
Information about MAC and protocol: | |
| Ptr< MeshWifiInterfaceMac > | m_parent |
| uint32_t | m_ifIndex |
| Ptr< PeerManagementProtocol > | m_protocol |
Friends | |
| class | PeerLink |
| class | PeerManagementProtocol |
Statistics | |
| struct Statistics | m_stats |
| void | Report (std::ostream &) const |
| void | ResetStats () |
| uint32_t | GetLinkMetric (Mac48Address peerAddress) |
Additional Inherited Members | |
Static Public Member Functions inherited from ns3::SimpleRefCount< MeshWifiInterfaceMacPlugin > | |
| static void | Cleanup (void) |
| Noop. More... | |
This is plugin to Mesh WiFi MAC, which implements interface to dot11s peer management protocol: it takes proper frames from MAC-layer, extracts peer link management information element and mesh configuration element and passes it to main part of protocol.
Definition at line 42 of file peer-management-protocol-mac.h.
| ns3::dot11s::PeerManagementProtocolMac::PeerManagementProtocolMac | ( | uint32_t | interface, |
| Ptr< PeerManagementProtocol > | protocol | ||
| ) |
Definition at line 34 of file peer-management-protocol-mac.cc.
References m_ifIndex, and m_protocol.
| ns3::dot11s::PeerManagementProtocolMac::~PeerManagementProtocolMac | ( | ) |
Definition at line 41 of file peer-management-protocol-mac.cc.
|
private |
|
virtual |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned.
| stream | first stream index to use |
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 320 of file peer-management-protocol-mac.cc.
References m_protocol.
Parses the start of the frame, where no WifiInformationElements exist.
Parses the start of the frame, where no WifiInformationElements exist.
Parses the start of the frame, where no WifiInformationElements exist.
|
private |
debug only, used to print established links
Definition at line 258 of file peer-management-protocol-mac.cc.
References m_parent.
Referenced by ns3::dot11s::PeerLink::Report().
Here is the caller graph for this function:| uint32_t ns3::dot11s::PeerManagementProtocolMac::GetLinkMetric | ( | Mac48Address | peerAddress | ) |
Definition at line 315 of file peer-management-protocol-mac.cc.
References m_parent.
Referenced by ns3::dot11s::PeerLink::Report().
Here is the caller graph for this function:
|
private |
|
private |
Parses the start of the frame, where no WifiInformationElements exist.
|
virtual |
Process received frame.
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 63 of file peer-management-protocol-mac.cc.
References ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::aid, ns3::dot11s::PeerManagementProtocolMac::Statistics::brokenMgt, ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::config, ns3::Packet::Copy(), ns3::WifiInformationElementVector::FindFirst(), ns3::WifiActionHeader::GetAction(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetAddr3(), ns3::MgtProbeResponseHeader::GetBeaconIntervalUs(), ns3::WifiActionHeader::GetCategory(), ns3::dot11s::PeerLinkFrameStart::GetFields(), ns3::Packet::GetSize(), IE11S_BEACON_TIMING, IE11S_MESH_ID, IE11S_PEERING_MANAGEMENT, ns3::WifiMacHeader::IsAction(), ns3::WifiMacHeader::IsBeacon(), ns3::dot11s::IeMeshId::IsEqual(), m_ifIndex, m_parent, m_protocol, m_stats, ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::meshId, ns3::MicroSeconds(), NS_ASSERT, ns3::WifiActionHeader::PEER_LINK_CLOSE, ns3::WifiActionHeader::PEER_LINK_CONFIRM, ns3::WifiActionHeader::PEER_LINK_OPEN, ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::rates, ns3::Packet::RemoveHeader(), ns3::dot11s::PeerManagementProtocolMac::Statistics::rxClose, ns3::dot11s::PeerManagementProtocolMac::Statistics::rxConfirm, ns3::dot11s::PeerManagementProtocolMac::Statistics::rxMgt, ns3::dot11s::PeerManagementProtocolMac::Statistics::rxMgtBytes, ns3::dot11s::PeerManagementProtocolMac::Statistics::rxOpen, ns3::WifiActionHeader::SELF_PROTECTED, ns3::WifiActionHeader::ActionValue::selfProtectedAction, ns3::dot11s::PeerLinkFrameStart::SetPlinkFrameSubtype(), and ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::subtype.
Here is the call graph for this function:| void ns3::dot11s::PeerManagementProtocolMac::Report | ( | std::ostream & | os | ) | const |
Definition at line 302 of file peer-management-protocol-mac.cc.
References m_parent, m_stats, and ns3::dot11s::PeerManagementProtocolMac::Statistics::Print().
Here is the call graph for this function:| void ns3::dot11s::PeerManagementProtocolMac::ResetStats | ( | ) |
Definition at line 310 of file peer-management-protocol-mac.cc.
References m_stats.
|
private |
Definition at line 196 of file peer-management-protocol-mac.cc.
References ns3::Packet::AddHeader(), ns3::WifiInformationElementVector::AddInformationElement(), ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::aid, ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::capability, ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::config, ns3::dot11s::IePeerManagement::GetReasonCode(), ns3::Packet::GetSize(), m_parent, m_protocol, m_stats, ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::meshId, ns3::WifiActionHeader::PEER_LINK_CLOSE, ns3::WifiActionHeader::PEER_LINK_CONFIRM, ns3::WifiActionHeader::PEER_LINK_OPEN, ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::rates, ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::reasonCode, ns3::WifiActionHeader::SELF_PROTECTED, ns3::WifiActionHeader::ActionValue::selfProtectedAction, ns3::WifiMacHeader::SetAction(), ns3::WifiActionHeader::SetAction(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::dot11s::IeConfiguration::SetNeighborCount(), ns3::dot11s::PeerLinkFrameStart::SetPlinkFrameStart(), ns3::dot11s::PeerLinkFrameStart::PlinkFrameStartFields::subtype, ns3::dot11s::IePeerManagement::SubtypeIsClose(), ns3::dot11s::IePeerManagement::SubtypeIsConfirm(), ns3::dot11s::IePeerManagement::SubtypeIsOpen(), ns3::dot11s::PeerManagementProtocolMac::Statistics::txClose, ns3::dot11s::PeerManagementProtocolMac::Statistics::txConfirm, ns3::dot11s::PeerManagementProtocolMac::Statistics::txMgt, ns3::dot11s::PeerManagementProtocolMac::Statistics::txMgtBytes, and ns3::dot11s::PeerManagementProtocolMac::Statistics::txOpen.
Referenced by ns3::dot11s::PeerLink::SendPeerLinkClose(), ns3::dot11s::PeerLink::SendPeerLinkConfirm(), and ns3::dot11s::PeerLink::SendPeerLinkOpen().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
BCA functionality.
Definition at line 270 of file peer-management-protocol-mac.cc.
References ns3::dot11s::PeerManagementProtocolMac::Statistics::beaconShift, m_parent, m_stats, and ns3::Seconds().
Here is the call graph for this function:
|
virtual |
Each plugin must be installed on interface to work.
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 46 of file peer-management-protocol-mac.cc.
References m_parent, ns3::MakeCallback(), TxError(), and TxOk().
Here is the call graph for this function:
|
private |
|
private |
Closes link when a proper number of successive transmissions have failed.
Definition at line 53 of file peer-management-protocol-mac.cc.
References ns3::WifiMacHeader::GetAddr1(), m_ifIndex, and m_protocol.
Referenced by SetParent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 58 of file peer-management-protocol-mac.cc.
References ns3::WifiMacHeader::GetAddr1(), m_ifIndex, and m_protocol.
Referenced by SetParent().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Update beacon before it will be formed and sent.
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 184 of file peer-management-protocol-mac.cc.
References ns3::MeshWifiBeacon::AddInformationElement(), ns3::MeshWifiBeacon::GetBeaconInterval(), m_ifIndex, and m_protocol.
Here is the call graph for this function:
|
virtual |
Update frame before it will be forwarded down.
Implements ns3::MeshWifiInterfaceMacPlugin.
Definition at line 154 of file peer-management-protocol-mac.cc.
References ns3::dot11s::PeerManagementProtocolMac::Statistics::dropped, ns3::WifiMacHeader::GetAddr1(), ns3::WifiActionHeader::GetCategory(), ns3::WifiMacHeader::IsAction(), ns3::Mac48Address::IsGroup(), m_ifIndex, m_protocol, m_stats, ns3::Packet::PeekHeader(), and ns3::WifiActionHeader::SELF_PROTECTED.
Here is the call graph for this function:
|
friend |
Definition at line 66 of file peer-management-protocol-mac.h.
|
friend |
Definition at line 65 of file peer-management-protocol-mac.h.
|
private |
Definition at line 129 of file peer-management-protocol-mac.h.
Referenced by PeerManagementProtocolMac(), Receive(), TxError(), TxOk(), UpdateBeacon(), and UpdateOutcomingFrame().
|
private |
Definition at line 128 of file peer-management-protocol-mac.h.
Referenced by GetAddress(), GetLinkMetric(), Receive(), Report(), SendPeerLinkManagementFrame(), SetBeaconShift(), and SetParent().
|
private |
Definition at line 130 of file peer-management-protocol-mac.h.
Referenced by AssignStreams(), PeerManagementProtocolMac(), Receive(), SendPeerLinkManagementFrame(), TxError(), TxOk(), UpdateBeacon(), and UpdateOutcomingFrame().
|
private |
Definition at line 124 of file peer-management-protocol-mac.h.
Referenced by Receive(), Report(), ResetStats(), SendPeerLinkManagementFrame(), SetBeaconShift(), and UpdateOutcomingFrame().