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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Kirill Andreev <andreev@iitp.ru>
7 */
8
9#ifndef PEER_LINK_FRAME_START_H
10#define PEER_LINK_FRAME_START_H
11#include "dot11s-mac-header.h"
13#include "ie-dot11s-id.h"
15
16#include "ns3/header.h"
17#include "ns3/supported-rates.h"
18
19#include <optional>
20
21namespace ns3
22{
23namespace dot11s
24{
25/**
26 * \ingroup dot11s
27 *
28 * \brief 802.11s Peer link open management frame
29 *
30 * Peer link open start frame includes the following:
31 * - Capability
32 * - Supported rates
33 * - Mesh ID of mesh
34 * - Configuration
35 */
37{
38 public:
40
41 // Delete copy constructor and assignment operator to avoid misuse
44
45 /// \brief fields:
47 {
48 IePeeringProtocol protocol; ///< Peering protocol version - 3 octets
49 uint16_t capability; ///< open and confirm
50 SupportedRates rates; ///< open and confirm
51 std::optional<ExtendedSupportedRatesIE> extendedRates; ///< open and confirm
52 IeMeshId meshId; ///< open and close
53 IeConfiguration config; ///< open and confirm
54 };
55
56 /**
57 * Set peer link open start fields
58 * \param fields PlinkOpenStartFields to set
59 */
61 /**
62 * Get peer link open start fields
63 * \return PlinkOpenStartFields
64 */
66
67 /**
68 * \brief Get the type ID.
69 * \return the object TypeId
70 */
71 static TypeId GetTypeId();
72 // Inherited from header:
73 TypeId GetInstanceTypeId() const override;
74 void Print(std::ostream& os) const override;
75 uint32_t GetSerializedSize() const override;
76 void Serialize(Buffer::Iterator start) const override;
78
79 private:
80 uint16_t m_capability; ///< capability
82 std::optional<ExtendedSupportedRatesIE> m_extendedRates; ///< extended rates
83 IeMeshId m_meshId; ///< mesh ID
85
86 /**
87 * equality operator
88 *
89 * \param a lhs
90 * \param b rhs
91 * \returns true if equal
92 */
93 friend bool operator==(const PeerLinkOpenStart& a, const PeerLinkOpenStart& b);
94};
95
96bool operator==(const PeerLinkOpenStart& a, const PeerLinkOpenStart& b);
97
98/**
99 * \ingroup dot11s
100 *
101 * \brief 802.11s Peer link close management frame
102 *
103 * Peer link close frame includes the following:
104 * - Mesh ID of mesh
105 */
107{
108 public:
110
111 // Delete copy constructor and assignment operator to avoid misuse
114
115 /// \brief fields:
117 {
118 IePeeringProtocol protocol; ///< Peering protocol version - 3 octets
119 IeMeshId meshId; ///< open and close
120 };
121
122 /**
123 * Set peer link close start fields
124 * \param fields PlinkCloseStartFields to set
125 */
127 /**
128 * Get peer link close start fields
129 * \return PlinkOpenStartFields
130 */
132
133 /**
134 * \brief Get the type ID.
135 * \return the object TypeId
136 */
137 static TypeId GetTypeId();
138 // Inherited from header:
139 TypeId GetInstanceTypeId() const override;
140 void Print(std::ostream& os) const override;
141 uint32_t GetSerializedSize() const override;
142 void Serialize(Buffer::Iterator start) const override;
143 uint32_t Deserialize(Buffer::Iterator start) override;
144
145 private:
146 IeMeshId m_meshId; ///< mesh ID
147
148 /**
149 * equality operator
150 *
151 * \param a lhs
152 * \param b rhs
153 * \returns true if equal
154 */
155 friend bool operator==(const PeerLinkCloseStart& a, const PeerLinkCloseStart& b);
156};
157
158bool operator==(const PeerLinkCloseStart& a, const PeerLinkCloseStart& b);
159
160/**
161 * \ingroup dot11s
162 *
163 * \brief 802.11s Peer link confirm management frame
164 *
165 * Peer link confirm frame includes the following:
166 * - Association ID field
167 * - Supported rates
168 * - Configuration
169 */
171{
172 public:
174
175 // Delete copy constructor and assignment operator to avoid misuse
178
179 /// \brief fields:
181 {
182 IePeeringProtocol protocol; ///< Peering protocol version - 3 octets
183 uint16_t capability; ///< open and confirm
184 uint16_t aid; ///< confirm only
185 SupportedRates rates; ///< open and confirm
186 std::optional<ExtendedSupportedRatesIE> extendedRates; ///< open and confirm
187 IeConfiguration config; ///< open and confirm
188 };
189
190 /**
191 * Set peer link confirm start fields
192 * \param fields PlinkCloseStartFields to set
193 */
195 /**
196 * Get peer link confirm start fields
197 * \return PlinkOpenStartFields
198 */
200
201 /**
202 * \brief Get the type ID.
203 * \return the object TypeId
204 */
205 static TypeId GetTypeId();
206 // Inherited from header:
207 TypeId GetInstanceTypeId() const override;
208 void Print(std::ostream& os) const override;
209 uint32_t GetSerializedSize() const override;
210 void Serialize(Buffer::Iterator start) const override;
211 uint32_t Deserialize(Buffer::Iterator start) override;
212
213 private:
214 uint16_t m_capability; ///< capability
215 uint16_t m_aid; ///< aid
217 std::optional<ExtendedSupportedRatesIE> m_extendedRates; ///< extended rates
219
220 /**
221 * equality operator
222 *
223 * \param a lhs
224 * \param b rhs
225 * \returns true if equal
226 */
227 friend bool operator==(const PeerLinkConfirmStart& a, const PeerLinkConfirmStart& b);
228};
229
231} // namespace dot11s
232} // namespace ns3
233#endif
iterator in a Buffer instance
Definition buffer.h:89
Protocol header serialization and deserialization.
Definition header.h:33
The Supported Rates Information Element.
a unique identifier for an interface.
Definition type-id.h:48
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)
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.