27 #include "ns3/wifi-mac-queue-item.h"
28 #include "ns3/mesh-wifi-interface-mac.h"
29 #include "ns3/simulator.h"
30 #include "ns3/mesh-information-element-vector.h"
85 if ((meshId != 0) && (
m_protocol->GetMeshId ()->IsEqual (*meshId)))
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);
Beacon is beacon header + list of arbitrary information elements.
Time GetBeaconInterval() const
Returns the beacon interval of Wifi beacon.
void AddInformationElement(Ptr< WifiInformationElement > ie)
Add information element.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
void SetNeighborCount(uint8_t neighbors)
Set neighbor count.
bool IsEqual(IeMeshId const &o) const
Equality test.
according to IEEE 802.11 - 2012
bool SubtypeIsOpen() const
Subtype is open function.
bool SubtypeIsClose() const
Subtype is close function.
bool SubtypeIsConfirm() const
Subtype is confirm function.
802.11s Peer link close management frame
PlinkCloseStartFields GetFields() const
Get peer link close start fields.
void SetPlinkCloseStart(PlinkCloseStartFields fields)
Set peer link close start fields.
802.11s Peer link confirm management frame
void SetPlinkConfirmStart(PlinkConfirmStartFields fields)
Set peer link confirm start fields.
PlinkConfirmStartFields GetFields() const
Get peer link confirm start fields.
802.11s Peer link open management frame
void SetPlinkOpenStart(PlinkOpenStartFields fields)
Set peer link open start fields.
PlinkOpenStartFields GetFields() const
Get peer link open start fields.
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
This method appears to test a few conditions.
Ptr< MeshWifiInterfaceMac > m_parent
parent
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Set pointer to parent.
void TxError(WifiMacDropReason reason, Ptr< const WifiMacQueueItem > mpdu)
Closes link when a proper number of successive transmissions have failed.
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Receive and process a packet.
PeerManagementProtocolMac(uint32_t interface, Ptr< PeerManagementProtocol > protocol)
Constructor.
void Report(std::ostream &) const
Report statistics.
uint32_t m_ifIndex
IF index.
Mac48Address GetAddress() const
debug only, used to print established links
void TxOk(Ptr< const WifiMacQueueItem > mpdu)
Transmit OK function.
void ResetStats()
Reset stats.
int64_t AssignStreams(int64_t stream)
Assign the streams.
struct Statistics m_stats
statistics
~PeerManagementProtocolMac()
void UpdateBeacon(MeshWifiBeacon &beacon) const
Add beacon timing and mesh ID information elements, and notify beacon sent.
void SendPeerLinkManagementFrame(Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig)
Send peer link management frame function.
uint32_t GetLinkMetric(Mac48Address peerAddress)
Get the link metric.
Ptr< PeerManagementProtocol > m_protocol
protocol
void SetBeaconShift(Time shift)
Set beacon shift function.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
WifiMacDropReason
The reason why an MPDU was dropped.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
IeMeshId meshId
open and close
SupportedRates rates
open and confirm
IeConfiguration config
open and confirm
uint16_t capability
open and confirm
IeConfiguration config
open and confirm
SupportedRates rates
open and confirm
IeMeshId meshId
open and close
uint16_t capability
open and confirm
uint16_t txOpen
transmit open
uint16_t txConfirm
transmit confirm
uint16_t rxConfirm
receive confirm
uint16_t rxClose
receive close
uint32_t txMgtBytes
transmit management bytes
uint16_t brokenMgt
broken management
uint16_t txClose
transmit close
uint16_t rxMgt
receive management
uint16_t rxOpen
receive open
uint16_t txMgt
transmit management
uint16_t beaconShift
beacon shift
uint32_t rxMgtBytes
receive management bytes
void Print(std::ostream &os) const
Print function.