27 #include "ns3/mesh-wifi-interface-mac.h" 28 #include "ns3/simulator.h" 29 #include "ns3/mesh-information-element-vector.h" 84 if ((meshId != 0) && (
m_protocol->GetMeshId ()->IsEqual (*meshId)))
87 beacon_hdr.GetBeaconIntervalUs ()), beaconTiming);
91 NS_LOG_DEBUG (
"MeshId mismatch " <<
m_protocol->GetMeshId ()->PeekString () <<
" " << (*meshId) <<
"; ignoring");
131 NS_LOG_DEBUG (
"PEER_LINK_OPEN: configuration mismatch");
148 NS_LOG_DEBUG (
"PEER_LINK_CONFIRM: configuration mismatch");
166 NS_LOG_DEBUG (
"PEER_LINK_CLOSE: configuration mismatch");
186 if (peerElement->SubtypeIsOpen ())
191 if (peerElement->SubtypeIsConfirm ())
196 if (peerElement->SubtypeIsClose ())
202 m_protocol->ReceivePeerLinkFrame (
m_ifIndex, peerAddress, peerMpAddress, aid, *peerElement, config);
242 if (
m_protocol->GetBeaconCollisionAvoidance ())
270 fields.
config = meshConfig;
286 fields.
config = meshConfig;
323 m_parent->SendManagementFrame (packet, hdr);
348 txOpen (0), txConfirm (0), txClose (0), rxOpen (0), rxConfirm (0), rxClose (0), dropped (0), brokenMgt (0),
349 txMgt (0), txMgtBytes (0), rxMgt (0), rxMgtBytes (0), beaconShift (0)
356 "txOpen=\"" << txOpen <<
"\"" << std::endl <<
357 "txConfirm=\"" << txConfirm <<
"\"" << std::endl <<
358 "txClose=\"" << txClose <<
"\"" << std::endl <<
359 "rxOpen=\"" << rxOpen <<
"\"" << std::endl <<
360 "rxConfirm=\"" << rxConfirm <<
"\"" << std::endl <<
361 "rxClose=\"" << rxClose <<
"\"" << std::endl <<
362 "dropped=\"" << dropped <<
"\"" << std::endl <<
363 "brokenMgt=\"" << brokenMgt <<
"\"" << std::endl <<
364 "txMgt=\"" << txMgt <<
"\"" << std::endl <<
365 "txMgtBytes=\"" << txMgtBytes <<
"\"" << std::endl <<
366 "rxMgt=\"" << rxMgt <<
"\"" << std::endl <<
367 "rxMgtBytes=\"" << rxMgtBytes <<
"\"" << std::endl <<
368 "beaconShift=\"" << beaconShift <<
"\"/>" << std::endl;
373 os <<
"<PeerManagementProtocolMac " 374 "address=\"" <<
m_parent->GetAddress () <<
"\">" << std::endl;
376 os <<
"</PeerManagementProtocolMac>" << std::endl;
386 return m_parent->GetLinkMetric (peerAddress);
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddInformationElement(Ptr< WifiInformationElement > ie)
Add information element.
Simulation virtual time values and global simulation resolution.
uint32_t txMgtBytes
transmit management bytes
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
PlinkOpenStartFields GetFields() const
Get peer link open start fields.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void SetBeaconShift(Time shift)
Set beacon shift function.
void UpdateBeacon(MeshWifiBeacon &beacon) const
Add beacon timing and mesh ID information elements, and notify beacon sent.
uint16_t rxClose
receive close
PlinkConfirmStartFields GetFields() const
Get peer link confirm start fields.
PlinkCloseStartFields GetFields() const
Get peer link close start fields.
802.11s Peer link open management frame
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint16_t rxConfirm
receive confirm
uint16_t capability
open and confirm
struct Statistics m_stats
statistics
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
802.11s Peer link close management frame
int64_t AssignStreams(int64_t stream)
Assign the streams.
bool SubtypeIsClose() const
Subtype is close function.
uint16_t txOpen
transmit open
bool SubtypeIsOpen() const
Subtype is open function.
uint16_t beaconShift
beacon shift
uint16_t txConfirm
transmit confirm
uint16_t txClose
transmit close
according to IEEE 802.11 - 2012
uint32_t rxMgtBytes
receive management bytes
PeerManagementProtocolMac(uint32_t interface, Ptr< PeerManagementProtocol > protocol)
Constructor.
IeMeshId meshId
open and close
uint16_t rxMgt
receive management
SupportedRates rates
open and confirm
uint32_t m_ifIndex
IF index.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
uint16_t brokenMgt
broken management
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
This method appears to test a few conditions.
uint32_t GetLinkMetric(Mac48Address peerAddress)
IeMeshId meshId
open and close
Time GetBeaconInterval() const
Returns the beacon interval of Wifi beacon.
uint16_t txMgt
transmit management
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
void SendPeerLinkManagementFrame(Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig)
Send peer link management frame function.
uint16_t capability
open and confirm
void SetPlinkCloseStart(PlinkCloseStartFields fields)
Set peer link close start fields.
uint16_t rxOpen
receive open
void Print(std::ostream &os) const
Print function.
Beacon is beacon header + list of arbitrary information elements.
Ptr< MeshWifiInterfaceMac > m_parent
parent
bool IsEqual(IeMeshId const &o) const
Equality test.
void TxOk(WifiMacHeader const &hdr)
Transmit OK function.
802.11s Peer link confirm management frame
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
void SetNeighborCount(uint8_t neighbors)
Set neighbor count.
IeConfiguration config
open and confirm
void Report(std::ostream &) const
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Receive and process a packet.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
void SetPlinkOpenStart(PlinkOpenStartFields fields)
Set peer link open start fields.
SupportedRates rates
open and confirm
~PeerManagementProtocolMac()
bool SubtypeIsConfirm() const
Subtype is confirm function.
Mac48Address GetAddress() const
debug only, used to print established links
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Set pointer to parent.
void SetPlinkConfirmStart(PlinkConfirmStartFields fields)
Set peer link confirm start fields.
void TxError(WifiMacHeader const &hdr)
Closes link when a proper number of successive transmissions have failed.
Ptr< PeerManagementProtocol > m_protocol
protocol
IeConfiguration config
open and confirm
void AddHeader(const Header &header)
Add header to this packet.