27 #include "ns3/mesh-wifi-interface-mac.h"
28 #include "ns3/simulator.h"
29 #include "ns3/wifi-mac-header.h"
30 #include "ns3/mesh-information-element-vector.h"
85 if ((meshId != 0) && (
m_protocol->GetMeshId ()->IsEqual (*meshId)))
88 beacon_hdr.GetBeaconIntervalUs ()), beaconTiming);
92 NS_LOG_DEBUG (
"MeshId mismatch " <<
m_protocol->GetMeshId ()->PeekString () <<
" " << (*meshId) <<
"; ignoring");
132 NS_LOG_DEBUG (
"PEER_LINK_OPEN: configuration mismatch");
149 NS_LOG_DEBUG (
"PEER_LINK_CONFIRM: configuration mismatch");
167 NS_LOG_DEBUG (
"PEER_LINK_CLOSE: configuration mismatch");
187 if (peerElement->SubtypeIsOpen ())
192 if (peerElement->SubtypeIsConfirm ())
197 if (peerElement->SubtypeIsClose ())
203 m_protocol->ReceivePeerLinkFrame (
m_ifIndex, peerAddress, peerMpAddress, aid, *peerElement, config);
243 if (
m_protocol->GetBeaconCollisionAvoidance ())
271 fields.
config = meshConfig;
287 fields.
config = meshConfig;
324 m_parent->SendManagementFrame (packet, hdr);
349 txOpen (0), txConfirm (0), txClose (0), rxOpen (0), rxConfirm (0), rxClose (0), dropped (0), brokenMgt (0),
350 txMgt (0), txMgtBytes (0), rxMgt (0), rxMgtBytes (0), beaconShift (0)
357 "txOpen=\"" << txOpen <<
"\"" << std::endl <<
358 "txConfirm=\"" << txConfirm <<
"\"" << std::endl <<
359 "txClose=\"" << txClose <<
"\"" << std::endl <<
360 "rxOpen=\"" << rxOpen <<
"\"" << std::endl <<
361 "rxConfirm=\"" << rxConfirm <<
"\"" << std::endl <<
362 "rxClose=\"" << rxClose <<
"\"" << std::endl <<
363 "dropped=\"" << dropped <<
"\"" << std::endl <<
364 "brokenMgt=\"" << brokenMgt <<
"\"" << std::endl <<
365 "txMgt=\"" << txMgt <<
"\"" << std::endl <<
366 "txMgtBytes=\"" << txMgtBytes <<
"\"" << std::endl <<
367 "rxMgt=\"" << rxMgt <<
"\"" << std::endl <<
368 "rxMgtBytes=\"" << rxMgtBytes <<
"\"" << std::endl <<
369 "beaconShift=\"" << beaconShift <<
"\"/>" << std::endl;
374 os <<
"<PeerManagementProtocolMac "
375 "address=\"" <<
m_parent->GetAddress () <<
"\">" << std::endl;
377 os <<
"</PeerManagementProtocolMac>" << std::endl;
387 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.
PlinkCloseStartFields GetFields() const
Get peer link close start fields.
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 "...
void SetBeaconShift(Time shift)
Set beacon shift function.
uint16_t rxClose
receive close
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.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
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.
uint16_t txOpen
transmit open
uint16_t beaconShift
beacon shift
uint16_t txConfirm
transmit confirm
PlinkOpenStartFields GetFields() const
Get peer link open start fields.
bool SubtypeIsOpen() const
Subtype is open function.
uint16_t txClose
transmit close
PlinkConfirmStartFields GetFields() const
Get peer link confirm start fields.
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.
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
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
uint16_t txMgt
transmit management
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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
Mac48Address GetAddress() const
debug only, used to print established links
Beacon is beacon header + list of arbitrary information elements.
Ptr< MeshWifiInterfaceMac > m_parent
parent
Time GetBeaconInterval() const
Returns the beacon interval of Wifi beacon.
void TxOk(WifiMacHeader const &hdr)
Transmit OK function.
802.11s Peer link confirm management frame
void UpdateBeacon(MeshWifiBeacon &beacon) const
Add beacon timing and mesh ID information elements, and notify beacon sent.
void Report(std::ostream &) const
bool SubtypeIsClose() const
Subtype is close function.
#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
bool IsEqual(IeMeshId const &o) const
Equality test.
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()
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.
void Print(std::ostream &os) const
Print function.
bool SubtypeIsConfirm() const
Subtype is confirm function.