Installers moved to src/helper

This commit is contained in:
Kirill Andreev
2009-08-27 13:38:13 +04:00
parent 3f6a30b19c
commit 38e5fe4ec9
14 changed files with 59 additions and 31 deletions

View File

@@ -20,7 +20,9 @@
* Pavel Boyko <boyko@iitp.ru>
*/
#include "peer-link.h"
#include "ns3/peer-link.h"
#include "ie-dot11s-configuration.h"
#include "peer-management-protocol-mac.h"
#include "ns3/log.h"
#include "ns3/simulator.h"
#include "ns3/traced-value.h"
@@ -89,8 +91,15 @@ PeerLink::GetTypeId ()
// PeerLink public interface
//-----------------------------------------------------------------------------
PeerLink::PeerLink () :
m_peerAddress (Mac48Address::GetBroadcast ()), m_peerMeshPointAddress (Mac48Address::GetBroadcast ()),
m_localLinkId (0), m_peerLinkId (0), m_packetFail (0), m_state (IDLE), m_retryCounter (0), m_maxPacketFail (3)
m_peerAddress (Mac48Address::GetBroadcast ()),
m_peerMeshPointAddress (Mac48Address::GetBroadcast ()),
m_localLinkId (0),
m_peerLinkId (0),
m_packetFail (0),
m_state (IDLE),
m_configuration (Create <IeConfiguration> ()),
m_retryCounter (0),
m_maxPacketFail (3)
{
}
PeerLink::~PeerLink ()
@@ -238,7 +247,7 @@ PeerLink::OpenAccept (uint16_t localLinkId, IeConfiguration conf, Mac48Address p
{
m_peerLinkId = localLinkId;
}
m_configuration = conf;
m_configuration = Ptr<IeConfiguration> (&conf);
if (m_peerMeshPointAddress != Mac48Address::GetBroadcast ())
{
NS_ASSERT (m_peerMeshPointAddress == peerMp);
@@ -256,7 +265,7 @@ PeerLink::OpenReject (uint16_t localLinkId, IeConfiguration conf, Mac48Address p
{
m_peerLinkId = localLinkId;
}
m_configuration = conf;
m_configuration = Ptr<IeConfiguration> (&conf);
if (m_peerMeshPointAddress != Mac48Address::GetBroadcast ())
{
NS_ASSERT (m_peerMeshPointAddress == peerMp);
@@ -286,7 +295,7 @@ PeerLink::ConfirmAccept (uint16_t localLinkId, uint16_t peerLinkId, uint16_t pee
return;
}
}
m_configuration = conf;
m_configuration = Ptr<IeConfiguration> (&conf);
m_peerAssocId = peerAid;
if (m_peerMeshPointAddress != Mac48Address::GetBroadcast ())
{
@@ -317,7 +326,7 @@ PeerLink::ConfirmReject (uint16_t localLinkId, uint16_t peerLinkId, IeConfigurat
return;
}
}
m_configuration = conf;
m_configuration = Ptr<IeConfiguration> (&conf);
if (m_peerMeshPointAddress != Mac48Address::GetBroadcast ())
{
NS_ASSERT (m_peerMeshPointAddress == peerMp);
@@ -607,27 +616,30 @@ PeerLink::ClearHoldingTimer ()
void
PeerLink::SendPeerLinkClose (PmpReasonCode reasoncode)
{
NS_ASSERT (m_configuration != 0);
IePeerManagement peerElement;
peerElement.SetPeerClose (m_localLinkId, m_peerLinkId, reasoncode);
m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_peerMeshPointAddress, m_assocId, peerElement,
m_configuration);
*m_configuration);
}
void
PeerLink::SendPeerLinkOpen ()
{
NS_ASSERT (m_configuration != 0);
IePeerManagement peerElement;
peerElement.SetPeerOpen (m_localLinkId);
NS_ASSERT (m_macPlugin != 0);
m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_peerMeshPointAddress, m_assocId, peerElement,
m_configuration);
*m_configuration);
}
void
PeerLink::SendPeerLinkConfirm ()
{
NS_ASSERT (m_configuration != 0);
IePeerManagement peerElement;
peerElement.SetPeerConfirm (m_localLinkId, m_peerLinkId);
m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_peerMeshPointAddress, m_assocId, peerElement,
m_configuration);
*m_configuration);
}
void
PeerLink::SetHoldingTimer ()

View File

@@ -23,15 +23,16 @@
#define PEERLLINK_H_
#include "ns3/nstime.h"
#include "ns3/object.h"
#include "ns3/callback.h"
#include "ns3/mac48-address.h"
#include "ns3/event-id.h"
#include "ie-dot11s-beacon-timing.h"
#include "ie-dot11s-peer-management.h"
#include "ie-dot11s-configuration.h"
#include "peer-management-protocol-mac.h"
#include "ns3/ie-dot11s-beacon-timing.h"
#include "ns3/ie-dot11s-peer-management.h"
namespace ns3 {
namespace dot11s {
class IeConfiguration;
class PeerManagementProtocolMac;
/**
* \ingroup dot11s
*
@@ -229,8 +230,11 @@ private:
/// Current state
PeerState m_state;
/// Mesh interface configuration
IeConfiguration m_configuration;
/**
* \brief Mesh interface configuration
* \attention Is not used now, nothing to configure :)
*/
Ptr<IeConfiguration> m_configuration;
/// Beacon timing element received from the peer. Needed by BCA
IeBeaconTiming m_beaconTiming;

View File

@@ -19,7 +19,8 @@
* Aleksey Kovalenko <kovalenko@iitp.ru>
*/
#include "peer-management-protocol.h"
#include "ns3/peer-management-protocol.h"
#include "peer-management-protocol-mac.h"
#include "ie-dot11s-configuration.h"
#include "ie-dot11s-id.h"
#include "ns3/mesh-point-device.h"

View File

@@ -23,12 +23,13 @@ def build(bld):
'hwmp-protocol-mac.cc',
'hwmp-protocol.cc',
'airtime-metric.cc',
'dot11s-installer.cc',
]
headers = bld.new_task_gen('ns3header')
headers.module = 'dot11s'
headers.source = [
'hwmp-protocol.h',
'peer-management-protocol.h',
'dot11s-installer.h',
'ie-dot11s-beacon-timing.h',
'ie-dot11s-peer-management.h',
'peer-link.h',
]

View File

@@ -19,7 +19,9 @@
*/
#include "flame-protocol.h"
#include "flame-protocol-mac.h"
#include "flame-header.h"
#include "flame-rtable.h"
#include "ns3/llc-snap-header.h"
#include "ns3/log.h"
#include "ns3/simulator.h"

View File

@@ -21,11 +21,9 @@
#ifndef FLAME_PROTOCOL_H
#define FLAME_PROTOCOL_H
#include "flame-protocol-mac.h"
#include "flame-header.h"
#include "flame-rtable.h"
#include "ns3/mesh-l2-routing-protocol.h"
#include "ns3/nstime.h"
#include "ns3/tag.h"
#include <map>
@@ -46,6 +44,9 @@
*/
namespace ns3 {
namespace flame {
class FlameProtocolMac;
class FlameHeader;
class FlameRtable;
/**
* \ingroup flame
* \brief Transmitter and receiver addresses

View File

@@ -7,7 +7,6 @@ def build(bld):
'flame-rtable.cc',
'flame-protocol-mac.cc',
'flame-protocol.cc',
'flame-installer.cc',
]
headers = bld.new_task_gen('ns3header')
headers.module = 'flame'

View File

@@ -19,5 +19,4 @@ def build(bld):
'mesh-wifi-beacon.h',
'mesh-wifi-interface-mac.h',
'mesh-wifi-interface-mac-plugin.h',
'mesh-stack-installer.h',
]

View File

@@ -17,9 +17,9 @@
*
* Authors: Kirill Andreev <andreev@iitp.ru>
*/
#include "dot11s-installer.h"
#include "peer-management-protocol.h"
#include "hwmp-protocol.h"
#include "ns3/dot11s-installer.h"
#include "ns3/peer-management-protocol.h"
#include "ns3/hwmp-protocol.h"
#include "ns3/wifi-net-device.h"
#include "ns3/mesh-wifi-interface-mac.h"

View File

@@ -18,8 +18,8 @@
* Authors: Kirill Andreev <andreev@iitp.ru>
*/
#include "flame-installer.h"
#include "flame-protocol.h"
#include "ns3/flame-installer.h"
#include "ns3/flame-protocol.h"
#include "ns3/wifi-net-device.h"
#include "ns3/mesh-wifi-interface-mac.h"

View File

@@ -26,15 +26,19 @@ namespace ns3 {
/**
* \ingroup mesh
*
* \brief Prototype for class, which helps to install mesh stack of
* protocols
* \brief Prototype for class, which helps to install MAC-layer
* routing stack to ns3::MeshPointDevice
* \details You need to create a MeshPointDevice and attach all
* interfaces to it, than call Install method
*/
class MeshStack : public Object
{
public:
///\brief Installs mesh stack. needed by helper only
virtual bool InstallStack (Ptr<MeshPointDevice> mp) = 0;
/// Report statistics of a given mesh point
virtual void Report (const Ptr<MeshPointDevice> mp, std::ostream&) = 0;
/// Reset statistics of a given mesh point
virtual void ResetStats (const Ptr<MeshPointDevice> mp) = 0;
};
}

View File

@@ -29,6 +29,8 @@ def build(bld):
'ipv4-list-routing-helper.cc',
'ipv4-routing-helper.cc',
'mesh-helper.cc',
'dot11s-installer.cc',
'flame-installer.cc',
'athstats-helper.cc',
'ipv6-address-helper.cc',
'ipv6-interface-container.cc',
@@ -67,6 +69,9 @@ def build(bld):
'ipv4-list-routing-helper.h',
'ipv4-routing-helper.h',
'mesh-helper.h',
'mesh-stack-installer.h',
'dot11s-installer.h',
'flame-installer.h',
'athstats-helper.h',
'ipv6-address-helper.h',
'ipv6-interface-container.h',