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