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"
77 if ((meshId != 0) && (
m_protocol->GetMeshId ()->IsEqual (*meshId)))
165 if (peerElement->SubtypeIsOpen ())
170 if (peerElement->SubtypeIsConfirm ())
175 if (peerElement->SubtypeIsClose ())
181 m_protocol->ReceivePeerLinkFrame (
m_ifIndex, peerAddress, peerMpAddress, aid, *peerElement, config);
220 if (
m_protocol->GetBeaconCollisionAvoidance ())
247 fields.
config = meshConfig;
263 fields.
config = meshConfig;
300 m_parent->SendManagementFrame (packet, hdr);
325 txOpen (0), txConfirm (0), txClose (0), rxOpen (0), rxConfirm (0), rxClose (0), dropped (0), brokenMgt (0),
326 txMgt (0), txMgtBytes (0), rxMgt (0), rxMgtBytes (0), beaconShift (0)
333 "txOpen=\"" << txOpen <<
"\"" << std::endl <<
334 "txConfirm=\"" << txConfirm <<
"\"" << std::endl <<
335 "txClose=\"" << txClose <<
"\"" << std::endl <<
336 "rxOpen=\"" << rxOpen <<
"\"" << std::endl <<
337 "rxConfirm=\"" << rxConfirm <<
"\"" << std::endl <<
338 "rxClose=\"" << rxClose <<
"\"" << std::endl <<
339 "dropped=\"" << dropped <<
"\"" << std::endl <<
340 "brokenMgt=\"" << brokenMgt <<
"\"" << std::endl <<
341 "txMgt=\"" << txMgt <<
"\"" << std::endl <<
342 "txMgtBytes=\"" << txMgtBytes <<
"\"" << std::endl <<
343 "rxMgt=\"" << rxMgt <<
"\"" << std::endl <<
344 "rxMgtBytes=\"" << rxMgtBytes <<
"\"" << std::endl <<
345 "beaconShift=\"" << beaconShift <<
"\"/>" << std::endl;
350 os <<
"<PeerManagementProtocolMac "
351 "address=\"" <<
m_parent->GetAddress () <<
"\">" << std::endl;
353 os <<
"</PeerManagementProtocolMac>" << std::endl;
363 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
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
void SetBeaconShift(Time shift)
BCA functionality.
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...
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
struct Statistics m_stats
#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 a fixed random variable stream number to the random variables used by this model...
void SetPlinkOpenStart(PlinkOpenStartFields)
PlinkOpenStartFields GetFields() const
bool SubtypeIsOpen() const
PlinkConfirmStartFields GetFields() const
PeerManagementProtocolMac(uint32_t interface, Ptr< PeerManagementProtocol > protocol)
void SetPlinkConfirmStart(PlinkConfirmStartFields)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
Update frame before it will be forwarded down.
uint32_t GetLinkMetric(Mac48Address peerAddress)
void SetPlinkCloseStart(PlinkCloseStartFields)
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.
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)
Mac48Address GetAddress() const
debug only, used to print established links
Beacon is beacon header + list of arbitrary information elements.
Ptr< MeshWifiInterfaceMac > m_parent
Time GetBeaconInterval() const
Returns a beacon interval of wifi beacon.
void TxOk(WifiMacHeader const &hdr)
802.11s Peer link confirm management frame
void UpdateBeacon(MeshWifiBeacon &beacon) const
Update beacon before it will be formed and sent.
void Report(std::ostream &) const
bool SubtypeIsClose() const
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)
bool IsEqual(IeMeshId const &o) const
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Process received frame.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
~PeerManagementProtocolMac()
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Each plugin must be installed on interface to work.
void TxError(WifiMacHeader const &hdr)
Closes link when a proper number of successive transmissions have failed.
Ptr< PeerManagementProtocol > m_protocol
void AddHeader(const Header &header)
Add header to this packet.
void Print(std::ostream &os) const
bool SubtypeIsConfirm() const