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::SetFrameControl
(uint16_t frameControl)
179
{
180
m_fctrlFrmType
=
static_cast<
NwkType
>
((frameControl) & (0x03));
// Bit 0-1
181
m_fctrlPrtVer
= (frameControl >> 2) & (0x0F);
// Bit 2-5
182
m_fctrlDscvRoute
=
static_cast<
DiscoverRouteType
>
((frameControl >> 6) & (0x03));
// Bit 6-7
183
m_fctrlMcst
= (frameControl >> 8) & (0x01);
// Bit 8
184
m_fctrlSecurity
= (frameControl >> 9) & (0x01);
// Bit 9
185
m_fctrlSrcRoute
= (frameControl >> 10) & (0x01);
// Bit 10
186
m_fctrlDstIEEEAddr
= (frameControl >> 11) & (0x01);
// Bit 11
187
m_fctrlSrcIEEEAddr
= (frameControl >> 12) & (0x01);
// Bit 12
188
m_fctrlEndDevIni
= (frameControl >> 13) & (0x01);
// Bit 13
189
}
190
191
uint16_t
192
ZigbeeNwkHeader::GetFrameControl
()
const
193
{
194
uint16_t val = 0;
195
196
val =
m_fctrlFrmType
& (0x03);
// Bit 0-1
197
val |= (
m_fctrlPrtVer
<< 2) & (0x0F << 2);
// Bit 2-5
198
val |= (
m_fctrlDscvRoute
<< 6) & (0x03 << 6);
// Bit 6-7
199
val |= (
m_fctrlMcst
<< 8) & (0x01 << 8);
// Bit 8
200
val |= (
m_fctrlSecurity
<< 9) & (0x01 << 9);
// Bit 9
201
val |= (
m_fctrlSrcRoute
<< 10) & (0x01 << 10);
// Bit 10
202
val |= (
m_fctrlDstIEEEAddr
<< 11) & (0x01 << 11);
// Bit 11
203
val |= (
m_fctrlSrcIEEEAddr
<< 12) & (0x01 << 12);
// Bit 12
204
val |= (
m_fctrlEndDevIni
<< 13) & (0x01 << 13);
// Bit 13
205
206
return
val;
207
}
208
209
void
210
ZigbeeNwkHeader::SetMulticastControl
(uint8_t multicastControl)
211
{
212
m_mcstMode
=
static_cast<
MulticastMode
>
((multicastControl) & (0x03));
// Bit 0-1
213
m_nonMemberRadius
= (multicastControl >> 2) & (0x07);
// Bit 2-4
214
m_maxNonMemberRadius
= (multicastControl >> 5) & (0x07);
// Bit 5-7
215
}
216
217
uint8_t
218
ZigbeeNwkHeader::GetMulticastControl
()
const
219
{
220
uint8_t val = 0;
221
222
val =
m_mcstMode
& (0x03);
// Bit 0-1
223
val |= (
m_nonMemberRadius
<< 2) & (0x07 << 2);
// Bit 2-4
224
val |= (
m_maxNonMemberRadius
<< 5) & (0x07 << 5);
// Bit 5-7
225
226
return
val;
227
}
228
229
void
230
ZigbeeNwkHeader::Serialize
(
Buffer::Iterator
start)
const
231
{
232
Buffer::Iterator
i = start;
233
234
uint16_t frameControl =
GetFrameControl
();
235
i.
WriteHtolsbU16
(frameControl);
236
237
WriteTo
(i,
m_dstAddr
);
238
WriteTo
(i,
m_srcAddr
);
239
i.
WriteU8
(
m_radius
);
240
i.
WriteU8
(
m_seqNum
);
241
242
if
(
m_fctrlDstIEEEAddr
)
243
{
244
WriteTo
(i,
m_dstIeeeAddr
);
245
}
246
247
if
(
m_fctrlSrcIEEEAddr
)
248
{
249
WriteTo
(i,
m_srcIeeeAddr
);
250
}
251
252
if
(
m_fctrlMcst
)
253
{
254
i.
WriteU8
(
GetMulticastControl
());
255
}
256
257
// TODO: Add Source route subframe when supported
258
}
259
260
uint32_t
261
ZigbeeNwkHeader::Deserialize
(
Buffer::Iterator
start)
262
{
263
Buffer::Iterator
i = start;
264
uint16_t frameControl = i.
ReadLsbtohU16
();
265
SetFrameControl
(frameControl);
266
ReadFrom
(i,
m_dstAddr
);
267
ReadFrom
(i,
m_srcAddr
);
268
SetRadius
(i.
ReadU8
());
269
SetSeqNum
(i.
ReadU8
());
270
271
if
(
m_fctrlDstIEEEAddr
)
272
{
273
ReadFrom
(i,
m_dstIeeeAddr
);
274
}
275
276
if
(
m_fctrlSrcIEEEAddr
)
277
{
278
ReadFrom
(i,
m_srcIeeeAddr
);
279
}
280
281
if
(
m_fctrlMcst
)
282
{
283
uint8_t multicastControl = i.
ReadU8
();
284
SetMulticastControl
(multicastControl);
285
}
286
287
// TODO: Add Source route subframe when supported
288
289
return
i.
GetDistanceFrom
(start);
290
}
291
292
uint32_t
293
ZigbeeNwkHeader::GetSerializedSize
()
const
294
{
295
/*
296
* Each NWK header will have:
297
*
298
* Frame Control : 2 octet
299
*
300
* Routing Fields:
301
* Destination address : 2 octet
302
* Source address : 2 octet
303
* Radius : 1 octet
304
* Sequence number : 1 octet
305
* Destination IEEE address : 0/8 octet
306
* Source IEEE address : 0/8 octet
307
* Multicast control : 0/1 octet
308
* Source route subframe : variable
309
*/
310
311
uint32_t
size = 8;
312
313
if
(
m_fctrlDstIEEEAddr
)
314
{
315
size += 8;
316
}
317
318
if
(
m_fctrlSrcIEEEAddr
)
319
{
320
size += 8;
321
}
322
323
if
(
m_fctrlMcst
)
324
{
325
size += 1;
326
}
327
328
// TODO: Add Source route subframe when supported.
329
330
return
(size);
331
}
332
333
TypeId
334
ZigbeeNwkHeader::GetTypeId
()
335
{
336
static
TypeId
tid =
TypeId
(
"ns3::zigbee::ZigbeeNwkHeader"
)
337
.
SetParent
<
Header
>()
338
.SetGroupName(
"Zigbee"
)
339
.AddConstructor<
ZigbeeNwkHeader
>();
340
return
tid;
341
}
342
343
TypeId
344
ZigbeeNwkHeader::GetInstanceTypeId
()
const
345
{
346
return
GetTypeId
();
347
}
348
349
void
350
ZigbeeNwkHeader::Print
(std::ostream& os)
const
351
{
352
os <<
"\n"
;
353
switch
(
m_fctrlFrmType
)
354
{
355
case
DATA
:
356
os <<
"Frame Type = DATA "
;
357
break
;
358
case
NWK_COMMAND
:
359
os <<
"Frame Type = NWK_COMMAND "
;
360
break
;
361
case
INTER_PAN
:
362
os <<
"Frame Type = INTER_PAN "
;
363
break
;
364
}
365
os <<
" | Protocol Version = "
<<
static_cast<
uint32_t
>
(
m_fctrlPrtVer
)
366
<<
" | Security Enabled = "
<<
static_cast<
uint32_t
>
(
m_fctrlSecurity
)
367
<<
" | Source Route = "
<<
static_cast<
uint32_t
>
(
m_fctrlSrcRoute
);
368
369
switch
(
m_fctrlDscvRoute
)
370
{
371
case
DiscoverRouteType::SUPPRESS_ROUTE_DISCOVERY
:
372
os <<
" | Enable Route Discovery = SUPPRESS "
;
373
break
;
374
case
DiscoverRouteType::ENABLE_ROUTE_DISCOVERY
:
375
os <<
" | Enable Route Discovery = ENABLED "
;
376
break
;
377
}
378
379
os <<
"\nDst Addr = "
<<
m_dstAddr
<<
" | Src Addr = "
<<
m_srcAddr
380
<<
" | Sequence Num = "
<<
static_cast<
uint32_t
>
(
m_seqNum
)
381
<<
" | Radius = "
<<
static_cast<
uint32_t
>
(
m_radius
);
382
383
if
(
m_fctrlDstIEEEAddr
)
384
{
385
os <<
"\nDst IEEE Addr = "
<<
m_dstIeeeAddr
;
386
}
387
388
if
(
m_fctrlSrcIEEEAddr
)
389
{
390
os <<
" | Src IEEE Addr = "
<<
m_srcIeeeAddr
;
391
}
392
393
if
(
m_fctrlMcst
)
394
{
395
switch
(
m_mcstMode
)
396
{
397
case
MEMBER
:
398
os <<
" | Mcst mode: MEMBER "
;
399
break
;
400
case
NONMEMBER
:
401
os <<
" | Mcst mode: NONMEMBER "
;
402
break
;
403
}
404
405
os <<
" | Non Member radius = "
<<
static_cast<
uint32_t
>
(
m_nonMemberRadius
)
406
<<
" | Max Non Member radius = "
<<
static_cast<
uint32_t
>
(
m_maxNonMemberRadius
);
407
}
408
os <<
"\n"
;
409
410
// TODO: Add Source route subframe when supported.
411
}
412
}
// namespace zigbee
413
}
// 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:218
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:178
ns3::zigbee::ZigbeeNwkHeader::m_radius
uint8_t m_radius
Radius (1 Octet)
Definition
zigbee-nwk-header.h:253
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:244
ns3::zigbee::ZigbeeNwkHeader::m_fctrlSecurity
bool m_fctrlSecurity
Security flag (Bit 9)
Definition
zigbee-nwk-header.h:242
ns3::zigbee::ZigbeeNwkHeader::m_srcIeeeAddr
Mac64Address m_srcIeeeAddr
Source IEEE address (0 or 8 Octets)
Definition
zigbee-nwk-header.h:256
ns3::zigbee::ZigbeeNwkHeader::m_fctrlPrtVer
uint8_t m_fctrlPrtVer
Protocol version (Bit 2-5)
Definition
zigbee-nwk-header.h:239
ns3::zigbee::ZigbeeNwkHeader::m_maxNonMemberRadius
uint8_t m_maxNonMemberRadius
Max non member radius sub-field (Bit 5-7)
Definition
zigbee-nwk-header.h:260
ns3::zigbee::ZigbeeNwkHeader::m_fctrlSrcRoute
bool m_fctrlSrcRoute
Source route flag (Bit 10)
Definition
zigbee-nwk-header.h:243
ns3::zigbee::ZigbeeNwkHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
zigbee-nwk-header.cc:293
ns3::zigbee::ZigbeeNwkHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
zigbee-nwk-header.cc:261
ns3::zigbee::ZigbeeNwkHeader::m_fctrlDscvRoute
DiscoverRouteType m_fctrlDscvRoute
Discover route (Bit 6-7)
Definition
zigbee-nwk-header.h:240
ns3::zigbee::ZigbeeNwkHeader::GetFrameControl
uint16_t GetFrameControl() const
Get the Frame control field.
Definition
zigbee-nwk-header.cc:192
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:334
ns3::zigbee::ZigbeeNwkHeader::m_fctrlEndDevIni
bool m_fctrlEndDevIni
End device initiator flag (Bit 13)
Definition
zigbee-nwk-header.h:246
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::m_nonMemberRadius
uint8_t m_nonMemberRadius
Non member radius sub-field (Bits 2-4)
Definition
zigbee-nwk-header.h:259
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:241
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:254
ns3::zigbee::ZigbeeNwkHeader::m_dstAddr
Mac16Address m_dstAddr
Destination address (2 Octets)
Definition
zigbee-nwk-header.h:251
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:230
ns3::zigbee::ZigbeeNwkHeader::SetRadius
void SetRadius(uint8_t radius)
Set the Radius.
Definition
zigbee-nwk-header.cc:128
ns3::zigbee::ZigbeeNwkHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
zigbee-nwk-header.cc:344
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::m_dstIeeeAddr
Mac64Address m_dstIeeeAddr
Destination IEEE address (0 or 8 Octets)
Definition
zigbee-nwk-header.h:255
ns3::zigbee::ZigbeeNwkHeader::m_fctrlFrmType
NwkType m_fctrlFrmType
Frame type (Bit 0-1)
Definition
zigbee-nwk-header.h:238
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:252
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:350
ns3::zigbee::ZigbeeNwkHeader::m_mcstMode
MulticastMode m_mcstMode
Multicast mode sub-field (Bits 0-1)
Definition
zigbee-nwk-header.h:258
ns3::zigbee::ZigbeeNwkHeader::SetMulticastControl
void SetMulticastControl(uint8_t multicastControl)
Set the Multicast control field.
Definition
zigbee-nwk-header.cc:210
ns3::zigbee::ZigbeeNwkHeader::m_fctrlSrcIEEEAddr
bool m_fctrlSrcIEEEAddr
Source IEEE address flag (Bit 12)
Definition
zigbee-nwk-header.h:245
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 Thu Feb 6 2025 09:24:38 for ns-3 by
1.11.0