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 * 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
26namespace ns3
27{
28namespace 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{
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
68/**
69 * \ingroup dot11s
70 * A set of values indicating whether a mesh STA is a possible candidate
71 * for mesh peering establishment (Section 8.4.2.100.8 of IEEE 802.11-2012)
72 */
74{
75 public:
77 /**
78 * Size of the field in bytes when serialized
79 * \returns the serialized size in bytes
80 */
81 uint8_t GetSerializedSize() const;
82 /**
83 * Serialize to a buffer
84 * \param i the iterator of the buffer to serialize to
85 * \returns new value of the iterator
86 */
88 /**
89 * Deserialize from a buffer
90 * \param i the iterator from which to deserialize
91 * \returns new value of the iterator
92 */
94 /**
95 * The Mesh Capability is expressed in terms of 8 single bit fields.
96 * This method returns the whole byte.
97 * \returns the Mesh Capability byte
98 */
99 uint8_t GetUint8() const;
100 bool acceptPeerLinks; ///< accept peer links
101 bool MCCASupported; ///< MCCA supported
102 bool MCCAEnabled; ///< MCCA enabled
103 bool forwarding; ///< forwarding?
104 bool beaconTimingReport; ///< beacon timing report
105 bool TBTTAdjustment; ///< TBTT adjustment
106 bool powerSaveLevel; ///< power save level
107 /**
108 * This is a utility function to test if the bit at position n is true
109 * \param cap byte to test
110 * \param n bit number to mask
111 * \returns true if bit n is set in cap
112 */
113 bool Is(uint8_t cap, uint8_t n) const;
114 /**
115 * equality operator
116 *
117 * \param a lhs
118 * \param b rhs
119 * \returns true if equal
120 */
121 friend bool operator==(const Dot11sMeshCapability& a, const Dot11sMeshCapability& b);
122};
123
124/**
125 * \ingroup dot11s
126 * \brief Describes Mesh Configuration Element
127 * see 7.3.2.86 of 802.11s draft 3.0
128 */
130{
131 public:
133 /**
134 * Set routing value
135 * \param routingId the routing ID
136 */
138 /**
139 * Set metric value
140 * \param metricId the path selection metric
141 */
143 /**
144 * Is HWMP function
145 * \returns true if Active Path Selection Protocol Identifier field set
146 * to HWMP
147 */
148 bool IsHWMP();
149 /**
150 * Is airtime function
151 * \returns true if Active Path Selection Metric Identifier is set to
152 * airtime link metric
153 */
154 bool IsAirtime();
155 /**
156 * Set neighbor count
157 * \param neighbors the number of neighbors
158 */
159 void SetNeighborCount(uint8_t neighbors);
160 /**
161 * Get neighbor count
162 * \returns the the neighbor count
163 */
164 uint8_t GetNeighborCount() const;
165 /**
166 * Mesh capability
167 * \returns the dot11s mesh capability
168 */
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:
179 /** Active Path Selection Protocol ID */
181 /** Active Path Metric ID */
183 /** Congestion Control Mode ID */
185 /** Sync protocol ID */
187 /** Auth protocol ID */
189 /** Mesh capability */
191 uint8_t m_neighbors; ///< neighbors
192 /**
193 * equality operator
194 *
195 * \param a lhs
196 * \param b rhs
197 * \returns true if equal
198 */
199 friend bool operator==(const IeConfiguration& a, const IeConfiguration& b);
200};
201
202bool operator==(const IeConfiguration& a, const IeConfiguration& b);
204std::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.