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