A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ie-dot11s-peer-management.h
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 = 2, // according to open80211s
37  REASON11S_MESH_MAX_PEERS,
38  REASON11S_MESH_CAPABILITY_POLICY_VIOLATION,
39  REASON11S_MESH_CLOSE_RCVD,
40  REASON11S_MESH_MAX_RETRIES,
41  REASON11S_MESH_CONFIRM_TIMEOUT,
42  REASON11S_MESH_INVALID_GTK,
43  REASON11S_MESH_INCONSISTENT_PARAMETERS,
44  REASON11S_MESH_INVALID_SECURITY_CAPABILITY,
45  REASON11S_RESERVED,
46 };
47 
53 {
54 public:
56  enum Subtype
57  {
58  PEER_OPEN = 0,
59  PEER_CONFIRM,
60  PEER_CLOSE,
61  };
62  void SetPeerOpen (uint16_t localLinkId);
63  void SetPeerClose (uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode);
64  void SetPeerConfirm (uint16_t localLinkID, uint16_t peerLinkId);
65 
66  PmpReasonCode GetReasonCode () const;
67  uint16_t GetLocalLinkId () const;
68  uint16_t GetPeerLinkId () const;
69  bool SubtypeIsOpen () const;
70  bool SubtypeIsClose () const;
71  bool SubtypeIsConfirm () const;
72  uint8_t GetSubtype () const;
77  virtual WifiInformationElementId ElementId () const;
78  virtual uint8_t GetInformationFieldSize (void) const;
79  virtual void SerializeInformationField (Buffer::Iterator i) const;
80  virtual uint8_t DeserializeInformationField (Buffer::Iterator i, uint8_t length);
81  virtual void Print (std::ostream& os) const;
83 private:
84  uint8_t m_length;
85  uint8_t m_subtype;
86  uint16_t m_localLinkId;
90  uint16_t m_peerLinkId;
95  friend bool operator== (const IePeerManagement & a, const IePeerManagement & b);
96 };
97 bool operator== (const IePeerManagement & a, const IePeerManagement & b);
98 std::ostream &operator << (std::ostream &os, const IePeerManagement &peerMan);
99 } // namespace dot11s
100 } // namespace ns3
101 
102 #endif /* IE_DOT11S_PEER_MANAGEMENT_H */
virtual WifiInformationElementId ElementId() const
Own unique Element ID.
iterator in a Buffer instance
Definition: buffer.h:98
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
See 7.3.2.85 of draft 2.07.
virtual uint8_t GetInformationFieldSize(void) const
virtual uint8_t DeserializeInformationField(Buffer::Iterator i, uint8_t length)
virtual void Print(std::ostream &os) const
In addition, a subclass may optionally override the following...
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:43
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
uint8_t WifiInformationElementId
virtual void SerializeInformationField(Buffer::Iterator i) const