A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ie-dot11s-configuration.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008,2009 IITP RAS
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Kirill Andreev <andreev@iitp.ru>
7 * Aleksey Kovalenko <kovalenko@iitp.ru>
8 */
9
10#ifndef MESH_CONFIGURATION_H
11#define MESH_CONFIGURATION_H
12
13#include "ns3/mesh-information-element-vector.h"
14
15namespace ns3
16{
17namespace dot11s
18{
19
20// according to IEEE 802.11 - 2012
21
22// in 7.3.2.98.2 Active Path Selection Protocol Identifier - 802.11s-2011
27
28// in 7.3.2.98.3 Active Path Selection Metric Identifier - 802.11s-2011
33
34// in 7.3.2.98.4 Congestion Control Mode Identifier - 802.11s-2011
40
41// in 7.3.2.98.5 Synchronization Method Identifier - 802.11s-2011
43{
44 SYNC_NEIGHBOUR_OFFSET = 0x01, // Neighbor offset synchronization method
45 SYNC_NULL = 0x00, // Reserved
46};
47
48// in 7.3.2.98.6 Authentication Protocol Identifier - 802.11s-2011
50{
51 AUTH_NULL =
52 0x00, // No authentication method is required to establish mesh peerings within the MBSS
53 AUTH_SAE = 0x01, // SAE defined in 8.2a
54 AUTH_IEEE = 0x02, // IEEE 802.1X authentication
55};
56
57/**
58 * \ingroup dot11s
59 * A set of values indicating whether a mesh STA is a possible candidate
60 * for mesh peering establishment (Section 8.4.2.100.8 of IEEE 802.11-2012)
61 */
63{
64 public:
66 /**
67 * Size of the field in bytes when serialized
68 * \returns the serialized size in bytes
69 */
70 uint8_t GetSerializedSize() const;
71 /**
72 * Serialize to a buffer
73 * \param i the iterator of the buffer to serialize to
74 * \returns new value of the iterator
75 */
77 /**
78 * Deserialize from a buffer
79 * \param i the iterator from which to deserialize
80 * \returns new value of the iterator
81 */
83 /**
84 * The Mesh Capability is expressed in terms of 8 single bit fields.
85 * This method returns the whole byte.
86 * \returns the Mesh Capability byte
87 */
88 uint8_t GetUint8() const;
89 bool acceptPeerLinks; ///< accept peer links
90 bool MCCASupported; ///< MCCA supported
91 bool MCCAEnabled; ///< MCCA enabled
92 bool forwarding; ///< forwarding?
93 bool beaconTimingReport; ///< beacon timing report
94 bool TBTTAdjustment; ///< TBTT adjustment
95 bool powerSaveLevel; ///< power save level
96 /**
97 * This is a utility function to test if the bit at position n is true
98 * \param cap byte to test
99 * \param n bit number to mask
100 * \returns true if bit n is set in cap
101 */
102 bool Is(uint8_t cap, uint8_t n) const;
103 /**
104 * equality operator
105 *
106 * \param a lhs
107 * \param b rhs
108 * \returns true if equal
109 */
110 friend bool operator==(const Dot11sMeshCapability& a, const Dot11sMeshCapability& b);
111};
112
113/**
114 * \ingroup dot11s
115 * \brief Describes Mesh Configuration Element
116 * see 7.3.2.86 of 802.11s draft 3.0
117 */
119{
120 public:
122 /**
123 * Set routing value
124 * \param routingId the routing ID
125 */
127 /**
128 * Set metric value
129 * \param metricId the path selection metric
130 */
132 /**
133 * Is HWMP function
134 * \returns true if Active Path Selection Protocol Identifier field set
135 * to HWMP
136 */
137 bool IsHWMP();
138 /**
139 * Is airtime function
140 * \returns true if Active Path Selection Metric Identifier is set to
141 * airtime link metric
142 */
143 bool IsAirtime();
144 /**
145 * Set neighbor count
146 * \param neighbors the number of neighbors
147 */
148 void SetNeighborCount(uint8_t neighbors);
149 /**
150 * Get neighbor count
151 * \returns the the neighbor count
152 */
153 uint8_t GetNeighborCount() const;
154 /**
155 * Mesh capability
156 * \returns the dot11s mesh capability
157 */
159
160 // Inherited from WifiInformationElement
161 WifiInformationElementId ElementId() const override;
162 uint16_t GetInformationFieldSize() const override;
163 void SerializeInformationField(Buffer::Iterator i) const override;
164 uint16_t DeserializeInformationField(Buffer::Iterator i, uint16_t length) override;
165 void Print(std::ostream& os) const override;
166
167 private:
168 /** Active Path Selection Protocol ID */
170 /** Active Path Metric ID */
172 /** Congestion Control Mode ID */
174 /** Sync protocol ID */
176 /** Auth protocol ID */
178 /** Mesh capability */
180 uint8_t m_neighbors; ///< neighbors
181 /**
182 * equality operator
183 *
184 * \param a lhs
185 * \param b rhs
186 * \returns true if equal
187 */
188 friend bool operator==(const IeConfiguration& a, const IeConfiguration& b);
189};
190
191bool operator==(const IeConfiguration& a, const IeConfiguration& b);
193std::ostream& operator<<(std::ostream& os, const IeConfiguration& config);
194} // namespace dot11s
195} // namespace ns3
196#endif
iterator in a Buffer instance
Definition buffer.h:89
Information element, as defined in 802.11-2007 standard.
A set of values indicating whether a mesh STA is a possible candidate for mesh peering establishment ...
friend bool operator==(const Dot11sMeshCapability &a, const Dot11sMeshCapability &b)
equality operator
uint8_t GetUint8() const
The Mesh Capability is expressed in terms of 8 single bit fields.
Buffer::Iterator Serialize(Buffer::Iterator i) const
Serialize to a buffer.
uint8_t GetSerializedSize() const
Size of the field in bytes when serialized.
bool Is(uint8_t cap, uint8_t n) const
This is a utility function to test if the bit at position n is true.
bool beaconTimingReport
beacon timing report
Buffer::Iterator Deserialize(Buffer::Iterator i)
Deserialize from a buffer.
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
void SetNeighborCount(uint8_t neighbors)
Set neighbor count.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
void SerializeInformationField(Buffer::Iterator i) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
Dot11sMeshCapability m_meshCap
Mesh capability.
void SetMetric(Dot11sPathSelectionMetric metricId)
Set metric value.
const Dot11sMeshCapability & MeshCapability()
Mesh capability.
Dot11sPathSelectionMetric m_APSMId
Active Path Metric ID.
Dot11sAuthenticationProtocol m_APId
Auth protocol ID.
uint16_t DeserializeInformationField(Buffer::Iterator i, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
Dot11sCongestionControlMode m_CCMId
Congestion Control Mode ID.
Dot11sSynchronizationProtocolIdentifier m_SPId
Sync protocol ID.
Dot11sPathSelectionProtocol m_APSPId
Active Path Selection Protocol ID.
uint8_t GetNeighborCount() const
Get neighbor count.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
friend bool operator==(const IeConfiguration &a, const IeConfiguration &b)
equality operator
void SetRouting(Dot11sPathSelectionProtocol routingId)
Set routing value.
bool IsAirtime()
Is airtime function.
bool operator==(const MeshHeader &a, const MeshHeader &b)
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)
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.