A Discrete-Event Network Simulator
API
tid-to-link-mapping-element.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022
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: Sharan Naribole <sharan.naribole@gmail.com>
18  */
19 
20 #ifndef TID_TO_LINK_MAPPING_H
21 #define TID_TO_LINK_MAPPING_H
22 
23 #include <ns3/wifi-information-element.h>
24 
25 #include <list>
26 #include <map>
27 #include <optional>
28 #include <vector>
29 
30 namespace ns3
31 {
32 
37 enum class TidLinkMapDir : uint8_t
38 {
39  DOWNLINK = 0,
40  UPLINK = 1,
41  BOTH_DIRECTIONS = 2,
42 };
43 
45 constexpr auto DEFAULT_WIFI_TID_LINK_MAPPING{true};
49 constexpr uint16_t WIFI_LINK_MAPPING_PER_TID_SIZE_B = 2;
52  1; // IEEE 802.11be D2.0 9.4.2.314
55 
66 {
67  public:
72  struct Control
73  {
76  std::optional<uint8_t> presenceBitmap;
77 
79  uint16_t GetSubfieldSize() const;
80 
86  void Serialize(Buffer::Iterator& start) const;
94  };
95 
96  WifiInformationElementId ElementId() const override;
97  WifiInformationElementId ElementIdExt() const override;
98 
106  void SetLinkMappingOfTid(uint8_t tid, std::list<uint8_t> linkIds);
113  std::list<uint8_t> GetLinkMappingOfTid(uint8_t tid) const;
114 
116  std::map<uint8_t, uint16_t> m_linkMapping;
117 
118  private:
119  uint16_t GetInformationFieldSize() const override;
120  void SerializeInformationField(Buffer::Iterator start) const override;
121  uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
122 };
123 
124 } // namespace ns3
125 
126 #endif /* TID_TO_LINK_MAPPING_H */
iterator in a Buffer instance
Definition: buffer.h:100
Information element, as defined in 802.11-2007 standard.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr uint16_t WIFI_TID_TO_LINK_MAPPING_CONTROL_BASIC_SIZE_B
size in bytes of the TID-To-Link Control field with default link mapping
TidLinkMapDir
TID-to-Link Mapping Control Direction IEEE 802.11be D2.0 Figure 9-1002an.
constexpr uint16_t WIFI_LINK_MAPPING_PER_TID_SIZE_B
size in bytes of the Link Mapping Of TID n field (IEEE 802.11be D2.0 9.4.2.314)
constexpr auto DEFAULT_WIFI_TID_LINK_MAP_DIR
default value for the Direction subfield of the TID-To-Link Control field
constexpr uint16_t WIFI_LINK_MAPPING_PRESENCE_IND_SIZE_B
size in bytes of the Link Mapping Presence Indicator field (IEEE 802.11be D2.0 9.4....
constexpr auto DEFAULT_WIFI_TID_LINK_MAPPING
whether to enforce the default link mapping
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.