A Discrete-Event Network Simulator
API
lr-wpan-helper.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 The Boeing Company
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  * Authors:
19  * Gary Pei <guangyu.pei@boeing.com>
20  * Tom Henderson <thomas.r.henderson@boeing.com>
21  */
22 #include "lr-wpan-helper.h"
23 #include <ns3/lr-wpan-csmaca.h>
24 #include <ns3/lr-wpan-error-model.h>
25 #include <ns3/lr-wpan-net-device.h>
26 #include <ns3/mobility-model.h>
27 #include <ns3/single-model-spectrum-channel.h>
28 #include <ns3/multi-model-spectrum-channel.h>
29 #include <ns3/propagation-loss-model.h>
30 #include <ns3/propagation-delay-model.h>
31 #include <ns3/log.h>
32 #include "ns3/names.h"
33 
34 namespace ns3 {
35 
36 NS_LOG_COMPONENT_DEFINE ("LrWpanHelper");
37 
44 static void
47  std::string context,
49 {
50  *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << context << " " << *p << std::endl;
51 }
52 
58 static void
62 {
63  *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << *p << std::endl;
64 }
65 
67 {
68  m_channel = CreateObject<SingleModelSpectrumChannel> ();
69 
70  Ptr<LogDistancePropagationLossModel> lossModel = CreateObject<LogDistancePropagationLossModel> ();
71  m_channel->AddPropagationLossModel (lossModel);
72 
73  Ptr<ConstantSpeedPropagationDelayModel> delayModel = CreateObject<ConstantSpeedPropagationDelayModel> ();
74  m_channel->SetPropagationDelayModel (delayModel);
75 }
76 
77 LrWpanHelper::LrWpanHelper (bool useMultiModelSpectrumChannel)
78 {
79  if (useMultiModelSpectrumChannel)
80  {
81  m_channel = CreateObject<MultiModelSpectrumChannel> ();
82  }
83  else
84  {
85  m_channel = CreateObject<SingleModelSpectrumChannel> ();
86  }
87  Ptr<LogDistancePropagationLossModel> lossModel = CreateObject<LogDistancePropagationLossModel> ();
88  m_channel->AddPropagationLossModel (lossModel);
89 
90  Ptr<ConstantSpeedPropagationDelayModel> delayModel = CreateObject<ConstantSpeedPropagationDelayModel> ();
91  m_channel->SetPropagationDelayModel (delayModel);
92 }
93 
95 {
96  m_channel->Dispose ();
97  m_channel = 0;
98 }
99 
100 void
102 {
105  LogComponentEnable ("LrWpanCsmaCa", LOG_LEVEL_ALL);
106  LogComponentEnable ("LrWpanErrorModel", LOG_LEVEL_ALL);
107  LogComponentEnable ("LrWpanInterferenceHelper", LOG_LEVEL_ALL);
108  LogComponentEnable ("LrWpanMac", LOG_LEVEL_ALL);
109  LogComponentEnable ("LrWpanNetDevice", LOG_LEVEL_ALL);
110  LogComponentEnable ("LrWpanPhy", LOG_LEVEL_ALL);
111  LogComponentEnable ("LrWpanSpectrumSignalParameters", LOG_LEVEL_ALL);
112  LogComponentEnable ("LrWpanSpectrumValueHelper", LOG_LEVEL_ALL);
113 }
114 
115 std::string
117 {
118  switch (e)
119  {
121  return std::string ("BUSY");
123  return std::string ("BUSY_RX");
125  return std::string ("BUSY_TX");
127  return std::string ("FORCE_TRX_OFF");
129  return std::string ("IDLE");
131  return std::string ("INVALID_PARAMETER");
133  return std::string ("RX_ON");
135  return std::string ("SUCCESS");
137  return std::string ("TRX_OFF");
139  return std::string ("TX_ON");
141  return std::string ("UNSUPPORTED_ATTRIBUTE");
143  return std::string ("READ_ONLY");
145  return std::string ("UNSPECIFIED");
146  default:
147  return std::string ("INVALID");
148  }
149 }
150 
151 std::string
153 {
154  switch (e)
155  {
156  case MAC_IDLE:
157  return std::string ("MAC_IDLE");
159  return std::string ("CHANNEL_ACCESS_FAILURE");
160  case CHANNEL_IDLE:
161  return std::string ("CHANNEL_IDLE");
162  case SET_PHY_TX_ON:
163  return std::string ("SET_PHY_TX_ON");
164  default:
165  return std::string ("INVALID");
166  }
167 }
168 
169 void
171 {
172  phy->SetMobility (m);
173 }
174 
177 {
179  for (NodeContainer::Iterator i = c.Begin (); i != c.End (); i++)
180  {
181  Ptr<Node> node = *i;
182 
183  Ptr<LrWpanNetDevice> netDevice = CreateObject<LrWpanNetDevice> ();
184  netDevice->SetChannel (m_channel);
185  node->AddDevice (netDevice);
186  netDevice->SetNode (node);
187  // \todo add the capability to change short address, extended
188  // address and panId. Right now they are hardcoded in LrWpanMac::LrWpanMac ()
189  devices.Add (netDevice);
190  }
191  return devices;
192 }
193 
194 
197 {
198  return m_channel;
199 }
200 
201 void
203 {
204  m_channel = channel;
205 }
206 
207 void
208 LrWpanHelper::SetChannel (std::string channelName)
209 {
210  Ptr<SpectrumChannel> channel = Names::Find<SpectrumChannel> (channelName);
211  m_channel = channel;
212 }
213 
214 
215 int64_t
217 {
218  int64_t currentStream = stream;
219  Ptr<NetDevice> netDevice;
220  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i)
221  {
222  netDevice = (*i);
223  Ptr<LrWpanNetDevice> lrwpan = DynamicCast<LrWpanNetDevice> (netDevice);
224  if (lrwpan)
225  {
226  currentStream += lrwpan->AssignStreams (currentStream);
227  }
228  }
229  return (currentStream - stream);
230 }
231 
232 void
234 {
236  uint16_t id = 1;
237  uint8_t idBuf[2];
238 
239  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); i++)
240  {
241  Ptr<LrWpanNetDevice> device = DynamicCast<LrWpanNetDevice> (*i);
242  if (device)
243  {
244  idBuf[0] = (id >> 8) & 0xff;
245  idBuf[1] = (id >> 0) & 0xff;
247  address.CopyFrom (idBuf);
248 
249  device->GetMac ()->SetPanId (panId);
250  device->GetMac ()->SetShortAddress (address);
251  id++;
252  }
253  }
254  return;
255 }
256 
257 void
258 LrWpanHelper::AssociateToBeaconPan (NetDeviceContainer c, uint16_t panId, Mac16Address coor, uint8_t bcnOrd, uint8_t sfrmOrd)
259 {
261  uint16_t id = 1;
262  uint8_t idBuf[2];
264 
265  if (bcnOrd > 14)
266  {
267  NS_LOG_DEBUG("The Beacon Order must be an int between 0 and 14");
268  return;
269  }
270 
271 
272  if ((sfrmOrd > 14) || (sfrmOrd > bcnOrd))
273  {
274  NS_LOG_DEBUG("The Superframe Order must be an int between 0 and 14, and less or equal to Beacon Order");
275  return;
276  }
277 
278  for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); i++)
279  {
280  Ptr<LrWpanNetDevice> device = DynamicCast<LrWpanNetDevice> (*i);
281  if (device)
282  {
283  idBuf[0] = (id >> 8) & 0xff;
284  idBuf[1] = (id >> 0) & 0xff;
285  address.CopyFrom (idBuf);
286 
287  device->GetMac ()->SetShortAddress (address);
288 
289  if (address == coor)
290  {
291  MlmeStartRequestParams params;
292  params.m_panCoor = true;
293  params.m_PanId = panId;
294  params.m_bcnOrd = bcnOrd;
295  params.m_sfrmOrd = sfrmOrd;
296 
297  Ptr<UniformRandomVariable> uniformRandomVariable = CreateObject<UniformRandomVariable> ();;
298  Time jitter = Time (MilliSeconds (uniformRandomVariable->GetInteger (0, 10)));
299 
301  device->GetMac (), params);
302  }
303  else
304  {
305  device->GetMac ()->SetPanId (panId);
306  device->GetMac ()->SetAssociatedCoor(coor);
307  }
308  id++;
309  }
310  }
311  return;
312 }
313 
319 static void
321 {
322  file->Write (Simulator::Now (), packet);
323 }
324 
325 void
326 LrWpanHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename)
327 {
328  NS_LOG_FUNCTION (this << prefix << nd << promiscuous << explicitFilename);
329  //
330  // All of the Pcap enable functions vector through here including the ones
331  // that are wandering through all of devices on perhaps all of the nodes in
332  // the system.
333  //
334 
335  // In the future, if we create different NetDevice types, we will
336  // have to switch on each type below and insert into the right
337  // NetDevice type
338  //
339  Ptr<LrWpanNetDevice> device = nd->GetObject<LrWpanNetDevice> ();
340  if (device == 0)
341  {
342  NS_LOG_INFO ("LrWpanHelper::EnablePcapInternal(): Device " << device << " not of type ns3::LrWpanNetDevice");
343  return;
344  }
345 
346  PcapHelper pcapHelper;
347 
348  std::string filename;
349  if (explicitFilename)
350  {
351  filename = prefix;
352  }
353  else
354  {
355  filename = pcapHelper.GetFilenameFromDevice (prefix, device);
356  }
357 
358  Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, std::ios::out,
360 
361  if (promiscuous == true)
362  {
363  device->GetMac ()->TraceConnectWithoutContext ("PromiscSniffer", MakeBoundCallback (&PcapSniffLrWpan, file));
364 
365  }
366  else
367  {
368  device->GetMac ()->TraceConnectWithoutContext ("Sniffer", MakeBoundCallback (&PcapSniffLrWpan, file));
369  }
370 }
371 
372 void
375  std::string prefix,
376  Ptr<NetDevice> nd,
377  bool explicitFilename)
378 {
379  uint32_t nodeid = nd->GetNode ()->GetId ();
380  uint32_t deviceid = nd->GetIfIndex ();
381  std::ostringstream oss;
382 
383  Ptr<LrWpanNetDevice> device = nd->GetObject<LrWpanNetDevice> ();
384  if (device == 0)
385  {
386  NS_LOG_INFO ("LrWpanHelper::EnableAsciiInternal(): Device " << device << " not of type ns3::LrWpanNetDevice");
387  return;
388  }
389 
390  //
391  // Our default trace sinks are going to use packet printing, so we have to
392  // make sure that is turned on.
393  //
395 
396  //
397  // If we are not provided an OutputStreamWrapper, we are expected to create
398  // one using the usual trace filename conventions and do a Hook*WithoutContext
399  // since there will be one file per context and therefore the context would
400  // be redundant.
401  //
402  if (stream == 0)
403  {
404  //
405  // Set up an output stream object to deal with private ofstream copy
406  // constructor and lifetime issues. Let the helper decide the actual
407  // name of the file given the prefix.
408  //
409  AsciiTraceHelper asciiTraceHelper;
410 
411  std::string filename;
412  if (explicitFilename)
413  {
414  filename = prefix;
415  }
416  else
417  {
418  filename = asciiTraceHelper.GetFilenameFromDevice (prefix, device);
419  }
420 
421  Ptr<OutputStreamWrapper> theStream = asciiTraceHelper.CreateFileStream (filename);
422 
423  // Ascii traces typically have "+", '-", "d", "r", and sometimes "t"
424  // The Mac and Phy objects have the trace sources for these
425  //
426 
427  asciiTraceHelper.HookDefaultReceiveSinkWithoutContext<LrWpanMac> (device->GetMac (), "MacRx", theStream);
428 
429  device->GetMac ()->TraceConnectWithoutContext ("MacTx", MakeBoundCallback (&AsciiLrWpanMacTransmitSinkWithoutContext, theStream));
430 
431  asciiTraceHelper.HookDefaultEnqueueSinkWithoutContext<LrWpanMac> (device->GetMac (), "MacTxEnqueue", theStream);
432  asciiTraceHelper.HookDefaultDequeueSinkWithoutContext<LrWpanMac> (device->GetMac (), "MacTxDequeue", theStream);
433  asciiTraceHelper.HookDefaultDropSinkWithoutContext<LrWpanMac> (device->GetMac (), "MacTxDrop", theStream);
434 
435  return;
436  }
437 
438  //
439  // If we are provided an OutputStreamWrapper, we are expected to use it, and
440  // to provide a context. We are free to come up with our own context if we
441  // want, and use the AsciiTraceHelper Hook*WithContext functions, but for
442  // compatibility and simplicity, we just use Config::Connect and let it deal
443  // with the context.
444  //
445  // Note that we are going to use the default trace sinks provided by the
446  // ascii trace helper. There is actually no AsciiTraceHelper in sight here,
447  // but the default trace sinks are actually publicly available static
448  // functions that are always there waiting for just such a case.
449  //
450 
451 
452  oss.str ("");
453  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::LrWpanNetDevice/Mac/MacRx";
454  device->GetMac ()->TraceConnect ("MacRx", oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultReceiveSinkWithContext, stream));
455 
456  oss.str ("");
457  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::LrWpanNetDevice/Mac/MacTx";
458  device->GetMac ()->TraceConnect ("MacTx", oss.str (), MakeBoundCallback (&AsciiLrWpanMacTransmitSinkWithContext, stream));
459 
460  oss.str ("");
461  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::LrWpanNetDevice/Mac/MacTxEnqueue";
462  device->GetMac ()->TraceConnect ("MacTxEnqueue", oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultEnqueueSinkWithContext, stream));
463 
464  oss.str ("");
465  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::LrWpanNetDevice/Mac/MacTxDequeue";
466  device->GetMac ()->TraceConnect ("MacTxDequeue", oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultDequeueSinkWithContext, stream));
467 
468  oss.str ("");
469  oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::LrWpanNetDevice/Mac/MacTxDrop";
470  device->GetMac ()->TraceConnect ("MacTxDrop", oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultDropSinkWithContext, stream));
471 
472 }
473 
474 } // namespace ns3
475 
NetDeviceContainer Install(NodeContainer c)
Install a LrWpanNetDevice and the associated structures (e.g., channel) in the nodes.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Manage ASCII trace files for device models.
Definition: trace-helper.h:161
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
static void DefaultEnqueueSinkWithContext(Ptr< OutputStreamWrapper > file, std::string context, Ptr< const Packet > p)
Basic Enqueue default trace sink.
Class that implements the LR-WPAN MAC state machine.
Definition: lr-wpan-mac.h:451
static std::string LrWpanPhyEnumerationPrinter(LrWpanPhyEnumeration e)
Transform the LrWpanPhyEnumeration enumeration into a printable string.
uint32_t GetInteger(uint32_t min, uint32_t max)
Get the next random value, as an unsigned integer in the specified range .
void HookDefaultDropSinkWithoutContext(Ptr< T > object, std::string traceName, Ptr< OutputStreamWrapper > stream)
Hook a trace source to the default drop operation trace sink that does not accept nor log a trace con...
Definition: trace-helper.h:483
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
Manage pcap files for device models.
Definition: trace-helper.h:38
CHANNEL_IDLE.
Definition: lr-wpan-mac.h:76
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Definition: callback.h:1847
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:361
static void DefaultDropSinkWithContext(Ptr< OutputStreamWrapper > file, std::string context, Ptr< const Packet > p)
Basic Drop default trace sink.
static std::string LrWpanMacStatePrinter(LrWpanMacState e)
Transform the LrWpanMacState enumeration into a printable string.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1078
void AssociateToPan(NetDeviceContainer c, uint16_t panId)
Associate the nodes to the same PAN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:751
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we&#39;ll use to write the traced bits. ...
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
void HookDefaultEnqueueSinkWithoutContext(Ptr< T > object, std::string traceName, Ptr< OutputStreamWrapper > stream)
Hook a trace source to the default enqueue operation trace sink that does not accept nor log a trace ...
Definition: trace-helper.h:461
std::string GetFilenameFromDevice(std::string prefix, Ptr< NetDevice > device, bool useObjectNames=true)
Let the ascii trace helper figure out a reasonable filename to use for an ascii trace file associated...
Ptr< PcapFileWrapper > CreateFile(std::string filename, std::ios::openmode filemode, DataLinkType dataLinkType, uint32_t snapLen=std::numeric_limits< uint32_t >::max(), int32_t tzCorrection=0)
Create and initialize a pcap file.
Definition: trace-helper.cc:49
Network layer to device interface.
MLME-START.request params.
Definition: lr-wpan-mac.h:288
channel
Definition: third.py:92
phy
Definition: third.py:93
void MlmeStartRequest(MlmeStartRequestParams params)
IEEE 802.15.4-2006, section 7.1.14.1 MLME-START.request Request to allow a PAN coordinator to initiat...
Definition: lr-wpan-mac.cc:496
std::string GetFilenameFromDevice(std::string prefix, Ptr< NetDevice > device, bool useObjectNames=true)
Let the pcap helper figure out a reasonable filename to use for a pcap file associated with a device...
Definition: trace-helper.cc:80
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
Definition: log.cc:370
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1390
uint8_t m_sfrmOrd
Superframe Order, indicates the length of the CAP in time slots.
Definition: lr-wpan-mac.h:307
static void EnablePrinting(void)
Enable printing packets metadata.
Definition: packet.cc:572
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
holds a vector of ns3::NetDevice pointers
SET_PHY_TX_ON.
Definition: lr-wpan-mac.h:77
static void AsciiLrWpanMacTransmitSinkWithoutContext(Ptr< OutputStreamWrapper > stream, Ptr< const Packet > p)
Output an ascii line representing the Transmit event (without context)
uint8_t m_bcnOrd
Beacon Order, Used to calculate the beacon interval, a value of 15 indicates no periodic beacons will...
Definition: lr-wpan-mac.h:306
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output on the indicated net device.
static void DefaultReceiveSinkWithContext(Ptr< OutputStreamWrapper > file, std::string context, Ptr< const Packet > p)
Basic Receive default trace sink.
uint16_t m_PanId
Pan Identifier used by the device.
Definition: lr-wpan-mac.h:302
Ptr< SpectrumChannel > m_channel
channel to be used for the devices
static void AsciiLrWpanMacTransmitSinkWithContext(Ptr< OutputStreamWrapper > stream, std::string context, Ptr< const Packet > p)
Output an ascii line representing the Transmit event (with context)
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
Definition: log.cc:394
Prefix all trace prints with simulation time.
Definition: log.h:119
static void DefaultDequeueSinkWithContext(Ptr< OutputStreamWrapper > file, std::string context, Ptr< const Packet > p)
Basic Dequeue default trace sink.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
address
Definition: first.py:44
LrWpanHelper(void)
Create a LrWpan helper in an empty state.
This class can contain 16 bit addresses.
Definition: mac16-address.h:41
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:193
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
void HookDefaultReceiveSinkWithoutContext(Ptr< T > object, std::string traceName, Ptr< OutputStreamWrapper > stream)
Hook a trace source to the default receive operation trace sink that does not accept nor log a trace ...
Definition: trace-helper.h:527
void SetChannel(Ptr< SpectrumChannel > channel)
Set the channel associated to this helper.
CHANNEL_ACCESS_FAILURE.
Definition: lr-wpan-mac.h:75
void AssociateToBeaconPan(NetDeviceContainer c, uint16_t panId, Mac16Address coor, uint8_t bcnOrd, uint8_t sfrmOrd)
Associate the nodes to the same PAN and initiate beacon enabled mode.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Definition: node.cc:128
Prefix all trace prints with function.
Definition: log.h:118
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
LrWpanMacState
MAC states.
Definition: lr-wpan-mac.h:69
Ptr< SpectrumChannel > GetChannel(void)
Get the channel associated to this helper.
Print everything.
Definition: log.h:116
bool m_panCoor
On true this device will become coordinator.
Definition: lr-wpan-mac.h:308
void AddMobility(Ptr< LrWpanPhy > phy, Ptr< MobilityModel > m)
Add mobility model to a physical device.
LrWpanPhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
Definition: lr-wpan-phy.h:105
devices
Definition: first.py:39
virtual ~LrWpanHelper(void)
void EnableLogComponents(void)
Helper to enable all LrWpan log components with one statement.
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
static void PcapSniffLrWpan(Ptr< PcapFileWrapper > file, Ptr< const Packet > packet)
Write a packet in a PCAP file.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
void HookDefaultDequeueSinkWithoutContext(Ptr< T > object, std::string traceName, Ptr< OutputStreamWrapper > stream)
Hook a trace source to the default dequeue operation trace sink that does not accept nor log a trace ...
Definition: trace-helper.h:505
MAC_IDLE.
Definition: lr-wpan-mac.h:71