A Discrete-Event Network Simulator
API
ie-dot11s-peer-management.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008,2009 IITP RAS
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Kirill Andreev <andreev@iitp.ru>
19  * Aleksey Kovalenko <kovalenko@iitp.ru>
20  */
21 
22 #ifndef IE_DOT11S_PEER_MANAGEMENT_H
23 #define IE_DOT11S_PEER_MANAGEMENT_H
24 
25 #include "ns3/mesh-information-element-vector.h"
26 
27 namespace ns3 {
28 namespace dot11s {
29 
35 {
36  REASON11S_PEERING_CANCELLED = 52, // according to IEEE 802.11 - 2012
46 };
47 
48 
51 {
52 public:
55  enum Subtype
56  {
57  PEER_OPEN = 1,
60  };
65  void SetPeerOpen (uint16_t localLinkId);
72  void SetPeerClose (uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode);
78  void SetPeerConfirm (uint16_t localLinkID, uint16_t peerLinkId);
79 
89  uint16_t GetLocalLinkId () const;
94  uint16_t GetPeerLinkId () const;
99  bool SubtypeIsOpen () const;
104  bool SubtypeIsClose () const;
109  bool SubtypeIsConfirm () const;
114  uint8_t GetSubtype () const;
115 
116  // Inherited from WifiInformationElement
117  virtual WifiInformationElementId ElementId () const;
118  virtual uint8_t GetInformationFieldSize (void) const;
119  virtual void SerializeInformationField (Buffer::Iterator i) const;
120  virtual uint8_t DeserializeInformationField (Buffer::Iterator i, uint8_t length);
121  virtual void Print (std::ostream& os) const;
122 
123 private:
124  uint8_t m_length;
125  uint8_t m_subtype;
126  uint16_t m_localLinkId;
127 
130  uint16_t m_peerLinkId;
142  friend bool operator== (const IePeerManagement & a, const IePeerManagement & b);
143 };
144 bool operator== (const IePeerManagement & a, const IePeerManagement & b);
145 std::ostream &operator << (std::ostream &os, const IePeerManagement &peerMan);
146 } // namespace dot11s
147 } // namespace ns3
148 
149 #endif /* IE_DOT11S_PEER_MANAGEMENT_H */
ns3::dot11s::IePeerManagement::PEER_CLOSE
@ PEER_CLOSE
Definition: ie-dot11s-peer-management.h:59
ns3::dot11s::IePeerManagement::GetReasonCode
PmpReasonCode GetReasonCode() const
Get reason code function.
Definition: ie-dot11s-peer-management.cc:65
ns3::dot11s::IePeerManagement::SubtypeIsOpen
bool SubtypeIsOpen() const
Subtype is open function.
Definition: ie-dot11s-peer-management.cc:93
ns3::dot11s::operator==
bool operator==(const MeshHeader &a, const MeshHeader &b)
Definition: dot11s-mac-header.cc:172
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::dot11s::IePeerManagement::m_length
uint8_t m_length
length
Definition: ie-dot11s-peer-management.h:124
ns3::WifiInformationElement
Information element, as defined in 802.11-2007 standard.
Definition: wifi-information-element.h:234
ns3::dot11s::IePeerManagement::GetLocalLinkId
uint16_t GetLocalLinkId() const
Get local link ID function.
Definition: ie-dot11s-peer-management.cc:71
ns3::dot11s::REASON11S_MESH_CLOSE_RCVD
@ REASON11S_MESH_CLOSE_RCVD
Definition: ie-dot11s-peer-management.h:39
ns3::dot11s::PmpReasonCode
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
Definition: ie-dot11s-peer-management.h:35
ns3::dot11s::REASON11S_RESERVED
@ REASON11S_RESERVED
Definition: ie-dot11s-peer-management.h:45
ns3::dot11s::IePeerManagement::operator==
friend bool operator==(const IePeerManagement &a, const IePeerManagement &b)
equality operator
Definition: ie-dot11s-peer-management.cc:162
ns3::WifiInformationElementId
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
Definition: wifi-information-element.h:40
ns3::dot11s::IePeerManagement::Print
virtual void Print(std::ostream &os) const
Generate human-readable form of IE.
Definition: ie-dot11s-peer-management.cc:152
ns3::dot11s::IePeerManagement::GetPeerLinkId
uint16_t GetPeerLinkId() const
Get peer link ID function.
Definition: ie-dot11s-peer-management.cc:77
ns3::dot11s::IePeerManagement::GetInformationFieldSize
virtual uint8_t GetInformationFieldSize(void) const
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Definition: ie-dot11s-peer-management.cc:83
ns3::dot11s::IePeerManagement::SetPeerClose
void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode)
Set peer close function.
Definition: ie-dot11s-peer-management.cc:46
ns3::dot11s::IePeerManagement::SerializeInformationField
virtual void SerializeInformationField(Buffer::Iterator i) const
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition: ie-dot11s-peer-management.cc:109
ns3::dot11s::REASON11S_MESH_INCONSISTENT_PARAMETERS
@ REASON11S_MESH_INCONSISTENT_PARAMETERS
Definition: ie-dot11s-peer-management.h:43
ns3::dot11s::IePeerManagement::m_localLinkId
uint16_t m_localLinkId
local link ID
Definition: ie-dot11s-peer-management.h:126
ns3::dot11s::IePeerManagement::PEER_OPEN
@ PEER_OPEN
Definition: ie-dot11s-peer-management.h:57
ns3::dot11s::REASON11S_PEERING_CANCELLED
@ REASON11S_PEERING_CANCELLED
Definition: ie-dot11s-peer-management.h:36
ns3::dot11s::REASON11S_MESH_INVALID_SECURITY_CAPABILITY
@ REASON11S_MESH_INVALID_SECURITY_CAPABILITY
Definition: ie-dot11s-peer-management.h:44
ns3::dot11s::IePeerManagement::m_subtype
uint8_t m_subtype
subtype
Definition: ie-dot11s-peer-management.h:125
ns3::dot11s::IePeerManagement::GetSubtype
uint8_t GetSubtype() const
Get subtype function.
Definition: ie-dot11s-peer-management.cc:88
ns3::dot11s::IePeerManagement::IePeerManagement
IePeerManagement()
Definition: ie-dot11s-peer-management.cc:29
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition: buffer.h:99
ns3::dot11s::REASON11S_MESH_MAX_PEERS
@ REASON11S_MESH_MAX_PEERS
Definition: ie-dot11s-peer-management.h:37
ns3::dot11s::REASON11S_MESH_CONFIRM_TIMEOUT
@ REASON11S_MESH_CONFIRM_TIMEOUT
Definition: ie-dot11s-peer-management.h:41
ns3::dot11s::IePeerManagement::SetPeerConfirm
void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId)
Set peer confirm function.
Definition: ie-dot11s-peer-management.cc:56
ns3::dot11s::IePeerManagement::PEER_CONFIRM
@ PEER_CONFIRM
Definition: ie-dot11s-peer-management.h:58
ns3::dot11s::IePeerManagement::Subtype
Subtype
Subtype enumeration.
Definition: ie-dot11s-peer-management.h:56
ns3::dot11s::REASON11S_MESH_MAX_RETRIES
@ REASON11S_MESH_MAX_RETRIES
Definition: ie-dot11s-peer-management.h:40
ns3::dot11s::IePeerManagement::m_reasonCode
PmpReasonCode m_reasonCode
Present only within close frame.
Definition: ie-dot11s-peer-management.h:134
ns3::dot11s::IePeerManagement::DeserializeInformationField
virtual uint8_t DeserializeInformationField(Buffer::Iterator i, uint8_t length)
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition: ie-dot11s-peer-management.cc:123
ns3::dot11s::IePeerManagement::ElementId
virtual WifiInformationElementId ElementId() const
Definition: ie-dot11s-peer-management.cc:34
ns3::dot11s::IePeerManagement::SubtypeIsConfirm
bool SubtypeIsConfirm() const
Subtype is confirm function.
Definition: ie-dot11s-peer-management.cc:103
ns3::dot11s::operator<<
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)
Definition: ie-dot11s-beacon-timing.cc:215
ns3::dot11s::REASON11S_MESH_CAPABILITY_POLICY_VIOLATION
@ REASON11S_MESH_CAPABILITY_POLICY_VIOLATION
Definition: ie-dot11s-peer-management.h:38
ns3::dot11s::IePeerManagement::m_peerLinkId
uint16_t m_peerLinkId
Present within confirm and may be present in close.
Definition: ie-dot11s-peer-management.h:130
ns3::dot11s::REASON11S_MESH_INVALID_GTK
@ REASON11S_MESH_INVALID_GTK
Definition: ie-dot11s-peer-management.h:42
ns3::dot11s::IePeerManagement::SetPeerOpen
void SetPeerOpen(uint16_t localLinkId)
Set peer open function.
Definition: ie-dot11s-peer-management.cc:39
ns3::dot11s::IePeerManagement
according to IEEE 802.11 - 2012
Definition: ie-dot11s-peer-management.h:51
ns3::dot11s::IePeerManagement::SubtypeIsClose
bool SubtypeIsClose() const
Subtype is close function.
Definition: ie-dot11s-peer-management.cc:98