A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ie-dot11s-peer-management.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 IE_DOT11S_PEER_MANAGEMENT_H
22#define IE_DOT11S_PEER_MANAGEMENT_H
23
24#include "ns3/mesh-information-element-vector.h"
25
26namespace ns3
27{
28namespace dot11s
29{
30
31/**
32 * \ingroup dot11s
33 * \brief Codes used by 802.11s Peer Management Protocol
34 */
36{
37 REASON11S_PEERING_CANCELLED = 52, // according to IEEE 802.11 - 2012
47};
48
49/// according to IEEE 802.11 - 2012
51{
52 public:
54
55 /// Subtype enumeration
57 {
61 };
62
63 /**
64 * Set peer open function
65 * \param localLinkId
66 */
67 void SetPeerOpen(uint16_t localLinkId);
68 /**
69 * Set peer close function
70 * \param localLinkID the local link id
71 * \param peerLinkId the peer link id
72 * \param reasonCode the reason code
73 */
74 void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode);
75 /**
76 * Set peer confirm function
77 * \param localLinkID the local link id
78 * \param peerLinkId the peer link id
79 */
80 void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId);
81
82 /**
83 * Get reason code function
84 * \returns the reason code
85 */
87 /**
88 * Get local link ID function
89 * \returns the local link id
90 */
91 uint16_t GetLocalLinkId() const;
92 /**
93 * Get peer link ID function
94 * \returns the peer link ID
95 */
96 uint16_t GetPeerLinkId() const;
97 /**
98 * Subtype is open function
99 * \returns true if open
100 */
101 bool SubtypeIsOpen() const;
102 /**
103 * Subtype is close function
104 * \returns true if closed
105 */
106 bool SubtypeIsClose() const;
107 /**
108 * Subtype is confirm function
109 * \returns true if the subtype is confirm
110 */
111 bool SubtypeIsConfirm() const;
112 /**
113 * Get subtype function
114 * \returns the subtype
115 */
116 uint8_t GetSubtype() const;
117
118 // Inherited from WifiInformationElement
119 WifiInformationElementId ElementId() const override;
120 uint16_t GetInformationFieldSize() const override;
121 void SerializeInformationField(Buffer::Iterator i) const override;
122 uint16_t DeserializeInformationField(Buffer::Iterator i, uint16_t length) override;
123 void Print(std::ostream& os) const override;
124
125 private:
126 uint8_t m_length; ///< length
127 uint8_t m_subtype; ///< subtype
128 uint16_t m_localLinkId; ///< local link ID
129 /**
130 * Present within confirm and may be present in close
131 */
132 uint16_t m_peerLinkId;
133 /**
134 * Present only within close frame
135 */
137 /**
138 * equality operator
139 *
140 * \param a lhs
141 * \param b rhs
142 * \returns true if equal
143 */
144 friend bool operator==(const IePeerManagement& a, const IePeerManagement& b);
145};
146
147bool operator==(const IePeerManagement& a, const IePeerManagement& b);
148std::ostream& operator<<(std::ostream& os, const IePeerManagement& peerMan);
149} // namespace dot11s
150} // namespace ns3
151
152#endif /* IE_DOT11S_PEER_MANAGEMENT_H */
iterator in a Buffer instance
Definition: buffer.h:100
Information element, as defined in 802.11-2007 standard.
according to IEEE 802.11 - 2012
uint16_t m_peerLinkId
Present within confirm and may be present in close.
bool SubtypeIsOpen() const
Subtype is open function.
PmpReasonCode m_reasonCode
Present only within close frame.
bool SubtypeIsClose() const
Subtype is close function.
PmpReasonCode GetReasonCode() const
Get reason code function.
void SerializeInformationField(Buffer::Iterator i) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
bool SubtypeIsConfirm() const
Subtype is confirm function.
void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId)
Set peer confirm function.
uint8_t GetSubtype() const
Get subtype function.
uint16_t GetPeerLinkId() const
Get peer link ID function.
void SetPeerOpen(uint16_t localLinkId)
Set peer open function.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
friend bool operator==(const IePeerManagement &a, const IePeerManagement &b)
equality operator
void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode)
Set peer close function.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint16_t GetLocalLinkId() const
Get local link ID function.
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)
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
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.