A Discrete-Event Network Simulator
API
peer-management-protocol-mac.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 IITP RAS
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Kirill Andreev <andreev@iitp.ru>
19  */
20 
23 #include "dot11s-mac-header.h"
26 #include "peer-link-frame.h"
27 #include "ns3/mesh-wifi-interface-mac.h"
28 #include "ns3/simulator.h"
29 #include "ns3/mesh-information-element-vector.h"
30 #include "ns3/log.h"
31 
32 namespace ns3 {
33 
34 NS_LOG_COMPONENT_DEFINE ("PeerManagementProtocolMac");
35 
36 namespace dot11s {
39 {
40  m_ifIndex = interface;
41  m_protocol = protocol;
42 }
43 
45 {
46 }
47 
48 void
50 {
51  m_parent = parent;
52  m_parent->TraceConnectWithoutContext ("DroppedMpdu", MakeCallback (&PeerManagementProtocolMac::TxError, this));
53  m_parent->TraceConnectWithoutContext ("AckedMpdu", MakeCallback (&PeerManagementProtocolMac::TxOk, this));
54 }
55 void
57 {
58  m_protocol->TransmissionFailure (m_ifIndex, mpdu->GetHeader ().GetAddr1 ());
59 }
60 void
62 {
63  m_protocol->TransmissionSuccess (m_ifIndex, mpdu->GetHeader ().GetAddr1 ());
64 }
65 bool
67 {
68  NS_LOG_FUNCTION (this << const_packet << header);
69  // First of all we copy a packet, because we need to remove some
70  //headers
71  Ptr<Packet> packet = const_packet->Copy ();
72  if (header.IsBeacon ())
73  {
74  NS_LOG_DEBUG ("Is Beacon from " << header.GetAddr2 ());
75  MgtBeaconHeader beacon_hdr;
76  packet->RemoveHeader (beacon_hdr);
78  // To determine header size here, we can rely on the knowledge that
79  // this is the last header to remove.
80  packet->RemoveHeader (elements, packet->GetSize ());
81  Ptr<IeBeaconTiming> beaconTiming = DynamicCast<IeBeaconTiming> (elements.FindFirst (IE_BEACON_TIMING));
82  Ptr<IeMeshId> meshId = DynamicCast<IeMeshId> (elements.FindFirst (IE_MESH_ID));
83 
84  if ((meshId != 0) && (m_protocol->GetMeshId ()->IsEqual (*meshId)))
85  {
86  m_protocol->ReceiveBeacon (m_ifIndex, header.GetAddr2 (), MicroSeconds (
87  beacon_hdr.GetBeaconIntervalUs ()), beaconTiming);
88  }
89  else
90  {
91  NS_LOG_DEBUG ("MeshId mismatch " << m_protocol->GetMeshId ()->PeekString () << " " << (*meshId) << "; ignoring");
92  }
93  // Beacon shall not be dropped. May be needed to another plugins
94  return true;
95  }
96  uint16_t aid = 0; // applicable only in Confirm message
97  IeConfiguration config;
98  if (header.IsAction ())
99  {
100  NS_LOG_DEBUG ("Is action");
101  WifiActionHeader actionHdr;
102  packet->RemoveHeader (actionHdr);
103  WifiActionHeader::ActionValue actionValue = actionHdr.GetAction ();
104  // If can not handle - just return;
105  if (actionHdr.GetCategory () != WifiActionHeader::SELF_PROTECTED)
106  {
107  NS_LOG_DEBUG ("Cannot handle non SELF PROTECTED");
108  return m_protocol->IsActiveLink (m_ifIndex, header.GetAddr2 ());
109  }
110  m_stats.rxMgt++;
111  m_stats.rxMgtBytes += packet->GetSize ();
112  Mac48Address peerAddress = header.GetAddr2 ();
113  Mac48Address peerMpAddress = header.GetAddr3 ();
115  {
116  NS_LOG_DEBUG ("Received PEER_LINK_OPEN");
118  PeerLinkOpenStart peerFrame;
119  packet->RemoveHeader (peerFrame);
120  fields = peerFrame.GetFields ();
121  if (!fields.meshId.IsEqual ( *(m_protocol->GetMeshId ())))
122  {
123  NS_LOG_DEBUG ("PEER_LINK_OPEN: MeshId mismatch");
124  m_protocol->ConfigurationMismatch (m_ifIndex, peerAddress);
125  // Broken peer link frame - drop it
126  m_stats.brokenMgt++;
127  return false;
128  }
129  if (!(m_parent->CheckSupportedRates (fields.rates)))
130  {
131  NS_LOG_DEBUG ("PEER_LINK_OPEN: configuration mismatch");
132  m_protocol->ConfigurationMismatch (m_ifIndex, peerAddress);
133  // Broken peer link frame - drop it
134  m_stats.brokenMgt++;
135  return false;
136  }
137  config = fields.config;
138  }
140  {
141  NS_LOG_DEBUG ("Received PEER_LINK_CONFIRM");
143  PeerLinkConfirmStart peerFrame;
144  packet->RemoveHeader (peerFrame);
145  fields = peerFrame.GetFields ();
146  if (!(m_parent->CheckSupportedRates (fields.rates)))
147  {
148  NS_LOG_DEBUG ("PEER_LINK_CONFIRM: configuration mismatch");
149  m_protocol->ConfigurationMismatch (m_ifIndex, peerAddress);
150  // Broken peer link frame - drop it
151  m_stats.brokenMgt++;
152  return false;
153  }
154  aid = fields.aid;
155  config = fields.config;
156  }
158  {
159  NS_LOG_DEBUG ("Received PEER_LINK_CLOSE");
161  PeerLinkCloseStart peerFrame;
162  packet->RemoveHeader (peerFrame);
163  fields = peerFrame.GetFields ();
164  if (!fields.meshId.IsEqual ( *(m_protocol->GetMeshId ())))
165  {
166  NS_LOG_DEBUG ("PEER_LINK_CLOSE: configuration mismatch");
167  m_protocol->ConfigurationMismatch (m_ifIndex, peerAddress);
168  // Broken peer link frame - drop it
169  m_stats.brokenMgt++;
170  return false;
171  }
172  }
173  else
174  {
175  NS_FATAL_ERROR ("Unknown Self-protected Action type: " << actionValue.selfProtectedAction);
176  }
177  Ptr<IePeerManagement> peerElement;
179  // To determine header size here, we can rely on the knowledge that
180  // this is the last header to remove.
181  packet->RemoveHeader (elements, packet->GetSize ());
182  peerElement = DynamicCast<IePeerManagement>(elements.FindFirst (IE_MESH_PEERING_MANAGEMENT));
183 
184  NS_ASSERT (peerElement != 0);
185  //Check that frame subtype corresponds to peer link subtype
186  if (peerElement->SubtypeIsOpen ())
187  {
188  m_stats.rxOpen++;
190  }
191  if (peerElement->SubtypeIsConfirm ())
192  {
193  m_stats.rxConfirm++;
195  }
196  if (peerElement->SubtypeIsClose ())
197  {
198  m_stats.rxClose++;
200  }
201  //Deliver Peer link management frame to protocol:
202  m_protocol->ReceivePeerLinkFrame (m_ifIndex, peerAddress, peerMpAddress, aid, *peerElement, config);
203  // if we can handle a frame - drop it
204  return false;
205  }
206  return m_protocol->IsActiveLink (m_ifIndex, header.GetAddr2 ());
207 }
208 bool
210  Mac48Address from, Mac48Address to)
211 {
212  NS_LOG_FUNCTION (this << packet << header << from << to);
213  if (header.IsAction ())
214  {
215  WifiActionHeader actionHdr;
216  packet->PeekHeader (actionHdr);
217  if (actionHdr.GetCategory () == WifiActionHeader::SELF_PROTECTED)
218  {
219  return true;
220  }
221  }
222  if (header.GetAddr1 ().IsGroup ())
223  {
224  return true;
225  }
226  else
227  {
228  if (m_protocol->IsActiveLink (m_ifIndex, header.GetAddr1 ()))
229  {
230  return true;
231  }
232  else
233  {
234  m_stats.dropped++;
235  return false;
236  }
237  }
238 }
239 void
241 {
242  if (m_protocol->GetBeaconCollisionAvoidance ())
243  {
244  Ptr<IeBeaconTiming> beaconTiming = m_protocol->GetBeaconTimingElement (m_ifIndex);
245  beacon.AddInformationElement (beaconTiming);
246  }
247  beacon.AddInformationElement (m_protocol->GetMeshId ());
248  m_protocol->NotifyBeaconSent (m_ifIndex, beacon.GetBeaconInterval ());
249 }
250 
251 void
253  uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig)
254 {
255  NS_LOG_FUNCTION (this << peerAddress << peerMpAddress);
256  //Create a packet:
257  meshConfig.SetNeighborCount (m_protocol->GetNumberOfLinks ());
258  Ptr<Packet> packet = Create<Packet> ();
260  elements.AddInformationElement (Ptr<IePeerManagement> (&peerElement));
261  packet->AddHeader (elements);
262  //Create an 802.11 frame header:
263  //Send management frame to MAC:
264  if (peerElement.SubtypeIsOpen ())
265  {
267  fields.rates = m_parent->GetSupportedRates ();
268  fields.capability = 0;
269  fields.meshId = *(m_protocol->GetMeshId ());
270  fields.config = meshConfig;
271  PeerLinkOpenStart plinkOpen;
272  WifiActionHeader actionHdr;
273  m_stats.txOpen++;
276  actionHdr.SetAction (WifiActionHeader::SELF_PROTECTED, action);
277  plinkOpen.SetPlinkOpenStart (fields);
278  packet->AddHeader (plinkOpen);
279  packet->AddHeader (actionHdr);
280  }
281  if (peerElement.SubtypeIsConfirm ())
282  {
284  fields.rates = m_parent->GetSupportedRates ();
285  fields.capability = 0;
286  fields.config = meshConfig;
287  PeerLinkConfirmStart plinkConfirm;
288  WifiActionHeader actionHdr;
289  m_stats.txConfirm++;
292  fields.aid = aid;
293  actionHdr.SetAction (WifiActionHeader::SELF_PROTECTED, action);
294  plinkConfirm.SetPlinkConfirmStart (fields);
295  packet->AddHeader (plinkConfirm);
296  packet->AddHeader (actionHdr);
297  }
298  if (peerElement.SubtypeIsClose ())
299  {
301  fields.meshId = *(m_protocol->GetMeshId ());
302  PeerLinkCloseStart plinkClose;
303  WifiActionHeader actionHdr;
304  m_stats.txClose++;
307  actionHdr.SetAction (WifiActionHeader::SELF_PROTECTED, action);
308  plinkClose.SetPlinkCloseStart (fields);
309  packet->AddHeader (plinkClose);
310  packet->AddHeader (actionHdr);
311  }
312  m_stats.txMgt++;
313  m_stats.txMgtBytes += packet->GetSize ();
314  // Wifi Mac header:
315  WifiMacHeader hdr;
317  hdr.SetAddr1 (peerAddress);
318  hdr.SetAddr2 (m_parent->GetAddress ());
319  //Addr is not used here, we use it as our MP address
320  hdr.SetAddr3 (m_protocol->GetAddress ());
321  hdr.SetDsNotFrom ();
322  hdr.SetDsNotTo ();
323  m_parent->SendManagementFrame (packet, hdr);
324 }
325 
328 {
329  if (m_parent != 0)
330  {
331  return m_parent->GetAddress ();
332  }
333  else
334  {
335  return Mac48Address ();
336  }
337 }
338 void
340 {
341  if (shift != Seconds (0))
342  {
344  }
345  m_parent->ShiftTbtt (shift);
346 }
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)
350 {
351 }
352 void
354 {
355  os << "<Statistics "
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;
369 }
370 void
371 PeerManagementProtocolMac::Report (std::ostream & os) const
372 {
373  os << "<PeerManagementProtocolMac "
374  "address=\"" << m_parent->GetAddress () << "\">" << std::endl;
375  m_stats.Print (os);
376  os << "</PeerManagementProtocolMac>" << std::endl;
377 }
378 void
380 {
381  m_stats = Statistics ();
382 }
383 uint32_t
385 {
386  return m_parent->GetLinkMetric (peerAddress);
387 }
388 int64_t
390 {
391  return m_protocol->AssignStreams (stream);
392 }
393 
394 } // namespace dot11s
395 } // namespace ns3
396 
ns3::dot11s::PeerManagementProtocolMac::m_parent
Ptr< MeshWifiInterfaceMac > m_parent
parent
Definition: peer-management-protocol-mac.h:231
ns3::dot11s::PeerManagementProtocolMac::Statistics::txConfirm
uint16_t txConfirm
transmit confirm
Definition: peer-management-protocol-mac.h:206
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::dot11s::PeerManagementProtocolMac::Statistics::rxMgt
uint16_t rxMgt
receive management
Definition: peer-management-protocol-mac.h:215
ns3::dot11s::PeerManagementProtocolMac::UpdateBeacon
void UpdateBeacon(MeshWifiBeacon &beacon) const
Add beacon timing and mesh ID information elements, and notify beacon sent.
Definition: peer-management-protocol-mac.cc:240
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
ns3::dot11s::PeerManagementProtocolMac::Statistics::rxConfirm
uint16_t rxConfirm
receive confirm
Definition: peer-management-protocol-mac.h:209
ns3::dot11s::IePeerManagement::SubtypeIsOpen
bool SubtypeIsOpen() const
Subtype is open function.
Definition: ie-dot11s-peer-management.cc:93
ns3::Packet::PeekHeader
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:290
ns3::MeshWifiBeacon::AddInformationElement
void AddInformationElement(Ptr< WifiInformationElement > ie)
Add information element.
Definition: mesh-wifi-beacon.cc:35
ns3::Mac48Address::IsGroup
bool IsGroup(void) const
Definition: mac48-address.cc:164
ns3::dot11s::PeerManagementProtocolMac::Statistics::Print
void Print(std::ostream &os) const
Print function.
Definition: peer-management-protocol-mac.cc:353
ns3::WifiMacHeader::IsBeacon
bool IsBeacon(void) const
Return true if the header is a Beacon header.
Definition: wifi-mac-header.cc:705
ns3::Packet::GetSize
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
ns3::dot11s::PeerManagementProtocolMac::PeerManagementProtocolMac
PeerManagementProtocolMac(uint32_t interface, Ptr< PeerManagementProtocol > protocol)
Constructor.
Definition: peer-management-protocol-mac.cc:37
ns3::Packet::AddHeader
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
ns3::WifiMacDropReason
WifiMacDropReason
The reason why an MPDU was dropped.
Definition: wifi-mac.h:55
ns3::dot11s::PeerManagementProtocolMac::Statistics::txClose
uint16_t txClose
transmit close
Definition: peer-management-protocol-mac.h:207
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::dot11s::PeerManagementProtocolMac::Statistics::Statistics
Statistics()
constructor
Definition: peer-management-protocol-mac.cc:347
ns3::dot11s::PeerManagementProtocolMac::SetBeaconShift
void SetBeaconShift(Time shift)
Set beacon shift function.
Definition: peer-management-protocol-mac.cc:339
ns3::dot11s::PeerManagementProtocolMac::TxError
void TxError(WifiMacDropReason reason, Ptr< const WifiMacQueueItem > mpdu)
Closes link when a proper number of successive transmissions have failed.
Definition: peer-management-protocol-mac.cc:56
ns3::dot11s::PeerManagementProtocolMac::Statistics::rxMgtBytes
uint32_t rxMgtBytes
receive management bytes
Definition: peer-management-protocol-mac.h:216
ns3::MicroSeconds
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
ns3::WifiMacHeader::SetDsNotFrom
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:90
ns3::dot11s::IeConfiguration
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
Definition: ie-dot11s-configuration.h:128
ns3::WifiActionHeader::ActionValue
typedef for union of different ActionValues
Definition: mgt-headers.h:956
ie-dot11s-peer-management.h
ns3::WifiActionHeader::ActionValue::selfProtectedAction
SelfProtectedActionValue selfProtectedAction
self protected action
Definition: mgt-headers.h:959
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::WifiMacHeader::GetAddr3
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
Definition: wifi-mac-header.cc:436
ns3::dot11s::PeerManagementProtocolMac::Report
void Report(std::ostream &) const
Report statistics.
Definition: peer-management-protocol-mac.cc:371
ns3::WifiMacHeader::GetAddr1
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
Definition: wifi-mac-header.cc:424
ns3::WifiMacHeader::SetAddr3
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
Definition: wifi-mac-header.cc:120
ns3::dot11s::IeConfiguration::SetNeighborCount
void SetNeighborCount(uint8_t neighbors)
Set neighbor count.
Definition: ie-dot11s-configuration.cc:184
ns3::WifiInformationElementVector::FindFirst
Ptr< WifiInformationElement > FindFirst(WifiInformationElementId id) const
vector of pointers to information elements is the body of IeVector
Definition: wifi-information-element-vector.cc:158
ns3::MgtProbeResponseHeader::GetBeaconIntervalUs
uint64_t GetBeaconIntervalUs(void) const
Return the beacon interval in microseconds unit.
Definition: mgt-headers.cc:208
ie-dot11s-configuration.h
ns3::MeshWifiBeacon
Beacon is beacon header + list of arbitrary information elements.
Definition: mesh-wifi-beacon.h:41
ns3::WifiMacHeader::SetAddr1
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
Definition: wifi-mac-header.cc:108
ns3::dot11s::PeerManagementProtocolMac::Statistics::txMgt
uint16_t txMgt
transmit management
Definition: peer-management-protocol-mac.h:213
ns3::WifiActionHeader::PEER_LINK_CONFIRM
@ PEER_LINK_CONFIRM
Definition: mgt-headers.h:911
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::dot11s::PeerManagementProtocolMac::Statistics
Statistics structure.
Definition: peer-management-protocol-mac.h:204
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::WifiActionHeader
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:885
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::WifiActionHeader::GetAction
ActionValue GetAction()
Return the action value.
Definition: mgt-headers.cc:1247
ns3::dot11s::PeerManagementProtocolMac::SetParent
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Set pointer to parent.
Definition: peer-management-protocol-mac.cc:49
IE_BEACON_TIMING
#define IE_BEACON_TIMING
Definition: wifi-information-element.h:154
ns3::WifiInformationElementVector::AddInformationElement
bool AddInformationElement(Ptr< WifiInformationElement > element)
add an IE, if maxSize has exceeded, returns false
Definition: wifi-information-element-vector.cc:147
ns3::dot11s::PeerManagementProtocolMac::Statistics::rxOpen
uint16_t rxOpen
receive open
Definition: peer-management-protocol-mac.h:208
ns3::dot11s::PeerManagementProtocolMac::SendPeerLinkManagementFrame
void SendPeerLinkManagementFrame(Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig)
Send peer link management frame function.
Definition: peer-management-protocol-mac.cc:252
peer-management-protocol-mac.h
ns3::Packet::RemoveHeader
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
ns3::WifiActionHeader::PEER_LINK_OPEN
@ PEER_LINK_OPEN
Definition: mgt-headers.h:910
peer-management-protocol.h
ns3::MeshWifiBeacon::GetBeaconInterval
Time GetBeaconInterval() const
Returns the beacon interval of Wifi beacon.
Definition: mesh-wifi-beacon.cc:41
ns3::dot11s::PeerManagementProtocolMac::GetLinkMetric
uint32_t GetLinkMetric(Mac48Address peerAddress)
Get the link metric.
Definition: peer-management-protocol-mac.cc:384
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::dot11s::PeerManagementProtocolMac::m_ifIndex
uint32_t m_ifIndex
IF index.
Definition: peer-management-protocol-mac.h:232
ns3::dot11s::PeerManagementProtocolMac::Statistics::txMgtBytes
uint32_t txMgtBytes
transmit management bytes
Definition: peer-management-protocol-mac.h:214
ns3::dot11s::PeerManagementProtocolMac::Statistics::txOpen
uint16_t txOpen
transmit open
Definition: peer-management-protocol-mac.h:205
ns3::WifiActionHeader::SELF_PROTECTED
@ SELF_PROTECTED
Definition: mgt-headers.h:901
ns3::dot11s::PeerManagementProtocolMac::Receive
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Receive and process a packet.
Definition: peer-management-protocol-mac.cc:66
ns3::MgtBeaconHeader
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:862
ns3::dot11s::PeerManagementProtocolMac::TxOk
void TxOk(Ptr< const WifiMacQueueItem > mpdu)
Transmit OK function.
Definition: peer-management-protocol-mac.cc:61
ns3::MakeCallback
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...
Definition: callback.h:1642
ns3::WIFI_MAC_MGT_ACTION
@ WIFI_MAC_MGT_ACTION
Definition: wifi-mac-header.h:58
IE_MESH_ID
#define IE_MESH_ID
Definition: wifi-information-element.h:148
ns3::WifiMacHeader::SetAddr2
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
Definition: wifi-mac-header.cc:114
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::dot11s::PeerManagementProtocolMac::Statistics::dropped
uint16_t dropped
dropped
Definition: peer-management-protocol-mac.h:211
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::WifiActionHeader::GetCategory
CategoryValue GetCategory()
Return the category value.
Definition: mgt-headers.cc:1226
ns3::Packet::Copy
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
ns3::WifiActionHeader::SetAction
void SetAction(CategoryValue type, ActionValue action)
Set action for this Action header.
Definition: mgt-headers.cc:1192
ns3::dot11s::PeerManagementProtocolMac::m_stats
struct Statistics m_stats
statistics
Definition: peer-management-protocol-mac.h:229
ns3::dot11s::PeerManagementProtocolMac::GetAddress
Mac48Address GetAddress() const
debug only, used to print established links
Definition: peer-management-protocol-mac.cc:327
ns3::dot11s::PeerManagementProtocolMac::m_protocol
Ptr< PeerManagementProtocol > m_protocol
protocol
Definition: peer-management-protocol-mac.h:233
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::WifiMacHeader::SetType
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
Definition: wifi-mac-header.cc:132
ns3::dot11s::PeerManagementProtocolMac::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign the streams.
Definition: peer-management-protocol-mac.cc:389
ns3::dot11s::PeerManagementProtocolMac::UpdateOutcomingFrame
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
This method appears to test a few conditions.
Definition: peer-management-protocol-mac.cc:209
IE_MESH_PEERING_MANAGEMENT
#define IE_MESH_PEERING_MANAGEMENT
Definition: wifi-information-element.h:151
dot11s-mac-header.h
ns3::dot11s::PeerManagementProtocolMac::~PeerManagementProtocolMac
~PeerManagementProtocolMac()
Definition: peer-management-protocol-mac.cc:44
ns3::WifiMacHeader::SetDsNotTo
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:102
ns3::dot11s::PeerManagementProtocolMac::ResetStats
void ResetStats()
Reset stats.
Definition: peer-management-protocol-mac.cc:379
ns3::MeshInformationElementVector
Introspection did not find any typical Config paths.
Definition: mesh-information-element-vector.h:32
ns3::dot11s::IePeerManagement::SubtypeIsConfirm
bool SubtypeIsConfirm() const
Subtype is confirm function.
Definition: ie-dot11s-peer-management.cc:103
ns3::dot11s::PeerManagementProtocolMac::Statistics::beaconShift
uint16_t beaconShift
beacon shift
Definition: peer-management-protocol-mac.h:217
ns3::WifiMacHeader::GetAddr2
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
Definition: wifi-mac-header.cc:430
ns3::dot11s::PeerManagementProtocolMac::Statistics::rxClose
uint16_t rxClose
receive close
Definition: peer-management-protocol-mac.h:210
ns3::dot11s::IePeerManagement
according to IEEE 802.11 - 2012
Definition: ie-dot11s-peer-management.h:51
ns3::WifiMacHeader::IsAction
bool IsAction(void) const
Return true if the header is an Action header.
Definition: wifi-mac-header.cc:729
ns3::dot11s::IePeerManagement::SubtypeIsClose
bool SubtypeIsClose() const
Subtype is close function.
Definition: ie-dot11s-peer-management.cc:98
ns3::dot11s::PeerManagementProtocolMac::Statistics::brokenMgt
uint16_t brokenMgt
broken management
Definition: peer-management-protocol-mac.h:212
ns3::WifiActionHeader::PEER_LINK_CLOSE
@ PEER_LINK_CLOSE
Definition: mgt-headers.h:912
ns3::dot11s::IeMeshId::IsEqual
bool IsEqual(IeMeshId const &o) const
Equality test.
Definition: ie-dot11s-id.cc:58