diff --git a/src/wifi/CMakeLists.txt b/src/wifi/CMakeLists.txt index 855e73246..9d00cc412 100644 --- a/src/wifi/CMakeLists.txt +++ b/src/wifi/CMakeLists.txt @@ -46,6 +46,7 @@ set(source_files model/fcfs-wifi-queue-scheduler.cc model/frame-capture-model.cc model/frame-exchange-manager.cc + model/gcr-group-address.cc model/he/constant-obss-pd-algorithm.cc model/he/he-6ghz-band-capabilities.cc model/he/he-capabilities.cc @@ -209,6 +210,7 @@ set(header_files model/fcfs-wifi-queue-scheduler.h model/frame-capture-model.h model/frame-exchange-manager.h + model/gcr-group-address.h model/he/constant-obss-pd-algorithm.h model/he/he-6ghz-band-capabilities.h model/he/he-capabilities.h diff --git a/src/wifi/model/gcr-group-address.cc b/src/wifi/model/gcr-group-address.cc new file mode 100644 index 000000000..62d72521b --- /dev/null +++ b/src/wifi/model/gcr-group-address.cc @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Universita' degli Studi di Napoli Federico II + * + * SPDX-License-Identifier: GPL-2.0-only + * + * Author: Stefano Avallone + */ + +#include "gcr-group-address.h" + +#include "ns3/address-utils.h" + +namespace ns3 +{ + +void +GcrGroupAddress::Print(std::ostream& os) const +{ + os << "gcrGroupAddress=" << m_gcrGroupAddress; +} + +WifiInformationElementId +GcrGroupAddress::ElementId() const +{ + return IE_GCR_GROUP_ADDRESS; +} + +uint16_t +GcrGroupAddress::GetInformationFieldSize() const +{ + return 6; // GCR Group Address field +} + +void +GcrGroupAddress::SerializeInformationField(Buffer::Iterator start) const +{ + WriteTo(start, m_gcrGroupAddress); +} + +uint16_t +GcrGroupAddress::DeserializeInformationField(Buffer::Iterator start, uint16_t length) +{ + ReadFrom(start, m_gcrGroupAddress); + return 6; +} + +} // namespace ns3 diff --git a/src/wifi/model/gcr-group-address.h b/src/wifi/model/gcr-group-address.h new file mode 100644 index 000000000..7dd4addad --- /dev/null +++ b/src/wifi/model/gcr-group-address.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Universita' degli Studi di Napoli Federico II + * + * SPDX-License-Identifier: GPL-2.0-only + * + * Author: Stefano Avallone + */ + +#ifndef GCR_GROUP_ADDRESS_H +#define GCR_GROUP_ADDRESS_H + +#include "wifi-information-element.h" + +#include "ns3/mac48-address.h" + +namespace ns3 +{ + +/** + * @ingroup wifi + * + * The IEEE 802.11 GCR Group Address Element (Sec. 9.4.2.125 of 802.11-2020) + */ +class GcrGroupAddress : public WifiInformationElement +{ + public: + GcrGroupAddress() = default; + + WifiInformationElementId ElementId() const override; + void Print(std::ostream& os) const override; + + Mac48Address m_gcrGroupAddress; //!< GCR Group Address field + + private: + uint16_t GetInformationFieldSize() const override; + void SerializeInformationField(Buffer::Iterator start) const override; + uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override; +}; + +} // namespace ns3 + +#endif /* GCR_GROUP_ADDRESS_H */ diff --git a/src/wifi/model/wifi-information-element.h b/src/wifi/model/wifi-information-element.h index 44da2bd61..966e3cce2 100644 --- a/src/wifi/model/wifi-information-element.h +++ b/src/wifi/model/wifi-information-element.h @@ -198,7 +198,14 @@ typedef uint8_t WifiInformationElementId; #define IE_QUIET_PERIOD_RESPONSE ((WifiInformationElementId)177) // 178 to 181 are reserved #define IE_ECPAC_POLICY ((WifiInformationElementId)182) -// 183 to 190 are reserved +#define IE_CLUSTER_TIME_OFFSET ((WifiInformationElementId)183) +#define IE_INTRA_ACCESS_CATEGORY_PRIORITY ((WifiInformationElementId)184) +#define IE_SCS_DESCRIPTOR ((WifiInformationElementId)185) +#define IE_QLOAD_REPORT ((WifiInformationElementId)186) +#define IE_HCCA_TXOP_UPDATE_COUNT ((WifiInformationElementId)187) +#define IE_HIGHER_LAYER_STREAM_ID ((WifiInformationElementId)188) +#define IE_GCR_GROUP_ADDRESS ((WifiInformationElementId)189) +#define IE_ANTENNA_SECTOR_ID_PATTERN ((WifiInformationElementId)190) #define IE_VHT_CAPABILITIES ((WifiInformationElementId)191) #define IE_VHT_OPERATION ((WifiInformationElementId)192) #define IE_EXTENDED_BSS_LOAD ((WifiInformationElementId)193)