A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-mac-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006, 2009 INRIA
3 * Copyright (c) 2009 MIRKO BANCHI
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
8 * Author: Mirko Banchi <mk.banchi@gmail.com>
9 */
10
11#ifndef WIFI_MAC_HEADER_H
12#define WIFI_MAC_HEADER_H
13
14#include "ns3/header.h"
15#include "ns3/mac48-address.h"
16
17namespace ns3
18{
19
20class Time;
21
22/**
23 * Combination of valid MAC header type/subtype.
24 */
80
81/**
82 * @ingroup wifi
83 *
84 * Implements the IEEE 802.11 MAC header
85 */
86class WifiMacHeader : public Header
87{
88 public:
89 /**
90 * Ack policy for QoS frames.
91 */
99
100 /**
101 * Address types.
102 */
110
111 WifiMacHeader() = default;
112 /**
113 * Construct a MAC header of the given type
114 *
115 * @param type the MAC header type
116 */
118
119 /**
120 * @brief Get the type ID.
121 * @return the object TypeId
122 */
123 static TypeId GetTypeId();
124
125 TypeId GetInstanceTypeId() const override;
126 void Print(std::ostream& os) const override;
127 uint32_t GetSerializedSize() const override;
128 void Serialize(Buffer::Iterator start) const override;
129 uint32_t Deserialize(Buffer::Iterator start) override;
130
131 /**
132 * Set the From DS bit in the Frame Control field.
133 */
134 void SetDsFrom();
135 /**
136 * Un-set the From DS bit in the Frame Control field.
137 */
138 void SetDsNotFrom();
139 /**
140 * Set the To DS bit in the Frame Control field.
141 */
142 void SetDsTo();
143 /**
144 * Un-set the To DS bit in the Frame Control field.
145 */
146 void SetDsNotTo();
147 /**
148 * Fill the Address 1 field with the given address.
149 *
150 * @param address the address to be used in the Address 1 field
151 */
152 void SetAddr1(Mac48Address address);
153 /**
154 * Fill the Address 2 field with the given address.
155 *
156 * @param address the address to be used in the Address 2 field
157 */
158 void SetAddr2(Mac48Address address);
159 /**
160 * Fill the Address 3 field with the given address.
161 *
162 * @param address the address to be used in the Address 3 field
163 */
164 void SetAddr3(Mac48Address address);
165 /**
166 * Fill the Address 4 field with the given address.
167 *
168 * @param address the address to be used in the Address 4 field
169 */
170 void SetAddr4(Mac48Address address);
171 /**
172 * Set Type/Subtype values with the correct values depending
173 * on the given type.
174 *
175 * @param type the WifiMacType for the header
176 * @param resetToDsFromDs whether the ToDs and FromDs flags
177 * should be reset.
178 */
179 virtual void SetType(WifiMacType type, bool resetToDsFromDs = true);
180 /**
181 * Set the Duration/ID field with the given raw uint16_t value.
182 *
183 * @param duration the raw duration in uint16_t
184 */
185 void SetRawDuration(uint16_t duration);
186 /**
187 * Set the Duration/ID field with the given duration (Time object).
188 * The method converts the given time to microseconds.
189 *
190 * @param duration the duration (Time object)
191 */
192 void SetDuration(Time duration);
193 /**
194 * Set the Duration/ID field with the given ID.
195 *
196 * @param id the ID
197 */
198 void SetId(uint16_t id);
199 /**
200 * Set the sequence number of the header.
201 *
202 * @param seq the given sequence number
203 */
204 void SetSequenceNumber(uint16_t seq);
205 /**
206 * Set the fragment number of the header.
207 *
208 * @param frag the given fragment number
209 */
210 void SetFragmentNumber(uint8_t frag);
211 /**
212 * Un-set the More Fragment bit in the Frame Control Field
213 */
214 void SetNoMoreFragments();
215 /**
216 * Set the More Fragment bit in the Frame Control field
217 */
218 void SetMoreFragments();
219 /**
220 * Set the Retry bit in the Frame Control field.
221 */
222 void SetRetry();
223 /**
224 * Un-set the Retry bit in the Frame Control field.
225 */
226 void SetNoRetry();
227 /**
228 * Set the Power Management bit in the Frame Control field.
229 */
230 void SetPowerManagement();
231 /**
232 * Un-set the Power Management bit in the Frame Control field.
233 */
235 /**
236 * Set the TID for the QoS header.
237 *
238 * @param tid the TID for the QoS header
239 */
240 void SetQosTid(uint8_t tid);
241 /**
242 * Set the end of service period (EOSP) bit in the QoS control field.
243 */
244 void SetQosEosp();
245 /**
246 * Un-set the end of service period (EOSP) bit in the QoS control field.
247 */
248 void SetQosNoEosp();
249 /**
250 * Set the QoS Ack policy in the QoS control field.
251 *
252 * @param policy the Qos Ack policy
253 */
254 void SetQosAckPolicy(QosAckPolicy policy);
255 /**
256 * Set that A-MSDU is present.
257 */
258 void SetQosAmsdu();
259 /**
260 * Set that A-MSDU is not present.
261 */
262 void SetQosNoAmsdu();
263 /**
264 * Set TXOP limit in the QoS control field.
265 *
266 * @param txop the TXOP limit
267 */
268 void SetQosTxopLimit(uint8_t txop);
269 /**
270 * Set the Queue Size subfield in the QoS control field.
271 *
272 * @param size the value for the Queue Size subfield
273 */
274 void SetQosQueueSize(uint8_t size);
275 /**
276 * Set the Mesh Control Present flag for the QoS header.
277 */
279 /**
280 * Clear the Mesh Control Present flag for the QoS header.
281 */
283 /**
284 * Set order bit in the frame control field.
285 */
286 void SetOrder();
287 /**
288 * Unset order bit in the frame control field.
289 */
290 void SetNoOrder();
291
292 /**
293 * Return the address in the Address 1 field.
294 *
295 * @return the address in the Address 1 field
296 */
297 Mac48Address GetAddr1() const;
298 /**
299 * Return the address in the Address 2 field.
300 *
301 * @return the address in the Address 2 field
302 */
303 Mac48Address GetAddr2() const;
304 /**
305 * Return the address in the Address 3 field.
306 *
307 * @return the address in the Address 3 field
308 */
309 Mac48Address GetAddr3() const;
310 /**
311 * Return the address in the Address 4 field.
312 *
313 * @return the address in the Address 4 field
314 */
315 Mac48Address GetAddr4() const;
316 /**
317 * Return the type (WifiMacType)
318 *
319 * @return the type (WifiMacType)
320 */
321 virtual WifiMacType GetType() const;
322 /**
323 * @return true if From DS bit is set, false otherwise
324 */
325 bool IsFromDs() const;
326 /**
327 * @return true if To DS bit is set, false otherwise
328 */
329 bool IsToDs() const;
330 /**
331 * Return true if the Type is DATA. The method does
332 * not check the Subtype field. (e.g. the header may be
333 * Data with QoS)
334 *
335 * @return true if Type is DATA, false otherwise
336 */
337 bool IsData() const;
338 /**
339 * Return true if the Type is DATA and Subtype is one of the
340 * possible values for QoS Data.
341 *
342 * @return true if Type is QoS DATA, false otherwise
343 */
344 bool IsQosData() const;
345 /**
346 * Return true if the header type is DATA and is not DATA_NULL.
347 *
348 * @return true if the header type is DATA and is not DATA_NULL,
349 * false otherwise
350 */
351 bool HasData() const;
352 /**
353 * Return true if the Type is Control.
354 *
355 * @return true if Type is Control, false otherwise
356 */
357 bool IsCtl() const;
358 /**
359 * Return true if the Type is Management.
360 *
361 * @return true if Type is Management, false otherwise
362 */
363 bool IsMgt() const;
364 /**
365 * Return true if the Type/Subtype is one of the possible CF-Poll headers.
366 *
367 * @return true if the Type/Subtype is one of the possible CF-Poll headers, false otherwise
368 */
369 bool IsCfPoll() const;
370 /**
371 * Return true if the header is a CF-Ack header.
372 *
373 * @return true if the header is a CF-Ack header, false otherwise
374 */
375 bool IsCfAck() const;
376 /**
377 * Return true if the header is a CF-End header.
378 *
379 * @return true if the header is a CF-End header, false otherwise
380 */
381 bool IsCfEnd() const;
382 /**
383 * Return true if the header is a PS-POLL header.
384 *
385 * @return true if the header is a PS-POLL header, false otherwise
386 */
387 bool IsPsPoll() const;
388 /**
389 * Return true if the header is a RTS header.
390 *
391 * @return true if the header is a RTS header, false otherwise
392 */
393 bool IsRts() const;
394 /**
395 * Return true if the header is a CTS header.
396 *
397 * @return true if the header is a CTS header, false otherwise
398 */
399 bool IsCts() const;
400 /**
401 * Return true if the header is an Ack header.
402 *
403 * @return true if the header is an Ack header, false otherwise
404 */
405 bool IsAck() const;
406 /**
407 * Return true if the header is a BlockAckRequest header.
408 *
409 * @return true if the header is a BlockAckRequest header, false otherwise
410 */
411 bool IsBlockAckReq() const;
412 /**
413 * Return true if the header is a BlockAck header.
414 *
415 * @return true if the header is a BlockAck header, false otherwise
416 */
417 bool IsBlockAck() const;
418 /**
419 * Return true if the header is a Trigger header.
420 *
421 * @return true if the header is a Trigger header, false otherwise
422 */
423 bool IsTrigger() const;
424 /**
425 * Return true if the header is an Association Request header.
426 *
427 * @return true if the header is an Association Request header, false otherwise
428 */
429 bool IsAssocReq() const;
430 /**
431 * Return true if the header is an Association Response header.
432 *
433 * @return true if the header is an Association Response header, false otherwise
434 */
435 bool IsAssocResp() const;
436 /**
437 * Return true if the header is a Reassociation Request header.
438 *
439 * @return true if the header is a Reassociation Request header, false otherwise
440 */
441 bool IsReassocReq() const;
442 /**
443 * Return true if the header is a Reassociation Response header.
444 *
445 * @return true if the header is a Reassociation Response header, false otherwise
446 */
447 bool IsReassocResp() const;
448 /**
449 * Return true if the header is a Probe Request header.
450 *
451 * @return true if the header is a Probe Request header, false otherwise
452 */
453 bool IsProbeReq() const;
454 /**
455 * Return true if the header is a Probe Response header.
456 *
457 * @return true if the header is a Probe Response header, false otherwise
458 */
459 bool IsProbeResp() const;
460 /**
461 * Return true if the header is a Beacon header.
462 *
463 * @return true if the header is a Beacon header, false otherwise
464 */
465 bool IsBeacon() const;
466 /**
467 * Return true if the header is a Disassociation header.
468 *
469 * @return true if the header is a Disassociation header, false otherwise
470 */
471 bool IsDisassociation() const;
472 /**
473 * Return true if the header is an Authentication header.
474 *
475 * @return true if the header is an Authentication header, false otherwise
476 */
477 bool IsAuthentication() const;
478 /**
479 * Return true if the header is a Deauthentication header.
480 *
481 * @return true if the header is a Deauthentication header, false otherwise
482 */
483 bool IsDeauthentication() const;
484 /**
485 * Return true if the header is an Action header.
486 *
487 * @return true if the header is an Action header, false otherwise
488 */
489 bool IsAction() const;
490 /**
491 * Return true if the header is an Action No Ack header.
492 *
493 * @return true if the header is an Action No Ack header, false otherwise
494 */
495 bool IsActionNoAck() const;
496 /**
497 * Check if the header is a Multihop action header.
498 *
499 * @return true if the header is a Multihop action header,
500 * false otherwise
501 */
502 bool IsMultihopAction() const;
503 /**
504 * Return the raw duration from the Duration/ID field.
505 *
506 * @return the raw duration from the Duration/ID field
507 */
508 uint16_t GetRawDuration() const;
509 /**
510 * Return the duration from the Duration/ID field (Time object).
511 *
512 * @return the duration from the Duration/ID field (Time object)
513 */
514 Time GetDuration() const;
515 /**
516 * Return the raw Sequence Control field.
517 *
518 * @return the raw Sequence Control field
519 */
520 uint16_t GetSequenceControl() const;
521 /**
522 * Return the sequence number of the header.
523 *
524 * @return the sequence number of the header
525 */
526 uint16_t GetSequenceNumber() const;
527 /**
528 * Return the fragment number of the header.
529 *
530 * @return the fragment number of the header
531 */
532 uint8_t GetFragmentNumber() const;
533 /**
534 * Return if the Retry bit is set.
535 *
536 * @return true if the Retry bit is set, false otherwise
537 */
538 bool IsRetry() const;
539 /**
540 * Return if the Power Management bit is set.
541 *
542 * @return true if the Power Management bit is set, false otherwise
543 */
544 bool IsPowerManagement() const;
545 /**
546 * Return if the More Data bit is set.
547 *
548 * @return true if the More Data bit is set, false otherwise
549 */
550 bool IsMoreData() const;
551 /**
552 * Return if the More Fragment bit is set.
553 *
554 * @return true if the More Fragment bit is set, false otherwise
555 */
556 bool IsMoreFragments() const;
557 /**
558 * Return if the QoS Ack policy is Block Ack.
559 *
560 * @return true if the QoS Ack policy is Block Ack, false otherwise
561 */
562 bool IsQosBlockAck() const;
563 /**
564 * Return if the QoS Ack policy is No Ack.
565 *
566 * @return true if the QoS Ack policy is No Ack, false otherwise
567 */
568 bool IsQosNoAck() const;
569 /**
570 * Return if the QoS Ack policy is Normal Ack.
571 *
572 * @return true if the QoS Ack policy is No Ack, false otherwise
573 */
574 bool IsQosAck() const;
575 /**
576 * Return if the end of service period (EOSP) is set.
577 *
578 * @return true if the end of service period (EOSP) is set, false otherwise
579 */
580 bool IsQosEosp() const;
581 /**
582 * Check if the A-MSDU present bit is set in the QoS control field.
583 *
584 * @return true if the A-MSDU present bit is set,
585 * false otherwise
586 */
587 bool IsQosAmsdu() const;
588 /**
589 * Return the Traffic ID of a QoS header.
590 *
591 * @return the Traffic ID of a QoS header
592 */
593 uint8_t GetQosTid() const;
594 /**
595 * Return the QoS Ack policy in the QoS control field.
596 *
597 * @return the QoS Ack policy in the QoS control field
598 */
600 /**
601 * Get the Queue Size subfield in the QoS control field.
602 *
603 * @return the value of the Queue Size subfield
604 */
605 uint8_t GetQosQueueSize() const;
606 /**
607 * Return the size of the WifiMacHeader in octets.
608 * GetSerializedSize calls this function.
609 *
610 * @return the size of the WifiMacHeader in octets
611 */
612 virtual uint32_t GetSize() const;
613 /**
614 * Return a string corresponds to the header type.
615 *
616 * @returns a string corresponds to the header type.
617 */
618 virtual const char* GetTypeString() const;
619
620 /**
621 * TracedCallback signature for WifiMacHeader
622 *
623 * @param [in] header The header
624 */
625 typedef void (*TracedCallback)(const WifiMacHeader& header);
626
627 protected:
628 /**
629 * Return the raw Frame Control field.
630 *
631 * @return the raw Frame Control field
632 */
633 virtual uint16_t GetFrameControl() const;
634 /**
635 * Return the raw QoS Control field.
636 *
637 * @return the raw QoS Control field
638 */
639 virtual uint16_t GetQosControl() const;
640 /**
641 * Set the Frame Control field with the given raw value.
642 *
643 * @param control the raw Frame Control field value
644 */
645 virtual void SetFrameControl(uint16_t control);
646 /**
647 * Set the Sequence Control field with the given raw value.
648 *
649 * @param seq the raw Sequence Control field value
650 */
651 void SetSequenceControl(uint16_t seq);
652 /**
653 * Set the QoS Control field with the given raw value.
654 *
655 * @param qos the raw QoS Control field value
656 */
657 virtual void SetQosControl(uint16_t qos);
658 /**
659 * Print the Frame Control field to the output stream.
660 *
661 * @param os the output stream to print to
662 */
663 void PrintFrameControl(std::ostream& os) const;
664
665 uint8_t m_ctrlType{0}; ///< control type
666 uint8_t m_ctrlSubtype{0}; ///< control subtype
667 uint8_t m_ctrlToDs{0}; ///< control to DS
668 uint8_t m_ctrlFromDs{0}; ///< control from DS
669 uint8_t m_ctrlMoreFrag{0}; ///< control more fragments
670 uint8_t m_ctrlRetry{0}; ///< control retry
671 uint8_t m_ctrlPowerManagement{0}; ///< control power management
672 uint8_t m_ctrlMoreData{0}; ///< control more data
673 uint8_t m_ctrlWep{0}; ///< control WEP
674 uint8_t m_ctrlOrder{0}; ///< control order (set to 1 for QoS Data and Management frames to
675 ///< signify that HT/VHT/HE control field is present, knowing that the
676 ///< latter are not implemented yet)
677 uint16_t m_duration{0}; ///< duration
678 Mac48Address m_addr1{}; ///< address 1
679 Mac48Address m_addr2{}; ///< address 2
680 Mac48Address m_addr3{}; ///< address 3
681 uint8_t m_seqFrag{0}; ///< sequence fragment
682 uint16_t m_seqSeq{0}; ///< sequence sequence
683 Mac48Address m_addr4{}; ///< address 4
684 uint8_t m_qosTid{0}; ///< QoS TID
685 uint8_t m_qosEosp{0}; ///< QoS EOSP
686 uint8_t m_qosAckPolicy{0}; ///< QoS Ack policy
687 uint8_t m_amsduPresent{0}; ///< A-MSDU present
688 uint8_t m_qosStuff{0}; ///< QoS stuff
689};
690
691} // namespace ns3
692
693#endif /* WIFI_MAC_HEADER_H */
iterator in a Buffer instance
Definition buffer.h:89
Protocol header serialization and deserialization.
Definition header.h:33
an EUI-48 address
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
Implements the IEEE 802.11 MAC header.
uint8_t GetQosTid() const
Return the Traffic ID of a QoS header.
bool IsCfAck() const
Return true if the header is a CF-Ack header.
uint8_t m_qosEosp
QoS EOSP.
uint8_t m_ctrlRetry
control retry
uint8_t m_qosTid
QoS TID.
uint8_t m_ctrlPowerManagement
control power management
bool IsAssocReq() const
Return true if the header is an Association Request header.
bool IsCfPoll() const
Return true if the Type/Subtype is one of the possible CF-Poll headers.
void SetQosAckPolicy(QosAckPolicy policy)
Set the QoS Ack policy in the QoS control field.
bool IsAck() const
Return true if the header is an Ack header.
AddressType
Address types.
uint16_t GetRawDuration() const
Return the raw duration from the Duration/ID field.
void SetRawDuration(uint16_t duration)
Set the Duration/ID field with the given raw uint16_t value.
bool IsProbeReq() const
Return true if the header is a Probe Request header.
bool IsBlockAckReq() const
Return true if the header is a BlockAckRequest header.
bool IsQosAmsdu() const
Check if the A-MSDU present bit is set in the QoS control field.
bool IsCts() const
Return true if the header is a CTS header.
Mac48Address GetAddr3() const
Return the address in the Address 3 field.
void SetQosAmsdu()
Set that A-MSDU is present.
virtual uint16_t GetFrameControl() const
Return the raw Frame Control field.
Mac48Address GetAddr4() const
Return the address in the Address 4 field.
virtual void SetFrameControl(uint16_t control)
Set the Frame Control field with the given raw value.
bool IsBeacon() const
Return true if the header is a Beacon header.
uint32_t GetSerializedSize() const override
bool IsAssocResp() const
Return true if the header is an Association Response header.
Mac48Address GetAddr1() const
Return the address in the Address 1 field.
uint16_t GetSequenceNumber() const
Return the sequence number of the header.
bool IsDisassociation() const
Return true if the header is a Disassociation header.
Mac48Address m_addr1
address 1
uint16_t m_seqSeq
sequence sequence
bool IsMoreFragments() const
Return if the More Fragment bit is set.
void SetRetry()
Set the Retry bit in the Frame Control field.
WifiMacHeader()=default
uint16_t GetSequenceControl() const
Return the raw Sequence Control field.
bool IsTrigger() const
Return true if the header is a Trigger header.
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
virtual WifiMacType GetType() const
Return the type (WifiMacType)
void SetNoMoreFragments()
Un-set the More Fragment bit in the Frame Control Field.
bool IsRetry() const
Return if the Retry bit is set.
bool IsActionNoAck() const
Return true if the header is an Action No Ack header.
bool IsMgt() const
Return true if the Type is Management.
bool IsCtl() const
Return true if the Type is Control.
Time GetDuration() const
Return the duration from the Duration/ID field (Time object).
virtual void SetQosControl(uint16_t qos)
Set the QoS Control field with the given raw value.
uint8_t m_ctrlSubtype
control subtype
void SetSequenceNumber(uint16_t seq)
Set the sequence number of the header.
void SetNoOrder()
Unset order bit in the frame control field.
virtual uint32_t GetSize() const
Return the size of the WifiMacHeader in octets.
uint8_t m_amsduPresent
A-MSDU present.
bool IsCfEnd() const
Return true if the header is a CF-End header.
void SetDsNotFrom()
Un-set the From DS bit in the Frame Control field.
virtual uint16_t GetQosControl() const
Return the raw QoS Control field.
bool IsProbeResp() const
Return true if the header is a Probe Response header.
bool IsAction() const
Return true if the header is an Action header.
void SetMoreFragments()
Set the More Fragment bit in the Frame Control field.
bool IsQosEosp() const
Return if the end of service period (EOSP) is set.
Mac48Address m_addr4
address 4
Mac48Address m_addr2
address 2
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
void SetOrder()
Set order bit in the frame control field.
void SetSequenceControl(uint16_t seq)
Set the Sequence Control field with the given raw value.
void SetQosQueueSize(uint8_t size)
Set the Queue Size subfield in the QoS control field.
void SetQosNoAmsdu()
Set that A-MSDU is not present.
bool IsBlockAck() const
Return true if the header is a BlockAck header.
virtual void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
void SetAddr4(Mac48Address address)
Fill the Address 4 field with the given address.
uint8_t m_ctrlOrder
control order (set to 1 for QoS Data and Management frames to signify that HT/VHT/HE control field is...
uint8_t m_ctrlFromDs
control from DS
Mac48Address GetAddr2() const
Return the address in the Address 2 field.
uint16_t m_duration
duration
virtual const char * GetTypeString() const
Return a string corresponds to the header type.
uint8_t m_ctrlWep
control WEP
bool HasData() const
Return true if the header type is DATA and is not DATA_NULL.
bool IsReassocReq() const
Return true if the header is a Reassociation Request header.
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
QosAckPolicy GetQosAckPolicy() const
Return the QoS Ack policy in the QoS control field.
void SetDuration(Time duration)
Set the Duration/ID field with the given duration (Time object).
bool IsData() const
Return true if the Type is DATA.
void SetQosNoEosp()
Un-set the end of service period (EOSP) bit in the QoS control field.
uint8_t m_seqFrag
sequence fragment
uint8_t m_ctrlMoreData
control more data
bool IsReassocResp() const
Return true if the header is a Reassociation Response header.
bool IsRts() const
Return true if the header is a RTS header.
static TypeId GetTypeId()
Get the type ID.
bool IsQosAck() const
Return if the QoS Ack policy is Normal Ack.
void Print(std::ostream &os) const override
bool IsMoreData() const
Return if the More Data bit is set.
void SetQosNoMeshControlPresent()
Clear the Mesh Control Present flag for the QoS header.
void SetDsFrom()
Set the From DS bit in the Frame Control field.
bool IsQosNoAck() const
Return if the QoS Ack policy is No Ack.
uint8_t m_qosStuff
QoS stuff.
void SetDsTo()
Set the To DS bit in the Frame Control field.
void PrintFrameControl(std::ostream &os) const
Print the Frame Control field to the output stream.
uint8_t m_ctrlType
control type
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
void SetId(uint16_t id)
Set the Duration/ID field with the given ID.
bool IsQosBlockAck() const
Return if the QoS Ack policy is Block Ack.
bool IsPsPoll() const
Return true if the header is a PS-POLL header.
uint32_t Deserialize(Buffer::Iterator start) override
uint8_t GetFragmentNumber() const
Return the fragment number of the header.
bool IsQosData() const
Return true if the Type is DATA and Subtype is one of the possible values for QoS Data.
void SetQosEosp()
Set the end of service period (EOSP) bit in the QoS control field.
void Serialize(Buffer::Iterator start) const override
uint8_t GetQosQueueSize() const
Get the Queue Size subfield in the QoS control field.
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
void SetDsNotTo()
Un-set the To DS bit in the Frame Control field.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetFragmentNumber(uint8_t frag)
Set the fragment number of the header.
void SetQosMeshControlPresent()
Set the Mesh Control Present flag for the QoS header.
Mac48Address m_addr3
address 3
bool IsPowerManagement() const
Return if the Power Management bit is set.
void SetPowerManagement()
Set the Power Management bit in the Frame Control field.
uint8_t m_ctrlMoreFrag
control more fragments
QosAckPolicy
Ack policy for QoS frames.
bool IsMultihopAction() const
Check if the header is a Multihop action header.
void SetNoRetry()
Un-set the Retry bit in the Frame Control field.
bool IsDeauthentication() const
Return true if the header is a Deauthentication header.
uint8_t m_ctrlToDs
control to DS
bool IsAuthentication() const
Return true if the header is an Authentication header.
void SetNoPowerManagement()
Un-set the Power Management bit in the Frame Control field.
uint8_t m_qosAckPolicy
QoS Ack policy.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition nstime.h:864
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiMacType
Combination of valid MAC header type/subtype.
@ WIFI_MAC_QOSDATA_NULL_CFACK_CFPOLL
@ WIFI_MAC_EXTENSION_DMG_BEACON
@ WIFI_MAC_CTL_TRIGGER
@ WIFI_MAC_CTL_DMG_SSW_ACK
@ WIFI_MAC_MGT_PROBE_REQUEST
@ WIFI_MAC_CTL_END_ACK
@ WIFI_MAC_DATA_CFACK
@ WIFI_MAC_CTL_BACKREQ
@ WIFI_MAC_DATA_NULL
@ WIFI_MAC_CTL_PSPOLL
@ WIFI_MAC_CTL_DMG_POLL
@ WIFI_MAC_CTL_DMG_GRANT_ACK
@ WIFI_MAC_CTL_RTS
@ WIFI_MAC_CTL_DMG_CTS
@ WIFI_MAC_CTL_CTS
@ WIFI_MAC_MGT_AUTHENTICATION
@ WIFI_MAC_MGT_MULTIHOP_ACTION
@ WIFI_MAC_CTL_CTLWRAPPER
@ WIFI_MAC_QOSDATA_CFACK_CFPOLL
@ WIFI_MAC_MGT_BEACON
@ WIFI_MAC_CTL_DMG_GRANT
@ WIFI_MAC_MGT_ACTION
@ WIFI_MAC_MGT_ASSOCIATION_RESPONSE
@ WIFI_MAC_CTL_DMG_SPR
@ WIFI_MAC_CTL_ACK
@ WIFI_MAC_MGT_DISASSOCIATION
@ WIFI_MAC_QOSDATA_NULL_CFPOLL
@ WIFI_MAC_MGT_ASSOCIATION_REQUEST
@ WIFI_MAC_DATA_NULL_CFACK_CFPOLL
@ WIFI_MAC_MGT_REASSOCIATION_REQUEST
@ WIFI_MAC_QOSDATA_CFACK
@ WIFI_MAC_CTL_BACKRESP
@ WIFI_MAC_DATA_CFACK_CFPOLL
@ WIFI_MAC_DATA_CFPOLL
@ WIFI_MAC_CTL_END
@ WIFI_MAC_DATA_NULL_CFACK
@ WIFI_MAC_MGT_ACTION_NO_ACK
@ WIFI_MAC_MGT_DEAUTHENTICATION
@ WIFI_MAC_QOSDATA_NULL
@ WIFI_MAC_CTL_DMG_DTS
@ WIFI_MAC_DATA_NULL_CFPOLL
@ WIFI_MAC_MGT_PROBE_RESPONSE
@ WIFI_MAC_QOSDATA_CFPOLL
@ WIFI_MAC_DATA
@ WIFI_MAC_CTL_DMG_SSW
@ WIFI_MAC_MGT_REASSOCIATION_RESPONSE
@ WIFI_MAC_CTL_DMG_SSW_FBCK
@ WIFI_MAC_QOSDATA