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
zigbee-nwk-header.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Tokushima University, Japan
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors:
7
* Ryo Okuda <c611901200@tokushima-u.ac.jp>
8
* Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
9
*/
10
11
#include "
zigbee-nwk-header.h
"
12
13
#include "ns3/address-utils.h"
14
15
namespace
ns3
16
{
17
namespace
zigbee
18
{
19
20
ZigbeeNwkHeader::ZigbeeNwkHeader
()
21
{
22
SetFrameType
(
DATA
);
23
SetProtocolVer
(3);
24
SetDiscoverRoute
(
DiscoverRouteType::SUPPRESS_ROUTE_DISCOVERY
);
25
m_fctrlMcst
=
false
;
26
m_fctrlSecurity
=
false
;
27
m_fctrlSrcRoute
=
false
;
28
m_fctrlDstIEEEAddr
=
false
;
29
m_fctrlSrcIEEEAddr
=
false
;
30
m_fctrlEndDevIni
=
false
;
31
}
32
33
ZigbeeNwkHeader::~ZigbeeNwkHeader
()
34
{
35
}
36
37
void
38
ZigbeeNwkHeader::SetFrameType
(
enum
NwkType
nwkType)
39
{
40
m_fctrlFrmType
= nwkType;
41
}
42
43
NwkType
44
ZigbeeNwkHeader::GetFrameType
()
const
45
{
46
return
m_fctrlFrmType
;
47
}
48
49
void
50
ZigbeeNwkHeader::SetProtocolVer
(uint8_t ver)
51
{
52
m_fctrlPrtVer
= ver;
53
}
54
55
uint8_t
56
ZigbeeNwkHeader::GetProtocolVer
()
const
57
{
58
return
(
m_fctrlPrtVer
);
59
}
60
61
void
62
ZigbeeNwkHeader::SetDiscoverRoute
(
enum
DiscoverRouteType
discoverRoute)
63
{
64
m_fctrlDscvRoute
= discoverRoute;
65
}
66
67
DiscoverRouteType
68
ZigbeeNwkHeader::GetDiscoverRoute
()
const
69
{
70
return
m_fctrlDscvRoute
;
71
}
72
73
void
74
ZigbeeNwkHeader::SetMulticast
()
75
{
76
m_fctrlMcst
=
true
;
77
}
78
79
bool
80
ZigbeeNwkHeader::IsMulticast
()
const
81
{
82
return
m_fctrlMcst
;
83
}
84
85
bool
86
ZigbeeNwkHeader::IsSecurityEnabled
()
const
87
{
88
return
m_fctrlSecurity
;
89
}
90
91
void
92
ZigbeeNwkHeader::SetEndDeviceInitiator
()
93
{
94
m_fctrlEndDevIni
=
true
;
95
}
96
97
bool
98
ZigbeeNwkHeader::GetEndDeviceInitiator
()
const
99
{
100
return
m_fctrlEndDevIni
;
101
}
102
103
void
104
ZigbeeNwkHeader::SetDstAddr
(
Mac16Address
addr)
105
{
106
m_dstAddr
= addr;
107
}
108
109
Mac16Address
110
ZigbeeNwkHeader::GetDstAddr
()
const
111
{
112
return
(
m_dstAddr
);
113
}
114
115
void
116
ZigbeeNwkHeader::SetSrcAddr
(
Mac16Address
addr)
117
{
118
m_srcAddr
= addr;
119
}
120
121
Mac16Address
122
ZigbeeNwkHeader::GetSrcAddr
()
const
123
{
124
return
(
m_srcAddr
);
125
}
126
127
void
128
ZigbeeNwkHeader::SetRadius
(uint8_t radius)
129
{
130
m_radius
= radius;
131
}
132
133
uint8_t
134
ZigbeeNwkHeader::GetRadius
()
const
135
{
136
return
(
m_radius
);
137
}
138
139
void
140
ZigbeeNwkHeader::SetSeqNum
(uint8_t seqNum)
141
{
142
m_seqNum
= seqNum;
143
}
144
145
uint8_t
146
ZigbeeNwkHeader::GetSeqNum
()
const
147
{
148
return
(
m_seqNum
);
149
}
150
151
void
152
ZigbeeNwkHeader::SetDstIeeeAddr
(
Mac64Address
dst)
153
{
154
m_fctrlDstIEEEAddr
=
true
;
155
m_dstIeeeAddr
= dst;
156
}
157
158
Mac64Address
159
ZigbeeNwkHeader::GetDstIeeeAddr
()
const
160
{
161
return
(
m_dstIeeeAddr
);
162
}
163
164
void
165
ZigbeeNwkHeader::SetSrcIeeeAddr
(
Mac64Address
src)
166
{
167
m_fctrlSrcIEEEAddr
=
true
;
168
m_srcIeeeAddr
= src;
169
}
170
171
Mac64Address
172
ZigbeeNwkHeader::GetSrcIeeeAddr
()
const
173
{
174
return
(
m_srcIeeeAddr
);
175
}
176
177
void
178
ZigbeeNwkHeader::SetMulticastMode
(
MulticastMode
mode)
179
{
180
m_mcstMode
= mode;
181
}
182
183
MulticastMode
184
ZigbeeNwkHeader::GetMulticastMode
()
const
185
{
186
return
m_mcstMode
;
187
}
188
189
void
190
ZigbeeNwkHeader::SetNonMemberRadius
(uint8_t radius)
191
{
192
m_nonMemberRadius
= radius;
193
}
194
195
uint8_t
196
ZigbeeNwkHeader::GetNonMemberRadius
()
const
197
{
198
return
m_nonMemberRadius
;
199
}
200
201
void
202
ZigbeeNwkHeader::SetMaxNonMemberRadius
(uint8_t radius)
203
{
204
m_maxNonMemberRadius
= radius;
205
}
206
207
uint8_t
208
ZigbeeNwkHeader::GetMaxNonMemberRadius
()
const
209
{
210
return
m_maxNonMemberRadius
;
211
}
212
213
void
214
ZigbeeNwkHeader::SetFrameControl
(uint16_t frameControl)
215
{
216
m_fctrlFrmType
=
static_cast<
NwkType
>
((frameControl) & (0x03));
// Bit 0-1
217
m_fctrlPrtVer
= (frameControl >> 2) & (0x0F);
// Bit 2-5
218
m_fctrlDscvRoute
=
static_cast<
DiscoverRouteType
>
((frameControl >> 6) & (0x03));
// Bit 6-7
219
m_fctrlMcst
= (frameControl >> 8) & (0x01);
// Bit 8
220
m_fctrlSecurity
= (frameControl >> 9) & (0x01);
// Bit 9
221
m_fctrlSrcRoute
= (frameControl >> 10) & (0x01);
// Bit 10
222
m_fctrlDstIEEEAddr
= (frameControl >> 11) & (0x01);
// Bit 11
223
m_fctrlSrcIEEEAddr
= (frameControl >> 12) & (0x01);
// Bit 12
224
m_fctrlEndDevIni
= (frameControl >> 13) & (0x01);
// Bit 13
225
}
226
227
uint16_t
228
ZigbeeNwkHeader::GetFrameControl
()
const
229
{
230
uint16_t val = 0;
231
232
val =
m_fctrlFrmType
& (0x03);
// Bit 0-1
233
val |= (
m_fctrlPrtVer
<< 2) & (0x0F << 2);
// Bit 2-5
234
val |= (
m_fctrlDscvRoute
<< 6) & (0x03 << 6);
// Bit 6-7
235
val |= (
m_fctrlMcst
<< 8) & (0x01 << 8);
// Bit 8
236
val |= (
m_fctrlSecurity
<< 9) & (0x01 << 9);
// Bit 9
237
val |= (
m_fctrlSrcRoute
<< 10) & (0x01 << 10);
// Bit 10
238
val |= (
m_fctrlDstIEEEAddr
<< 11) & (0x01 << 11);
// Bit 11
239
val |= (
m_fctrlSrcIEEEAddr
<< 12) & (0x01 << 12);
// Bit 12
240
val |= (
m_fctrlEndDevIni
<< 13) & (0x01 << 13);
// Bit 13
241
242
return
val;
243
}
244
245
void
246
ZigbeeNwkHeader::SetMulticastControl
(uint8_t multicastControl)
247
{
248
m_mcstMode
=
static_cast<
MulticastMode
>
((multicastControl) & (0x03));
// Bit 0-1
249
m_nonMemberRadius
= (multicastControl >> 2) & (0x07);
// Bit 2-4
250
m_maxNonMemberRadius
= (multicastControl >> 5) & (0x07);
// Bit 5-7
251
}
252
253
uint8_t
254
ZigbeeNwkHeader::GetMulticastControl
()
const
255
{
256
uint8_t mcstCtrl = 0;
257
258
mcstCtrl =
m_mcstMode
& (0x03);
// Bit 0-1
259
mcstCtrl |= (
m_nonMemberRadius
<< 2) & (0x07 << 2);
// Bit 2-4
260
mcstCtrl |= (
m_maxNonMemberRadius
<< 5) & (0x07 << 5);
// Bit 5-7
261
262
return
mcstCtrl;
263
}
264
265
void
266
ZigbeeNwkHeader::Serialize
(
Buffer::Iterator
start)
const
267
{
268
Buffer::Iterator
i = start;
269
270
uint16_t frameControl =
GetFrameControl
();
271
i.
WriteHtolsbU16
(frameControl);
272
273
WriteTo
(i,
m_dstAddr
);
274
WriteTo
(i,
m_srcAddr
);
275
i.
WriteU8
(
m_radius
);
276
i.
WriteU8
(
m_seqNum
);
277
278
if
(
m_fctrlDstIEEEAddr
)
279
{
280
WriteTo
(i,
m_dstIeeeAddr
);
281
}
282
283
if
(
m_fctrlSrcIEEEAddr
)
284
{
285
WriteTo
(i,
m_srcIeeeAddr
);
286
}
287
288
if
(
m_fctrlMcst
)
289
{
290
i.
WriteU8
(
GetMulticastControl
());
291
}
292
293
// TODO: Add Source route subframe when supported
294
}
295
296
uint32_t
297
ZigbeeNwkHeader::Deserialize
(
Buffer::Iterator
start)
298
{
299
Buffer::Iterator
i = start;
300
uint16_t frameControl = i.
ReadLsbtohU16
();
301
SetFrameControl
(frameControl);
302
ReadFrom
(i,
m_dstAddr
);
303
ReadFrom
(i,
m_srcAddr
);
304
SetRadius
(i.
ReadU8
());
305
SetSeqNum
(i.
ReadU8
());
306
307
if
(
m_fctrlDstIEEEAddr
)
308
{
309
ReadFrom
(i,
m_dstIeeeAddr
);
310
}
311
312
if
(
m_fctrlSrcIEEEAddr
)
313
{
314
ReadFrom
(i,
m_srcIeeeAddr
);
315
}
316
317
if
(
m_fctrlMcst
)
318
{
319
uint8_t mcstCtrl = i.
ReadU8
();
320
SetMulticastControl
(mcstCtrl);
321
}
322
323
// TODO: Add Source route subframe when supported
324
325
return
i.
GetDistanceFrom
(start);
326
}
327
328
uint32_t
329
ZigbeeNwkHeader::GetSerializedSize
()
const
330
{
331
/*
332
* Each NWK header will have:
333
*
334
* Frame Control : 2 octet
335
*
336
* Routing Fields:
337
* Destination address : 2 octet
338
* Source address : 2 octet
339
* Radius : 1 octet
340
* Sequence number : 1 octet
341
* Destination IEEE address : 0/8 octet
342
* Source IEEE address : 0/8 octet
343
* Multicast control : 0/1 octet
344
* Source route subframe : variable
345
*/
346
347
uint32_t
size = 8;
348
349
if
(
m_fctrlDstIEEEAddr
)
350
{
351
size += 8;
352
}
353
354
if
(
m_fctrlSrcIEEEAddr
)
355
{
356
size += 8;
357
}
358
359
if
(
m_fctrlMcst
)
360
{
361
size += 1;
362
}
363
364
// TODO: Add Source route subframe when supported.
365
366
return
(size);
367
}
368
369
TypeId
370
ZigbeeNwkHeader::GetTypeId
()
371
{
372
static
TypeId
tid =
TypeId
(
"ns3::zigbee::ZigbeeNwkHeader"
)
373
.
SetParent
<
Header
>()
374
.SetGroupName(
"Zigbee"
)
375
.AddConstructor<
ZigbeeNwkHeader
>();
376
return
tid;
377
}
378
379
TypeId
380
ZigbeeNwkHeader::GetInstanceTypeId
()
const
381
{
382
return
GetTypeId
();
383
}
384
385
void
386
ZigbeeNwkHeader::Print
(std::ostream& os)
const
387
{
388
os <<
"\n"
;
389
switch
(
m_fctrlFrmType
)
390
{
391
case
DATA
:
392
os <<
"Frame Type = DATA "
;
393
break
;
394
case
NWK_COMMAND
:
395
os <<
"Frame Type = NWK_COMMAND "
;
396
break
;
397
case
INTER_PAN
:
398
os <<
"Frame Type = INTER_PAN "
;
399
break
;
400
}
401
os <<
" | Protocol Version = "
<<
static_cast<
uint32_t
>
(
m_fctrlPrtVer
)
402
<<
" | Security Enabled = "
<<
static_cast<
uint32_t
>
(
m_fctrlSecurity
)
403
<<
" | Source Route = "
<<
static_cast<
uint32_t
>
(
m_fctrlSrcRoute
);
404
405
switch
(
m_fctrlDscvRoute
)
406
{
407
case
DiscoverRouteType::SUPPRESS_ROUTE_DISCOVERY
:
408
os <<
" | Enable Route Discovery = SUPPRESS "
;
409
break
;
410
case
DiscoverRouteType::ENABLE_ROUTE_DISCOVERY
:
411
os <<
" | Enable Route Discovery = ENABLED "
;
412
break
;
413
}
414
415
os <<
"\nDst Addr = "
<<
m_dstAddr
<<
" | Src Addr = "
<<
m_srcAddr
416
<<
" | Sequence Num = "
<<
static_cast<
uint32_t
>
(
m_seqNum
)
417
<<
" | Radius = "
<<
static_cast<
uint32_t
>
(
m_radius
);
418
419
if
(
m_fctrlDstIEEEAddr
)
420
{
421
os <<
"\nDst IEEE Addr = "
<<
m_dstIeeeAddr
;
422
}
423
424
if
(
m_fctrlSrcIEEEAddr
)
425
{
426
os <<
" | Src IEEE Addr = "
<<
m_srcIeeeAddr
;
427
}
428
429
if
(
m_fctrlMcst
)
430
{
431
switch
(
m_mcstMode
)
432
{
433
case
MEMBER
:
434
os <<
" | Mcst mode: MEMBER "
;
435
break
;
436
case
NONMEMBER
:
437
os <<
" | Mcst mode: NONMEMBER "
;
438
break
;
439
}
440
441
os <<
" | Non Member radius = "
<<
static_cast<
uint32_t
>
(
m_nonMemberRadius
)
442
<<
" | Max Non Member radius = "
<<
static_cast<
uint32_t
>
(
m_maxNonMemberRadius
);
443
}
444
os <<
"\n"
;
445
446
// TODO: Add Source route subframe when supported.
447
}
448
}
// namespace zigbee
449
}
// namespace ns3
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Buffer::Iterator::WriteHtolsbU16
void WriteHtolsbU16(uint16_t data)
Definition
buffer.cc:891
ns3::Buffer::Iterator::ReadU8
uint8_t ReadU8()
Definition
buffer.h:1016
ns3::Buffer::Iterator::WriteU8
void WriteU8(uint8_t data)
Definition
buffer.h:870
ns3::Buffer::Iterator::ReadLsbtohU16
uint16_t ReadLsbtohU16()
Definition
buffer.cc:1053
ns3::Buffer::Iterator::GetDistanceFrom
uint32_t GetDistanceFrom(const Iterator &o) const
Definition
buffer.cc:769
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:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
ns3::zigbee::ZigbeeNwkHeader
Represent the NWK Header with the Frame Control and Routing fields Zigbee Specification r22....
Definition
zigbee-nwk-header.h:58
ns3::zigbee::ZigbeeNwkHeader::GetMulticastControl
uint8_t GetMulticastControl() const
Get The Multicast control field.
Definition
zigbee-nwk-header.cc:254
ns3::zigbee::ZigbeeNwkHeader::SetMulticast
void SetMulticast()
Set to true the value of the multicast flag in the frame control field.
Definition
zigbee-nwk-header.cc:74
ns3::zigbee::ZigbeeNwkHeader::SetDstIeeeAddr
void SetDstIeeeAddr(Mac64Address dst)
Set the destination IEEE address.
Definition
zigbee-nwk-header.cc:152
ns3::zigbee::ZigbeeNwkHeader::GetEndDeviceInitiator
bool GetEndDeviceInitiator() const
Get whether or not the source of this message was an end device.
Definition
zigbee-nwk-header.cc:98
ns3::zigbee::ZigbeeNwkHeader::SetDiscoverRoute
void SetDiscoverRoute(enum DiscoverRouteType discoverRoute)
Suppress or enable route discovery for this frame.
Definition
zigbee-nwk-header.cc:62
ns3::zigbee::ZigbeeNwkHeader::SetSrcAddr
void SetSrcAddr(Mac16Address addr)
Set Source address.
Definition
zigbee-nwk-header.cc:116
ns3::zigbee::ZigbeeNwkHeader::~ZigbeeNwkHeader
~ZigbeeNwkHeader() override
Definition
zigbee-nwk-header.cc:33
ns3::zigbee::ZigbeeNwkHeader::SetFrameControl
void SetFrameControl(uint16_t frameControl)
Set the Frame control field.
Definition
zigbee-nwk-header.cc:214
ns3::zigbee::ZigbeeNwkHeader::m_radius
uint8_t m_radius
Radius (1 Octet)
Definition
zigbee-nwk-header.h:295
ns3::zigbee::ZigbeeNwkHeader::ZigbeeNwkHeader
ZigbeeNwkHeader()
Definition
zigbee-nwk-header.cc:20
ns3::zigbee::ZigbeeNwkHeader::SetEndDeviceInitiator
void SetEndDeviceInitiator()
This flag is used by the NWK to indicate if the the initiator device of the message is an end device ...
Definition
zigbee-nwk-header.cc:92
ns3::zigbee::ZigbeeNwkHeader::m_fctrlDstIEEEAddr
bool m_fctrlDstIEEEAddr
Destination IEEE address flag (Bit 11)
Definition
zigbee-nwk-header.h:286
ns3::zigbee::ZigbeeNwkHeader::m_fctrlSecurity
bool m_fctrlSecurity
Security flag (Bit 9)
Definition
zigbee-nwk-header.h:284
ns3::zigbee::ZigbeeNwkHeader::m_srcIeeeAddr
Mac64Address m_srcIeeeAddr
Source IEEE address (0 or 8 Octets)
Definition
zigbee-nwk-header.h:298
ns3::zigbee::ZigbeeNwkHeader::m_fctrlPrtVer
uint8_t m_fctrlPrtVer
Protocol version (Bit 2-5)
Definition
zigbee-nwk-header.h:281
ns3::zigbee::ZigbeeNwkHeader::m_maxNonMemberRadius
uint8_t m_maxNonMemberRadius
Max non member radius sub-field (Bit 5-7)
Definition
zigbee-nwk-header.h:302
ns3::zigbee::ZigbeeNwkHeader::m_fctrlSrcRoute
bool m_fctrlSrcRoute
Source route flag (Bit 10)
Definition
zigbee-nwk-header.h:285
ns3::zigbee::ZigbeeNwkHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
zigbee-nwk-header.cc:329
ns3::zigbee::ZigbeeNwkHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
zigbee-nwk-header.cc:297
ns3::zigbee::ZigbeeNwkHeader::m_fctrlDscvRoute
DiscoverRouteType m_fctrlDscvRoute
Discover route (Bit 6-7)
Definition
zigbee-nwk-header.h:282
ns3::zigbee::ZigbeeNwkHeader::GetFrameControl
uint16_t GetFrameControl() const
Get the Frame control field.
Definition
zigbee-nwk-header.cc:228
ns3::zigbee::ZigbeeNwkHeader::SetProtocolVer
void SetProtocolVer(uint8_t ver)
Set the Protocol version.
Definition
zigbee-nwk-header.cc:50
ns3::zigbee::ZigbeeNwkHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
zigbee-nwk-header.cc:370
ns3::zigbee::ZigbeeNwkHeader::GetMulticastMode
MulticastMode GetMulticastMode() const
Get the multicast mode.
Definition
zigbee-nwk-header.cc:184
ns3::zigbee::ZigbeeNwkHeader::m_fctrlEndDevIni
bool m_fctrlEndDevIni
End device initiator flag (Bit 13)
Definition
zigbee-nwk-header.h:288
ns3::zigbee::ZigbeeNwkHeader::IsMulticast
bool IsMulticast() const
Inform whether or not the current frame is used in multicast.
Definition
zigbee-nwk-header.cc:80
ns3::zigbee::ZigbeeNwkHeader::SetSeqNum
void SetSeqNum(uint8_t seqNum)
Set the Sequence number.
Definition
zigbee-nwk-header.cc:140
ns3::zigbee::ZigbeeNwkHeader::SetNonMemberRadius
void SetNonMemberRadius(uint8_t radius)
Set the non-member radius.
Definition
zigbee-nwk-header.cc:190
ns3::zigbee::ZigbeeNwkHeader::m_nonMemberRadius
uint8_t m_nonMemberRadius
Non member radius sub-field (Bits 2-4)
Definition
zigbee-nwk-header.h:301
ns3::zigbee::ZigbeeNwkHeader::GetNonMemberRadius
uint8_t GetNonMemberRadius() const
Get the non-member radius.
Definition
zigbee-nwk-header.cc:196
ns3::zigbee::ZigbeeNwkHeader::GetRadius
uint8_t GetRadius() const
Get the Radius.
Definition
zigbee-nwk-header.cc:134
ns3::zigbee::ZigbeeNwkHeader::GetDstIeeeAddr
Mac64Address GetDstIeeeAddr() const
Get the destination IEEE address.
Definition
zigbee-nwk-header.cc:159
ns3::zigbee::ZigbeeNwkHeader::IsSecurityEnabled
bool IsSecurityEnabled() const
Inform whether or not security is enabled.
Definition
zigbee-nwk-header.cc:86
ns3::zigbee::ZigbeeNwkHeader::GetSeqNum
uint8_t GetSeqNum() const
Get the frame Sequence number.
Definition
zigbee-nwk-header.cc:146
ns3::zigbee::ZigbeeNwkHeader::m_fctrlMcst
bool m_fctrlMcst
Multicast flag (Bit 8)
Definition
zigbee-nwk-header.h:283
ns3::zigbee::ZigbeeNwkHeader::GetSrcIeeeAddr
Mac64Address GetSrcIeeeAddr() const
Get the source IEEE address.
Definition
zigbee-nwk-header.cc:172
ns3::zigbee::ZigbeeNwkHeader::m_seqNum
uint8_t m_seqNum
Sequence number (1 Octet)
Definition
zigbee-nwk-header.h:296
ns3::zigbee::ZigbeeNwkHeader::m_dstAddr
Mac16Address m_dstAddr
Destination address (2 Octets)
Definition
zigbee-nwk-header.h:293
ns3::zigbee::ZigbeeNwkHeader::SetSrcIeeeAddr
void SetSrcIeeeAddr(Mac64Address src)
Set the source IEEE address.
Definition
zigbee-nwk-header.cc:165
ns3::zigbee::ZigbeeNwkHeader::GetFrameType
NwkType GetFrameType() const
Set the Frame Control field "Frame Type" bits.
Definition
zigbee-nwk-header.cc:44
ns3::zigbee::ZigbeeNwkHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
zigbee-nwk-header.cc:266
ns3::zigbee::ZigbeeNwkHeader::SetRadius
void SetRadius(uint8_t radius)
Set the Radius.
Definition
zigbee-nwk-header.cc:128
ns3::zigbee::ZigbeeNwkHeader::SetMulticastMode
void SetMulticastMode(MulticastMode mode)
Set the multicast mode.
Definition
zigbee-nwk-header.cc:178
ns3::zigbee::ZigbeeNwkHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
zigbee-nwk-header.cc:380
ns3::zigbee::ZigbeeNwkHeader::SetFrameType
void SetFrameType(enum NwkType nwkType)
Set the Frame type used (Data or Command)
Definition
zigbee-nwk-header.cc:38
ns3::zigbee::ZigbeeNwkHeader::GetMaxNonMemberRadius
uint8_t GetMaxNonMemberRadius() const
Get the maximum non-member radius.
Definition
zigbee-nwk-header.cc:208
ns3::zigbee::ZigbeeNwkHeader::m_dstIeeeAddr
Mac64Address m_dstIeeeAddr
Destination IEEE address (0 or 8 Octets)
Definition
zigbee-nwk-header.h:297
ns3::zigbee::ZigbeeNwkHeader::SetMaxNonMemberRadius
void SetMaxNonMemberRadius(uint8_t radius)
Set the maximum non-member radius.
Definition
zigbee-nwk-header.cc:202
ns3::zigbee::ZigbeeNwkHeader::m_fctrlFrmType
NwkType m_fctrlFrmType
Frame type (Bit 0-1)
Definition
zigbee-nwk-header.h:280
ns3::zigbee::ZigbeeNwkHeader::GetDstAddr
Mac16Address GetDstAddr() const
Get the Destination address.
Definition
zigbee-nwk-header.cc:110
ns3::zigbee::ZigbeeNwkHeader::SetDstAddr
void SetDstAddr(Mac16Address addr)
Set Destination address.
Definition
zigbee-nwk-header.cc:104
ns3::zigbee::ZigbeeNwkHeader::GetProtocolVer
uint8_t GetProtocolVer() const
Get Frame protocol version.
Definition
zigbee-nwk-header.cc:56
ns3::zigbee::ZigbeeNwkHeader::GetDiscoverRoute
DiscoverRouteType GetDiscoverRoute() const
Get the status of frame discovery route (suppress or enabled)
Definition
zigbee-nwk-header.cc:68
ns3::zigbee::ZigbeeNwkHeader::m_srcAddr
Mac16Address m_srcAddr
Source address (2 Octets)
Definition
zigbee-nwk-header.h:294
ns3::zigbee::ZigbeeNwkHeader::GetSrcAddr
Mac16Address GetSrcAddr() const
Get the Source address.
Definition
zigbee-nwk-header.cc:122
ns3::zigbee::ZigbeeNwkHeader::Print
void Print(std::ostream &os) const override
Definition
zigbee-nwk-header.cc:386
ns3::zigbee::ZigbeeNwkHeader::m_mcstMode
MulticastMode m_mcstMode
Multicast mode sub-field (Bits 0-1)
Definition
zigbee-nwk-header.h:300
ns3::zigbee::ZigbeeNwkHeader::SetMulticastControl
void SetMulticastControl(uint8_t multicastControl)
Set the Multicast control field (mcstMode, nonMemberRadius, maxNonMemberRadius)
Definition
zigbee-nwk-header.cc:246
ns3::zigbee::ZigbeeNwkHeader::m_fctrlSrcIEEEAddr
bool m_fctrlSrcIEEEAddr
Source IEEE address flag (Bit 12)
Definition
zigbee-nwk-header.h:287
uint32_t
ns3::zigbee::DiscoverRouteType
DiscoverRouteType
Zigbee Specification r22.1.0, Values of the discover route sub-field (Table 3-47)
Definition
zigbee-nwk-header.h:38
ns3::zigbee::SUPPRESS_ROUTE_DISCOVERY
@ SUPPRESS_ROUTE_DISCOVERY
Suppress route discovery.
Definition
zigbee-nwk-header.h:39
ns3::zigbee::ENABLE_ROUTE_DISCOVERY
@ ENABLE_ROUTE_DISCOVERY
Enable route discovery.
Definition
zigbee-nwk-header.h:40
ns3::zigbee::NwkType
NwkType
Zigbee Specification r22.1.0, Values of the frame Type Sub-field (Table 3-46)
Definition
zigbee-nwk-header.h:28
ns3::zigbee::NWK_COMMAND
@ NWK_COMMAND
Network command frame type.
Definition
zigbee-nwk-header.h:30
ns3::zigbee::DATA
@ DATA
Data frame type.
Definition
zigbee-nwk-header.h:29
ns3::zigbee::INTER_PAN
@ INTER_PAN
Inter-Pan frame type.
Definition
zigbee-nwk-header.h:31
ns3::zigbee::MulticastMode
MulticastMode
Zigbee Specification r22.1.0, Multicast Mode Sub-Field (Table 3-7)
Definition
zigbee-nwk-header.h:47
ns3::zigbee::MEMBER
@ MEMBER
Member multicast mode.
Definition
zigbee-nwk-header.h:49
ns3::zigbee::NONMEMBER
@ NONMEMBER
Non member multicast mode.
Definition
zigbee-nwk-header.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WriteTo
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
Definition
address-utils.cc:21
ns3::ReadFrom
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.
Definition
address-utils.cc:74
zigbee-nwk-header.h
src
zigbee
model
zigbee-nwk-header.cc
Generated on Sun Jul 27 2025 18:22:37 for ns-3 by
1.11.0