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