From b349a7045cc47accc83a4b0c00f99b780f2ee3ae Mon Sep 17 00:00:00 2001 From: Kirill Andreev Date: Wed, 8 Apr 2009 17:50:52 +0400 Subject: [PATCH] Added docs to peer link frame cleass, mesh-wifi-mac-header has been moved to dot11s namespace --- src/devices/mesh/dot11s/hwmp-mac-plugin.cc | 3 +- .../mesh/{ => dot11s}/mesh-wifi-mac-header.cc | 39 +++---------------- .../mesh/{ => dot11s}/mesh-wifi-mac-header.h | 4 +- src/devices/mesh/dot11s/peer-link-frame.h | 12 ++++++ .../mesh/dot11s/peer-management-plugin.cc | 3 +- src/devices/mesh/dot11s/wscript | 1 + src/devices/mesh/mesh-wifi-interface-mac.cc | 2 +- src/devices/mesh/wscript | 10 ----- 8 files changed, 24 insertions(+), 50 deletions(-) rename src/devices/mesh/{ => dot11s}/mesh-wifi-mac-header.cc (97%) rename src/devices/mesh/{ => dot11s}/mesh-wifi-mac-header.h (98%) diff --git a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc index a09c679af..929ebb13b 100644 --- a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc +++ b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc @@ -23,9 +23,8 @@ #include "ns3/simulator.h" #include "ns3/nstime.h" #include "ns3/log.h" -#include "ns3/mesh-wifi-mac-header.h" - #include "hwmp-mac-plugin.h" +#include "mesh-wifi-mac-header.h" #include "hwmp-protocol.h" #include "hwmp-tag.h" #include "ie-dot11s-preq.h" diff --git a/src/devices/mesh/mesh-wifi-mac-header.cc b/src/devices/mesh/dot11s/mesh-wifi-mac-header.cc similarity index 97% rename from src/devices/mesh/mesh-wifi-mac-header.cc rename to src/devices/mesh/dot11s/mesh-wifi-mac-header.cc index 7ddc9e7dc..437ddde8d 100644 --- a/src/devices/mesh/mesh-wifi-mac-header.cc +++ b/src/devices/mesh/dot11s/mesh-wifi-mac-header.cc @@ -21,10 +21,10 @@ #include "ns3/assert.h" #include "ns3/address-utils.h" -#include "ns3/mesh-wifi-mac-header.h" +#include "mesh-wifi-mac-header.h" namespace ns3 { - +namespace dot11s { /*********************************************************** * Here Mesh Mac Header functionality is defined. ***********************************************************/ @@ -37,7 +37,6 @@ WifiMeshHeader::GetTypeId () ; return tid; } - WifiMeshHeader::WifiMeshHeader (): m_meshFlags (0), m_meshTtl (0), @@ -47,77 +46,64 @@ WifiMeshHeader::WifiMeshHeader (): m_addr6 (Mac48Address ()) { } - WifiMeshHeader::~WifiMeshHeader () { } - TypeId WifiMeshHeader::GetInstanceTypeId () const { return GetTypeId (); } - void WifiMeshHeader::SetAddr4 (Mac48Address address) { m_addr4 = address; } - void WifiMeshHeader::SetAddr5 (Mac48Address address) { m_addr5 = address; } - void WifiMeshHeader::SetAddr6 (Mac48Address address) { m_addr6 = address; } - Mac48Address WifiMeshHeader::GetAddr4 () const { return m_addr4; } - Mac48Address WifiMeshHeader::GetAddr5 () const { return m_addr5; } - Mac48Address WifiMeshHeader::GetAddr6 () const { return m_addr6; } - void WifiMeshHeader::SetMeshSeqno (uint32_t seqno) { m_meshSeqno = seqno; } - uint32_t WifiMeshHeader::GetMeshSeqno () const { return m_meshSeqno; } - void WifiMeshHeader::SetMeshTtl (uint8_t TTL) { m_meshTtl = TTL; } - uint8_t WifiMeshHeader::GetMeshTtl () const { return m_meshTtl; } - void WifiMeshHeader::SetAddressExt (uint8_t num_of_addresses) { @@ -125,20 +111,16 @@ WifiMeshHeader::SetAddressExt (uint8_t num_of_addresses) return; m_meshFlags |= 0xc0 & (num_of_addresses << 6); } - uint8_t WifiMeshHeader::GetAddressExt () const { return ((0xc0 & m_meshFlags) >> 6); } - - uint32_t WifiMeshHeader::GetSerializedSize () const { return 6 + GetAddressExt () * 6; } - void WifiMeshHeader::Serialize (Buffer::Iterator start) const { @@ -155,7 +137,6 @@ WifiMeshHeader::Serialize (Buffer::Iterator start) const if (addresses_to_add > 2) WriteTo (i, m_addr6); } - uint32_t WifiMeshHeader::Deserialize (Buffer::Iterator start) { @@ -186,14 +167,12 @@ WifiMeshHeader::Print (std::ostream &os) const WifiMeshMultihopActionHeader::WifiMeshMultihopActionHeader () { } - WifiMeshMultihopActionHeader::~WifiMeshMultihopActionHeader () { } - void WifiMeshMultihopActionHeader::SetAction ( - enum WifiMeshMultihopActionHeader::CategoryValue type, + WifiMeshMultihopActionHeader::CategoryValue type, WifiMeshMultihopActionHeader::ACTION_VALUE action) { switch (type) @@ -242,8 +221,7 @@ WifiMeshMultihopActionHeader::SetAction ( break; }; } - -enum WifiMeshMultihopActionHeader::CategoryValue +WifiMeshMultihopActionHeader::CategoryValue WifiMeshMultihopActionHeader::GetCategory () { switch (m_category) @@ -263,7 +241,6 @@ WifiMeshMultihopActionHeader::GetCategory () return MESH_PEER_LINK_MGT; } } - WifiMeshMultihopActionHeader::ACTION_VALUE WifiMeshMultihopActionHeader::GetAction () { @@ -320,7 +297,6 @@ WifiMeshMultihopActionHeader::GetAction () return retval; } } - TypeId WifiMeshMultihopActionHeader::GetTypeId () { @@ -330,31 +306,26 @@ WifiMeshMultihopActionHeader::GetTypeId () ; return tid; } - TypeId WifiMeshMultihopActionHeader::GetInstanceTypeId () const { return GetTypeId (); } - void WifiMeshMultihopActionHeader::Print (std::ostream &os) const { } - uint32_t WifiMeshMultihopActionHeader::GetSerializedSize () const { return 2; } - void WifiMeshMultihopActionHeader::Serialize (Buffer::Iterator start) const { start.WriteU8 (m_category); start.WriteU8 (m_actionValue); } - uint32_t WifiMeshMultihopActionHeader::Deserialize (Buffer::Iterator start) { @@ -363,5 +334,5 @@ WifiMeshMultihopActionHeader::Deserialize (Buffer::Iterator start) m_actionValue = i.ReadU8 (); return i.GetDistanceFrom (start); } - +} //namespace dot11s } // namespace ns3 diff --git a/src/devices/mesh/mesh-wifi-mac-header.h b/src/devices/mesh/dot11s/mesh-wifi-mac-header.h similarity index 98% rename from src/devices/mesh/mesh-wifi-mac-header.h rename to src/devices/mesh/dot11s/mesh-wifi-mac-header.h index 4e8d55018..ed354c20e 100644 --- a/src/devices/mesh/mesh-wifi-mac-header.h +++ b/src/devices/mesh/dot11s/mesh-wifi-mac-header.h @@ -26,8 +26,9 @@ #include "ns3/mac48-address.h" namespace ns3 { +namespace dot11s { /** - * \ingroup mesh + * \ingroup dot11s */ class WifiMeshHeader : public Header //7.1.3.5b { @@ -145,5 +146,6 @@ private: uint8_t m_category; uint8_t m_actionValue; }; +} //namespace dot11s } // namespace ns3 #endif /* MESH_WIFI_MAC_HEADER_H */ diff --git a/src/devices/mesh/dot11s/peer-link-frame.h b/src/devices/mesh/dot11s/peer-link-frame.h index 0ee1a6655..2756e5bda 100644 --- a/src/devices/mesh/dot11s/peer-link-frame.h +++ b/src/devices/mesh/dot11s/peer-link-frame.h @@ -27,10 +27,22 @@ namespace ns3 { class MeshWifiInterfaceMac; namespace dot11s { +/** + * \ingroup dot11s + * + * \brief 802.11s Peer link management frame: + * \details included the following (see chapters 7.4.12.1-7.4.12.3 of + * 802.11s): + * - Subtype field + * - Association ID field + * - Supported rates + * - SSID of mesh + */ class PeerLinkFrameStart : public Header { public: PeerLinkFrameStart (); + ///\brief fields: struct PlinkFrameStartFields { uint8_t subtype; diff --git a/src/devices/mesh/dot11s/peer-management-plugin.cc b/src/devices/mesh/dot11s/peer-management-plugin.cc index deb43cb3c..261355a14 100644 --- a/src/devices/mesh/dot11s/peer-management-plugin.cc +++ b/src/devices/mesh/dot11s/peer-management-plugin.cc @@ -23,11 +23,10 @@ #include "peer-management-plugin.h" #include "peer-management-protocol.h" #include "peer-link-frame.h" +#include "mesh-wifi-mac-header.h" #include "ns3/mesh-wifi-interface-mac.h" -#include "ns3/mesh-wifi-mac-header.h" #include "ns3/simulator.h" #include "ns3/wifi-mac-header.h" -#include "ns3/mesh-wifi-mac-header.h" #include "ns3/log.h" NS_LOG_COMPONENT_DEFINE("PeerManager"); diff --git a/src/devices/mesh/dot11s/wscript b/src/devices/mesh/dot11s/wscript index f4dfa8d19..b5cbd2c82 100644 --- a/src/devices/mesh/dot11s/wscript +++ b/src/devices/mesh/dot11s/wscript @@ -20,6 +20,7 @@ def build(bld): 'hwmp-protocol.cc', 'airtime-metric.cc', 'dot11s-helper.cc', + 'mesh-wifi-mac-header.cc', ] headers = bld.new_task_gen('ns3header') headers.module = 'dot11s' diff --git a/src/devices/mesh/mesh-wifi-interface-mac.cc b/src/devices/mesh/mesh-wifi-interface-mac.cc index 6877c86d0..17480fbf4 100644 --- a/src/devices/mesh/mesh-wifi-interface-mac.cc +++ b/src/devices/mesh/mesh-wifi-interface-mac.cc @@ -27,7 +27,7 @@ #include "ns3/mac-rx-middle.h" #include "ns3/mac-low.h" #include "ns3/dca-txop.h" -#include "ns3/mesh-wifi-mac-header.h" +//#include "ns3/mesh-wifi-mac-header.h" #include "ns3/random-variable.h" #include "ns3/simulator.h" #include "ns3/yans-wifi-phy.h" diff --git a/src/devices/mesh/wscript b/src/devices/mesh/wscript index 86c046b36..bd7b5495d 100644 --- a/src/devices/mesh/wscript +++ b/src/devices/mesh/wscript @@ -3,15 +3,11 @@ def build(bld): obj = bld.create_ns3_module('mesh', ['wifi', 'dot11s']) obj.source = [ - # Refactored 'wifi-information-element.cc', 'mesh-point-device.cc', 'mesh-l2-routing-protocol.cc', 'mesh-wifi-beacon.cc', 'mesh-wifi-interface-mac.cc', - # Not refactored - 'mesh-wifi-mac-header.cc', - #'tx-statistics.cc', ] headers = bld.new_task_gen('ns3header') headers.module = 'mesh' @@ -23,11 +19,5 @@ def build(bld): 'mesh-wifi-beacon.h', 'mesh-wifi-interface-mac.h', 'mesh-wifi-interface-mac-plugin.h', - # Dirty - #'tx-statistics.h', - 'mesh-wifi-mac-header.h', ] -# obj = bld.create_ns3_program('wifi-phy-test', -# ['core', 'simulator', 'mobility', 'node', 'wifi']) -# obj.source = 'wifi-phy-test.cc'