A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lr-wpan-mac-header.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 The Boeing Company
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: kwong yin <kwong-sang.yin@boeing.com>
18 */
19#include "lr-wpan-mac-header.h"
20
21#include <ns3/address-utils.h>
22
23namespace ns3
24{
25namespace lrwpan
26{
27
29
30// TODO: Test Compressed PAN Id, Security Enabled, different size Key
31
33{
34 SetType(LRWPAN_MAC_DATA); // Assume Data frame
35 SetSecDisable(); // Assume there is No Aux Sec but
36 SetNoFrmPend(); // No Frame Pending
37 SetNoAckReq(); // No Ack Frame will be expected from recipient
38 SetNoPanIdComp(); // No PAN Id Compression since no addresses
39 SetFrmCtrlRes(0); // Initialize the 3 reserved bits to 0
40 SetDstAddrMode(NOADDR); // Assume there will be no src and dst address
42 SetFrameVer(1); // Indicates an IEEE 802.15.4 frame
43}
44
46{
47 SetType(wpanMacType);
48 SetSeqNum(seqNum);
49 SetSecDisable(); // Assume there is No Aux Sec but
50 SetNoFrmPend(); // No Frame Pending
51 SetNoAckReq(); // No Ack Frame will be expected from recipient
52 SetNoPanIdComp(); // No PAN Id Compression since no addresses
53 SetFrmCtrlRes(0); // Initialize the 3 reserved bits to 0
54 SetDstAddrMode(NOADDR); // Assume there will be no src and dst address
56 SetFrameVer(1); // Indicates an IEEE 802.15.4 frame
57}
58
60{
61}
62
65{
66 switch (m_fctrlFrmType)
67 {
68 case 0:
69 return LRWPAN_MAC_BEACON;
70 case 1:
71 return LRWPAN_MAC_DATA;
72 case 2:
74 case 3:
75 return LRWPAN_MAC_COMMAND;
76 default:
78 }
79}
80
81uint16_t
83{
84 uint16_t val = 0;
85
86 val = m_fctrlFrmType & (0x07); // Bit 0-2
87 val |= (m_fctrlSecU << 3) & (0x01 << 3); // Bit 3
88 val |= (m_fctrlFrmPending << 4) & (0x01 << 4); // Bit 4
89 val |= (m_fctrlAckReq << 5) & (0x01 << 5); // Bit 5
90 val |= (m_fctrlPanIdComp << 6) & (0x01 << 6); // Bit 6
91 val |= (m_fctrlReserved << 7) & (0x07 << 7); // Bit 7-9
92 val |= (m_fctrlDstAddrMode << 10) & (0x03 << 10); // Bit 10-11
93 val |= (m_fctrlFrmVer << 12) & (0x03 << 12); // Bit 12-13
94 val |= (m_fctrlSrcAddrMode << 14) & (0x03 << 14); // Bit 14-15
95 return val;
96}
97
98bool
100{
101 return (m_fctrlSecU == 1);
102}
103
104bool
106{
107 return (m_fctrlFrmPending == 1);
108}
109
110bool
112{
113 return (m_fctrlAckReq == 1);
114}
115
116bool
118{
119 return (m_fctrlPanIdComp == 1);
120}
121
122uint8_t
124{
125 return m_fctrlReserved;
126}
127
128uint8_t
130{
131 return m_fctrlDstAddrMode;
132}
133
134uint8_t
136{
137 return m_fctrlFrmVer;
138}
139
140uint8_t
142{
143 return m_fctrlSrcAddrMode;
144}
145
146uint8_t
148{
149 return m_SeqNum;
150}
151
152uint16_t
154{
155 return m_addrDstPanId;
156}
157
160{
161 return m_addrShortDstAddr;
162}
163
166{
167 return m_addrExtDstAddr;
168}
169
170uint16_t
172{
173 return m_addrSrcPanId;
174}
175
178{
179 return m_addrShortSrcAddr;
180}
181
184{
185 return m_addrExtSrcAddr;
186}
187
188uint8_t
190{
191 uint8_t val = 0;
192
193 val = m_secctrlSecLevel & (0x7); // Bit 0-2
194 val |= (m_secctrlKeyIdMode << 3) & (0x3 << 3); // Bit 3-4
195 val |= (m_secctrlReserved << 5) & (0x7 << 5); // Bit 5-7
196
197 return val;
198}
199
202{
203 return m_auxFrmCntr;
204}
205
206uint8_t
208{
209 return m_secctrlSecLevel;
210}
211
212uint8_t
214{
215 return m_secctrlKeyIdMode;
216}
217
218uint8_t
220{
221 return m_secctrlReserved;
222}
223
226{
227 return m_auxKeyIdKeySrc32;
228}
229
230uint64_t
232{
233 return m_auxKeyIdKeySrc64;
234}
235
236uint8_t
238{
239 return m_auxKeyIdKeyIndex;
240}
241
242bool
244{
246}
247
248bool
250{
252}
253
254bool
256{
258}
259
260bool
262{
264}
265
266void
268{
269 m_fctrlFrmType = wpanMacType;
270}
271
272void
274{
275 m_fctrlFrmType = (frameControl) & (0x07); // Bit 0-2
276 m_fctrlSecU = (frameControl >> 3) & (0x01); // Bit 3
277 m_fctrlFrmPending = (frameControl >> 4) & (0x01); // Bit 4
278 m_fctrlAckReq = (frameControl >> 5) & (0x01); // Bit 5
279 m_fctrlPanIdComp = (frameControl >> 6) & (0x01); // Bit 6
280 m_fctrlReserved = (frameControl >> 7) & (0x07); // Bit 7-9
281 m_fctrlDstAddrMode = (frameControl >> 10) & (0x03); // Bit 10-11
282 m_fctrlFrmVer = (frameControl >> 12) & (0x03); // Bit 12-13
283 m_fctrlSrcAddrMode = (frameControl >> 14) & (0x03); // Bit 14-15
284}
285
286void
288{
289 m_fctrlSecU = 1;
290}
291
292void
294{
295 m_fctrlSecU = 0;
296}
297
298void
300{
302}
303
304void
306{
308}
309
310void
312{
313 m_fctrlAckReq = 1;
314}
315
316void
318{
319 m_fctrlAckReq = 0;
320}
321
322void
324{
326}
327
328void
330{
332}
333
334void
336{
337 m_fctrlReserved = res;
338}
339
340void
342{
343 m_fctrlDstAddrMode = addrMode;
344}
345
346void
348{
349 m_fctrlFrmVer = ver;
350}
351
352void
354{
355 m_fctrlSrcAddrMode = addrMode;
356}
357
358void
360{
361 m_SeqNum = seqNum;
362}
363
364void
366{
367 m_addrSrcPanId = panId;
368 m_addrShortSrcAddr = addr;
369}
370
371void
373{
374 m_addrSrcPanId = panId;
375 m_addrExtSrcAddr = addr;
376}
377
378void
380{
381 m_addrDstPanId = panId;
382 m_addrShortDstAddr = addr;
383}
384
385void
387{
388 m_addrDstPanId = panId;
389 m_addrExtDstAddr = addr;
390}
391
392void
394{
395 m_secctrlSecLevel = (secControl) & (0x07); // Bit 0-2
396 m_secctrlKeyIdMode = (secControl >> 3) & (0x03); // Bit 3-4
397 m_secctrlReserved = (secControl >> 5) & (0x07); // Bit 5-7
398}
399
400void
402{
403 m_auxFrmCntr = frmCntr;
404}
405
406void
408{
409 m_secctrlSecLevel = secLevel;
410}
411
412void
414{
415 m_secctrlKeyIdMode = keyIdMode;
416}
417
418void
420{
421 m_secctrlReserved = res;
422}
423
424void
426{
427 m_auxKeyIdKeyIndex = keyIndex;
428}
429
430void
431LrWpanMacHeader::SetKeyId(uint32_t keySrc, uint8_t keyIndex)
432{
433 m_auxKeyIdKeyIndex = keyIndex;
434 m_auxKeyIdKeySrc32 = keySrc;
435}
436
437void
438LrWpanMacHeader::SetKeyId(uint64_t keySrc, uint8_t keyIndex)
439{
440 m_auxKeyIdKeyIndex = keyIndex;
441 m_auxKeyIdKeySrc64 = keySrc;
442}
443
444TypeId
446{
447 static TypeId tid = TypeId("ns3::LrWpanMacHeader")
448 .SetParent<Header>()
449 .SetGroupName("LrWpan")
450 .AddConstructor<LrWpanMacHeader>();
451 return tid;
452}
453
454TypeId
456{
457 return GetTypeId();
458}
459
460void
461LrWpanMacHeader::Print(std::ostream& os) const
462{
463 os << " Frame Type = " << (uint32_t)m_fctrlFrmType
464 << ", Sec Enable = " << (uint32_t)m_fctrlSecU
465 << ", Frame Pending = " << (uint32_t)m_fctrlFrmPending
466 << ", Ack Request = " << (uint32_t)m_fctrlAckReq
467 << ", PAN ID Compress = " << (uint32_t)m_fctrlPanIdComp
468 << ", Frame Vers = " << (uint32_t)m_fctrlFrmVer
469 << ", Dst Addrs Mode = " << (uint32_t)m_fctrlDstAddrMode
470 << ", Src Addr Mode = " << (uint32_t)m_fctrlSrcAddrMode;
471
472 os << ", Sequence Num = " << static_cast<uint16_t>(m_SeqNum);
473
474 switch (m_fctrlDstAddrMode)
475 {
476 case NOADDR:
477 break;
478 case SHORTADDR:
479 os << ", Dst Addr Pan ID = " << static_cast<uint16_t>(m_addrDstPanId)
480 << ", m_addrShortDstAddr = " << m_addrShortDstAddr;
481 break;
482 case EXTADDR:
483 os << ", Dst Addr Pan ID = " << static_cast<uint16_t>(m_addrDstPanId)
484 << ", m_addrExtDstAddr = " << m_addrExtDstAddr;
485 break;
486 }
487
488 switch (m_fctrlSrcAddrMode)
489 {
490 case NOADDR:
491 break;
492 case SHORTADDR:
493 os << ", Src Addr Pan ID = " << static_cast<uint16_t>(m_addrSrcPanId)
494 << ", m_addrShortSrcAddr = " << m_addrShortSrcAddr;
495 break;
496 case EXTADDR:
497 os << ", Src Addr Pan ID = " << static_cast<uint32_t>(m_addrSrcPanId)
498 << ", m_addrExtSrcAddr = " << m_addrExtDstAddr;
499 break;
500 }
501
502 if (IsSecEnable())
503 {
504 os << " Security Level = " << static_cast<uint32_t>(m_secctrlSecLevel)
505 << ", Key Id Mode = " << static_cast<uint32_t>(m_secctrlKeyIdMode)
506 << ", Frame Counter = " << static_cast<uint32_t>(m_auxFrmCntr);
507
508 switch (m_secctrlKeyIdMode)
509 {
510 case IMPLICIT:
511 break;
512 case NOKEYSOURCE:
513 os << ", Key Id - Key Index = " << static_cast<uint32_t>(m_auxKeyIdKeyIndex);
514 break;
515 case SHORTKEYSOURCE:
516 os << ", Key Id - Key Source 32 =" << static_cast<uint32_t>(m_auxKeyIdKeySrc32)
517 << ", Key Id - Key Index = " << static_cast<uint32_t>(m_auxKeyIdKeyIndex);
518 break;
519 case LONGKEYSOURCE:
520 os << ", Key Id - Key Source 64 =" << static_cast<uint64_t>(m_auxKeyIdKeySrc64)
521 << ", Key Id - Key Index = " << static_cast<uint32_t>(m_auxKeyIdKeyIndex);
522 break;
523 }
524 }
525}
526
529{
530 /*
531 * Each mac header will have
532 * Frame Control : 2 octet
533 * Sequence Number : 1 Octet
534 * Dst PAN Id : 0/2 Octet
535 * Dst Address : 0/2/8 octet
536 * Src PAN Id : 0/2 octet
537 * Src Address : 0/2/8 octet
538 * Aux Sec Header : 0/5/6/10/14 octet
539 */
540
541 uint32_t size = 3;
542
543 switch (m_fctrlDstAddrMode)
544 {
545 case NOADDR:
546 break;
547 case SHORTADDR:
548 size += 4;
549 break;
550 case EXTADDR:
551 size += 10;
552 break;
553 }
554
555 switch (m_fctrlSrcAddrMode)
556 {
557 case NOADDR:
558 break;
559 case SHORTADDR:
560 // check if PAN Id compression is enabled
561 if (!IsPanIdComp())
562 {
563 size += 4;
564 }
565 else
566 {
567 size += 2;
568 }
569 break;
570 case EXTADDR:
571 // check if PAN Id compression is enabled
572 if (!IsPanIdComp())
573 {
574 size += 10;
575 }
576 else
577 {
578 size += 8;
579 }
580 break;
581 }
582
583 // check if security is enabled
584 if (IsSecEnable())
585 {
586 size += 5;
587 switch (m_secctrlKeyIdMode)
588 {
589 case IMPLICIT:
590 break;
591 case NOKEYSOURCE:
592 size += 1;
593 break;
594 case SHORTKEYSOURCE:
595 size += 5;
596 break;
597 case LONGKEYSOURCE:
598 size += 9;
599 break;
600 }
601 }
602 return size;
603}
604
605void
607{
608 Buffer::Iterator i = start;
609 uint16_t frameControl = GetFrameControl();
610
611 i.WriteHtolsbU16(frameControl);
612 i.WriteU8(GetSeqNum());
613
614 switch (m_fctrlDstAddrMode)
615 {
616 case NOADDR:
617 break;
618 case SHORTADDR:
621 break;
622 case EXTADDR:
625 break;
626 }
627
628 switch (m_fctrlSrcAddrMode)
629 {
630 case NOADDR:
631 break;
632 case SHORTADDR:
633 if (!IsPanIdComp())
634 {
636 }
638 break;
639 case EXTADDR:
640 if (!IsPanIdComp())
641 {
643 }
645 break;
646 }
647
648 if (IsSecEnable())
649 {
652
653 switch (m_secctrlKeyIdMode)
654 {
655 case IMPLICIT:
656 break;
657 case NOKEYSOURCE:
659 break;
660 case SHORTKEYSOURCE:
663 break;
664 case LONGKEYSOURCE:
667 break;
668 }
669 }
670}
671
674{
675 Buffer::Iterator i = start;
676 uint16_t frameControl = i.ReadLsbtohU16();
677 SetFrameControl(frameControl);
678
679 SetSeqNum(i.ReadU8());
680 switch (m_fctrlDstAddrMode)
681 {
682 case NOADDR:
683 break;
684 case SHORTADDR:
687 break;
688 case EXTADDR:
691 break;
692 }
693
694 switch (m_fctrlSrcAddrMode)
695 {
696 case NOADDR:
697 break;
698 case SHORTADDR:
699 if (!IsPanIdComp())
700 {
702 }
703 else
704 {
705 if (m_fctrlDstAddrMode > 0)
706 {
708 }
709 }
711 break;
712 case EXTADDR:
713 if (!IsPanIdComp())
714 {
716 }
717 else
718 {
719 if (m_fctrlDstAddrMode > 0)
720 {
722 }
723 }
725 break;
726 }
727
728 if (IsSecEnable())
729 {
732
733 switch (m_secctrlKeyIdMode)
734 {
735 case IMPLICIT:
736 break;
737 case NOKEYSOURCE:
738 SetKeyId(i.ReadU8());
739 break;
740 case SHORTKEYSOURCE:
741 SetKeyId(i.ReadLsbtohU32(), i.ReadU8());
742 break;
743 case LONGKEYSOURCE:
744 SetKeyId(i.ReadLsbtohU64(), i.ReadU8());
745 break;
746 }
747 }
748 return i.GetDistanceFrom(start);
749}
750
751} // namespace lrwpan
752} // namespace ns3
iterator in a Buffer instance
Definition: buffer.h:100
void WriteHtolsbU16(uint16_t data)
Definition: buffer.cc:902
uint8_t ReadU8()
Definition: buffer.h:1027
void WriteU8(uint8_t data)
Definition: buffer.h:881
void WriteHtolsbU32(uint32_t data)
Definition: buffer.cc:910
uint16_t ReadLsbtohU16()
Definition: buffer.cc:1064
uint64_t ReadLsbtohU64()
Definition: buffer.cc:1094
void WriteHtolsbU64(uint64_t data)
Definition: buffer.cc:920
uint32_t GetDistanceFrom(const Iterator &o) const
Definition: buffer.cc:780
uint32_t ReadLsbtohU32()
Definition: buffer.cc:1076
Protocol header serialization and deserialization.
Definition: header.h:44
Introspection did not find any typical Config paths.
This class can contain 16 bit addresses.
Definition: mac16-address.h:44
an EUI-64 address
Definition: mac64-address.h:46
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
Represent the Mac Header with the Frame Control and Sequence Number fields.
uint8_t GetSecControl() const
Get the Auxiliary Security Header - Security Control Octet.
void SetFrmPend()
Set the Frame Control field "Frame Pending" bit to true.
uint32_t GetSerializedSize() const override
void SetSecLevel(uint8_t secLevel)
Set the Security Control field "Security Level" bits (3 bits)
LrWpanMacType GetType() const
Get the header type.
uint8_t m_fctrlReserved
Frame Control field Bit 7-9.
bool IsSecEnable() const
Check if Security Enabled bit of Frame Control is enabled.
uint8_t GetKeyIdIndex() const
Get the Auxiliary Security Header - Key Identifier - Key Index.
uint8_t m_secctrlKeyIdMode
Auxiliary security header - Security Control field - Bit 3-4 will indicate size of Key Id.
uint8_t m_auxKeyIdKeyIndex
Auxiliary security header - Key Index (1 Octet)
void SetSecControl(uint8_t secLevel)
Set the auxiliary security header "Security Control" octet.
uint64_t m_auxKeyIdKeySrc64
Auxiliary security header - Key Source (8 Octets)
Mac16Address GetShortSrcAddr() const
Get the Source Short address.
void SetType(LrWpanMacType wpanMacType)
Set the Frame Control field "Frame Type" bits.
void SetDstAddrMode(uint8_t addrMode)
Set the Destination address mode.
uint16_t m_addrDstPanId
Dst PAN id (0 or 2 Octets)
void SetNoAckReq()
Set the Frame Control field "Ack. Request" bit to false.
uint8_t GetSecLevel() const
Get the Auxiliary Security Header - Security Control - Security Level bits.
void SetSecCtrlReserved(uint8_t res)
Set the Security Control field "Reserved" bits (3 bits)
void SetDstAddrFields(uint16_t panId, Mac16Address addr)
Set Destination address fields.
Mac64Address GetExtSrcAddr() const
Get the Source Extended address.
static TypeId GetTypeId()
Get the type ID.
uint32_t m_auxKeyIdKeySrc32
Auxiliary security header - Key Source (4 Octets)
uint32_t Deserialize(Buffer::Iterator start) override
bool IsData() const
Returns true if the header is a data.
uint8_t m_fctrlFrmType
Frame Control field Bit 0-2 = 0 - Beacon, 1 - Data, 2 - Ack, 3 - Command.
uint64_t GetKeyIdSrc64() const
Get the Auxiliary Security Header - Key Identifier - Key Source (4 Octets)
void SetFrameControl(uint16_t frameControl)
Set the whole Frame Control field.
Mac16Address m_addrShortDstAddr
Dst Short addr (0 or 2 Octets)
uint8_t m_SeqNum
Sequence Number (1 Octet)
bool IsBeacon() const
Returns true if the header is a beacon.
void Print(std::ostream &os) const override
LrWpanMacType
The possible MAC types, see IEEE 802.15.4-2006, Table 79.
@ LRWPAN_MAC_ACKNOWLEDGMENT
LRWPAN_MAC_ACKNOWLEDGMENT.
@ LRWPAN_MAC_RESERVED
LRWPAN_MAC_RESERVED.
@ LRWPAN_MAC_COMMAND
LRWPAN_MAC_COMMAND.
@ LRWPAN_MAC_BEACON
LRWPAN_MAC_BEACON.
uint32_t GetFrmCounter() const
Get the Auxiliary Security Header - Frame Counter Octets.
void SetPanIdComp()
Set the Frame Control field "PAN ID Compression" bit to true.
Mac16Address GetShortDstAddr() const
Get the Destination Short address.
void Serialize(Buffer::Iterator start) const override
Mac16Address m_addrShortSrcAddr
Src Short addr (0 or 2 Octets)
uint16_t GetFrameControl() const
Get the Frame control field.
uint8_t GetKeyIdMode() const
Get the Auxiliary Security Header - Security Control - Key Identifier Mode bits.
void SetSrcAddrMode(uint8_t addrMode)
Set the Source address mode.
bool IsCommand() const
Returns true if the header is a command.
uint16_t m_addrSrcPanId
Src PAN id (0 or 2 Octets)
uint32_t GetKeyIdSrc32() const
Get the Auxiliary Security Header - Key Identifier - Key Source (2 Octets)
uint8_t GetSecCtrlReserved() const
Get the Auxiliary Security Header - Security Control - Reserved bits.
void SetFrmCtrlRes(uint8_t res)
Set the Frame Control field "Reserved" bits.
void SetKeyId(uint8_t keyIndex)
Set the Key Index.
uint8_t GetSeqNum() const
Get the frame Sequence number.
void SetFrameVer(uint8_t ver)
Set the Frame version.
uint8_t m_secctrlSecLevel
Auxiliary security header - Security Control field - Bit 0-2.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t GetFrameVer() const
Get the Frame Version of Frame control field.
void SetFrmCounter(uint32_t frmCntr)
Set the auxiliary security header "Frame Counter" octet.
void SetSrcAddrFields(uint16_t panId, Mac16Address addr)
Set Source address fields.
Mac64Address m_addrExtDstAddr
Dst Ext addr (0 or 8 Octets)
uint8_t m_fctrlDstAddrMode
Frame Control field Bit 10-11 = 0 - No DstAddr, 2 - ShtDstAddr, 3 - ExtDstAddr.
Mac64Address m_addrExtSrcAddr
Src Ext addr (0 or 8 Octets)
bool IsFrmPend() const
Check if Frame Pending bit of Frame Control is enabled.
uint8_t m_secctrlReserved
Auxiliary security header - Security Control field - Bit 5-7.
uint16_t GetSrcPanId() const
Get the Source PAN ID.
void SetNoPanIdComp()
Set the Frame Control field "PAN ID Compression" bit to false.
uint8_t m_fctrlSrcAddrMode
Frame Control field Bit 14-15 = 0 - No SrcAddr, 2 - ShtSrcAddr, 3 - ExtSrcAddr.
uint16_t GetDstPanId() const
Get the Destination PAN ID.
uint8_t m_fctrlFrmPending
Frame Control field Bit 4.
uint8_t m_fctrlPanIdComp
Frame Control field Bit 6 = 0 - no compression, 1 - using only DstPanId for both Src and DstPanId.
uint8_t m_fctrlFrmVer
Frame Control field Bit 12-13.
uint8_t m_fctrlAckReq
Frame Control field Bit 5.
void SetNoFrmPend()
Set the Frame Control field "Frame Pending" bit to false.
uint32_t m_auxFrmCntr
Auxiliary security header - Frame Counter (4 Octets)
void SetAckReq()
Set the Frame Control field "Ack. Request" bit to true.
bool IsAckReq() const
Check if Ack.
uint8_t GetDstAddrMode() const
Get the Dest.
uint8_t m_fctrlSecU
Frame Control field Bit 3 = 0 - no AuxSecHdr , 1 - security enabled AuxSecHdr present.
void SetSecEnable()
Set the Frame Control field "Security Enabled" bit to true.
void SetSecDisable()
Set the Frame Control field "Security Enabled" bit to false.
Mac64Address GetExtDstAddr() const
Get the Destination Extended address.
bool IsAcknowledgment() const
Returns true if the header is an ack.
uint8_t GetSrcAddrMode() const
Get the Source Addressing Mode of Frame control field.
bool IsPanIdComp() const
Check if PAN ID Compression bit of Frame Control is enabled.
void SetSeqNum(uint8_t seqNum)
Set the Sequence number.
uint8_t GetFrmCtrlRes() const
Get the Reserved bits of Frame control field.
void SetKeyIdMode(uint8_t keyIdMode)
Set the Security Control field "Key Identifier Mode" bits (2 bits)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.