A Discrete-Event Network Simulator
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
44namespace ns3
45{
46namespace lrwpan
47{
48
49/**
50 * \ingroup lr-wpan
51 * Represent the Mac Header with the Frame Control and Sequence Number fields
52 */
53class LrWpanMacHeader : public Header
54{
55 public:
56 /**
57 * The possible MAC types, see IEEE 802.15.4-2006, Table 79.
58 */
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 */
72 {
73 NOADDR = 0,
76 EXTADDR = 3
77 };
78
79 /**
80 * The addressing mode types, see IEEE 802.15.4-2006, Table 80.
81 */
83 {
88 };
89
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 */
170 /**
171 * Get the Destination Extended address
172 * \return the Destination Extended address
173 */
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 */
185 /**
186 * Get the Source Extended address
187 * \return the Source Extended address
188 */
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 */
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
This class can contain 16 bit addresses.
Definition: mac16-address.h:44
an EUI-64 address
Definition: mac64-address.h:46
a unique identifier for an interface.
Definition: type-id.h:59
Represent the Mac Header with the Frame Control and Sequence Number fields.
uint8_t GetSecControl() const
Get the Auxiliary Security Header - Security Control Octet.
void SetFrmPend()
Set the Frame Control field "Frame Pending" bit to true.
uint32_t GetSerializedSize() const override
void SetSecLevel(uint8_t secLevel)
Set the Security Control field "Security Level" bits (3 bits)
LrWpanMacType GetType() const
Get the header type.
uint8_t m_fctrlReserved
Frame Control field Bit 7-9.
bool IsSecEnable() const
Check if Security Enabled bit of Frame Control is enabled.
uint8_t GetKeyIdIndex() const
Get the Auxiliary Security Header - Key Identifier - Key Index.
uint8_t m_secctrlKeyIdMode
Auxiliary security header - Security Control field - Bit 3-4 will indicate size of Key Id.
uint8_t m_auxKeyIdKeyIndex
Auxiliary security header - Key Index (1 Octet)
void SetSecControl(uint8_t secLevel)
Set the auxiliary security header "Security Control" octet.
uint64_t m_auxKeyIdKeySrc64
Auxiliary security header - Key Source (8 Octets)
Mac16Address GetShortSrcAddr() const
Get the Source Short address.
void SetType(LrWpanMacType wpanMacType)
Set the Frame Control field "Frame Type" bits.
void SetDstAddrMode(uint8_t addrMode)
Set the Destination address mode.
uint16_t m_addrDstPanId
Dst PAN id (0 or 2 Octets)
void SetNoAckReq()
Set the Frame Control field "Ack. Request" bit to false.
uint8_t GetSecLevel() const
Get the Auxiliary Security Header - Security Control - Security Level bits.
void SetSecCtrlReserved(uint8_t res)
Set the Security Control field "Reserved" bits (3 bits)
void SetDstAddrFields(uint16_t panId, Mac16Address addr)
Set Destination address fields.
Mac64Address GetExtSrcAddr() const
Get the Source Extended address.
static TypeId GetTypeId()
Get the type ID.
uint32_t m_auxKeyIdKeySrc32
Auxiliary security header - Key Source (4 Octets)
uint32_t Deserialize(Buffer::Iterator start) override
AddrModeType
The addressing mode types, see IEEE 802.15.4-2006, Table 80.
bool IsData() const
Returns true if the header is a data.
KeyIdModeType
The addressing mode types, see IEEE 802.15.4-2006, Table 80.
uint8_t m_fctrlFrmType
Frame Control field Bit 0-2 = 0 - Beacon, 1 - Data, 2 - Ack, 3 - Command.
uint64_t GetKeyIdSrc64() const
Get the Auxiliary Security Header - Key Identifier - Key Source (4 Octets)
void SetFrameControl(uint16_t frameControl)
Set the whole Frame Control field.
Mac16Address m_addrShortDstAddr
Dst Short addr (0 or 2 Octets)
uint8_t m_SeqNum
Sequence Number (1 Octet)
bool IsBeacon() const
Returns true if the header is a beacon.
void Print(std::ostream &os) const override
LrWpanMacType
The possible MAC types, see IEEE 802.15.4-2006, Table 79.
@ LRWPAN_MAC_ACKNOWLEDGMENT
LRWPAN_MAC_ACKNOWLEDGMENT.
@ LRWPAN_MAC_RESERVED
LRWPAN_MAC_RESERVED.
@ LRWPAN_MAC_COMMAND
LRWPAN_MAC_COMMAND.
@ LRWPAN_MAC_BEACON
LRWPAN_MAC_BEACON.
uint32_t GetFrmCounter() const
Get the Auxiliary Security Header - Frame Counter Octets.
void SetPanIdComp()
Set the Frame Control field "PAN ID Compression" bit to true.
Mac16Address GetShortDstAddr() const
Get the Destination Short address.
void Serialize(Buffer::Iterator start) const override
Mac16Address m_addrShortSrcAddr
Src Short addr (0 or 2 Octets)
uint16_t GetFrameControl() const
Get the Frame control field.
uint8_t GetKeyIdMode() const
Get the Auxiliary Security Header - Security Control - Key Identifier Mode bits.
void SetSrcAddrMode(uint8_t addrMode)
Set the Source address mode.
bool IsCommand() const
Returns true if the header is a command.
uint16_t m_addrSrcPanId
Src PAN id (0 or 2 Octets)
uint32_t GetKeyIdSrc32() const
Get the Auxiliary Security Header - Key Identifier - Key Source (2 Octets)
uint8_t GetSecCtrlReserved() const
Get the Auxiliary Security Header - Security Control - Reserved bits.
void SetFrmCtrlRes(uint8_t res)
Set the Frame Control field "Reserved" bits.
void SetKeyId(uint8_t keyIndex)
Set the Key Index.
uint8_t GetSeqNum() const
Get the frame Sequence number.
void SetFrameVer(uint8_t ver)
Set the Frame version.
uint8_t m_secctrlSecLevel
Auxiliary security header - Security Control field - Bit 0-2.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t GetFrameVer() const
Get the Frame Version of Frame control field.
void SetFrmCounter(uint32_t frmCntr)
Set the auxiliary security header "Frame Counter" octet.
void SetSrcAddrFields(uint16_t panId, Mac16Address addr)
Set Source address fields.
Mac64Address m_addrExtDstAddr
Dst Ext addr (0 or 8 Octets)
uint8_t m_fctrlDstAddrMode
Frame Control field Bit 10-11 = 0 - No DstAddr, 2 - ShtDstAddr, 3 - ExtDstAddr.
Mac64Address m_addrExtSrcAddr
Src Ext addr (0 or 8 Octets)
bool IsFrmPend() const
Check if Frame Pending bit of Frame Control is enabled.
uint8_t m_secctrlReserved
Auxiliary security header - Security Control field - Bit 5-7.
uint16_t GetSrcPanId() const
Get the Source PAN ID.
void SetNoPanIdComp()
Set the Frame Control field "PAN ID Compression" bit to false.
uint8_t m_fctrlSrcAddrMode
Frame Control field Bit 14-15 = 0 - No SrcAddr, 2 - ShtSrcAddr, 3 - ExtSrcAddr.
uint16_t GetDstPanId() const
Get the Destination PAN ID.
uint8_t m_fctrlFrmPending
Frame Control field Bit 4.
uint8_t m_fctrlPanIdComp
Frame Control field Bit 6 = 0 - no compression, 1 - using only DstPanId for both Src and DstPanId.
uint8_t m_fctrlFrmVer
Frame Control field Bit 12-13.
uint8_t m_fctrlAckReq
Frame Control field Bit 5.
void SetNoFrmPend()
Set the Frame Control field "Frame Pending" bit to false.
uint32_t m_auxFrmCntr
Auxiliary security header - Frame Counter (4 Octets)
void SetAckReq()
Set the Frame Control field "Ack. Request" bit to true.
bool IsAckReq() const
Check if Ack.
uint8_t GetDstAddrMode() const
Get the Dest.
uint8_t m_fctrlSecU
Frame Control field Bit 3 = 0 - no AuxSecHdr , 1 - security enabled AuxSecHdr present.
void SetSecEnable()
Set the Frame Control field "Security Enabled" bit to true.
void SetSecDisable()
Set the Frame Control field "Security Enabled" bit to false.
Mac64Address GetExtDstAddr() const
Get the Destination Extended address.
bool IsAcknowledgment() const
Returns true if the header is an ack.
uint8_t GetSrcAddrMode() const
Get the Source Addressing Mode of Frame control field.
bool IsPanIdComp() const
Check if PAN ID Compression bit of Frame Control is enabled.
void SetSeqNum(uint8_t seqNum)
Set the Sequence number.
uint8_t GetFrmCtrlRes() const
Get the Reserved bits of Frame control field.
void SetKeyIdMode(uint8_t keyIdMode)
Set the Security Control field "Key Identifier Mode" bits (2 bits)
Every class exported by the ns3 library is enclosed in the ns3 namespace.