A Discrete-Event Network Simulator
API
reduced-neighbor-report.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2021 Universita' degli Studi di Napoli Federico II
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: Stefano Avallone <stavallo@unina.it>
19 */
20
21#ifndef REDUCED_NEIGHBOR_REPORT_H
22#define REDUCED_NEIGHBOR_REPORT_H
23
25#include "ns3/mac48-address.h"
26#include <vector>
27
28namespace ns3 {
29
30class WifiPhyOperatingChannel;
31
32
40{
41public:
42
47 {
48 uint8_t mldId;
49 uint8_t linkId;
51 };
52
57 {
61 uint8_t bssParameters {0};
62 uint8_t psd20MHz {0};
64 };
65
70 {
71 uint8_t type : 2;
72 uint8_t filtered : 1;
73 uint8_t reserved : 1;
74 uint8_t tbttInfoCount : 4;
76 };
77
82 {
83 mutable TbttInformationHeader tbttInfoHdr {0, 0, 0, 0, 0};
84 uint8_t operatingClass {0};
85 uint8_t channelNumber {0};
86 std::vector<TbttInformation> tbttInformationSet;
87
88 bool hasBssid {false};
89 bool hasShortSsid {false};
90 bool hasBssParams {false};
91 bool has20MHzPsd {false};
92 bool hasMldParams {false};
93 };
94
96
97 // Implementations of pure virtual methods of WifiInformationElement
98 WifiInformationElementId ElementId () const override;
99 uint16_t GetInformationFieldSize () const override;
101 uint16_t DeserializeInformationField (Buffer::Iterator start, uint16_t length) override;
102
108 std::size_t GetNNbrApInfoFields (void) const;
112 void AddNbrApInfoField (void);
113
121 void SetOperatingChannel (std::size_t nbrApInfoId, const WifiPhyOperatingChannel& channel);
129 WifiPhyOperatingChannel GetOperatingChannel (std::size_t nbrApInfoId) const;
130
138 std::size_t GetNTbttInformationFields (std::size_t nbrApInfoId) const;
145 void AddTbttInformationField (std::size_t nbrApInfoId);
146
155 void SetBssid (std::size_t nbrApInfoId, std::size_t index, Mac48Address bssid);
163 bool HasBssid (std::size_t nbrApInfoId) const;
172 Mac48Address GetBssid (std::size_t nbrApInfoId, std::size_t index) const;
173
182 void SetShortSsid (std::size_t nbrApInfoId, std::size_t index, uint32_t shortSsid);
190 bool HasShortSsid (std::size_t nbrApInfoId) const;
199 uint32_t GetShortSsid (std::size_t nbrApInfoId, std::size_t index) const;
200
209 void SetBssParameters (std::size_t nbrApInfoId, std::size_t index, uint8_t bssParameters);
217 bool HasBssParameters (std::size_t nbrApInfoId) const;
226 uint8_t GetBssParameters (std::size_t nbrApInfoId, std::size_t index) const;
227
236 void SetPsd20MHz (std::size_t nbrApInfoId, std::size_t index, uint8_t psd20MHz);
244 bool HasPsd20MHz (std::size_t nbrApInfoId) const;
253 uint8_t GetPsd20MHz (std::size_t nbrApInfoId, std::size_t index) const;
254
265 void SetMldParameters (std::size_t nbrApInfoId, std::size_t index,
266 uint8_t mldId, uint8_t linkId, uint8_t changeSequence);
274 bool HasMldParameters (std::size_t nbrApInfoId) const;
283 uint8_t GetMldId (std::size_t nbrApInfoId, std::size_t index) const;
292 uint8_t GetLinkId (std::size_t nbrApInfoId, std::size_t index) const;
293
294private:
306 void WriteTbttInformationCount (std::size_t nbrApInfoId) const;
313 uint8_t ReadTbttInformationCount (std::size_t nbrApInfoId) const;
314
326 void WriteTbttInformationLength (std::size_t nbrApInfoId) const;
333 void ReadTbttInformationLength (std::size_t nbrApInfoId);
334
335 std::vector<NeighborApInformation> m_nbrApInfoFields;
336};
337
338} //namespace ns3
339
340#endif /* REDUCED_NEIGHBOR_REPORT_H */
iterator in a Buffer instance
Definition: buffer.h:99
an EUI-48 address
Definition: mac48-address.h:44
The Reduced Neighbor Report element.
void WriteTbttInformationLength(std::size_t nbrApInfoId) const
Set the TBTT Information Length field of the given Neighbor AP Information field based on the xxxPres...
Mac48Address GetBssid(std::size_t nbrApInfoId, std::size_t index) const
Get the BSSID field (must be present) in the i-th TBTT Information field of the given Neighbor AP Inf...
std::vector< NeighborApInformation > m_nbrApInfoFields
one or more Neighbor AP Information fields
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
bool HasShortSsid(std::size_t nbrApInfoId) const
Return true if the Short SSID field is present in all the TBTT Information fields of the given Neighb...
void WriteTbttInformationCount(std::size_t nbrApInfoId) const
Set the TBTT Information Count field of the given Neighbor AP Information field based on the size of ...
bool HasBssid(std::size_t nbrApInfoId) const
Return true if the BSSID field is present in all the TBTT Information fields of the given Neighbor AP...
uint8_t ReadTbttInformationCount(std::size_t nbrApInfoId) const
Get the TBTT Information Count field of the given Neighbor AP Information field.
void SetMldParameters(std::size_t nbrApInfoId, std::size_t index, uint8_t mldId, uint8_t linkId, uint8_t changeSequence)
Set the MLD Parameters subfield of the i-th TBTT Information field of the given Neighbor AP Informati...
void SetShortSsid(std::size_t nbrApInfoId, std::size_t index, uint32_t shortSsid)
Set the Short SSID field of the i-th TBTT Information field of the given Neighbor AP Information fiel...
uint32_t GetShortSsid(std::size_t nbrApInfoId, std::size_t index) const
Get the Short SSID field (must be present) in the i-th TBTT Information field of the given Neighbor A...
void SetBssid(std::size_t nbrApInfoId, std::size_t index, Mac48Address bssid)
Set the BSSID field of the i-th TBTT Information field of the given Neighbor AP Information field.
std::size_t GetNNbrApInfoFields(void) const
Get the number of Neighbor AP Information fields.
void AddNbrApInfoField(void)
Add a Neighbor AP Information field.
std::size_t GetNTbttInformationFields(std::size_t nbrApInfoId) const
Get the number of TBTT Information fields included in the TBTT Information Set field of the given Nei...
uint8_t GetLinkId(std::size_t nbrApInfoId, std::size_t index) const
Get the Link ID value in the MLD Parameters subfield (must be present) in the i-th TBTT Information f...
uint8_t GetMldId(std::size_t nbrApInfoId, std::size_t index) const
Get the MLD ID value in the MLD Parameters subfield (must be present) in the i-th TBTT Information fi...
void SetPsd20MHz(std::size_t nbrApInfoId, std::size_t index, uint8_t psd20MHz)
Set the 20 MHz PSD field of the i-th TBTT Information field of the given Neighbor AP Information fiel...
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
WifiPhyOperatingChannel GetOperatingChannel(std::size_t nbrApInfoId) const
Get the operating channel coded into the Operating Class and the Channel Number fields of the given N...
void SetBssParameters(std::size_t nbrApInfoId, std::size_t index, uint8_t bssParameters)
Set the BSS Parameters field of the i-th TBTT Information field of the given Neighbor AP Information ...
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t GetPsd20MHz(std::size_t nbrApInfoId, std::size_t index) const
Get the 20 MHz PSD field (must be present) in the i-th TBTT Information field of the given Neighbor A...
bool HasMldParameters(std::size_t nbrApInfoId) const
Return true if the MLD Parameters subfield is present in all the TBTT Information fields of the given...
void AddTbttInformationField(std::size_t nbrApInfoId)
Add a TBTT Information fields to the TBTT Information Set field of the given Neighbor AP Information ...
void ReadTbttInformationLength(std::size_t nbrApInfoId)
Use the TBTT Information Length field of the given Neighbor AP Information field to set the xxxPresen...
bool HasBssParameters(std::size_t nbrApInfoId) const
Return true if the BSS Parameters field is present in all the TBTT Information fields of the given Ne...
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
void SetOperatingChannel(std::size_t nbrApInfoId, const WifiPhyOperatingChannel &channel)
Set the Operating Class and the Channel Number fields of the given Neighbor AP Information field base...
bool HasPsd20MHz(std::size_t nbrApInfoId) const
Return true if the 20 MHz PSD field is present in all the TBTT Information fields of the given Neighb...
uint8_t GetBssParameters(std::size_t nbrApInfoId, std::size_t index) const
Get the BSS Parameters field (must be present) in the i-th TBTT Information field of the given Neighb...
Information element, as defined in 802.11-2007 standard.
Class that keeps track of all information about the current PHY operating channel.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
channel
Definition: third.py:83
def start()
Definition: core.py:1852
uint8_t bssParamsChangeCount
BSS Parameters Change Count.
std::vector< TbttInformation > tbttInformationSet
One or more TBTT Information fields.
bool hasMldParams
whether MLD Parameters is present in all TBTT Information fields
TbttInformationHeader tbttInfoHdr
TBTT Information header.
bool hasShortSsid
whether Short SSID is present in all TBTT Information fields
bool hasBssParams
whether BSS parameters is present in all TBTT Information fields
bool has20MHzPsd
whether 20 MHz PSD is present in all TBTT Information fields
bool hasBssid
whether BSSID is present in all TBTT Information fields
uint8_t tbttInfoLength
TBTT Information Length (8 bits)
uint8_t tbttInfoCount
TBTT Information Count (4 bits)
uint8_t type
TBTT Information Field Type (2 bits)
uint8_t neighborApTbttOffset
Neighbor AP TBTT Offset.
uint8_t bssParameters
BSS parameters (optional)
MldParameters mldParameters
MLD Parameters (optional)