A Discrete-Event Network Simulator
API
lr-wpan-net-device.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  * Author:
19  * Tom Henderson <thomas.r.henderson@boeing.com>
20  * Tommaso Pecorella <tommaso.pecorella@unifi.it>
21  * Margherita Filippetti <morag87@gmail.com>
22  */
23 #include "lr-wpan-net-device.h"
24 #include "lr-wpan-phy.h"
25 #include "lr-wpan-csmaca.h"
26 #include "lr-wpan-error-model.h"
27 #include <ns3/abort.h>
28 #include <ns3/node.h>
29 #include <ns3/log.h>
30 #include <ns3/spectrum-channel.h>
31 #include <ns3/pointer.h>
32 #include <ns3/boolean.h>
33 #include <ns3/mobility-model.h>
34 #include <ns3/packet.h>
35 
36 
37 namespace ns3 {
38 
39 NS_LOG_COMPONENT_DEFINE ("LrWpanNetDevice");
40 
41 NS_OBJECT_ENSURE_REGISTERED (LrWpanNetDevice);
42 
43 TypeId
45 {
46  static TypeId tid = TypeId ("ns3::LrWpanNetDevice")
47  .SetParent<NetDevice> ()
48  .SetGroupName ("LrWpan")
49  .AddConstructor<LrWpanNetDevice> ()
50  .AddAttribute ("Channel", "The channel attached to this device",
51  PointerValue (),
53  MakePointerChecker<SpectrumChannel> ())
54  .AddAttribute ("Phy", "The PHY layer attached to this device.",
55  PointerValue (),
58  MakePointerChecker<LrWpanPhy> ())
59  .AddAttribute ("Mac", "The MAC layer attached to this device.",
60  PointerValue (),
63  MakePointerChecker<LrWpanMac> ())
64  .AddAttribute ("UseAcks", "Request acknowledgments for data frames.",
65  BooleanValue (true),
68  .AddAttribute ("PseudoMacAddressMode", "Build the pseudo-MAC Address according to RFC 4944 or RFC 6282 (default: RFC 6282).",
71  MakeEnumChecker (LrWpanNetDevice::RFC6282, "RFC 6282 (don't use PanId)",
72  LrWpanNetDevice::RFC4944, "RFC 4944 (use PanId)"))
73  ;
74  return tid;
75 }
76 
78  : m_configComplete (false)
79 {
80  NS_LOG_FUNCTION (this);
81  m_mac = CreateObject<LrWpanMac> ();
82  m_phy = CreateObject<LrWpanPhy> ();
83  m_csmaca = CreateObject<LrWpanCsmaCa> ();
84  CompleteConfig ();
85 }
86 
88 {
89  NS_LOG_FUNCTION (this);
90 }
91 
92 
93 void
95 {
96  NS_LOG_FUNCTION (this);
97  m_mac->Dispose ();
98  m_phy->Dispose ();
99  m_csmaca->Dispose ();
100  m_phy = 0;
101  m_mac = 0;
102  m_csmaca = 0;
103  m_node = 0;
104  // chain up.
106 
107 }
108 
109 void
111 {
112  NS_LOG_FUNCTION (this);
113  m_phy->Initialize ();
114  m_mac->Initialize ();
116 }
117 
118 
119 void
121 {
122  NS_LOG_FUNCTION (this);
123  if (m_mac == 0
124  || m_phy == 0
125  || m_csmaca == 0
126  || m_node == 0
127  || m_configComplete)
128  {
129  return;
130  }
131  m_mac->SetPhy (m_phy);
132  m_mac->SetCsmaCa (m_csmaca);
133  m_mac->SetMcpsDataIndicationCallback (MakeCallback (&LrWpanNetDevice::McpsDataIndication, this));
134  m_csmaca->SetMac (m_mac);
135 
137  if (!mobility)
138  {
139  NS_LOG_WARN ("LrWpanNetDevice: no Mobility found on the node, probably it's not a good idea.");
140  }
141  m_phy->SetMobility (mobility);
142  Ptr<LrWpanErrorModel> model = CreateObject<LrWpanErrorModel> ();
143  m_phy->SetErrorModel (model);
144  m_phy->SetDevice (this);
145 
146  m_phy->SetPdDataIndicationCallback (MakeCallback (&LrWpanMac::PdDataIndication, m_mac));
147  m_phy->SetPdDataConfirmCallback (MakeCallback (&LrWpanMac::PdDataConfirm, m_mac));
148  m_phy->SetPlmeEdConfirmCallback (MakeCallback (&LrWpanMac::PlmeEdConfirm, m_mac));
149  m_phy->SetPlmeGetAttributeConfirmCallback (MakeCallback (&LrWpanMac::PlmeGetAttributeConfirm, m_mac));
150  m_phy->SetPlmeSetTRXStateConfirmCallback (MakeCallback (&LrWpanMac::PlmeSetTRXStateConfirm, m_mac));
151  m_phy->SetPlmeSetAttributeConfirmCallback (MakeCallback (&LrWpanMac::PlmeSetAttributeConfirm, m_mac));
152 
153  m_csmaca->SetLrWpanMacStateCallback (MakeCallback (&LrWpanMac::SetLrWpanMacState, m_mac));
154  m_phy->SetPlmeCcaConfirmCallback (MakeCallback (&LrWpanCsmaCa::PlmeCcaConfirm, m_csmaca));
155  m_configComplete = true;
156 }
157 
158 void
160 {
161  NS_LOG_FUNCTION (this);
162  m_mac = mac;
163  CompleteConfig ();
164 }
165 
166 void
168 {
169  NS_LOG_FUNCTION (this);
170  m_phy = phy;
171  CompleteConfig ();
172 }
173 
174 void
176 {
177  NS_LOG_FUNCTION (this);
178  m_csmaca = csmaca;
179  CompleteConfig ();
180 }
181 
182 void
184 {
185  NS_LOG_FUNCTION (this << channel);
186  m_phy->SetChannel (channel);
187  channel->AddRx (m_phy);
188  CompleteConfig ();
189 }
190 
193 {
194  // NS_LOG_FUNCTION (this);
195  return m_mac;
196 }
197 
200 {
201  NS_LOG_FUNCTION (this);
202  return m_phy;
203 }
204 
207 {
208  NS_LOG_FUNCTION (this);
209  return m_csmaca;
210 }
211 void
212 LrWpanNetDevice::SetIfIndex (const uint32_t index)
213 {
214  NS_LOG_FUNCTION (this << index);
215  m_ifIndex = index;
216 }
217 
218 uint32_t
220 {
221  NS_LOG_FUNCTION (this);
222  return m_ifIndex;
223 }
224 
227 {
228  NS_LOG_FUNCTION (this);
229  return m_phy->GetChannel ();
230 }
231 
232 void
234 {
235  NS_LOG_FUNCTION (this);
236  m_linkUp = true;
237  m_linkChanges ();
238 }
239 
240 void
242 {
243  NS_LOG_FUNCTION (this);
244  m_linkUp = false;
245  m_linkChanges ();
246 }
247 
250 {
251  NS_LOG_FUNCTION (this);
252  return m_phy->GetChannel ();
253 }
254 
255 void
257 {
258  NS_LOG_FUNCTION (this);
260  {
261  m_mac->SetShortAddress (Mac16Address::ConvertFrom (address));
262  }
264  {
265  uint8_t buf[6];
267  addr.CopyTo (buf);
268  Mac16Address addr16;
269  addr16.CopyFrom (buf+4);
270  m_mac->SetShortAddress (addr16);
271  uint16_t panId;
272  panId = buf[0];
273  panId <<= 8;
274  panId |= buf[1];
275  m_mac->SetPanId (panId);
276  }
277  else
278  {
279  NS_ABORT_MSG ("LrWpanNetDevice::SetAddress - address is not of a compatible type");
280  }
281 }
282 
283 Address
285 {
286  NS_LOG_FUNCTION (this);
287 
288  if (m_mac->GetShortAddress () == Mac16Address ("00:00"))
289  {
290  return m_mac->GetExtendedAddress ();
291  }
292 
293  Mac48Address pseudoAddress = BuildPseudoMacAddress (m_mac->GetPanId (), m_mac->GetShortAddress ());
294 
295  return pseudoAddress;
296 }
297 
298 bool
299 LrWpanNetDevice::SetMtu (const uint16_t mtu)
300 {
301  NS_ABORT_MSG ("Unsupported");
302  return false;
303 }
304 
305 uint16_t
307 {
308  NS_LOG_FUNCTION (this);
309  // Maximum payload size is: max psdu - frame control - seqno - addressing - security - fcs
310  // = 127 - 2 - 1 - (2+2+2+2) - 0 - 2
311  // = 114
312  // assuming no security and addressing with only 16 bit addresses without pan id compression.
313  return 114;
314 }
315 
316 bool
318 {
319  NS_LOG_FUNCTION (this);
320  return m_phy != 0 && m_linkUp;
321 }
322 
323 void
325 {
326  NS_LOG_FUNCTION (this);
328 }
329 
330 bool
332 {
333  NS_LOG_FUNCTION (this);
334  return true;
335 }
336 
337 Address
339 {
340  NS_LOG_FUNCTION (this);
341 
342  Mac48Address pseudoAddress = BuildPseudoMacAddress (m_mac->GetPanId (), Mac16Address::GetBroadcast ());
343 
344  return pseudoAddress;
345 }
346 
347 bool
349 {
350  NS_LOG_FUNCTION (this);
351  return true;
352 }
353 
354 Address
356 {
357  NS_ABORT_MSG ("Unsupported");
358  return Address ();
359 }
360 
361 Address
363 {
364  NS_LOG_FUNCTION (this << addr);
365 
366  Mac48Address pseudoAddress = BuildPseudoMacAddress (m_mac->GetPanId (), Mac16Address::GetMulticast (addr));
367 
368  return pseudoAddress;
369 }
370 
371 bool
373 {
374  NS_LOG_FUNCTION (this);
375  return false;
376 }
377 
378 bool
380 {
381  NS_LOG_FUNCTION (this);
382  return false;
383 }
384 
385 bool
386 LrWpanNetDevice::Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber)
387 {
388  // This method basically assumes an 802.3-compliant device, but a raw
389  // 802.15.4 device does not have an ethertype, and requires specific
390  // McpsDataRequest parameters.
391  // For further study: how to support these methods somehow, such as
392  // inventing a fake ethertype and packet tag for McpsDataRequest
393  NS_LOG_FUNCTION (this << packet << dest << protocolNumber);
394 
395  if (packet->GetSize () > GetMtu ())
396  {
397  NS_LOG_ERROR ("Fragmentation is needed for this packet, drop the packet ");
398  return false;
399  }
400 
401  McpsDataRequestParams m_mcpsDataRequestParams;
402 
403  Mac16Address dst16;
404  if (Mac48Address::IsMatchingType (dest))
405  {
406  uint8_t buf[6];
407  dest.CopyTo (buf);
408  dst16.CopyFrom (buf+4);
409  }
410  else
411  {
412  dst16 = Mac16Address::ConvertFrom (dest);
413  }
414  m_mcpsDataRequestParams.m_dstAddr = dst16;
415  m_mcpsDataRequestParams.m_dstAddrMode = SHORT_ADDR;
416  m_mcpsDataRequestParams.m_dstPanId = m_mac->GetPanId ();
417  m_mcpsDataRequestParams.m_srcAddrMode = SHORT_ADDR;
418  // Using ACK requests for broadcast destinations is ok here. They are disabled
419  // by the MAC.
420  if (m_useAcks)
421  {
422  m_mcpsDataRequestParams.m_txOptions = TX_OPTION_ACK;
423  }
424  m_mcpsDataRequestParams.m_msduHandle = 0;
425  m_mac->McpsDataRequest (m_mcpsDataRequestParams, packet);
426  return true;
427 }
428 
429 bool
430 LrWpanNetDevice::SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber)
431 {
432  NS_ABORT_MSG ("Unsupported");
433  // TODO: To support SendFrom, the MACs McpsDataRequest has to use the provided source address, instead of to local one.
434  return false;
435 }
436 
437 Ptr<Node>
439 {
440  NS_LOG_FUNCTION (this);
441  return m_node;
442 }
443 
444 void
446 {
447  NS_LOG_FUNCTION (this);
448  m_node = node;
449  CompleteConfig ();
450 }
451 
452 bool
454 {
455  NS_LOG_FUNCTION (this);
456  return true;
457 }
458 
459 void
461 {
462  NS_LOG_FUNCTION (this);
463  m_receiveCallback = cb;
464 }
465 
466 void
468 {
469  // This method basically assumes an 802.3-compliant device, but a raw
470  // 802.15.4 device does not have an ethertype, and requires specific
471  // McpsDataIndication parameters.
472  // For further study: how to support these methods somehow, such as
473  // inventing a fake ethertype and packet tag for McpsDataRequest
474  NS_LOG_WARN ("Unsupported; use LrWpan MAC APIs instead");
475 }
476 
477 void
479 {
480  NS_LOG_FUNCTION (this);
481  // TODO: Use the PromiscReceiveCallback if the MAC is in promiscuous mode.
482 
483  if (params.m_dstAddrMode == SHORT_ADDR)
484  {
485  m_receiveCallback (this, pkt, 0, BuildPseudoMacAddress (params.m_srcPanId, params.m_srcAddr));
486  }
487  else
488  {
489  m_receiveCallback (this, pkt, 0, params.m_srcExtAddr);
490  }
491 }
492 
493 bool
495 {
497  return false;
498 }
499 
501 LrWpanNetDevice::BuildPseudoMacAddress (uint16_t panId, Mac16Address shortAddr) const
502 {
503  NS_LOG_FUNCTION (this);
504 
505  uint8_t buf[6];
506 
507  if (m_pseudoMacMode == RFC4944)
508  {
509  buf[0] = panId >> 8;
510  // Make sure the U/L bit is set
511  buf[0] |= 0x02;
512  buf[1] = panId & 0xff;
513  }
514  else
515  {
516  // Make sure the U/L bit is set
517  buf[0] = 0x02;
518  buf[1] = 0x00;
519  }
520  buf[2] = 0;
521  buf[3] = 0;
522  shortAddr.CopyTo (buf+4);
523 
524  Mac48Address pseudoAddress;
525  pseudoAddress.CopyFrom (buf);
526 
527  return pseudoAddress;
528 }
529 
530 int64_t
532 {
533  NS_LOG_FUNCTION (stream);
534  int64_t streamIndex = stream;
535  streamIndex += m_csmaca->AssignStreams (stream);
536  streamIndex += m_phy->AssignStreams (stream);
537  NS_LOG_DEBUG ("Number of assigned RV streams: " << (streamIndex - stream));
538  return (streamIndex - stream);
539 }
540 
541 } // namespace ns3
a polymophic address class
Definition: address.h:91
uint32_t CopyTo(uint8_t buffer[MAX_SIZE]) const
Copy the address bytes into a buffer.
Definition: address.cc:82
AttributeValue implementation for Boolean.
Definition: boolean.h:37
Hold variables of type enum.
Definition: enum.h:55
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
Describes an IPv6 address.
Definition: ipv6-address.h:50
void PlmeCcaConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.2.2 PLME-CCA.confirm status.
void PlmeSetTRXStateConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.2.8 PLME-SET-TRX-STATE.confirm Set PHY state.
void PlmeEdConfirm(LrWpanPhyEnumeration status, uint8_t energyLevel)
IEEE 802.15.4-2006 section 6.2.2.4 PLME-ED.confirm status and energy level.
void SetLrWpanMacState(LrWpanMacState macState)
CSMA-CA algorithm calls back the MAC after executing channel assessment.
void PdDataIndication(uint32_t psduLength, Ptr< Packet > p, uint8_t lqi)
IEEE 802.15.4-2006 section 6.2.1.3 PD-DATA.indication Indicates the transfer of an MPDU from PHY to M...
void PlmeGetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id, LrWpanPhyPibAttributes *attribute)
IEEE 802.15.4-2006 section 6.2.2.6 PLME-GET.confirm Get attributes per definition from Table 23 in se...
void PlmeSetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id)
IEEE 802.15.4-2006 section 6.2.2.10 PLME-SET.confirm Set attributes per definition from Table 23 in s...
void PdDataConfirm(LrWpanPhyEnumeration status)
IEEE 802.15.4-2006 section 6.2.1.2 Confirm the end of transmission of an MPDU to MAC.
Network layer to device interface.
virtual void SetIfIndex(const uint32_t index)
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual void DoInitialize(void)
Initialize() implementation.
virtual bool IsBroadcast(void) const
virtual bool SetMtu(const uint16_t mtu)
virtual ~LrWpanNetDevice(void)
virtual bool NeedsArp(void) const
PseudoMacAddressMode_e m_pseudoMacMode
How the pseudo MAC address is created.
virtual bool IsLinkUp(void) const
virtual void DoDispose(void)
Destructor implementation.
@ RFC4944
YYYY:0000:XXXX (with U/L bit set to local)
@ RFC6282
0200:0000:XXXX
virtual void SetNode(Ptr< Node > node)
Ptr< LrWpanMac > m_mac
The MAC for this NetDevice.
virtual Ptr< Channel > GetChannel(void) const
void CompleteConfig(void)
Configure PHY, MAC and CSMA/CA.
virtual void SetAddress(Address address)
This method indirects to LrWpanMac::SetShortAddress ()
bool m_useAcks
Configure the NetDevice to request MAC layer acknowledgments when sending packets using the Send() AP...
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual Ptr< Node > GetNode(void) const
void SetCsmaCa(Ptr< LrWpanCsmaCa > csmaca)
Set the CSMA/CA implementation to be used by the MAC and this NetDevice.
void LinkUp(void)
Mark NetDevice link as up.
void SetChannel(Ptr< SpectrumChannel > channel)
Set the channel to which the NetDevice, and therefore the PHY, should be attached to.
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
Ptr< Node > m_node
The node associated with this NetDevice.
void SetPhy(Ptr< LrWpanPhy > phy)
Set the PHY to be used by the MAC and this NetDevice.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
void McpsDataIndication(McpsDataIndicationParams params, Ptr< Packet > pkt)
The callback used by the MAC to hand over incoming packets to the NetDevice.
ReceiveCallback m_receiveCallback
Upper layer callback used for notification of new data packet arrivals.
virtual bool IsMulticast(void) const
bool m_linkUp
Is the link/device currently up and running?
Ptr< LrWpanPhy > GetPhy(void) const
Get the PHY used by this NetDevice.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Ptr< LrWpanPhy > m_phy
The PHY for this NetDevice.
Ptr< LrWpanMac > GetMac(void) const
Get the MAC used by this NetDevice.
virtual Address GetBroadcast(void) const
virtual uint32_t GetIfIndex(void) const
void SetMac(Ptr< LrWpanMac > mac)
Set the MAC to be used by this NetDevice.
virtual Address GetAddress(void) const
This method indirects to LrWpanMac::SetShortAddress ()
void LinkDown(void)
Mark NetDevice link as down.
virtual bool SupportsSendFrom(void) const
bool m_configComplete
True if MAC, PHY and CSMA/CA where successfully configured and the NetDevice is ready for being used.
Mac48Address BuildPseudoMacAddress(uint16_t panId, Mac16Address shortAddr) const
Builds a "pseudo 48-bit address" from the PanId and Short Address The form is PanId : 0x0 : 0x0 : Sho...
static TypeId GetTypeId(void)
Get the type ID.
Ptr< LrWpanCsmaCa > GetCsmaCa(void) const
Get the CSMA/CA implementation used by this NetDevice.
Ptr< SpectrumChannel > DoGetChannel(void) const
Attribute accessor method for the "Channel" attribute.
Ptr< LrWpanCsmaCa > m_csmaca
The CSMA/CA implementation for this NetDevice.
TracedCallback m_linkChanges
Trace source for link up/down changes.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual uint16_t GetMtu(void) const
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
uint32_t m_ifIndex
The interface index of this NetDevice.
This class can contain 16 bit addresses.
Definition: mac16-address.h:42
static Mac16Address GetMulticast(Ipv6Address address)
Returns the multicast address associated with an IPv6 address according to RFC 4944 Section 9.
static bool IsMatchingType(const Address &address)
static Mac16Address ConvertFrom(const Address &address)
void CopyTo(uint8_t buffer[2]) const
void CopyFrom(const uint8_t buffer[2])
static Mac16Address GetBroadcast(void)
an EUI-48 address
Definition: mac48-address.h:44
static bool IsMatchingType(const Address &address)
void CopyFrom(const uint8_t buffer[6])
static Mac48Address ConvertFrom(const Address &address)
void CopyTo(uint8_t buffer[6]) const
Keep track of the current position and velocity of an object.
Network layer to device interface.
Definition: net-device.h:96
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:346
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:353
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:856
Hold objects of type Ptr<T>.
Definition: pointer.h:37
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: boolean.h:85
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: enum.h:205
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: pointer.h:227
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:257
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
@ TX_OPTION_ACK
TX_OPTION_ACK.
Definition: lr-wpan-mac.h:59
@ SHORT_ADDR
Definition: lr-wpan-mac.h:141
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
address
Definition: first.py:44
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Definition: enum.h:162
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:1648
channel
Definition: third.py:92
mac
Definition: third.py:99
mobility
Definition: third.py:108
phy
Definition: third.py:93
MCPS-DATA.indication params.
Definition: lr-wpan-mac.h:271
uint8_t m_dstAddrMode
Destination address mode.
Definition: lr-wpan-mac.h:276
uint16_t m_srcPanId
Source PAN identifier.
Definition: lr-wpan-mac.h:273
Mac64Address m_srcExtAddr
Source extended address.
Definition: lr-wpan-mac.h:275
Mac16Address m_srcAddr
Source address.
Definition: lr-wpan-mac.h:274
MCPS-DATA.request params.
Definition: lr-wpan-mac.h:237
LrWpanAddressMode m_srcAddrMode
Source address mode.
Definition: lr-wpan-mac.h:246
LrWpanAddressMode m_dstAddrMode
Destination address mode.
Definition: lr-wpan-mac.h:247
uint16_t m_dstPanId
Destination PAN identifier.
Definition: lr-wpan-mac.h:248
Mac16Address m_dstAddr
Destination address.
Definition: lr-wpan-mac.h:249
uint8_t m_msduHandle
MSDU handle.
Definition: lr-wpan-mac.h:251
uint8_t m_txOptions
Tx Options (bitfield)
Definition: lr-wpan-mac.h:252