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 */
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...
PmpReasonCode m_reasonCode
Present only within close frame.
bool SubtypeIsClose() const
Subtype is close function.
bool SubtypeIsOpen() const
Subtype is open function.
bool operator==(const MeshHeader &a, const MeshHeader &b)
uint16_t GetPeerLinkId() const
Get peer link ID function.
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t GetSubtype() const
Get subtype function.
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
friend bool operator==(const IePeerManagement &a, const IePeerManagement &b)
equality operator
according to IEEE 802.11 - 2012
uint16_t GetLocalLinkId() const
Get local link ID function.
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) ...
void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode)
Set peer close function.
uint16_t m_peerLinkId
Present within confirm and may be present in close.
virtual WifiInformationElementId ElementId() const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void Print(std::ostream &os) const
Generate human-readable form of IE.
virtual void SerializeInformationField(Buffer::Iterator i) const
Serialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
PmpReasonCode GetReasonCode() const
Get reason code function.
void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId)
Set peer confirm function.
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
void SetPeerOpen(uint16_t localLinkId)
Set peer open function.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
bool SubtypeIsConfirm() const
Subtype is confirm function.
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)