A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
peer-link-frame.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 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 */
19
20#ifndef PEER_LINK_FRAME_START_H
21#define PEER_LINK_FRAME_START_H
22#include "dot11s-mac-header.h"
24#include "ie-dot11s-id.h"
26
27#include "ns3/header.h"
28#include "ns3/supported-rates.h"
29
30#include <optional>
31
32namespace ns3
33{
34namespace dot11s
35{
36/**
37 * \ingroup dot11s
38 *
39 * \brief 802.11s Peer link open management frame
40 *
41 * Peer link open start frame includes the following:
42 * - Capability
43 * - Supported rates
44 * - Mesh ID of mesh
45 * - Configuration
46 */
48{
49 public:
51
52 // Delete copy constructor and assignment operator to avoid misuse
55
56 ///\brief fields:
58 {
59 IePeeringProtocol protocol; ///< Peering protocol version - 3 octets
60 uint16_t capability; ///< open and confirm
61 SupportedRates rates; ///< open and confirm
62 std::optional<ExtendedSupportedRatesIE> extendedRates; ///< open and confirm
63 IeMeshId meshId; ///< open and close
64 IeConfiguration config; ///< open and confirm
65 };
66
67 /**
68 * Set peer link open start fields
69 * \param fields PlinkOpenStartFields to set
70 */
72 /**
73 * Get peer link open start fields
74 * \return PlinkOpenStartFields
75 */
77
78 /**
79 * \brief Get the type ID.
80 * \return the object TypeId
81 */
82 static TypeId GetTypeId();
83 // Inherited from header:
84 TypeId GetInstanceTypeId() const override;
85 void Print(std::ostream& os) const override;
86 uint32_t GetSerializedSize() const override;
87 void Serialize(Buffer::Iterator start) const override;
89
90 private:
91 uint16_t m_capability; ///< capability
93 std::optional<ExtendedSupportedRatesIE> m_extendedRates; ///< extended rates
94 IeMeshId m_meshId; ///< mesh ID
96
97 /**
98 * equality operator
99 *
100 * \param a lhs
101 * \param b rhs
102 * \returns true if equal
103 */
104 friend bool operator==(const PeerLinkOpenStart& a, const PeerLinkOpenStart& b);
105};
106
107bool operator==(const PeerLinkOpenStart& a, const PeerLinkOpenStart& b);
108
109/**
110 * \ingroup dot11s
111 *
112 * \brief 802.11s Peer link close management frame
113 *
114 * Peer link close frame includes the following:
115 * - Mesh ID of mesh
116 */
118{
119 public:
121
122 // Delete copy constructor and assignment operator to avoid misuse
125
126 ///\brief fields:
128 {
129 IePeeringProtocol protocol; ///< Peering protocol version - 3 octets
130 IeMeshId meshId; ///< open and close
131 };
132
133 /**
134 * Set peer link close start fields
135 * \param fields PlinkCloseStartFields to set
136 */
138 /**
139 * Get peer link close start fields
140 * \return PlinkOpenStartFields
141 */
143
144 /**
145 * \brief Get the type ID.
146 * \return the object TypeId
147 */
148 static TypeId GetTypeId();
149 // Inherited from header:
150 TypeId GetInstanceTypeId() const override;
151 void Print(std::ostream& os) const override;
152 uint32_t GetSerializedSize() const override;
153 void Serialize(Buffer::Iterator start) const override;
154 uint32_t Deserialize(Buffer::Iterator start) override;
155
156 private:
157 IeMeshId m_meshId; ///< mesh ID
158
159 /**
160 * equality operator
161 *
162 * \param a lhs
163 * \param b rhs
164 * \returns true if equal
165 */
166 friend bool operator==(const PeerLinkCloseStart& a, const PeerLinkCloseStart& b);
167};
168
169bool operator==(const PeerLinkCloseStart& a, const PeerLinkCloseStart& b);
170
171/**
172 * \ingroup dot11s
173 *
174 * \brief 802.11s Peer link confirm management frame
175 *
176 * Peer link confirm frame includes the following:
177 * - Association ID field
178 * - Supported rates
179 * - Configuration
180 */
182{
183 public:
185
186 // Delete copy constructor and assignment operator to avoid misuse
189
190 ///\brief fields:
192 {
193 IePeeringProtocol protocol; ///< Peering protocol version - 3 octets
194 uint16_t capability; ///< open and confirm
195 uint16_t aid; ///< confirm only
196 SupportedRates rates; ///< open and confirm
197 std::optional<ExtendedSupportedRatesIE> extendedRates; ///< open and confirm
198 IeConfiguration config; ///< open and confirm
199 };
200
201 /**
202 * Set peer link confirm start fields
203 * \param fields PlinkCloseStartFields to set
204 */
206 /**
207 * Get peer link confirm start fields
208 * \return PlinkOpenStartFields
209 */
211
212 /**
213 * \brief Get the type ID.
214 * \return the object TypeId
215 */
216 static TypeId GetTypeId();
217 // Inherited from header:
218 TypeId GetInstanceTypeId() const override;
219 void Print(std::ostream& os) const override;
220 uint32_t GetSerializedSize() const override;
221 void Serialize(Buffer::Iterator start) const override;
222 uint32_t Deserialize(Buffer::Iterator start) override;
223
224 private:
225 uint16_t m_capability; ///< capability
226 uint16_t m_aid; ///< aid
228 std::optional<ExtendedSupportedRatesIE> m_extendedRates; ///< extended rates
230
231 /**
232 * equality operator
233 *
234 * \param a lhs
235 * \param b rhs
236 * \returns true if equal
237 */
238 friend bool operator==(const PeerLinkConfirmStart& a, const PeerLinkConfirmStart& b);
239};
240
242} // namespace dot11s
243} // namespace ns3
244#endif
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
The Supported Rates Information Element.
a unique identifier for an interface.
Definition: type-id.h:59
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
a IEEE 802.11 Mesh ID element (Section 8.4.2.101 of IEEE 802.11-2012)
Definition: ie-dot11s-id.h:37
Mesh Peering Protocol Identifier information element Note that it does not permit to set any value be...
bool operator==(const MeshHeader &a, const MeshHeader &b)
Every class exported by the ns3 library is enclosed in the ns3 namespace.