A Discrete-Event Network Simulator
API
ie-dot11s-configuration.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008,2009 IITP RAS
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  * Authors: Kirill Andreev <andreev@iitp.ru>
18  * Aleksey Kovalenko <kovalenko@iitp.ru>
19  */
20 
21 #ifndef MESH_CONFIGURATION_H
22 #define MESH_CONFIGURATION_H
23 
24 #include "ns3/mesh-information-element-vector.h"
25 
26 namespace ns3
27 {
28 namespace dot11s
29 {
30 
31 // according to IEEE 802.11 - 2012
32 
33 // in 7.3.2.98.2 Active Path Selection Protocol Identifier - 802.11s-2011
35 {
36  PROTOCOL_HWMP = 0x01,
37 };
38 
39 // in 7.3.2.98.3 Active Path Selection Metric Identifier - 802.11s-2011
41 {
43 };
44 
45 // in 7.3.2.98.4 Congestion Control Mode Identifier - 802.11s-2011
47 {
50 };
51 
52 // in 7.3.2.98.5 Synchronization Method Identifier - 802.11s-2011
54 {
55  SYNC_NEIGHBOUR_OFFSET = 0x01, // Neighbor offset synchronization method
56  SYNC_NULL = 0x00, // Reserved
57 };
58 
59 // in 7.3.2.98.6 Authentication Protocol Identifier - 802.11s-2011
61 {
62  AUTH_NULL =
63  0x00, // No authentication method is required to establish mesh peerings within the MBSS
64  AUTH_SAE = 0x01, // SAE defined in 8.2a
65  AUTH_IEEE = 0x02, // IEEE 802.1X authentication
66 };
67 
74 {
75  public:
81  uint8_t GetSerializedSize() const;
99  uint8_t GetUint8() const;
102  bool MCCAEnabled;
103  bool forwarding;
113  bool Is(uint8_t cap, uint8_t n) const;
121  friend bool operator==(const Dot11sMeshCapability& a, const Dot11sMeshCapability& b);
122 };
123 
130 {
131  public:
132  IeConfiguration();
137  void SetRouting(Dot11sPathSelectionProtocol routingId);
142  void SetMetric(Dot11sPathSelectionMetric metricId);
148  bool IsHWMP();
154  bool IsAirtime();
159  void SetNeighborCount(uint8_t neighbors);
164  uint8_t GetNeighborCount() const;
170 
171  // Inherited from WifiInformationElement
172  WifiInformationElementId ElementId() const override;
173  uint16_t GetInformationFieldSize() const override;
174  void SerializeInformationField(Buffer::Iterator i) const override;
175  uint16_t DeserializeInformationField(Buffer::Iterator i, uint16_t length) override;
176  void Print(std::ostream& os) const override;
177 
178  private:
191  uint8_t m_neighbors;
199  friend bool operator==(const IeConfiguration& a, const IeConfiguration& b);
200 };
201 
202 bool operator==(const IeConfiguration& a, const IeConfiguration& b);
203 bool operator==(const Dot11sMeshCapability& a, const Dot11sMeshCapability& b);
204 std::ostream& operator<<(std::ostream& os, const IeConfiguration& config);
205 } // namespace dot11s
206 } // namespace ns3
207 #endif
iterator in a Buffer instance
Definition: buffer.h:100
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.