A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
lr-wpan-mac-header.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 The Boeing Company
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: kwong yin <kwong-sang.yin@boeing.com>
7
*/
8
9
/*
10
* the following classes implements the 802.15.4 Mac Header
11
* There are 4 types of 802.15.4 Mac Headers Frames, and they have these fields
12
*
13
* Headers Frames : Fields
14
* -------------------------------------------------------------------------------------------
15
* Beacon : Frame Control, Sequence Number, Address Fields+, Auxiliary Security
16
* Header++. Data : Frame Control, Sequence Number, Address Fields++, Auxiliary Security
17
* Header++. Acknowledgment : Frame Control, Sequence Number. Command : Frame Control,
18
* Sequence Number, Address Fields++, Auxiliary Security Header++.
19
*
20
* + - The Address fields in Beacon frame is made up of the Source PAN Id and address only and
21
* size is 4 or 8 octets whereas the other frames may contain the Destination PAN Id and address as
22
* well. (see specs).
23
* ++ - These fields are optional and of variable size
24
*/
25
26
#ifndef LR_WPAN_MAC_HEADER_H
27
#define LR_WPAN_MAC_HEADER_H
28
29
#include <ns3/header.h>
30
#include <ns3/mac16-address.h>
31
#include <ns3/mac64-address.h>
32
33
namespace
ns3
34
{
35
namespace
lrwpan
36
{
37
38
/**
39
* \ingroup lr-wpan
40
* Represent the Mac Header with the Frame Control and Sequence Number fields
41
*/
42
class
LrWpanMacHeader
:
public
Header
43
{
44
public
:
45
/**
46
* The possible MAC types, see IEEE 802.15.4-2006, Table 79.
47
*/
48
enum
LrWpanMacType
49
{
50
LRWPAN_MAC_BEACON
= 0,
//!< LRWPAN_MAC_BEACON
51
LRWPAN_MAC_DATA
= 1,
//!< LRWPAN_MAC_DATA
52
LRWPAN_MAC_ACKNOWLEDGMENT
= 2,
//!< LRWPAN_MAC_ACKNOWLEDGMENT
53
LRWPAN_MAC_COMMAND
= 3,
//!< LRWPAN_MAC_COMMAND
54
LRWPAN_MAC_RESERVED
//!< LRWPAN_MAC_RESERVED
55
};
56
57
/**
58
* The addressing mode types, see IEEE 802.15.4-2006, Table 80.
59
*/
60
enum
AddrModeType
61
{
62
NOADDR
= 0,
63
RESADDR
= 1,
64
SHORTADDR
= 2,
65
EXTADDR
= 3
66
};
67
68
/**
69
* The addressing mode types, see IEEE 802.15.4-2006, Table 80.
70
*/
71
enum
KeyIdModeType
72
{
73
IMPLICIT
= 0,
74
NOKEYSOURCE
= 1,
75
SHORTKEYSOURCE
= 2,
76
LONGKEYSOURCE
= 3
77
};
78
79
LrWpanMacHeader
();
80
81
/**
82
* Constructor
83
* \param wpanMacType the header MAC type
84
* \param seqNum the sequence number
85
*
86
* \internal
87
* Data, ACK, Control MAC Header must have frame control and sequence number.
88
* Beacon MAC Header must have frame control, sequence number, source PAN Id, source address.
89
*/
90
LrWpanMacHeader
(
LrWpanMacType
wpanMacType, uint8_t seqNum);
91
92
~LrWpanMacHeader
()
override
;
93
94
/**
95
* Get the header type
96
* \return the header type
97
*/
98
LrWpanMacType
GetType
()
const
;
99
/**
100
* Get the Frame control field
101
* \return the Frame control field
102
*/
103
uint16_t
GetFrameControl
()
const
;
104
/**
105
* Check if Security Enabled bit of Frame Control is enabled
106
* \return true if Security Enabled bit is enabled
107
*/
108
bool
IsSecEnable
()
const
;
109
/**
110
* Check if Frame Pending bit of Frame Control is enabled
111
* \return true if Frame Pending bit is enabled
112
*/
113
bool
IsFrmPend
()
const
;
114
/**
115
* Check if Ack. Request bit of Frame Control is enabled
116
* \return true if Ack. Request bit is enabled
117
*/
118
bool
IsAckReq
()
const
;
119
/**
120
* Check if PAN ID Compression bit of Frame Control is enabled
121
* \return true if PAN ID Compression bit is enabled
122
*/
123
bool
IsPanIdComp
()
const
;
124
/**
125
* Get the Reserved bits of Frame control field
126
* \return the Reserved bits
127
*/
128
uint8_t
GetFrmCtrlRes
()
const
;
129
/**
130
* Get the Dest. Addressing Mode of Frame control field
131
* \return the Dest. Addressing Mode bits
132
*/
133
uint8_t
GetDstAddrMode
()
const
;
134
/**
135
* Get the Frame Version of Frame control field
136
* \return the Frame Version bits
137
*/
138
uint8_t
GetFrameVer
()
const
;
139
/**
140
* Get the Source Addressing Mode of Frame control field
141
* \return the Source Addressing Mode bits
142
*/
143
uint8_t
GetSrcAddrMode
()
const
;
144
/**
145
* Get the frame Sequence number
146
* \return the sequence number
147
*/
148
uint8_t
GetSeqNum
()
const
;
149
/**
150
* Get the Destination PAN ID
151
* \return the Destination PAN ID
152
*/
153
uint16_t
GetDstPanId
()
const
;
154
/**
155
* Get the Destination Short address
156
* \return the Destination Short address
157
*/
158
Mac16Address
GetShortDstAddr
()
const
;
159
/**
160
* Get the Destination Extended address
161
* \return the Destination Extended address
162
*/
163
Mac64Address
GetExtDstAddr
()
const
;
164
/**
165
* Get the Source PAN ID
166
* \return the Source PAN ID
167
*/
168
uint16_t
GetSrcPanId
()
const
;
169
/**
170
* Get the Source Short address
171
* \return the Source Short address
172
*/
173
Mac16Address
GetShortSrcAddr
()
const
;
174
/**
175
* Get the Source Extended address
176
* \return the Source Extended address
177
*/
178
Mac64Address
GetExtSrcAddr
()
const
;
179
/**
180
* Get the Auxiliary Security Header - Security Control Octet
181
* \return the Auxiliary Security Header - Security Control Octet
182
*/
183
uint8_t
GetSecControl
()
const
;
184
/**
185
* Get the Auxiliary Security Header - Frame Counter Octets
186
* \return the Auxiliary Security Header - Frame Counter Octets
187
*/
188
uint32_t
GetFrmCounter
()
const
;
189
190
/**
191
* Get the Auxiliary Security Header - Security Control - Security Level bits
192
* \return the Auxiliary Security Header - Security Control - Security Level bits
193
*/
194
uint8_t
GetSecLevel
()
const
;
195
/**
196
* Get the Auxiliary Security Header - Security Control - Key Identifier Mode bits
197
* \return the Auxiliary Security Header - Security Control - Key Identifier Mode bits
198
*/
199
uint8_t
GetKeyIdMode
()
const
;
200
/**
201
* Get the Auxiliary Security Header - Security Control - Reserved bits
202
* \return the Auxiliary Security Header - Security Control - Reserved bits
203
*/
204
uint8_t
GetSecCtrlReserved
()
const
;
205
/**
206
* Get the Auxiliary Security Header - Key Identifier - Key Source (2 Octets)
207
* \return the Auxiliary Security Header - Key Identifier - Key Source (2 Octets)
208
*/
209
uint32_t
GetKeyIdSrc32
()
const
;
210
/**
211
* Get the Auxiliary Security Header - Key Identifier - Key Source (4 Octets)
212
* \return the Auxiliary Security Header - Key Identifier - Key Source (4 Octets)
213
*/
214
uint64_t
GetKeyIdSrc64
()
const
;
215
/**
216
* Get the Auxiliary Security Header - Key Identifier - Key Index
217
* \return the Auxiliary Security Header - Key Identifier - Key Index
218
*/
219
uint8_t
GetKeyIdIndex
()
const
;
220
/**
221
* Returns true if the header is a beacon
222
* \return true if the header is a beacon
223
*/
224
bool
IsBeacon
()
const
;
225
/**
226
* Returns true if the header is a data
227
* \return true if the header is a data
228
*/
229
bool
IsData
()
const
;
230
/**
231
* Returns true if the header is an ack
232
* \return true if the header is an ack
233
*/
234
bool
IsAcknowledgment
()
const
;
235
/**
236
* Returns true if the header is a command
237
* \return true if the header is a command
238
*/
239
bool
IsCommand
()
const
;
240
/**
241
* Set the Frame Control field "Frame Type" bits
242
* \param wpanMacType the frame type
243
*/
244
void
SetType
(
LrWpanMacType
wpanMacType);
245
/**
246
* Set the whole Frame Control field
247
* \param frameControl the Frame Control field
248
*/
249
void
SetFrameControl
(uint16_t frameControl);
250
/**
251
* Set the Frame Control field "Security Enabled" bit to true
252
*/
253
void
SetSecEnable
();
254
/**
255
* Set the Frame Control field "Security Enabled" bit to false
256
*/
257
void
SetSecDisable
();
258
/**
259
* Set the Frame Control field "Frame Pending" bit to true
260
*/
261
void
SetFrmPend
();
262
/**
263
* Set the Frame Control field "Frame Pending" bit to false
264
*/
265
void
SetNoFrmPend
();
266
/**
267
* Set the Frame Control field "Ack. Request" bit to true
268
*/
269
void
SetAckReq
();
270
/**
271
* Set the Frame Control field "Ack. Request" bit to false
272
*/
273
void
SetNoAckReq
();
274
/**
275
* Set the Frame Control field "PAN ID Compression" bit to true
276
*/
277
void
SetPanIdComp
();
278
/**
279
* Set the Frame Control field "PAN ID Compression" bit to false
280
*/
281
void
SetNoPanIdComp
();
282
/**
283
* Set the Frame Control field "Reserved" bits
284
* \param res reserved bits
285
*/
286
void
SetFrmCtrlRes
(uint8_t res);
287
/**
288
* Set the Destination address mode
289
* \param addrMode Destination address mode
290
*/
291
void
SetDstAddrMode
(uint8_t addrMode);
292
/**
293
* Set the Frame version
294
* \param ver frame version
295
*/
296
void
SetFrameVer
(uint8_t ver);
297
/**
298
* Set the Source address mode
299
* \param addrMode Source address mode
300
*/
301
void
SetSrcAddrMode
(uint8_t addrMode);
302
/**
303
* Set the Sequence number
304
* \param seqNum sequence number
305
*/
306
void
SetSeqNum
(uint8_t seqNum);
307
/* The Source/Destination Addressing fields are only set if SrcAddrMode/DstAddrMode are set */
308
/**
309
* Set Source address fields
310
* \param panId source PAN ID
311
* \param addr source address (16 bit)
312
*/
313
void
SetSrcAddrFields
(uint16_t panId,
Mac16Address
addr);
314
/**
315
* Set Source address fields
316
* \param panId source PAN ID
317
* \param addr source address (64 bit)
318
*/
319
void
SetSrcAddrFields
(uint16_t panId,
Mac64Address
addr);
320
/**
321
* Set Destination address fields
322
* \param panId destination PAN ID
323
* \param addr destination address (16 bit)
324
*/
325
void
SetDstAddrFields
(uint16_t panId,
Mac16Address
addr);
326
/**
327
* Set Destination address fields
328
* \param panId destination PAN ID
329
* \param addr destination address (64 bit)
330
*/
331
void
SetDstAddrFields
(uint16_t panId,
Mac64Address
addr);
332
333
/* Auxiliary Security Header is only set if Sec Enable (SecU) field is set to 1 */
334
/**
335
* Set the auxiliary security header "Security Control" octet
336
* \param secLevel the "Security Control" octet
337
*/
338
void
SetSecControl
(uint8_t secLevel);
339
/**
340
* Set the auxiliary security header "Frame Counter" octet
341
* \param frmCntr the "Frame Counter" octet
342
*/
343
void
SetFrmCounter
(
uint32_t
frmCntr);
344
/**
345
* Set the Security Control field "Security Level" bits (3 bits)
346
* \param secLevel the "Security Level" bits
347
*/
348
void
SetSecLevel
(uint8_t secLevel);
349
/**
350
* Set the Security Control field "Key Identifier Mode" bits (2 bits)
351
* \param keyIdMode the "Key Identifier Mode" bits
352
*/
353
void
SetKeyIdMode
(uint8_t keyIdMode);
354
/**
355
* Set the Security Control field "Reserved" bits (3 bits)
356
* \param res the "Reserved" bits
357
*/
358
void
SetSecCtrlReserved
(uint8_t res);
359
/* Variable length will be dependent on Key Id Mode*/
360
/**
361
* Set the Key Index
362
* \param keyIndex the Key index
363
*/
364
void
SetKeyId
(uint8_t keyIndex);
365
/**
366
* Set the Key Index and originator
367
* \param keySrc the originator of a group key
368
* \param keyIndex the Key index
369
*/
370
void
SetKeyId
(
uint32_t
keySrc, uint8_t keyIndex);
371
/**
372
* Set the Key Index and originator
373
* \param keySrc the originator of a group key
374
* \param keyIndex the Key index
375
*/
376
void
SetKeyId
(uint64_t keySrc, uint8_t keyIndex);
377
/**
378
* \brief Get the type ID.
379
* \return the object TypeId
380
*/
381
static
TypeId
GetTypeId
();
382
TypeId
GetInstanceTypeId
()
const override
;
383
384
void
Print
(std::ostream& os)
const override
;
385
uint32_t
GetSerializedSize
()
const override
;
386
void
Serialize
(
Buffer::Iterator
start)
const override
;
387
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
388
389
private
:
390
/* Frame Control 2 Octets */
391
/* Frame Control field - see 7.2.1.1 */
392
uint8_t
m_fctrlFrmType
;
//!< Frame Control field Bit 0-2 = 0 - Beacon, 1 - Data, 2 - Ack, 3 -
393
//!< Command
394
uint8_t
m_fctrlSecU
;
//!< Frame Control field Bit 3 = 0 - no AuxSecHdr , 1 - security
395
//!< enabled AuxSecHdr present
396
uint8_t
m_fctrlFrmPending
;
//!< Frame Control field Bit 4
397
uint8_t
m_fctrlAckReq
;
//!< Frame Control field Bit 5
398
uint8_t
m_fctrlPanIdComp
;
//!< Frame Control field Bit 6 = 0 - no compression, 1 - using
399
//!< only DstPanId for both Src and DstPanId
400
uint8_t
m_fctrlReserved
;
//!< Frame Control field Bit 7-9
401
uint8_t
m_fctrlDstAddrMode
;
//!< Frame Control field Bit 10-11 = 0 - No DstAddr, 2 -
402
//!< ShtDstAddr, 3 - ExtDstAddr
403
uint8_t
m_fctrlFrmVer
;
//!< Frame Control field Bit 12-13
404
uint8_t
m_fctrlSrcAddrMode
;
//!< Frame Control field Bit 14-15 = 0 - No SrcAddr, 2 -
405
//!< ShtSrcAddr, 3 - ExtSrcAddr
406
407
/* Sequence Number */
408
uint8_t
m_SeqNum
;
//!< Sequence Number (1 Octet)
409
410
/* Addressing fields */
411
uint16_t
m_addrDstPanId
;
//!< Dst PAN id (0 or 2 Octets)
412
Mac16Address
m_addrShortDstAddr
;
//!< Dst Short addr (0 or 2 Octets)
413
Mac64Address
m_addrExtDstAddr
;
//!< Dst Ext addr (0 or 8 Octets)
414
uint16_t
m_addrSrcPanId
;
//!< Src PAN id (0 or 2 Octets)
415
Mac16Address
m_addrShortSrcAddr
;
//!< Src Short addr (0 or 2 Octets)
416
Mac64Address
m_addrExtSrcAddr
;
//!< Src Ext addr (0 or 8 Octets)
417
418
/* Auxiliary Security Header - See 7.6.2 - 0, 5, 6, 10 or 14 Octets */
419
// uint8_t m_auxSecCtrl; // 1 Octet see below
420
uint32_t
m_auxFrmCntr
;
//!< Auxiliary security header - Frame Counter (4 Octets)
421
422
/* Security Control fields - See 7.6.2.2 */
423
uint8_t
m_secctrlSecLevel
;
//!< Auxiliary security header - Security Control field - Bit 0-2
424
uint8_t
m_secctrlKeyIdMode
;
//!< Auxiliary security header - Security Control field - Bit 3-4
425
//!< will indicate size of Key Id
426
// = 0 - Key is determined implicitly
427
// from originator and recipient
428
// = 1 - 1 Octet Key Index
429
// = 2 - 1 Octet Key Index and 4 oct Key src
430
// = 3 - 1 Octet Key Index and 8 oct Key src
431
432
uint8_t
m_secctrlReserved
;
//!< Auxiliary security header - Security Control field - Bit 5-7
433
434
union
{
435
uint32_t
m_auxKeyIdKeySrc32
;
//!< Auxiliary security header - Key Source (4 Octets)
436
uint64_t
m_auxKeyIdKeySrc64
;
//!< Auxiliary security header - Key Source (8 Octets)
437
};
//!< Auxiliary security header
438
439
uint8_t
m_auxKeyIdKeyIndex
;
//!< Auxiliary security header - Key Index (1 Octet)
440
441
};
// LrWpanMacHeader
442
443
}
// namespace lrwpan
444
}
// namespace ns3
445
446
#endif
/* LR_WPAN_MAC_HEADER_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Header
Protocol header serialization and deserialization.
Definition
header.h:33
ns3::Mac16Address
This class can contain 16 bit addresses.
Definition
mac16-address.h:33
ns3::Mac64Address
an EUI-64 address
Definition
mac64-address.h:35
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::lrwpan::LrWpanMacHeader
Represent the Mac Header with the Frame Control and Sequence Number fields.
Definition
lr-wpan-mac-header.h:43
ns3::lrwpan::LrWpanMacHeader::GetSecControl
uint8_t GetSecControl() const
Get the Auxiliary Security Header - Security Control Octet.
Definition
lr-wpan-mac-header.cc:178
ns3::lrwpan::LrWpanMacHeader::SetFrmPend
void SetFrmPend()
Set the Frame Control field "Frame Pending" bit to true.
Definition
lr-wpan-mac-header.cc:288
ns3::lrwpan::LrWpanMacHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
lr-wpan-mac-header.cc:518
ns3::lrwpan::LrWpanMacHeader::SetSecLevel
void SetSecLevel(uint8_t secLevel)
Set the Security Control field "Security Level" bits (3 bits)
Definition
lr-wpan-mac-header.cc:396
ns3::lrwpan::LrWpanMacHeader::GetType
LrWpanMacType GetType() const
Get the header type.
Definition
lr-wpan-mac-header.cc:53
ns3::lrwpan::LrWpanMacHeader::~LrWpanMacHeader
~LrWpanMacHeader() override
Definition
lr-wpan-mac-header.cc:48
ns3::lrwpan::LrWpanMacHeader::m_fctrlReserved
uint8_t m_fctrlReserved
Frame Control field Bit 7-9.
Definition
lr-wpan-mac-header.h:400
ns3::lrwpan::LrWpanMacHeader::IsSecEnable
bool IsSecEnable() const
Check if Security Enabled bit of Frame Control is enabled.
Definition
lr-wpan-mac-header.cc:88
ns3::lrwpan::LrWpanMacHeader::GetKeyIdIndex
uint8_t GetKeyIdIndex() const
Get the Auxiliary Security Header - Key Identifier - Key Index.
Definition
lr-wpan-mac-header.cc:226
ns3::lrwpan::LrWpanMacHeader::m_secctrlKeyIdMode
uint8_t m_secctrlKeyIdMode
Auxiliary security header - Security Control field - Bit 3-4 will indicate size of Key Id.
Definition
lr-wpan-mac-header.h:424
ns3::lrwpan::LrWpanMacHeader::m_auxKeyIdKeyIndex
uint8_t m_auxKeyIdKeyIndex
Auxiliary security header - Key Index (1 Octet)
Definition
lr-wpan-mac-header.h:439
ns3::lrwpan::LrWpanMacHeader::SetSecControl
void SetSecControl(uint8_t secLevel)
Set the auxiliary security header "Security Control" octet.
Definition
lr-wpan-mac-header.cc:382
ns3::lrwpan::LrWpanMacHeader::m_auxKeyIdKeySrc64
uint64_t m_auxKeyIdKeySrc64
Auxiliary security header - Key Source (8 Octets)
Definition
lr-wpan-mac-header.h:436
ns3::lrwpan::LrWpanMacHeader::GetShortSrcAddr
Mac16Address GetShortSrcAddr() const
Get the Source Short address.
Definition
lr-wpan-mac-header.cc:166
ns3::lrwpan::LrWpanMacHeader::SetType
void SetType(LrWpanMacType wpanMacType)
Set the Frame Control field "Frame Type" bits.
Definition
lr-wpan-mac-header.cc:256
ns3::lrwpan::LrWpanMacHeader::SetDstAddrMode
void SetDstAddrMode(uint8_t addrMode)
Set the Destination address mode.
Definition
lr-wpan-mac-header.cc:330
ns3::lrwpan::LrWpanMacHeader::m_addrDstPanId
uint16_t m_addrDstPanId
Dst PAN id (0 or 2 Octets)
Definition
lr-wpan-mac-header.h:411
ns3::lrwpan::LrWpanMacHeader::SetNoAckReq
void SetNoAckReq()
Set the Frame Control field "Ack. Request" bit to false.
Definition
lr-wpan-mac-header.cc:306
ns3::lrwpan::LrWpanMacHeader::GetSecLevel
uint8_t GetSecLevel() const
Get the Auxiliary Security Header - Security Control - Security Level bits.
Definition
lr-wpan-mac-header.cc:196
ns3::lrwpan::LrWpanMacHeader::SetSecCtrlReserved
void SetSecCtrlReserved(uint8_t res)
Set the Security Control field "Reserved" bits (3 bits)
Definition
lr-wpan-mac-header.cc:408
ns3::lrwpan::LrWpanMacHeader::SetDstAddrFields
void SetDstAddrFields(uint16_t panId, Mac16Address addr)
Set Destination address fields.
Definition
lr-wpan-mac-header.cc:368
ns3::lrwpan::LrWpanMacHeader::GetExtSrcAddr
Mac64Address GetExtSrcAddr() const
Get the Source Extended address.
Definition
lr-wpan-mac-header.cc:172
ns3::lrwpan::LrWpanMacHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
lr-wpan-mac-header.cc:434
ns3::lrwpan::LrWpanMacHeader::m_auxKeyIdKeySrc32
uint32_t m_auxKeyIdKeySrc32
Auxiliary security header - Key Source (4 Octets)
Definition
lr-wpan-mac-header.h:435
ns3::lrwpan::LrWpanMacHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
lr-wpan-mac-header.cc:663
ns3::lrwpan::LrWpanMacHeader::AddrModeType
AddrModeType
The addressing mode types, see IEEE 802.15.4-2006, Table 80.
Definition
lr-wpan-mac-header.h:61
ns3::lrwpan::LrWpanMacHeader::SHORTADDR
@ SHORTADDR
Definition
lr-wpan-mac-header.h:64
ns3::lrwpan::LrWpanMacHeader::EXTADDR
@ EXTADDR
Definition
lr-wpan-mac-header.h:65
ns3::lrwpan::LrWpanMacHeader::NOADDR
@ NOADDR
Definition
lr-wpan-mac-header.h:62
ns3::lrwpan::LrWpanMacHeader::RESADDR
@ RESADDR
Definition
lr-wpan-mac-header.h:63
ns3::lrwpan::LrWpanMacHeader::IsData
bool IsData() const
Returns true if the header is a data.
Definition
lr-wpan-mac-header.cc:238
ns3::lrwpan::LrWpanMacHeader::KeyIdModeType
KeyIdModeType
The addressing mode types, see IEEE 802.15.4-2006, Table 80.
Definition
lr-wpan-mac-header.h:72
ns3::lrwpan::LrWpanMacHeader::IMPLICIT
@ IMPLICIT
Definition
lr-wpan-mac-header.h:73
ns3::lrwpan::LrWpanMacHeader::LONGKEYSOURCE
@ LONGKEYSOURCE
Definition
lr-wpan-mac-header.h:76
ns3::lrwpan::LrWpanMacHeader::SHORTKEYSOURCE
@ SHORTKEYSOURCE
Definition
lr-wpan-mac-header.h:75
ns3::lrwpan::LrWpanMacHeader::NOKEYSOURCE
@ NOKEYSOURCE
Definition
lr-wpan-mac-header.h:74
ns3::lrwpan::LrWpanMacHeader::m_fctrlFrmType
uint8_t m_fctrlFrmType
Frame Control field Bit 0-2 = 0 - Beacon, 1 - Data, 2 - Ack, 3 - Command.
Definition
lr-wpan-mac-header.h:392
ns3::lrwpan::LrWpanMacHeader::GetKeyIdSrc64
uint64_t GetKeyIdSrc64() const
Get the Auxiliary Security Header - Key Identifier - Key Source (4 Octets)
Definition
lr-wpan-mac-header.cc:220
ns3::lrwpan::LrWpanMacHeader::SetFrameControl
void SetFrameControl(uint16_t frameControl)
Set the whole Frame Control field.
Definition
lr-wpan-mac-header.cc:262
ns3::lrwpan::LrWpanMacHeader::m_addrShortDstAddr
Mac16Address m_addrShortDstAddr
Dst Short addr (0 or 2 Octets)
Definition
lr-wpan-mac-header.h:412
ns3::lrwpan::LrWpanMacHeader::m_SeqNum
uint8_t m_SeqNum
Sequence Number (1 Octet)
Definition
lr-wpan-mac-header.h:408
ns3::lrwpan::LrWpanMacHeader::IsBeacon
bool IsBeacon() const
Returns true if the header is a beacon.
Definition
lr-wpan-mac-header.cc:232
ns3::lrwpan::LrWpanMacHeader::Print
void Print(std::ostream &os) const override
Definition
lr-wpan-mac-header.cc:451
ns3::lrwpan::LrWpanMacHeader::LrWpanMacType
LrWpanMacType
The possible MAC types, see IEEE 802.15.4-2006, Table 79.
Definition
lr-wpan-mac-header.h:49
ns3::lrwpan::LrWpanMacHeader::LRWPAN_MAC_ACKNOWLEDGMENT
@ LRWPAN_MAC_ACKNOWLEDGMENT
LRWPAN_MAC_ACKNOWLEDGMENT.
Definition
lr-wpan-mac-header.h:52
ns3::lrwpan::LrWpanMacHeader::LRWPAN_MAC_RESERVED
@ LRWPAN_MAC_RESERVED
LRWPAN_MAC_RESERVED.
Definition
lr-wpan-mac-header.h:54
ns3::lrwpan::LrWpanMacHeader::LRWPAN_MAC_COMMAND
@ LRWPAN_MAC_COMMAND
LRWPAN_MAC_COMMAND.
Definition
lr-wpan-mac-header.h:53
ns3::lrwpan::LrWpanMacHeader::LRWPAN_MAC_BEACON
@ LRWPAN_MAC_BEACON
LRWPAN_MAC_BEACON.
Definition
lr-wpan-mac-header.h:50
ns3::lrwpan::LrWpanMacHeader::LRWPAN_MAC_DATA
@ LRWPAN_MAC_DATA
LRWPAN_MAC_DATA.
Definition
lr-wpan-mac-header.h:51
ns3::lrwpan::LrWpanMacHeader::GetFrmCounter
uint32_t GetFrmCounter() const
Get the Auxiliary Security Header - Frame Counter Octets.
Definition
lr-wpan-mac-header.cc:190
ns3::lrwpan::LrWpanMacHeader::SetPanIdComp
void SetPanIdComp()
Set the Frame Control field "PAN ID Compression" bit to true.
Definition
lr-wpan-mac-header.cc:312
ns3::lrwpan::LrWpanMacHeader::GetShortDstAddr
Mac16Address GetShortDstAddr() const
Get the Destination Short address.
Definition
lr-wpan-mac-header.cc:148
ns3::lrwpan::LrWpanMacHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
lr-wpan-mac-header.cc:596
ns3::lrwpan::LrWpanMacHeader::m_addrShortSrcAddr
Mac16Address m_addrShortSrcAddr
Src Short addr (0 or 2 Octets)
Definition
lr-wpan-mac-header.h:415
ns3::lrwpan::LrWpanMacHeader::GetFrameControl
uint16_t GetFrameControl() const
Get the Frame control field.
Definition
lr-wpan-mac-header.cc:71
ns3::lrwpan::LrWpanMacHeader::GetKeyIdMode
uint8_t GetKeyIdMode() const
Get the Auxiliary Security Header - Security Control - Key Identifier Mode bits.
Definition
lr-wpan-mac-header.cc:202
ns3::lrwpan::LrWpanMacHeader::SetSrcAddrMode
void SetSrcAddrMode(uint8_t addrMode)
Set the Source address mode.
Definition
lr-wpan-mac-header.cc:342
ns3::lrwpan::LrWpanMacHeader::IsCommand
bool IsCommand() const
Returns true if the header is a command.
Definition
lr-wpan-mac-header.cc:250
ns3::lrwpan::LrWpanMacHeader::m_addrSrcPanId
uint16_t m_addrSrcPanId
Src PAN id (0 or 2 Octets)
Definition
lr-wpan-mac-header.h:414
ns3::lrwpan::LrWpanMacHeader::GetKeyIdSrc32
uint32_t GetKeyIdSrc32() const
Get the Auxiliary Security Header - Key Identifier - Key Source (2 Octets)
Definition
lr-wpan-mac-header.cc:214
ns3::lrwpan::LrWpanMacHeader::GetSecCtrlReserved
uint8_t GetSecCtrlReserved() const
Get the Auxiliary Security Header - Security Control - Reserved bits.
Definition
lr-wpan-mac-header.cc:208
ns3::lrwpan::LrWpanMacHeader::SetFrmCtrlRes
void SetFrmCtrlRes(uint8_t res)
Set the Frame Control field "Reserved" bits.
Definition
lr-wpan-mac-header.cc:324
ns3::lrwpan::LrWpanMacHeader::SetKeyId
void SetKeyId(uint8_t keyIndex)
Set the Key Index.
Definition
lr-wpan-mac-header.cc:414
ns3::lrwpan::LrWpanMacHeader::GetSeqNum
uint8_t GetSeqNum() const
Get the frame Sequence number.
Definition
lr-wpan-mac-header.cc:136
ns3::lrwpan::LrWpanMacHeader::SetFrameVer
void SetFrameVer(uint8_t ver)
Set the Frame version.
Definition
lr-wpan-mac-header.cc:336
ns3::lrwpan::LrWpanMacHeader::m_secctrlSecLevel
uint8_t m_secctrlSecLevel
Auxiliary security header - Security Control field - Bit 0-2.
Definition
lr-wpan-mac-header.h:423
ns3::lrwpan::LrWpanMacHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
lr-wpan-mac-header.cc:445
ns3::lrwpan::LrWpanMacHeader::GetFrameVer
uint8_t GetFrameVer() const
Get the Frame Version of Frame control field.
Definition
lr-wpan-mac-header.cc:124
ns3::lrwpan::LrWpanMacHeader::SetFrmCounter
void SetFrmCounter(uint32_t frmCntr)
Set the auxiliary security header "Frame Counter" octet.
Definition
lr-wpan-mac-header.cc:390
ns3::lrwpan::LrWpanMacHeader::SetSrcAddrFields
void SetSrcAddrFields(uint16_t panId, Mac16Address addr)
Set Source address fields.
Definition
lr-wpan-mac-header.cc:354
ns3::lrwpan::LrWpanMacHeader::m_addrExtDstAddr
Mac64Address m_addrExtDstAddr
Dst Ext addr (0 or 8 Octets)
Definition
lr-wpan-mac-header.h:413
ns3::lrwpan::LrWpanMacHeader::m_fctrlDstAddrMode
uint8_t m_fctrlDstAddrMode
Frame Control field Bit 10-11 = 0 - No DstAddr, 2 - ShtDstAddr, 3 - ExtDstAddr.
Definition
lr-wpan-mac-header.h:401
ns3::lrwpan::LrWpanMacHeader::m_addrExtSrcAddr
Mac64Address m_addrExtSrcAddr
Src Ext addr (0 or 8 Octets)
Definition
lr-wpan-mac-header.h:416
ns3::lrwpan::LrWpanMacHeader::IsFrmPend
bool IsFrmPend() const
Check if Frame Pending bit of Frame Control is enabled.
Definition
lr-wpan-mac-header.cc:94
ns3::lrwpan::LrWpanMacHeader::LrWpanMacHeader
LrWpanMacHeader()
Definition
lr-wpan-mac-header.cc:21
ns3::lrwpan::LrWpanMacHeader::m_secctrlReserved
uint8_t m_secctrlReserved
Auxiliary security header - Security Control field - Bit 5-7.
Definition
lr-wpan-mac-header.h:432
ns3::lrwpan::LrWpanMacHeader::GetSrcPanId
uint16_t GetSrcPanId() const
Get the Source PAN ID.
Definition
lr-wpan-mac-header.cc:160
ns3::lrwpan::LrWpanMacHeader::SetNoPanIdComp
void SetNoPanIdComp()
Set the Frame Control field "PAN ID Compression" bit to false.
Definition
lr-wpan-mac-header.cc:318
ns3::lrwpan::LrWpanMacHeader::m_fctrlSrcAddrMode
uint8_t m_fctrlSrcAddrMode
Frame Control field Bit 14-15 = 0 - No SrcAddr, 2 - ShtSrcAddr, 3 - ExtSrcAddr.
Definition
lr-wpan-mac-header.h:404
ns3::lrwpan::LrWpanMacHeader::GetDstPanId
uint16_t GetDstPanId() const
Get the Destination PAN ID.
Definition
lr-wpan-mac-header.cc:142
ns3::lrwpan::LrWpanMacHeader::m_fctrlFrmPending
uint8_t m_fctrlFrmPending
Frame Control field Bit 4.
Definition
lr-wpan-mac-header.h:396
ns3::lrwpan::LrWpanMacHeader::m_fctrlPanIdComp
uint8_t m_fctrlPanIdComp
Frame Control field Bit 6 = 0 - no compression, 1 - using only DstPanId for both Src and DstPanId.
Definition
lr-wpan-mac-header.h:398
ns3::lrwpan::LrWpanMacHeader::m_fctrlFrmVer
uint8_t m_fctrlFrmVer
Frame Control field Bit 12-13.
Definition
lr-wpan-mac-header.h:403
ns3::lrwpan::LrWpanMacHeader::m_fctrlAckReq
uint8_t m_fctrlAckReq
Frame Control field Bit 5.
Definition
lr-wpan-mac-header.h:397
ns3::lrwpan::LrWpanMacHeader::SetNoFrmPend
void SetNoFrmPend()
Set the Frame Control field "Frame Pending" bit to false.
Definition
lr-wpan-mac-header.cc:294
ns3::lrwpan::LrWpanMacHeader::m_auxFrmCntr
uint32_t m_auxFrmCntr
Auxiliary security header - Frame Counter (4 Octets)
Definition
lr-wpan-mac-header.h:420
ns3::lrwpan::LrWpanMacHeader::SetAckReq
void SetAckReq()
Set the Frame Control field "Ack. Request" bit to true.
Definition
lr-wpan-mac-header.cc:300
ns3::lrwpan::LrWpanMacHeader::IsAckReq
bool IsAckReq() const
Check if Ack.
Definition
lr-wpan-mac-header.cc:100
ns3::lrwpan::LrWpanMacHeader::GetDstAddrMode
uint8_t GetDstAddrMode() const
Get the Dest.
Definition
lr-wpan-mac-header.cc:118
ns3::lrwpan::LrWpanMacHeader::m_fctrlSecU
uint8_t m_fctrlSecU
Frame Control field Bit 3 = 0 - no AuxSecHdr , 1 - security enabled AuxSecHdr present.
Definition
lr-wpan-mac-header.h:394
ns3::lrwpan::LrWpanMacHeader::SetSecEnable
void SetSecEnable()
Set the Frame Control field "Security Enabled" bit to true.
Definition
lr-wpan-mac-header.cc:276
ns3::lrwpan::LrWpanMacHeader::SetSecDisable
void SetSecDisable()
Set the Frame Control field "Security Enabled" bit to false.
Definition
lr-wpan-mac-header.cc:282
ns3::lrwpan::LrWpanMacHeader::GetExtDstAddr
Mac64Address GetExtDstAddr() const
Get the Destination Extended address.
Definition
lr-wpan-mac-header.cc:154
ns3::lrwpan::LrWpanMacHeader::IsAcknowledgment
bool IsAcknowledgment() const
Returns true if the header is an ack.
Definition
lr-wpan-mac-header.cc:244
ns3::lrwpan::LrWpanMacHeader::GetSrcAddrMode
uint8_t GetSrcAddrMode() const
Get the Source Addressing Mode of Frame control field.
Definition
lr-wpan-mac-header.cc:130
ns3::lrwpan::LrWpanMacHeader::IsPanIdComp
bool IsPanIdComp() const
Check if PAN ID Compression bit of Frame Control is enabled.
Definition
lr-wpan-mac-header.cc:106
ns3::lrwpan::LrWpanMacHeader::SetSeqNum
void SetSeqNum(uint8_t seqNum)
Set the Sequence number.
Definition
lr-wpan-mac-header.cc:348
ns3::lrwpan::LrWpanMacHeader::GetFrmCtrlRes
uint8_t GetFrmCtrlRes() const
Get the Reserved bits of Frame control field.
Definition
lr-wpan-mac-header.cc:112
ns3::lrwpan::LrWpanMacHeader::SetKeyIdMode
void SetKeyIdMode(uint8_t keyIdMode)
Set the Security Control field "Key Identifier Mode" bits (2 bits)
Definition
lr-wpan-mac-header.cc:402
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lr-wpan
model
lr-wpan-mac-header.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0