Merge to ns3dev
This commit is contained in:
@@ -69,7 +69,7 @@ main(int argc, char *argv[])
|
||||
);
|
||||
wifi.SetPeerLinkManager ("ns3::WifiPeerManager");
|
||||
wifi.SetL2RoutingProtocol ("ns3::Hwmp");
|
||||
wifi.SetL2RoutingNetDevice ("ns3::L2RoutingNetDevice");
|
||||
wifi.SetL2RoutingNetDevice ("ns3::MeshPointDevice");
|
||||
meshDevices = wifi.Install (wifiPhy,nodes,1);
|
||||
// Installing Mobility.
|
||||
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
|
||||
|
||||
@@ -36,7 +36,7 @@ dot11sMeshCapability::dot11sMeshCapability():
|
||||
powerSaveLevel(false)
|
||||
{}
|
||||
|
||||
uint32_t dot11sMeshCapability::GetSerializedSize () const
|
||||
uint8_t dot11sMeshCapability::GetSerializedSize () const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
@@ -85,25 +85,33 @@ MeshConfigurationElement::MeshConfigurationElement ():
|
||||
m_CP(CHANNEL_PRECEDENCE_OFF)
|
||||
{}
|
||||
|
||||
uint32_t
|
||||
MeshConfigurationElement::GetSerializedSize () const
|
||||
TypeId
|
||||
MeshConfigurationElement::GetTypeId ()
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::MeshConfigurationElement")
|
||||
.SetParent<WifiInformationElement> ();
|
||||
return tid;
|
||||
}
|
||||
|
||||
TypeId
|
||||
MeshConfigurationElement::GetInstanceTypeId () const
|
||||
{
|
||||
return GetTypeId();
|
||||
}
|
||||
uint8_t
|
||||
MeshConfigurationElement::GetInformationSize () const
|
||||
{
|
||||
return 1 // ID
|
||||
+ 1 // Length
|
||||
+ 1 // Version
|
||||
+ 4 // APSPId
|
||||
+ 4 // APSMId
|
||||
+ 4 // CCMId
|
||||
+ 4 // CP
|
||||
+ m_meshCap.GetSerializedSize();
|
||||
return 1 // Version
|
||||
+ 4 // APSPId
|
||||
+ 4 // APSMId
|
||||
+ 4 // CCMId
|
||||
+ 4 // CP
|
||||
+ m_meshCap.GetSerializedSize();
|
||||
}
|
||||
|
||||
Buffer::Iterator
|
||||
MeshConfigurationElement::Serialize (Buffer::Iterator i) const
|
||||
{
|
||||
|
||||
i.WriteU8 (ElementId());
|
||||
i.WriteU8 (GetSerializedSize()); // Length
|
||||
void
|
||||
MeshConfigurationElement::SerializeInformation (Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8 (1); //Version
|
||||
// Active Path Selection Protocol ID:
|
||||
i.WriteHtonU32 (m_APSId);
|
||||
@@ -113,22 +121,14 @@ MeshConfigurationElement::Serialize (Buffer::Iterator i) const
|
||||
i.WriteU32 (m_CCMId);
|
||||
// Channel Precedence:
|
||||
i.WriteU32 (m_CP);
|
||||
i = m_meshCap.Serialize (i);
|
||||
return i;
|
||||
}
|
||||
m_meshCap.Serialize (i);
|
||||
}
|
||||
|
||||
Buffer::Iterator
|
||||
MeshConfigurationElement::Deserialize (Buffer::Iterator i)
|
||||
uint8_t
|
||||
MeshConfigurationElement::DeserializeInformation (Buffer::Iterator i, uint8_t length)
|
||||
{
|
||||
|
||||
//uint8_t elementId;
|
||||
uint8_t size;
|
||||
Buffer::Iterator start = i;
|
||||
uint8_t version;
|
||||
//elementId = i.ReadU8 ();
|
||||
|
||||
NS_ASSERT (ElementId() == i.ReadU8());
|
||||
|
||||
size = i.ReadU8 ();
|
||||
version = i.ReadU8 ();
|
||||
// Active Path Selection Protocol ID:
|
||||
m_APSId = (dot11sPathSelectionProtocol)i.ReadNtohU32 ();
|
||||
@@ -139,11 +139,13 @@ MeshConfigurationElement::Deserialize (Buffer::Iterator i)
|
||||
// Channel Precedence:
|
||||
m_CP = (dot11sChannelPrecedence)i.ReadU32 ();
|
||||
i = m_meshCap.Deserialize (i);
|
||||
return i;
|
||||
|
||||
|
||||
return i.GetDistanceFrom(start);
|
||||
}
|
||||
void
|
||||
MeshConfigurationElement::PrintInformation(std::ostream& os) const
|
||||
{
|
||||
//TODO: print
|
||||
}
|
||||
|
||||
void
|
||||
MeshConfigurationElement::SetRouting(dot11sPathSelectionProtocol routingId)
|
||||
{
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <stdint.h>
|
||||
#include "ns3/buffer.h"
|
||||
#include "ns3/dot11s-codes.h"
|
||||
#include "ns3/wifi-information-element.h"
|
||||
|
||||
namespace ns3 {
|
||||
/**
|
||||
@@ -67,7 +68,7 @@ class dot11sMeshCapability
|
||||
{
|
||||
public:
|
||||
dot11sMeshCapability();
|
||||
uint32_t GetSerializedSize () const;
|
||||
uint8_t GetSerializedSize () const;
|
||||
Buffer::Iterator Serialize (Buffer::Iterator i) const;
|
||||
Buffer::Iterator Deserialize (Buffer::Iterator i);
|
||||
bool acceptPeerLinks;
|
||||
@@ -83,9 +84,12 @@ private:
|
||||
/**
|
||||
* \ingroup mesh
|
||||
*/
|
||||
class MeshConfigurationElement
|
||||
class MeshConfigurationElement : public WifiInformationElement
|
||||
{
|
||||
public:
|
||||
static TypeId GetTypeId ();
|
||||
TypeId GetInstanceTypeId () const;
|
||||
|
||||
MeshConfigurationElement();
|
||||
void SetRouting(dot11sPathSelectionProtocol routingId);
|
||||
void SetMetric(dot11sPathSelectionMetric metricId);
|
||||
@@ -93,16 +97,19 @@ public:
|
||||
bool IsAirtime();
|
||||
|
||||
dot11sMeshCapability const& MeshCapability();
|
||||
protected:
|
||||
WifiElementId ElementId () const
|
||||
{
|
||||
return IE11S_MESH_CONFIGURATION;
|
||||
}
|
||||
|
||||
uint32_t GetSerializedSize () const;
|
||||
Buffer::Iterator Serialize (Buffer::Iterator i) const;
|
||||
Buffer::Iterator Deserialize (Buffer::Iterator i);
|
||||
uint8_t GetInformationSize () const;
|
||||
void SerializeInformation (Buffer::Iterator i) const;
|
||||
uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length);
|
||||
void PrintInformation(std::ostream& os) const;
|
||||
// TODO: Release and fill other fields in configuration
|
||||
// element
|
||||
private:
|
||||
static uint8_t ElementId() {
|
||||
return (uint8_t)IE11S_MESH_CONFIGURATION;
|
||||
}
|
||||
/** Active Path Selection Protocol ID */
|
||||
dot11sPathSelectionProtocol m_APSId;
|
||||
/** Active Path Metric ID */
|
||||
1
src/devices/mesh/802.11s/waf
vendored
Executable file
1
src/devices/mesh/802.11s/waf
vendored
Executable file
@@ -0,0 +1 @@
|
||||
exec "`dirname "$0"`"/../../../../waf "$@"
|
||||
@@ -30,6 +30,11 @@ WifiInformationElement::GetTypeId()
|
||||
return tid;
|
||||
}
|
||||
|
||||
TypeId
|
||||
WifiInformationElement::GetInstanceTypeId () const
|
||||
{
|
||||
return GetTypeId ();
|
||||
}
|
||||
uint32_t WifiInformationElement::GetSerializedSize () const
|
||||
{
|
||||
return (GetInformationSize() + 2);
|
||||
@@ -75,6 +75,7 @@ class WifiInformationElement : public Header
|
||||
public:
|
||||
/// Support object system
|
||||
static TypeId GetTypeId ();
|
||||
TypeId GetInstanceTypeId() const;
|
||||
|
||||
/// virtual d-tor for subclasses
|
||||
virtual ~WifiInformationElement() {}
|
||||
@@ -137,7 +138,7 @@ protected:
|
||||
/// Serialize information
|
||||
virtual void SerializeInformation (Buffer::Iterator start) const = 0;
|
||||
/// Deserialize information
|
||||
virtual uint32_t DeserializeInformation (Buffer::Iterator start, uint32_t length) = 0;
|
||||
virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length) = 0;
|
||||
/// Print information
|
||||
virtual void PrintInformation (std::ostream &os) const = 0;
|
||||
//\}
|
||||
31
src/devices/mesh/802.11s/wscript
Normal file
31
src/devices/mesh/802.11s/wscript
Normal file
@@ -0,0 +1,31 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_module('802.11s', ['wifi'])
|
||||
obj.source = [
|
||||
'wifi-information-element.cc',
|
||||
# Not refactored
|
||||
'mesh-wifi-beacon-timing-element.cc',
|
||||
'mesh-wifi-perr-information-element.cc',
|
||||
'mesh-wifi-prep-information-element.cc',
|
||||
'mesh-configuration-element.cc',
|
||||
'mesh-wifi-rann-information-element.cc',
|
||||
'mesh-wifi-preq-information-element.cc',
|
||||
]
|
||||
headers = bld.new_task_gen('ns3header')
|
||||
headers.module = '802.11s'
|
||||
headers.source = [
|
||||
# Refactored
|
||||
'wifi-information-element.h',
|
||||
# Dirty
|
||||
'mesh-wifi-rann-information-element.h',
|
||||
'mesh-wifi-beacon-timing-element.h',
|
||||
'mesh-wifi-preq-information-element.h',
|
||||
'mesh-configuration-element.h',
|
||||
'mesh-wifi-perr-information-element.h',
|
||||
'mesh-wifi-prep-information-element.h',
|
||||
]
|
||||
|
||||
# obj = bld.create_ns3_program('wifi-phy-test',
|
||||
# ['core', 'simulator', 'mobility', 'node', 'wifi'])
|
||||
# obj.source = 'wifi-phy-test.cc'
|
||||
@@ -76,7 +76,8 @@ MgtMeshBeaconHeader::Serialize (Buffer::Iterator start) const
|
||||
Buffer::Iterator i = start;
|
||||
MgtBeaconHeader::Serialize(i);
|
||||
i.Next (MgtBeaconHeader::GetSerializedSize());
|
||||
i = m_meshConfig.Serialize(i);
|
||||
m_meshConfig.Serialize(i);
|
||||
i.Next(m_meshConfig.GetSerializedSize());
|
||||
i = m_meshTiming.Serialize(i);
|
||||
i.Next (9); //MSCIE
|
||||
}
|
||||
@@ -88,7 +89,8 @@ MgtMeshBeaconHeader::Deserialize (Buffer::Iterator start)
|
||||
Buffer::Iterator i = start;
|
||||
MgtBeaconHeader::Deserialize(start);
|
||||
i.Next (MgtBeaconHeader::GetSerializedSize());
|
||||
i = m_meshConfig.Deserialize(i);
|
||||
m_meshConfig.Deserialize(i);
|
||||
i.Next(m_meshConfig.GetSerializedSize());
|
||||
i = m_meshTiming.Deserialize(i);
|
||||
i.Next (9); //MSCIE
|
||||
return i.GetDistanceFrom (start);
|
||||
@@ -230,7 +232,8 @@ MeshMgtPeerLinkManFrame::Serialize(Buffer::Iterator start) const
|
||||
//now QoS capabilities
|
||||
i.WriteHtonU16 (QoS);
|
||||
i = MeshId.Serialize (i);
|
||||
i = MeshConfig.Serialize (i);
|
||||
MeshConfig.Serialize (i);
|
||||
i.Next(MeshConfig.GetSerializedSize());
|
||||
}
|
||||
i = PeerLinkMan.Serialize (i);
|
||||
}
|
||||
@@ -247,7 +250,8 @@ MeshMgtPeerLinkManFrame::Deserialize(Buffer::Iterator start)
|
||||
i = Rates.Deserialize (i);
|
||||
QoS = i.ReadNtohU16 ();
|
||||
i = MeshId.Deserialize (i);
|
||||
i = MeshConfig.Deserialize (i);
|
||||
MeshConfig.Deserialize (i);
|
||||
i.Next(MeshConfig.GetSerializedSize());
|
||||
}
|
||||
i = PeerLinkMan.Deserialize (i);
|
||||
return i.GetDistanceFrom (start);
|
||||
|
||||
@@ -1,31 +1,28 @@
|
||||
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
def build(bld):
|
||||
obj = bld.create_ns3_module('mesh', ['wifi'])
|
||||
obj = bld.create_ns3_module('mesh', ['wifi', '802.11s'])
|
||||
obj.source = [
|
||||
# Refactored
|
||||
'mesh-point-device.cc',
|
||||
'mesh-l2-routing-protocol.cc',
|
||||
<<<<<<< local
|
||||
'wifi-information-element.cc',
|
||||
'mesh-wifi-beacon.cc',
|
||||
=======
|
||||
>>>>>>> other
|
||||
# Not refactored
|
||||
'mesh-wifi-helper.cc',
|
||||
'mesh-wifi-mac-header.cc',
|
||||
'mesh-wifi-peer-manager.cc',
|
||||
'tx-statistics.cc',
|
||||
'mesh-wifi-beacon-timing-element.cc',
|
||||
'hwmp-rtable.cc',
|
||||
'dot11s-parameters.cc',
|
||||
'mesh-wifi-perr-information-element.cc',
|
||||
'hwmp.cc',
|
||||
'mesh-wifi-prep-information-element.cc',
|
||||
'mesh-wifi-mac.cc',
|
||||
'hwmp-state.cc',
|
||||
'mesh-configuration-element.cc',
|
||||
'dot11s-peer-management-element.cc',
|
||||
'mesh-mgt-headers.cc',
|
||||
'mesh-wifi-rann-information-element.cc',
|
||||
'mesh-wifi-preq-information-element.cc',
|
||||
]
|
||||
headers = bld.new_task_gen('ns3header')
|
||||
headers.module = 'mesh'
|
||||
@@ -33,28 +30,25 @@ def build(bld):
|
||||
# Refactored
|
||||
'mesh-point-device.h',
|
||||
'mesh-l2-routing-protocol.h',
|
||||
<<<<<<< local
|
||||
'wifi-information-element.h',
|
||||
'mesh-wifi-beacon.h',
|
||||
=======
|
||||
>>>>>>> other
|
||||
# Dirty
|
||||
'dot11s-codes.h',
|
||||
'mesh-wifi-rann-information-element.h',
|
||||
'hwmp-state.h',
|
||||
'mesh-wifi-beacon-timing-element.h',
|
||||
'dot11s-parameters.h',
|
||||
'mesh-mgt-headers.h',
|
||||
'hwmp.h',
|
||||
'tx-statistics.h',
|
||||
'dot11s-peer-management-element.h',
|
||||
'mac48-address-comparator.h',
|
||||
'mesh-wifi-preq-information-element.h',
|
||||
'hwmp-rtable.h',
|
||||
'mesh-wifi-peer-manager.h',
|
||||
'mesh-wifi-mac-header.h',
|
||||
'mesh-wifi-mac.h',
|
||||
'mesh-configuration-element.h',
|
||||
'mesh-wifi-perr-information-element.h',
|
||||
'mesh-wifi-helper.h',
|
||||
'mesh-wifi-prep-information-element.h',
|
||||
]
|
||||
|
||||
# obj = bld.create_ns3_program('wifi-phy-test',
|
||||
|
||||
@@ -35,6 +35,7 @@ all_modules = (
|
||||
'contrib/stats',
|
||||
'applications/v4ping',
|
||||
'devices/mesh',
|
||||
'devices/mesh/802.11s',
|
||||
)
|
||||
|
||||
def set_options(opt):
|
||||
|
||||
Reference in New Issue
Block a user