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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Kirill Andreev <andreev@iitp.ru>
7 * Aleksey Kovalenko <kovalenko@iitp.ru>
8 */
9
10#ifndef IE_DOT11S_PEER_MANAGEMENT_H
11#define IE_DOT11S_PEER_MANAGEMENT_H
12
13#include "ns3/mesh-information-element-vector.h"
14
15namespace ns3
16{
17namespace dot11s
18{
19
20/**
21 * \ingroup dot11s
22 * \brief Codes used by 802.11s Peer Management Protocol
23 */
37
38/// according to IEEE 802.11 - 2012
40{
41 public:
43
44 /// Subtype enumeration
46 {
50 };
51
52 /**
53 * Set peer open function
54 * \param localLinkId
55 */
56 void SetPeerOpen(uint16_t localLinkId);
57 /**
58 * Set peer close function
59 * \param localLinkID the local link id
60 * \param peerLinkId the peer link id
61 * \param reasonCode the reason code
62 */
63 void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode);
64 /**
65 * Set peer confirm function
66 * \param localLinkID the local link id
67 * \param peerLinkId the peer link id
68 */
69 void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId);
70
71 /**
72 * Get reason code function
73 * \returns the reason code
74 */
76 /**
77 * Get local link ID function
78 * \returns the local link id
79 */
80 uint16_t GetLocalLinkId() const;
81 /**
82 * Get peer link ID function
83 * \returns the peer link ID
84 */
85 uint16_t GetPeerLinkId() const;
86 /**
87 * Subtype is open function
88 * \returns true if open
89 */
90 bool SubtypeIsOpen() const;
91 /**
92 * Subtype is close function
93 * \returns true if closed
94 */
95 bool SubtypeIsClose() const;
96 /**
97 * Subtype is confirm function
98 * \returns true if the subtype is confirm
99 */
100 bool SubtypeIsConfirm() const;
101 /**
102 * Get subtype function
103 * \returns the subtype
104 */
105 uint8_t GetSubtype() const;
106
107 // Inherited from WifiInformationElement
108 WifiInformationElementId ElementId() const override;
109 uint16_t GetInformationFieldSize() const override;
110 void SerializeInformationField(Buffer::Iterator i) const override;
111 uint16_t DeserializeInformationField(Buffer::Iterator i, uint16_t length) override;
112 void Print(std::ostream& os) const override;
113
114 private:
115 uint8_t m_length; ///< length
116 uint8_t m_subtype; ///< subtype
117 uint16_t m_localLinkId; ///< local link ID
118 /**
119 * Present within confirm and may be present in close
120 */
121 uint16_t m_peerLinkId;
122 /**
123 * Present only within close frame
124 */
126 /**
127 * equality operator
128 *
129 * \param a lhs
130 * \param b rhs
131 * \returns true if equal
132 */
133 friend bool operator==(const IePeerManagement& a, const IePeerManagement& b);
134};
135
136bool operator==(const IePeerManagement& a, const IePeerManagement& b);
137std::ostream& operator<<(std::ostream& os, const IePeerManagement& peerMan);
138} // namespace dot11s
139} // namespace ns3
140
141#endif /* IE_DOT11S_PEER_MANAGEMENT_H */
iterator in a Buffer instance
Definition buffer.h:89
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.