22 #include "ie-dot11s-peer-management.h"
23 #include "ns3/assert.h"
24 #include "ns3/packet.h"
29 IePeerManagement::IePeerManagement () :
30 m_length (3), m_subtype (PEER_OPEN), m_localLinkId (0), m_peerLinkId (0), m_reasonCode (REASON11S_RESERVED)
36 return IE11S_PEERING_MANAGEMENT;
39 IePeerManagement::SetPeerOpen (uint16_t localLinkId)
42 m_subtype = PEER_OPEN;
43 m_localLinkId = localLinkId;
46 IePeerManagement::SetPeerClose (uint16_t localLinkId, uint16_t peerLinkId,
PmpReasonCode reasonCode)
49 m_subtype = PEER_CLOSE;
50 m_localLinkId = localLinkId;
56 IePeerManagement::SetPeerConfirm (uint16_t localLinkId, uint16_t peerLinkId)
59 m_subtype = PEER_CONFIRM;
60 m_localLinkId = localLinkId;
65 IePeerManagement::GetReasonCode ()
const
71 IePeerManagement::GetLocalLinkId ()
const
77 IePeerManagement::GetPeerLinkId ()
const
88 IePeerManagement::GetSubtype ()
const
93 IePeerManagement::SubtypeIsOpen ()
const
95 return (m_subtype == PEER_OPEN);
98 IePeerManagement::SubtypeIsClose ()
const
100 return (m_subtype == PEER_CLOSE);
103 IePeerManagement::SubtypeIsConfirm ()
const
105 return (m_subtype == PEER_CONFIRM);
128 if (m_subtype == PEER_OPEN)
132 if (m_subtype == PEER_CONFIRM)
136 if (m_subtype == PEER_CLOSE)
154 os << std::endl <<
"<information_element id=" <<
ElementId () <<
">" << std::endl;
155 os <<
" Subtype: = " << (uint16_t) m_subtype << std::endl;
156 os <<
" Length: = " << (uint16_t) m_length << std::endl;
157 os <<
" LocalLinkId: = " << m_localLinkId << std::endl;
160 os <<
"</information_element>" << std::endl;
165 return ((a.m_length == b.m_length) && (a.m_subtype == b.m_subtype) && (a.m_localLinkId == b.m_localLinkId)
PmpReasonCode m_reasonCode
#define NS_ASSERT(condition)
virtual WifiInformationElementId ElementId() const
Own unique Element ID.
uint32_t GetDistanceFrom(Iterator const &o) const
iterator in a Buffer instance
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)
void WriteHtolsbU16(uint16_t data)
void WriteU8(uint8_t data)
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
uint16_t ReadLsbtohU16(void)
uint8_t WifiInformationElementId
virtual void SerializeInformationField(Buffer::Iterator i) const