A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mgt-action-headers.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006 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 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 * Mirko Banchi <mk.banchi@gmail.com>
20 */
21
22#ifndef MGT_ACTION_HEADERS_H
23#define MGT_ACTION_HEADERS_H
24
25#include "status-code.h"
26
27#include "ns3/header.h"
28
29#include <list>
30#include <optional>
31
32namespace ns3
33{
34
35class Packet;
36
45{
46 public:
48 ~WifiActionHeader() override;
49
50 /*
51 * Compatible with table 8-38 IEEE 802.11, Part11, (Year 2012)
52 * Category values - see 802.11-2012 Table 8-38
53 */
54
56 enum CategoryValue : uint8_t // table 9-51 of IEEE 802.11-2020
57 {
59 QOS = 1,
61 PUBLIC = 4,
62 RADIO_MEASUREMENT = 5, // Category: Radio Measurement
63 MESH = 13, // Category: Mesh
64 MULTIHOP = 14, // not used so far
65 SELF_PROTECTED = 15, // Category: Self Protected
66 DMG = 16, // Category: DMG
67 FST = 18, // Category: Fast Session Transfer
68 UNPROTECTED_DMG = 20, // Category: Unprotected DMG
69 PROTECTED_EHT = 37, // Category: Protected EHT
70 // Since vendor specific action has no stationary Action value,the parse process is not
71 // here. Refer to vendor-specific-action in wave module.
73 // values 128 to 255 are illegal
74 };
75
77 enum QosActionValue : uint8_t
78 {
81 DELTS = 2,
84 };
85
90 enum BlockAckActionValue : uint8_t
91 {
95 };
96
98 enum PublicActionValue : uint8_t
99 {
102 };
103
106 {
113 };
114
116 enum MeshActionValue : uint8_t
117 {
118 LINK_METRIC_REPORT = 0, // Action Value:0 in Category 13: Mesh
119 PATH_SELECTION = 1, // Action Value:1 in Category 13: Mesh
120 PORTAL_ANNOUNCEMENT = 2, // Action Value:2 in Category 13: Mesh
121 CONGESTION_CONTROL_NOTIFICATION = 3, // Action Value:3 in Category 13: Mesh
123 4, // Action Value:4 in Category 13: Mesh MCCA-Setup-Request (not used so far)
125 5, // Action Value:5 in Category 13: Mesh MCCA-Setup-Reply (not used so far)
127 6, // Action Value:6 in Category 13: Mesh MCCA-Advertisement-Request (not used so far)
128 MDAOP_ADVERTISEMENTS = 7, // Action Value:7 in Category 13: Mesh (not used so far)
129 MDAOP_SET_TEARDOWN = 8, // Action Value:8 in Category 13: Mesh (not used so far)
130 TBTT_ADJUSTMENT_REQUEST = 9, // Action Value:9 in Category 13: Mesh (not used so far)
131 TBTT_ADJUSTMENT_RESPONSE = 10, // Action Value:10 in Category 13: Mesh (not used so far)
132 };
133
135 enum MultihopActionValue : uint8_t
136 {
137 PROXY_UPDATE = 0, // not used so far
138 PROXY_UPDATE_CONFIRMATION = 1, // not used so far
139 };
140
142 enum SelfProtectedActionValue : uint8_t // Category: 15 (Self Protected)
143 {
144 PEER_LINK_OPEN = 1, // Mesh Peering Open
145 PEER_LINK_CONFIRM = 2, // Mesh Peering Confirm
146 PEER_LINK_CLOSE = 3, // Mesh Peering Close
147 GROUP_KEY_INFORM = 4, // Mesh Group Key Inform
148 GROUP_KEY_ACK = 5, // Mesh Group Key Acknowledge
149 };
150
155 enum DmgActionValue : uint8_t
156 {
180 };
181
186 enum FstActionValue : uint8_t
187 {
194 };
195
201 {
208 };
209
215 {
226 };
227
231 typedef union {
243 } ActionValue;
244
251 void SetAction(CategoryValue type, ActionValue action);
252
264 ActionValue GetAction() const;
265
272 static std::pair<CategoryValue, ActionValue> Peek(Ptr<const Packet> pkt);
273
280 static std::pair<CategoryValue, ActionValue> Remove(Ptr<Packet> pkt);
281
286 static TypeId GetTypeId();
287 TypeId GetInstanceTypeId() const override;
288 void Print(std::ostream& os) const override;
289 uint32_t GetSerializedSize() const override;
290 void Serialize(Buffer::Iterator start) const override;
291 uint32_t Deserialize(Buffer::Iterator start) override;
292
293 private:
294 uint8_t m_category;
296};
297
303{
304 public:
309 static TypeId GetTypeId();
310 TypeId GetInstanceTypeId() const override;
311 void Print(std::ostream& os) const override;
312 uint32_t GetSerializedSize() const override;
313 void Serialize(Buffer::Iterator start) const override;
314 uint32_t Deserialize(Buffer::Iterator start) override;
315
319 void SetDelayedBlockAck();
329 void SetTid(uint8_t tid);
335 void SetTimeout(uint16_t timeout);
341 void SetBufferSize(uint16_t size);
347 void SetStartingSequence(uint16_t seq);
353 void SetAmsduSupport(bool supported);
354
360 uint16_t GetStartingSequence() const;
366 uint8_t GetTid() const;
372 bool IsImmediateBlockAck() const;
378 uint16_t GetTimeout() const;
384 uint16_t GetBufferSize() const;
390 bool IsAmsduSupported() const;
391
392 private:
398 uint16_t GetParameterSet() const;
404 void SetParameterSet(uint16_t params);
410 uint16_t GetStartingSequenceControl() const;
416 void SetStartingSequenceControl(uint16_t seqControl);
417
418 uint8_t m_dialogToken{1};
419 uint8_t m_amsduSupport{1};
420 uint8_t m_policy{1};
421 uint8_t m_tid{0};
422 uint16_t m_bufferSize{0};
423 uint16_t m_timeoutValue{0};
424 uint16_t m_startingSeq{0};
425};
426
432{
433 public:
438 static TypeId GetTypeId();
439 TypeId GetInstanceTypeId() const override;
440 void Print(std::ostream& os) const override;
441 uint32_t GetSerializedSize() const override;
442 void Serialize(Buffer::Iterator start) const override;
443 uint32_t Deserialize(Buffer::Iterator start) override;
444
448 void SetDelayedBlockAck();
458 void SetTid(uint8_t tid);
464 void SetTimeout(uint16_t timeout);
470 void SetBufferSize(uint16_t size);
476 void SetStatusCode(StatusCode code);
482 void SetAmsduSupport(bool supported);
483
495 uint8_t GetTid() const;
501 bool IsImmediateBlockAck() const;
507 uint16_t GetTimeout() const;
513 uint16_t GetBufferSize() const;
519 bool IsAmsduSupported() const;
520
521 private:
527 uint16_t GetParameterSet() const;
533 void SetParameterSet(uint16_t params);
534
535 uint8_t m_dialogToken{1};
537 uint8_t m_amsduSupport{1};
538 uint8_t m_policy{1};
539 uint8_t m_tid{0};
540 uint16_t m_bufferSize{0};
541 uint16_t m_timeoutValue{0};
542};
543
548class MgtDelBaHeader : public Header
549{
550 public:
555 static TypeId GetTypeId();
556
557 TypeId GetInstanceTypeId() const override;
558 void Print(std::ostream& os) const override;
559 uint32_t GetSerializedSize() const override;
560 void Serialize(Buffer::Iterator start) const override;
561 uint32_t Deserialize(Buffer::Iterator start) override;
562
569 bool IsByOriginator() const;
575 uint8_t GetTid() const;
581 void SetTid(uint8_t tid);
585 void SetByOriginator();
589 void SetByRecipient();
590
591 private:
597 uint16_t GetParameterSet() const;
603 void SetParameterSet(uint16_t params);
604
605 uint16_t m_initiator{0};
606 uint16_t m_tid{0};
607 uint16_t m_reasonCode{1};
608};
609
614class MgtEmlOmn : public Header
615{
616 public:
617 MgtEmlOmn() = default;
618
623 static TypeId GetTypeId();
624 TypeId GetInstanceTypeId() const override;
625 void Print(std::ostream& os) const override;
626 uint32_t GetSerializedSize() const override;
627 void Serialize(Buffer::Iterator start) const override;
628 uint32_t Deserialize(Buffer::Iterator start) override;
629
634 {
635 uint8_t emlsrMode : 1;
636 uint8_t emlmrMode : 1;
638 uint8_t : 5;
639 std::optional<uint16_t> linkBitmap;
640 std::optional<uint8_t> mcsMapCountCtrl;
641 // TODO Add EMLMR Supported MCS And NSS Set subfield when EMLMR is supported
642 };
643
648 {
649 uint8_t paddingDelay : 3;
650 uint8_t transitionDelay : 3;
651 };
652
658 void SetLinkIdInBitmap(uint8_t linkId);
662 std::list<uint8_t> GetLinkBitmap() const;
663
664 uint8_t m_dialogToken{0};
666 std::optional<EmlsrParamUpdate> m_emlsrParamUpdate{};
667};
668
669} // namespace ns3
670
671#endif /* MGT_ACTION_HEADERS_H */
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
Implement the header for management frames of type Add Block Ack request.
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
uint16_t m_startingSeq
Starting sequence number.
void Serialize(Buffer::Iterator start) const override
uint16_t GetStartingSequenceControl() const
Return the raw sequence control.
void SetStartingSequenceControl(uint16_t seqControl)
Set sequence control with the given raw value.
static TypeId GetTypeId()
Register this type.
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
void SetBufferSize(uint16_t size)
Set buffer size.
void Print(std::ostream &os) const override
void SetDelayedBlockAck()
Enable delayed BlockAck.
uint8_t m_dialogToken
Not used for now.
uint16_t GetParameterSet() const
Return the raw parameter set.
uint32_t Deserialize(Buffer::Iterator start) override
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
void SetImmediateBlockAck()
Enable immediate BlockAck.
uint16_t GetBufferSize() const
Return the buffer size.
uint16_t m_bufferSize
Buffer size.
uint16_t GetTimeout() const
Return the timeout.
uint8_t GetTid() const
Return the Traffic ID (TID).
uint16_t GetStartingSequence() const
Return the starting sequence number.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint32_t GetSerializedSize() const override
bool IsAmsduSupported() const
Return whether A-MSDU capability is supported.
bool IsImmediateBlockAck() const
Return whether the Block Ack policy is immediate Block Ack.
void SetTimeout(uint16_t timeout)
Set timeout.
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint8_t m_policy
Block Ack policy.
void SetStartingSequence(uint16_t seq)
Set the starting sequence number.
Implement the header for management frames of type Add Block Ack response.
uint16_t m_bufferSize
Buffer size.
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint32_t GetSerializedSize() const override
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
uint8_t m_dialogToken
Not used for now.
void Serialize(Buffer::Iterator start) const override
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
uint16_t GetBufferSize() const
Return the buffer size.
bool IsAmsduSupported() const
Return whether A-MSDU capability is supported.
StatusCode GetStatusCode() const
Return the status code.
void SetTimeout(uint16_t timeout)
Set timeout.
uint8_t m_policy
Block ACK policy.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetBufferSize(uint16_t size)
Set buffer size.
void Print(std::ostream &os) const override
void SetStatusCode(StatusCode code)
Set the status code.
uint8_t GetTid() const
Return the Traffic ID (TID).
bool IsImmediateBlockAck() const
Return whether the Block Ack policy is immediate Block Ack.
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
uint16_t GetParameterSet() const
Return the raw parameter set.
uint32_t Deserialize(Buffer::Iterator start) override
uint16_t GetTimeout() const
Return the timeout.
void SetDelayedBlockAck()
Enable delayed BlockAck.
void SetImmediateBlockAck()
Enable immediate BlockAck.
static TypeId GetTypeId()
Register this type.
StatusCode m_code
Status code.
Implement the header for management frames of type Delete Block Ack.
static TypeId GetTypeId()
Register this type.
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint32_t Deserialize(Buffer::Iterator start) override
void SetByRecipient()
Un-set the initiator bit in the DELBA.
void Print(std::ostream &os) const override
uint16_t m_initiator
initiator
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t GetTid() const
Return the Traffic ID (TID).
uint16_t m_reasonCode
Not used for now.
bool IsByOriginator() const
Check if the initiator bit in the DELBA is set.
uint16_t GetParameterSet() const
Return the raw parameter set.
void Serialize(Buffer::Iterator start) const override
uint16_t m_tid
Traffic ID.
uint32_t GetSerializedSize() const override
void SetByOriginator()
Set the initiator bit in the DELBA.
Implement the header for Action frames of type EML Operating Mode Notification.
void Serialize(Buffer::Iterator start) const override
uint32_t GetSerializedSize() const override
void SetLinkIdInBitmap(uint8_t linkId)
Set the bit position in the link bitmap corresponding to the given link.
EmlControl m_emlControl
EML Control field.
uint32_t Deserialize(Buffer::Iterator start) override
void Print(std::ostream &os) const override
std::optional< EmlsrParamUpdate > m_emlsrParamUpdate
EMLSR Parameter Update field.
MgtEmlOmn()=default
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t m_dialogToken
Dialog Token.
std::list< uint8_t > GetLinkBitmap() const
static TypeId GetTypeId()
Register this type.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Status code for association response.
Definition: status-code.h:32
a unique identifier for an interface.
Definition: type-id.h:59
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
uint32_t GetSerializedSize() const override
CategoryValue
CategoryValue enumeration.
uint8_t m_category
Category of the action.
DmgActionValue
DMG Action field values See 802.11ad Table 8-281b.
RadioMeasurementActionValue
RadioMeasurementActionValue enumeration.
SelfProtectedActionValue
SelfProtectedActionValue enumeration.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
FstActionValue
FST Action field values See 802.11ad Table 8-281x.
UnprotectedDmgActionValue
Unprotected DMG action field values See 802.11ad Table 8-281ae.
uint8_t m_actionValue
Action value.
QosActionValue
QosActionValue enumeration.
uint32_t Deserialize(Buffer::Iterator start) override
BlockAckActionValue
Block Ack Action field values See 802.11 Table 8-202.
static std::pair< CategoryValue, ActionValue > Peek(Ptr< const Packet > pkt)
Peek an Action header from the given packet.
void Print(std::ostream &os) const override
MultihopActionValue
MultihopActionValue enumeration.
ProtectedEhtActionValue
Protected EHT action field values See 802.11be D3.0 Table 9-623c.
static std::pair< CategoryValue, ActionValue > Remove(Ptr< Packet > pkt)
Remove an Action header from the given packet.
static TypeId GetTypeId()
Register this type.
void SetAction(CategoryValue type, ActionValue action)
Set action for this Action header.
MeshActionValue
MeshActionValue enumeration.
void Serialize(Buffer::Iterator start) const override
PublicActionValue
PublicActionValue enumeration.
CategoryValue GetCategory() const
Return the category value.
ActionValue GetAction() const
Return the action value.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Time timeout
std::optional< uint8_t > mcsMapCountCtrl
MCS Map Count Control.
uint8_t emlsrParamUpdateCtrl
EMLSR Parameter Update Control.
std::optional< uint16_t > linkBitmap
EMLSR/EMLMR Link Bitmap.
EMLSR Parameter Update field.
uint8_t transitionDelay
EMLSR Transition Delay.
uint8_t paddingDelay
EMLSR Padding Delay.
typedef for union of different ActionValues
UnprotectedDmgActionValue unprotectedDmgAction
unprotected dmg
ProtectedEhtActionValue protectedEhtAction
protected eht
SelfProtectedActionValue selfProtectedAction
self protected
MultihopActionValue multihopAction
multi hop
RadioMeasurementActionValue radioMeasurementAction
radio measurement
PublicActionValue publicAction
public
BlockAckActionValue blockAck
block ack