wifi: Implement GCR Group Address element

This commit is contained in:
Stefano Avallone
2023-08-22 19:05:34 +02:00
committed by Sébastien Deronne
parent 28d56de9da
commit 9f72247061
4 changed files with 99 additions and 1 deletions

View File

@@ -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

View File

@@ -0,0 +1,47 @@
/*
* Copyright (c) 2023 Universita' degli Studi di Napoli Federico II
*
* SPDX-License-Identifier: GPL-2.0-only
*
* Author: Stefano Avallone <stavallo@unina.it>
*/
#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

View File

@@ -0,0 +1,42 @@
/*
* Copyright (c) 2023 Universita' degli Studi di Napoli Federico II
*
* SPDX-License-Identifier: GPL-2.0-only
*
* Author: Stefano Avallone <stavallo@unina.it>
*/
#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 */

View File

@@ -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)