From 99f082e65253e5eb68cab017d5e8d4a357d1d8a6 Mon Sep 17 00:00:00 2001 From: Kirill Andreev Date: Wed, 18 Mar 2009 15:08:17 +0300 Subject: [PATCH] Finished restructuring information elements --- .../mesh/802.11s/ie-dot11s-beacon-timing.cc | 4 +- .../mesh/802.11s/ie-dot11s-beacon-timing.h | 4 +- .../mesh/802.11s/ie-dot11s-configuration.cc | 4 +- .../mesh/802.11s/ie-dot11s-configuration.h | 5 +- .../ie-dot11s-peer-management.cc} | 49 ++++++++++--------- .../ie-dot11s-peer-management.h} | 20 ++++---- src/devices/mesh/802.11s/ie-dot11s-perr.cc | 6 +-- src/devices/mesh/802.11s/ie-dot11s-perr.h | 4 +- src/devices/mesh/802.11s/ie-dot11s-prep.cc | 4 +- src/devices/mesh/802.11s/ie-dot11s-prep.h | 4 +- src/devices/mesh/802.11s/ie-dot11s-preq.cc | 6 +-- src/devices/mesh/802.11s/ie-dot11s-preq.h | 4 +- src/devices/mesh/802.11s/ie-dot11s-rann.cc | 6 +-- src/devices/mesh/802.11s/ie-dot11s-rann.h | 4 +- src/devices/mesh/802.11s/wscript | 2 + src/devices/mesh/mesh-mgt-headers.cc | 12 +++-- src/devices/mesh/mesh-mgt-headers.h | 10 ++-- src/devices/mesh/mesh-wifi-mac.cc | 18 +++---- src/devices/mesh/mesh-wifi-mac.h | 6 +-- src/devices/mesh/mesh-wifi-peer-manager.cc | 12 ++--- src/devices/mesh/mesh-wifi-peer-manager.h | 12 ++--- src/devices/mesh/wifi-information-element.h | 4 +- src/devices/mesh/wscript | 2 - 23 files changed, 103 insertions(+), 99 deletions(-) rename src/devices/mesh/{dot11s-peer-management-element.cc => 802.11s/ie-dot11s-peer-management.cc} (66%) rename src/devices/mesh/{dot11s-peer-management-element.h => 802.11s/ie-dot11s-peer-management.h} (80%) diff --git a/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.cc b/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.cc index e83018c81..c4702da45 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.cc +++ b/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.cc @@ -145,7 +145,7 @@ IeDot11sBeaconTiming::ClearTimingElement() } -uint16_t +uint8_t IeDot11sBeaconTiming::GetInformationSize () const { return (5*m_numOfUnits); @@ -167,7 +167,7 @@ IeDot11sBeaconTiming::SerializeInformation (Buffer::Iterator i) const i.WriteHtonU16 ((*j)->GetBeaconInterval()); } } -uint16_t +uint8_t IeDot11sBeaconTiming::DeserializeInformation (Buffer::Iterator start, uint8_t length) { Buffer::Iterator i = start; diff --git a/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.h b/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.h index f6c00a53f..703847c59 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.h +++ b/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.h @@ -90,9 +90,9 @@ protected: return IE11S_BEACON_TIMING; } //Serialize-deserialize methods: - uint16_t GetInformationSize () const; + uint8_t GetInformationSize () const; void SerializeInformation (Buffer::Iterator i) const; - uint16_t DeserializeInformation (Buffer::Iterator i, uint8_t length); + uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); void PrintInformation(std::ostream& os) const; private: static uint16_t TimestampToU16(Time x); diff --git a/src/devices/mesh/802.11s/ie-dot11s-configuration.cc b/src/devices/mesh/802.11s/ie-dot11s-configuration.cc index 756f7bd53..311b463d2 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-configuration.cc +++ b/src/devices/mesh/802.11s/ie-dot11s-configuration.cc @@ -98,7 +98,7 @@ IeDot11sConfiguration::GetInstanceTypeId () const { return GetTypeId(); } -uint16_t +uint8_t IeDot11sConfiguration::GetInformationSize () const { return 1 // Version @@ -124,7 +124,7 @@ IeDot11sConfiguration::SerializeInformation (Buffer::Iterator i) const m_meshCap.Serialize (i); } -uint16_t +uint8_t IeDot11sConfiguration::DeserializeInformation (Buffer::Iterator i, uint8_t length) { Buffer::Iterator start = i; diff --git a/src/devices/mesh/802.11s/ie-dot11s-configuration.h b/src/devices/mesh/802.11s/ie-dot11s-configuration.h index a59b04cc6..8db1627ba 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-configuration.h +++ b/src/devices/mesh/802.11s/ie-dot11s-configuration.h @@ -102,10 +102,9 @@ protected: { return IE11S_MESH_CONFIGURATION; } - - uint16_t GetInformationSize () const; + uint8_t GetInformationSize () const; void SerializeInformation (Buffer::Iterator i) const; - uint16_t DeserializeInformation (Buffer::Iterator i, uint8_t length); + uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); void PrintInformation(std::ostream& os) const; // TODO: Release and fill other fields in configuration // element diff --git a/src/devices/mesh/dot11s-peer-management-element.cc b/src/devices/mesh/802.11s/ie-dot11s-peer-management.cc similarity index 66% rename from src/devices/mesh/dot11s-peer-management-element.cc rename to src/devices/mesh/802.11s/ie-dot11s-peer-management.cc index d767b4549..8301511a6 100644 --- a/src/devices/mesh/dot11s-peer-management-element.cc +++ b/src/devices/mesh/802.11s/ie-dot11s-peer-management.cc @@ -20,7 +20,7 @@ */ -#include "ns3/dot11s-peer-management-element.h" +#include "ns3/ie-dot11s-peer-management.h" #include "ns3/assert.h" @@ -28,7 +28,7 @@ namespace ns3 { -PeerLinkManagementElement::PeerLinkManagementElement (): +IeDot11sPeerManagement::IeDot11sPeerManagement (): m_length(0), m_subtype(PEER_OPEN), m_localLinkId(0), @@ -38,14 +38,14 @@ PeerLinkManagementElement::PeerLinkManagementElement (): void -PeerLinkManagementElement::SetPeerOpen(uint16_t localLinkId) +IeDot11sPeerManagement::SetPeerOpen(uint16_t localLinkId) { m_length = 3; m_subtype = PEER_OPEN; m_localLinkId = localLinkId; } void -PeerLinkManagementElement::SetPeerClose(uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCode reasonCode) +IeDot11sPeerManagement::SetPeerClose(uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCode reasonCode) { m_length = 7; m_subtype = PEER_CLOSE; @@ -55,7 +55,7 @@ PeerLinkManagementElement::SetPeerClose(uint16_t localLinkId, uint16_t peerLinkI } void -PeerLinkManagementElement::SetPeerConfirm(uint16_t localLinkId, uint16_t peerLinkId) +IeDot11sPeerManagement::SetPeerConfirm(uint16_t localLinkId, uint16_t peerLinkId) { m_length = 5; m_subtype = PEER_CONFIRM; @@ -64,69 +64,70 @@ PeerLinkManagementElement::SetPeerConfirm(uint16_t localLinkId, uint16_t peerLin } dot11sReasonCode -PeerLinkManagementElement::GetReasonCode() const +IeDot11sPeerManagement::GetReasonCode() const { return m_reasonCode; } uint16_t -PeerLinkManagementElement::GetLocalLinkId() const +IeDot11sPeerManagement::GetLocalLinkId() const { return m_localLinkId; } uint16_t -PeerLinkManagementElement::GetPeerLinkId() const +IeDot11sPeerManagement::GetPeerLinkId() const { return m_peerLinkId; } -uint32_t -PeerLinkManagementElement::GetSerializedSize (void) const +uint8_t +IeDot11sPeerManagement::GetInformationSize (void) const { - return m_length+2; + return m_length; } bool -PeerLinkManagementElement::SubtypeIsOpen() const +IeDot11sPeerManagement::SubtypeIsOpen() const { return (m_subtype == PEER_OPEN); } bool -PeerLinkManagementElement::SubtypeIsClose() const +IeDot11sPeerManagement::SubtypeIsClose() const { return (m_subtype == PEER_CLOSE); } bool -PeerLinkManagementElement::SubtypeIsConfirm() const +IeDot11sPeerManagement::SubtypeIsConfirm() const { return (m_subtype == PEER_CONFIRM); } -Buffer::Iterator -PeerLinkManagementElement::Serialize (Buffer::Iterator i) const +void +IeDot11sPeerManagement::SerializeInformation (Buffer::Iterator i) const { - i.WriteU8(ElementId()); - i.WriteU8(m_length); i.WriteU8(m_subtype); i.WriteHtonU16(m_localLinkId); if (m_length > 3) i.WriteHtonU16(m_peerLinkId); if (m_length > 5) i.WriteHtonU16(m_reasonCode); - return i; } -Buffer::Iterator -PeerLinkManagementElement::Deserialize (Buffer::Iterator i) +uint8_t +IeDot11sPeerManagement::DeserializeInformation (Buffer::Iterator start, uint8_t length) { - NS_ASSERT(ElementId() == i.ReadU8()); - m_length = i.ReadU8(); + Buffer::Iterator i = start; m_subtype = i.ReadU8(); m_localLinkId = i.ReadNtohU16(); if (m_length > 3) m_peerLinkId = i.ReadNtohU16(); if (m_length > 5) m_reasonCode = (dot11sReasonCode)i.ReadNtohU16(); - return i; + return i.GetDistanceFrom(start); +} +void +IeDot11sPeerManagement::PrintInformation(std::ostream& os) const +{ + //TODO } } //namespace NS3 diff --git a/src/devices/mesh/dot11s-peer-management-element.h b/src/devices/mesh/802.11s/ie-dot11s-peer-management.h similarity index 80% rename from src/devices/mesh/dot11s-peer-management-element.h rename to src/devices/mesh/802.11s/ie-dot11s-peer-management.h index 878540ae1..0e758e47d 100644 --- a/src/devices/mesh/dot11s-peer-management-element.h +++ b/src/devices/mesh/802.11s/ie-dot11s-peer-management.h @@ -26,12 +26,13 @@ #include #include "ns3/buffer.h" #include "ns3/dot11s-codes.h" +#include "ns3/wifi-information-element.h" namespace ns3 { /** * \ingroup mesh */ -class PeerLinkManagementElement +class IeDot11sPeerManagement : public WifiInformationElement { public: enum Subtype { @@ -40,7 +41,7 @@ public: PEER_CONFIRM = 2, }; public: - PeerLinkManagementElement (); + IeDot11sPeerManagement (); void SetPeerOpen(uint16_t localLinkId); void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, dot11sReasonCode reasonCode); @@ -52,14 +53,15 @@ public: bool SubtypeIsOpen() const; bool SubtypeIsClose() const; bool SubtypeIsConfirm() const ; - - uint32_t GetSerializedSize (void) const; - Buffer::Iterator Serialize (Buffer::Iterator i) const; - Buffer::Iterator Deserialize (Buffer::Iterator i); -private: - static uint8_t ElementId() { - return (uint8_t)IE11S_PEER_LINK_MANAGEMENT; +protected: + WifiElementId ElementId() const{ + return IE11S_PEER_LINK_MANAGEMENT; } + uint8_t GetInformationSize (void) const; + void SerializeInformation (Buffer::Iterator i) const; + uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); + void PrintInformation(std::ostream& os) const; +private: uint8_t m_length; uint8_t m_subtype; uint16_t m_localLinkId; //always is present diff --git a/src/devices/mesh/802.11s/ie-dot11s-perr.cc b/src/devices/mesh/802.11s/ie-dot11s-perr.cc index f6c43517a..9763edab8 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-perr.cc +++ b/src/devices/mesh/802.11s/ie-dot11s-perr.cc @@ -65,7 +65,7 @@ IeDot11sPerr::SerializeInformation(Buffer::Iterator i)const i.WriteHtonU32 (m_addressUnits[j].seqnum); } } -uint16_t +uint8_t IeDot11sPerr::DeserializeInformation(Buffer::Iterator start, uint8_t length) { Buffer::Iterator i = start; @@ -83,10 +83,10 @@ IeDot11sPerr::DeserializeInformation(Buffer::Iterator start, uint8_t length) return i.GetDistanceFrom(start); } -uint16_t +uint8_t IeDot11sPerr::GetInformationSize() const { - uint16_t retval = + uint8_t retval = 1 //ModeFlags +1 //NumOfDests +6*m_numOfDest diff --git a/src/devices/mesh/802.11s/ie-dot11s-perr.h b/src/devices/mesh/802.11s/ie-dot11s-perr.h index 85fa7ac2f..4021c860e 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-perr.h +++ b/src/devices/mesh/802.11s/ie-dot11s-perr.h @@ -59,9 +59,9 @@ protected: return IE11S_PERR; }; void SerializeInformation(Buffer::Iterator i) const; - uint16_t DeserializeInformation(Buffer::Iterator start, uint8_t length); + uint8_t DeserializeInformation(Buffer::Iterator start, uint8_t length); void PrintInformation(std::ostream& os) const; - uint16_t GetInformationSize() const; + uint8_t GetInformationSize() const; private: uint8_t m_numOfDest; std::vector diff --git a/src/devices/mesh/802.11s/ie-dot11s-prep.cc b/src/devices/mesh/802.11s/ie-dot11s-prep.cc index dfff0a6a9..0e7a7874a 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-prep.cc +++ b/src/devices/mesh/802.11s/ie-dot11s-prep.cc @@ -175,7 +175,7 @@ IeDot11sPrep::SerializeInformation(Buffer::Iterator i) const WriteTo (i, m_originatorAddress); i.WriteHtonU32 (m_originatorSeqNumber); } -uint16_t +uint8_t IeDot11sPrep::DeserializeInformation(Buffer::Iterator start, uint8_t length) { Buffer::Iterator i = start; @@ -190,7 +190,7 @@ IeDot11sPrep::DeserializeInformation(Buffer::Iterator start, uint8_t length) m_originatorSeqNumber = i.ReadNtohU32(); return i.GetDistanceFrom(start); } -uint16_t +uint8_t IeDot11sPrep::GetInformationSize() const { uint32_t retval = diff --git a/src/devices/mesh/802.11s/ie-dot11s-prep.h b/src/devices/mesh/802.11s/ie-dot11s-prep.h index 2cfb29a7a..3de2207b5 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-prep.h +++ b/src/devices/mesh/802.11s/ie-dot11s-prep.h @@ -70,8 +70,8 @@ protected: return IE11S_PREP; } void SerializeInformation(Buffer::Iterator i) const; - uint16_t DeserializeInformation(Buffer::Iterator start, uint8_t length); - uint16_t GetInformationSize() const; + uint8_t DeserializeInformation(Buffer::Iterator start, uint8_t length); + uint8_t GetInformationSize() const; void PrintInformation(std::ostream& os) const; private: uint8_t m_flags; diff --git a/src/devices/mesh/802.11s/ie-dot11s-preq.cc b/src/devices/mesh/802.11s/ie-dot11s-preq.cc index ebffb87d0..a31cb2b0f 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-preq.cc +++ b/src/devices/mesh/802.11s/ie-dot11s-preq.cc @@ -275,7 +275,7 @@ IeDot11sPreq::SerializeInformation(Buffer::Iterator i) const } } -uint16_t +uint8_t IeDot11sPreq::DeserializeInformation(Buffer::Iterator start, uint8_t length) { Buffer::Iterator i = start; @@ -311,10 +311,10 @@ IeDot11sPreq::DeserializeInformation(Buffer::Iterator start, uint8_t length) } return i.GetDistanceFrom(start); } -uint16_t +uint8_t IeDot11sPreq::GetInformationSize() const { - uint32_t retval = + uint8_t retval = 1 //Flags +1 //Hopcount +1 //TTL diff --git a/src/devices/mesh/802.11s/ie-dot11s-preq.h b/src/devices/mesh/802.11s/ie-dot11s-preq.h index 8518893f1..01ee11305 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-preq.h +++ b/src/devices/mesh/802.11s/ie-dot11s-preq.h @@ -108,8 +108,8 @@ protected: return IE11S_PREQ; } void SerializeInformation(Buffer::Iterator i) const; - uint16_t DeserializeInformation(Buffer::Iterator i, uint8_t length); - uint16_t GetInformationSize() const; + uint8_t DeserializeInformation(Buffer::Iterator i, uint8_t length); + uint8_t GetInformationSize() const; void PrintInformation(std::ostream& os) const; private: //how many destinations we support diff --git a/src/devices/mesh/802.11s/ie-dot11s-rann.cc b/src/devices/mesh/802.11s/ie-dot11s-rann.cc index 2d388b5c5..ca2c7cb4a 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-rann.cc +++ b/src/devices/mesh/802.11s/ie-dot11s-rann.cc @@ -124,7 +124,7 @@ IeDot11sRann::SerializeInformation(Buffer::Iterator i) const i.WriteHtonU32 (m_destSeqNumber); i.WriteHtonU32 (m_metric); } -uint16_t +uint8_t IeDot11sRann::DeserializeInformation(Buffer::Iterator start, uint8_t length) { Buffer::Iterator i = start; @@ -136,10 +136,10 @@ IeDot11sRann::DeserializeInformation(Buffer::Iterator start, uint8_t length) m_metric = i.ReadNtohU32(); return i.GetDistanceFrom(start); } -uint16_t +uint8_t IeDot11sRann::GetInformationSize() const { - uint16_t retval = + uint8_t retval = 1//Flags +1//Hopcount +1//TTL diff --git a/src/devices/mesh/802.11s/ie-dot11s-rann.h b/src/devices/mesh/802.11s/ie-dot11s-rann.h index ac6a45fbc..7de682324 100644 --- a/src/devices/mesh/802.11s/ie-dot11s-rann.h +++ b/src/devices/mesh/802.11s/ie-dot11s-rann.h @@ -62,8 +62,8 @@ protected: return IE11S_RANN; } void SerializeInformation(Buffer::Iterator i) const; - uint16_t DeserializeInformation(Buffer::Iterator start, uint8_t length); - uint16_t GetInformationSize() const; + uint8_t DeserializeInformation(Buffer::Iterator start, uint8_t length); + uint8_t GetInformationSize() const; private: uint8_t m_flags; uint8_t m_hopcount; diff --git a/src/devices/mesh/802.11s/wscript b/src/devices/mesh/802.11s/wscript index 8bf1cc636..da86d1b79 100644 --- a/src/devices/mesh/802.11s/wscript +++ b/src/devices/mesh/802.11s/wscript @@ -5,6 +5,7 @@ def build(bld): obj.source = [ 'ie-dot11s-beacon-timing.cc', 'ie-dot11s-configuration.cc', + 'ie-dot11s-peer-management.cc', 'ie-dot11s-preq.cc', 'ie-dot11s-prep.cc', 'ie-dot11s-perr.cc', @@ -15,6 +16,7 @@ def build(bld): headers.source = [ 'ie-dot11s-beacon-timing.h', 'ie-dot11s-configuration.h', + 'ie-dot11s-peer-management.h', 'ie-dot11s-preq.h', 'ie-dot11s-prep.h', 'ie-dot11s-perr.h', diff --git a/src/devices/mesh/mesh-mgt-headers.cc b/src/devices/mesh/mesh-mgt-headers.cc index 05389d91b..e1f823920 100644 --- a/src/devices/mesh/mesh-mgt-headers.cc +++ b/src/devices/mesh/mesh-mgt-headers.cc @@ -138,7 +138,7 @@ MeshMgtPeerLinkManFrame::SetIeDot11sConfiguration(IeDot11sConfiguration MeshConf } void -MeshMgtPeerLinkManFrame::SetPeerLinkManagementElement(PeerLinkManagementElement MeshPeerElement) +MeshMgtPeerLinkManFrame::SetIeDot11sPeerManagement(IeDot11sPeerManagement MeshPeerElement) { PeerLinkMan = MeshPeerElement; } @@ -173,8 +173,8 @@ MeshMgtPeerLinkManFrame::GetIeDot11sConfiguration() return MeshConfig; } -PeerLinkManagementElement -MeshMgtPeerLinkManFrame::GetPeerLinkManagementElement() +IeDot11sPeerManagement +MeshMgtPeerLinkManFrame::GetIeDot11sPeerManagement() { return PeerLinkMan; } @@ -236,7 +236,8 @@ MeshMgtPeerLinkManFrame::Serialize(Buffer::Iterator start) const MeshConfig.Serialize (i); i.Next(MeshConfig.GetSerializedSize()); } - i = PeerLinkMan.Serialize (i); + PeerLinkMan.Serialize (i); + i.Next(PeerLinkMan.GetSerializedSize()); } uint32_t @@ -254,7 +255,8 @@ MeshMgtPeerLinkManFrame::Deserialize(Buffer::Iterator start) MeshConfig.Deserialize (i); i.Next(MeshConfig.GetSerializedSize()); } - i = PeerLinkMan.Deserialize (i); + PeerLinkMan.Deserialize (i); + i.Next(PeerLinkMan.GetSerializedSize()); return i.GetDistanceFrom (start); } void diff --git a/src/devices/mesh/mesh-mgt-headers.h b/src/devices/mesh/mesh-mgt-headers.h index 5eee82b9a..fd24fdbfb 100644 --- a/src/devices/mesh/mesh-mgt-headers.h +++ b/src/devices/mesh/mesh-mgt-headers.h @@ -27,8 +27,8 @@ #include "ns3/header.h" #include "ns3/status-code.h" -#include "ns3/dot11s-peer-management-element.h" #include "ns3/supported-rates.h" +#include "ns3/ie-dot11s-peer-management.h" #include "ns3/ie-dot11s-preq.h" #include "ns3/ie-dot11s-prep.h" #include "ns3/ie-dot11s-perr.h" @@ -70,14 +70,14 @@ public: void SetQosField(uint16_t qos); void SetMeshId(Ssid Id); void SetIeDot11sConfiguration(IeDot11sConfiguration MeshConf); - void SetPeerLinkManagementElement(PeerLinkManagementElement MeshPeerElement); + void SetIeDot11sPeerManagement(IeDot11sPeerManagement MeshPeerElement); uint16_t GetAid(); SupportedRates GetSupportedRates(); uint16_t GetQosField(); Ssid GetMeshId(); IeDot11sConfiguration GetIeDot11sConfiguration(); - PeerLinkManagementElement GetPeerLinkManagementElement(); + IeDot11sPeerManagement GetIeDot11sPeerManagement(); static TypeId GetTypeId(); virtual TypeId GetInstanceTypeId() const; @@ -101,14 +101,14 @@ private: static const uint8_t MESH_MGT_HEADER_PEER_CLOSE = 3; // Standart is also requires a ReasonCode to be within // PeerLinkClose frame format, but it is present within - // PeerLinkManagementElement, so we did not duplicate + // IeDot11sPeerManagement, so we did not duplicate // it. uint16_t Aid; //only in Confirm SupportedRates Rates; //only in Open and Confirm uint16_t QoS; //only in Open and Confirm Ssid MeshId; //only in Open and Confirm IeDot11sConfiguration MeshConfig; //only in Open and Confirm - PeerLinkManagementElement PeerLinkMan; //in all types of frames + IeDot11sPeerManagement PeerLinkMan; //in all types of frames }; }//namespace NS3 diff --git a/src/devices/mesh/mesh-wifi-mac.cc b/src/devices/mesh/mesh-wifi-mac.cc index d89e0d28d..e2dd8c30d 100644 --- a/src/devices/mesh/mesh-wifi-mac.cc +++ b/src/devices/mesh/mesh-wifi-mac.cc @@ -578,7 +578,7 @@ MeshWifiMac::Receive (Ptr packet, WifiMacHeader const *hdr) GetAddress(), peerAddress, peer_frame.GetAid(), - peer_frame.GetPeerLinkManagementElement(), + peer_frame.GetIeDot11sPeerManagement(), m_meshConfig ); return; @@ -586,7 +586,7 @@ MeshWifiMac::Receive (Ptr packet, WifiMacHeader const *hdr) m_peerManager->SetOpenReceived( GetAddress(), peerAddress, - peer_frame.GetPeerLinkManagementElement(), + peer_frame.GetIeDot11sPeerManagement(), m_meshConfig ); return; @@ -594,7 +594,7 @@ MeshWifiMac::Receive (Ptr packet, WifiMacHeader const *hdr) m_peerManager->SetCloseReceived( GetAddress(), peerAddress, - peer_frame.GetPeerLinkManagementElement() + peer_frame.GetIeDot11sPeerManagement() ); return; default: @@ -677,34 +677,34 @@ MeshWifiMac::CalcSwDelay() } void -MeshWifiMac::SendPeerLinkOpen(PeerLinkManagementElement peer_element, Mac48Address peerAddress) +MeshWifiMac::SendPeerLinkOpen(IeDot11sPeerManagement peer_element, Mac48Address peerAddress) { MeshMgtPeerLinkManFrame open; open.SetOpen(); open.SetIeDot11sConfiguration(m_meshConfig); - open.SetPeerLinkManagementElement(peer_element); + open.SetIeDot11sPeerManagement(peer_element); Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, open, peerAddress); } void -MeshWifiMac::SendPeerLinkConfirm(PeerLinkManagementElement peer_element, Mac48Address peerAddress, uint16_t aid) +MeshWifiMac::SendPeerLinkConfirm(IeDot11sPeerManagement peer_element, Mac48Address peerAddress, uint16_t aid) { MeshMgtPeerLinkManFrame confirm; confirm.SetConfirm(); confirm.SetIeDot11sConfiguration(m_meshConfig); - confirm.SetPeerLinkManagementElement(peer_element); + confirm.SetIeDot11sPeerManagement(peer_element); confirm.SetAid(aid); Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, confirm, peerAddress); } void -MeshWifiMac::SendPeerLinkClose(PeerLinkManagementElement peer_element, Mac48Address peerAddress) +MeshWifiMac::SendPeerLinkClose(IeDot11sPeerManagement peer_element, Mac48Address peerAddress) { MeshMgtPeerLinkManFrame close; close.SetClose(); close.SetIeDot11sConfiguration(m_meshConfig); - close.SetPeerLinkManagementElement(peer_element); + close.SetIeDot11sPeerManagement(peer_element); Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, close, peerAddress); } diff --git a/src/devices/mesh/mesh-wifi-mac.h b/src/devices/mesh/mesh-wifi-mac.h index 70d59fe99..6b9c63ad5 100644 --- a/src/devices/mesh/mesh-wifi-mac.h +++ b/src/devices/mesh/mesh-wifi-mac.h @@ -202,7 +202,7 @@ public: * destination of given frame */ void SendPeerLinkOpen( - PeerLinkManagementElement peer_element, + IeDot11sPeerManagement peer_element, Mac48Address peerAddress ); /** @@ -217,7 +217,7 @@ public: * peer manager */ void SendPeerLinkConfirm( - PeerLinkManagementElement peer_element, + IeDot11sPeerManagement peer_element, Mac48Address peerAddress, uint16_t aid ); @@ -231,7 +231,7 @@ public: * destination of given frame */ void SendPeerLinkClose( - PeerLinkManagementElement peer_element, + IeDot11sPeerManagement peer_element, Mac48Address peerAddress ); /** diff --git a/src/devices/mesh/mesh-wifi-peer-manager.cc b/src/devices/mesh/mesh-wifi-peer-manager.cc index d22750f10..6dddbbe53 100644 --- a/src/devices/mesh/mesh-wifi-peer-manager.cc +++ b/src/devices/mesh/mesh-wifi-peer-manager.cc @@ -498,14 +498,14 @@ void WifiPeerLinkDescriptor::ClearHoldingTimer() void WifiPeerLinkDescriptor::SendPeerLinkClose(dot11sReasonCode reasoncode) { - PeerLinkManagementElement peerElement; + IeDot11sPeerManagement peerElement; peerElement.SetPeerClose(m_localLinkId, m_peerLinkId, reasoncode); m_mac->SendPeerLinkClose(peerElement,m_peerAddress); } void WifiPeerLinkDescriptor::SendPeerLinkOpen() { - PeerLinkManagementElement peerElement; + IeDot11sPeerManagement peerElement; peerElement.SetPeerOpen(m_localLinkId); NS_ASSERT(m_mac != NULL); m_mac->SendPeerLinkOpen(peerElement, m_peerAddress); @@ -513,7 +513,7 @@ void WifiPeerLinkDescriptor::SendPeerLinkOpen() void WifiPeerLinkDescriptor::SendPeerLinkConfirm() { - PeerLinkManagementElement peerElement; + IeDot11sPeerManagement peerElement; peerElement.SetPeerConfirm(m_localLinkId, m_peerLinkId); m_mac->SendPeerLinkConfirm(peerElement, m_peerAddress, m_assocId); } @@ -694,7 +694,7 @@ void WifiPeerManager::SetOpenReceived( Mac48Address portAddress, Mac48Address peerAddress, - PeerLinkManagementElement peerMan, + IeDot11sPeerManagement peerMan, IeDot11sConfiguration conf ) { @@ -724,7 +724,7 @@ WifiPeerManager::SetConfirmReceived( Mac48Address portAddress, Mac48Address peerAddress, uint16_t peerAid, - PeerLinkManagementElement peerMan, + IeDot11sPeerManagement peerMan, IeDot11sConfiguration meshConfig ) { @@ -739,7 +739,7 @@ void WifiPeerManager::SetCloseReceived( Mac48Address portAddress, Mac48Address peerAddress, - PeerLinkManagementElement peerMan + IeDot11sPeerManagement peerMan ) { PeerDescriptorsMap::iterator port = m_peerDescriptors.find(portAddress); diff --git a/src/devices/mesh/mesh-wifi-peer-manager.h b/src/devices/mesh/mesh-wifi-peer-manager.h index eaeb988ff..094c37185 100644 --- a/src/devices/mesh/mesh-wifi-peer-manager.h +++ b/src/devices/mesh/mesh-wifi-peer-manager.h @@ -29,7 +29,7 @@ #include "ns3/mac48-address.h" #include "ns3/uinteger.h" #include "ns3/wifi-net-device.h" -#include "ns3/dot11s-peer-management-element.h" +#include "ns3/ie-dot11s-peer-management.h" #include "ns3/ie-dot11s-beacon-timing.h" #include "ns3/mesh-wifi-mac.h" @@ -69,7 +69,7 @@ public: void SetPeerAid(uint16_t aid); void SetBeaconTimingElement(IeDot11sBeaconTiming beaconTiming); void SetPeerLinkDescriptorElement( - PeerLinkManagementElement peerLinkElement + IeDot11sPeerManagement peerLinkElement ); Mac48Address GetPeerAddress()const; /** @@ -81,7 +81,7 @@ public: Time GetBeaconInterval()const; IeDot11sBeaconTiming GetBeaconTimingElement()const; - PeerLinkManagementElement + IeDot11sPeerManagement GetPeerLinkDescriptorElement()const; void ClearTimingElement(); /* MLME */ @@ -232,7 +232,7 @@ public: void SetOpenReceived( Mac48Address portAddress, Mac48Address peerAddress, - PeerLinkManagementElement + IeDot11sPeerManagement peerMan, IeDot11sConfiguration conf ); @@ -240,14 +240,14 @@ public: Mac48Address portAddress, Mac48Address peerAddress, uint16_t peerAid, - PeerLinkManagementElement + IeDot11sPeerManagement peerMan, IeDot11sConfiguration meshConfig ); void SetCloseReceived( Mac48Address portAddress, Mac48Address peerAddress, - PeerLinkManagementElement peerMan + IeDot11sPeerManagement peerMan ); //Using this function MAC void ConfigurationMismatch( diff --git a/src/devices/mesh/wifi-information-element.h b/src/devices/mesh/wifi-information-element.h index 2973f0aed..3c2cc1d7a 100644 --- a/src/devices/mesh/wifi-information-element.h +++ b/src/devices/mesh/wifi-information-element.h @@ -134,11 +134,11 @@ protected: /// Own unique Element ID virtual WifiElementId ElementId () const = 0; /// Length of serialized information - virtual uint16_t GetInformationSize () const = 0; + virtual uint8_t GetInformationSize () const = 0; /// Serialize information virtual void SerializeInformation (Buffer::Iterator start) const = 0; /// Deserialize information - virtual uint16_t DeserializeInformation (Buffer::Iterator start, uint8_t length) = 0; + virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length) = 0; /// Print information virtual void PrintInformation (std::ostream &os) const = 0; //\} diff --git a/src/devices/mesh/wscript b/src/devices/mesh/wscript index f35baef75..d48ebec79 100644 --- a/src/devices/mesh/wscript +++ b/src/devices/mesh/wscript @@ -18,7 +18,6 @@ def build(bld): 'hwmp.cc', 'mesh-wifi-mac.cc', 'hwmp-state.cc', - 'dot11s-peer-management-element.cc', 'mesh-mgt-headers.cc', ] headers = bld.new_task_gen('ns3header') @@ -36,7 +35,6 @@ def build(bld): 'mesh-mgt-headers.h', 'hwmp.h', 'tx-statistics.h', - 'dot11s-peer-management-element.h', 'hwmp-rtable.h', 'mesh-wifi-peer-manager.h', 'mesh-wifi-mac-header.h',