29 #include "ns3/mesh-information-element-vector.h"
30 #include "ns3/mesh-wifi-interface-mac.h"
31 #include "ns3/mgt-action-headers.h"
32 #include "ns3/simulator.h"
33 #include "ns3/wifi-mpdu.h"
57 m_parent->TraceConnectWithoutContext(
"DroppedMpdu",
59 m_parent->TraceConnectWithoutContext(
"AckedMpdu",
95 if (meshId && (
m_protocol->GetMeshId()->IsEqual(*meshId)))
105 << (*meshId) <<
"; ignoring");
143 if (!(
m_parent->CheckSupportedRates(
161 if (!(
m_parent->CheckSupportedRates(
164 NS_LOG_DEBUG(
"PEER_LINK_CONFIRM: configuration mismatch");
182 NS_LOG_DEBUG(
"PEER_LINK_CLOSE: configuration mismatch");
203 if (peerElement->SubtypeIsOpen())
208 if (peerElement->SubtypeIsConfirm())
213 if (peerElement->SubtypeIsClose())
268 if (
m_protocol->GetBeaconCollisionAvoidance())
296 auto allSupportedRates =
m_parent->GetSupportedRates();
297 fields.
rates = allSupportedRates.rates;
301 fields.
config = meshConfig;
315 auto allSupportedRates =
m_parent->GetSupportedRates();
316 fields.
rates = allSupportedRates.rates;
319 fields.
config = meshConfig;
356 m_parent->SendManagementFrame(packet, hdr);
404 << txOpen <<
"\"" << std::endl
405 <<
"txConfirm=\"" << txConfirm <<
"\"" << std::endl
406 <<
"txClose=\"" << txClose <<
"\"" << std::endl
407 <<
"rxOpen=\"" << rxOpen <<
"\"" << std::endl
408 <<
"rxConfirm=\"" << rxConfirm <<
"\"" << std::endl
409 <<
"rxClose=\"" << rxClose <<
"\"" << std::endl
410 <<
"dropped=\"" << dropped <<
"\"" << std::endl
411 <<
"brokenMgt=\"" << brokenMgt <<
"\"" << std::endl
412 <<
"txMgt=\"" << txMgt <<
"\"" << std::endl
413 <<
"txMgtBytes=\"" << txMgtBytes <<
"\"" << std::endl
414 <<
"rxMgt=\"" << rxMgt <<
"\"" << std::endl
415 <<
"rxMgtBytes=\"" << rxMgtBytes <<
"\"" << std::endl
416 <<
"beaconShift=\"" << beaconShift <<
"\"/>" << std::endl;
422 os <<
"<PeerManagementProtocolMac "
424 <<
m_parent->GetAddress() <<
"\">" << std::endl;
426 os <<
"</PeerManagementProtocolMac>" << std::endl;
438 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 GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Ptr< Packet > Copy() 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.
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(const IeMeshId &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.
Ptr< MeshWifiInterfaceMac > m_parent
parent
void SetParent(Ptr< MeshWifiInterfaceMac > parent) override
Set pointer to parent.
PeerManagementProtocolMac(uint32_t interface, Ptr< PeerManagementProtocol > protocol)
Constructor.
void Report(std::ostream &) const
Report statistics.
Statistics m_stats
statistics
uint32_t m_ifIndex
IF index.
Mac48Address GetAddress() const
debug only, used to print established links
void UpdateBeacon(MeshWifiBeacon &beacon) const override
Add beacon timing and mesh ID information elements, and notify beacon sent.
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to) override
This method appears to test a few conditions.
void TxError(WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu)
Closes link when a proper number of successive transmissions have failed.
void ResetStats()
Reset stats.
int64_t AssignStreams(int64_t stream) override
Assign the streams.
void SendPeerLinkManagementFrame(Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig)
Send peer link management frame function.
void TxOk(Ptr< const WifiMpdu > mpdu)
Transmit OK function.
uint32_t GetLinkMetric(Mac48Address peerAddress)
Get the link metric.
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header) override
Receive and process a packet.
~PeerManagementProtocolMac() override
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, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Struct containing all supported rates.
IeMeshId meshId
open and close
SupportedRates rates
open and confirm
std::optional< ExtendedSupportedRatesIE > extendedRates
open and confirm
IeConfiguration config
open and confirm
uint16_t capability
open and confirm
std::optional< ExtendedSupportedRatesIE > extendedRates
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.