From d2c93355a04cf5267fa8ea4af48cc3fcb0dd6223 Mon Sep 17 00:00:00 2001 From: Borovkova Elena Date: Wed, 9 Sep 2009 12:19:22 +0400 Subject: [PATCH] preparation for merge with ns-3-dev --- examples/aodv.cc | 100 ++-------- examples/aodv2.cc | 214 --------------------- examples/aodv_random_disc.cc | 214 --------------------- examples/wscript | 361 ++++++++++++++++++----------------- samples/wscript | 103 +++++----- src/internet-stack/wscript | 22 ++- 6 files changed, 271 insertions(+), 743 deletions(-) delete mode 100644 examples/aodv2.cc delete mode 100644 examples/aodv_random_disc.cc diff --git a/examples/aodv.cc b/examples/aodv.cc index b79f8c183..30e3c845e 100644 --- a/examples/aodv.cc +++ b/examples/aodv.cc @@ -34,13 +34,6 @@ using namespace ns3; -enum TrafficType -{ - PING = 1, - UDP = 2, - TCP = 3 -}; - /** * \brief Test script. * @@ -72,8 +65,6 @@ private: double totalTime; /// Write per-device PCAP traces if true bool pcap; - /// Traffic type - uint16_t type; //\} ///\name network @@ -106,8 +97,7 @@ AodvExample::AodvExample () : size (10), step (120), totalTime (10), - pcap (true), - type (PING) + pcap (true) { } @@ -121,7 +111,6 @@ AodvExample::Configure (int argc, char **argv) CommandLine cmd; cmd.AddValue ("pcap", "Write PCAP traces.", pcap); - cmd.AddValue ("type", "Traffic type.", type); cmd.AddValue ("size", "Number of nodes.", size); cmd.AddValue ("time", "Simulation time, s.", totalTime); cmd.AddValue ("step", "Grid step, m", step); @@ -210,83 +199,16 @@ AodvExample::InstallInternetStack () void AodvExample::InstallApplications () { - switch (type) - { - case PING: - { - V4PingHelper ping (interfaces.GetAddress(size - 1)); - ping.SetAttribute ("Verbose", BooleanValue (true)); - - ApplicationContainer p = ping.Install (nodes.Get (0)); - p.Start (Seconds (0)); - p.Stop (Seconds (totalTime)); - break; - } - case UDP: - { - // Create the OnOff application to send UDP datagrams of size - // 210 bytes at a rate of 448 Kb/s - Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); - Config::SetDefault ("ns3::OnOffApplication::DataRate", DataRateValue (DataRate ("6Mbps"))); - uint16_t port = 9; // Discard port (RFC 863) - - OnOffHelper onoff ("ns3::UdpSocketFactory", - Address (InetSocketAddress (interfaces.GetAddress(size-1), port))); - onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable(1))); - onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable(0))); - - ApplicationContainer apps = onoff.Install (nodes.Get (0)); - apps.Start(Seconds(0)); - apps.Stop (Seconds(totalTime)); - - // Create an optional packet sink to receive these packets - PacketSinkHelper sink ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); - for (uint32_t i = 1; i < nodes.GetN (); ++i) - { - apps.Add(sink.Install (nodes.Get (i)) ); - } - apps.Start (Seconds (0)); - apps.Stop (Seconds (totalTime)); - break; - } - case TCP: - { - V4PingHelper ping (interfaces.GetAddress(size - 1)); - ping.SetAttribute ("Verbose", BooleanValue (true)); - - ApplicationContainer p = ping.Install (nodes.Get (0)); - p.Start (Seconds (0)); - p.Stop (Seconds (totalTime/2)); - - - Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (4096)); - Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("6Mbps")); - - uint16_t port = 8080; - PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), port)); - ApplicationContainer sinkApp = sinkHelper.Install (nodes.Get (size-1)); - sinkApp.Start (Seconds (totalTime/2)); - sinkApp.Stop (Seconds (totalTime)); - - // Create the OnOff applications to send TCP - OnOffHelper clientHelper ("ns3::TcpSocketFactory", Address ()); - clientHelper.SetAttribute - ("OnTime", RandomVariableValue (ConstantVariable (1))); - clientHelper.SetAttribute - ("OffTime", RandomVariableValue (ConstantVariable (0))); - - ApplicationContainer clientApp; - AddressValue remoteAddress - (InetSocketAddress (interfaces.GetAddress (size-1), port)); - clientHelper.SetAttribute ("Remote", remoteAddress); - clientApp = clientHelper.Install (nodes.Get (0)); - clientApp.Start (Seconds (totalTime/2)); - clientApp.Stop (Seconds (totalTime)); - - } - - }; + V4PingHelper ping (interfaces.GetAddress(size - 1)); + ping.SetAttribute ("Verbose", BooleanValue (true)); + + ApplicationContainer p = ping.Install (nodes.Get (0)); + p.Start (Seconds (0)); + p.Stop (Seconds (totalTime)); + // move node away + Ptr node = nodes.Get (size/2); + Ptr mob = node->GetObject(); + Simulator::Schedule (Seconds (totalTime/3), &MobilityModel::SetPosition, mob, Vector(1e5, 1e5, 1e5)); } diff --git a/examples/aodv2.cc b/examples/aodv2.cc deleted file mode 100644 index dafaf0e17..000000000 --- a/examples/aodv2.cc +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2009 IITP RAS - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * This is an example script for AODV manet routing protocol. - * - * Authors: Pavel Boyko - */ - -#include "ns3/aodv-module.h" -#include "ns3/core-module.h" -#include "ns3/common-module.h" -#include "ns3/node-module.h" -#include "ns3/helper-module.h" -#include "ns3/mobility-module.h" -#include "ns3/contrib-module.h" -#include "ns3/wifi-module.h" -#include "ns3/v4ping-helper.h" -#include -#include - -using namespace ns3; - -/** - * \brief Test script. - * - * This script creates 1-dimensional grid topology and then ping last node from the first one: - * - * [10.0.0.1] <-- step --> [10.0.0.2] <-- step --> [10.0.0.3] <-- step --> [10.0.04] - * - * ping 10.0.0.4 - */ -class AodvExample -{ -public: - AodvExample (); - /// Configure script parameters, \return true on successful configuration - bool Configure (int argc, char **argv); - /// Run simulation - void Run (); - /// Report results - void Report (std::ostream & os); - -private: - ///\name parameters - //\{ - /// Number of nodes - uint32_t size; - /// Distance between nodes, meters - double step; - /// Simulation time, seconds - double totalTime; - /// Write per-device PCAP traces if true - bool pcap; - //\} - - ///\name network - //\{ - NodeContainer nodes; - NetDeviceContainer devices; - Ipv4InterfaceContainer interfaces; - //\} - -private: - void CreateNodes (); - void CreateDevices (); - void InstallInternetStack (); - void InstallApplications (); -}; - -int main (int argc, char **argv) -{ - AodvExample test; - if (! test.Configure(argc, argv)) - NS_FATAL_ERROR ("Configuration failed. Aborted."); - - test.Run (); - test.Report (std::cout); - return 0; -} - -//----------------------------------------------------------------------------- -AodvExample::AodvExample () : - size (10), - step (120), - totalTime (10), - pcap (true) -{ -} - -bool -AodvExample::Configure (int argc, char **argv) -{ - // Enable AODV logs by default. Comment this if too noisy - // LogComponentEnable("AodvRoutingProtocol", LOG_LEVEL_ALL); - - SeedManager::SetSeed(12345); - CommandLine cmd; - - cmd.AddValue ("pcap", "Write PCAP traces.", pcap); - cmd.AddValue ("size", "Number of nodes.", size); - cmd.AddValue ("time", "Simulation time, s.", totalTime); - cmd.AddValue ("step", "Grid step, m", step); - - cmd.Parse (argc, argv); - return true; -} - -void -AodvExample::Run () -{ -// Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", UintegerValue (1)); // enable rts cts all the time. - CreateNodes (); - CreateDevices (); - InstallInternetStack (); - InstallApplications (); - - std::cout << "Starting simulation for " << totalTime << " s ...\n"; - - Simulator::Stop (Seconds (totalTime)); - Simulator::Run (); - Simulator::Destroy (); -} - -void -AodvExample::Report (std::ostream &) -{ -} - -void -AodvExample::CreateNodes () -{ - std::cout << "Creating " << (unsigned)size << " nodes " << step << " m apart.\n"; - nodes.Create (size); - // Name nodes - for (uint32_t i = 0; i < size; ++i) - { - std::ostringstream os; - os << "node-" << i; - Names::Add (os.str (), nodes.Get (i)); - } - // Create static grid - MobilityHelper mobility; - mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (0.0), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (step), - "DeltaY", DoubleValue (0), - "GridWidth", UintegerValue (size), - "LayoutType", StringValue ("RowFirst")); - mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); - mobility.Install (nodes); -} - -void -AodvExample::CreateDevices () -{ - NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); - wifiMac.SetType ("ns3::AdhocWifiMac"); - YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); - YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); - wifiPhy.SetChannel (wifiChannel.Create ()); - WifiHelper wifi = WifiHelper::Default (); - wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("wifia-6mbs"), "RtsCtsThreshold", UintegerValue (0)); - devices = wifi.Install (wifiPhy, wifiMac, nodes); - - if (pcap) - { - wifiPhy.EnablePcapAll (std::string ("aodv")); - } -} - -void -AodvExample::InstallInternetStack () -{ - AodvHelper aodv; - // you can configure AODV attributes here using aodv.Set(name, value) - InternetStackHelper stack; - stack.SetRoutingHelper (aodv); - stack.Install (nodes); - Ipv4AddressHelper address; - address.SetBase ("10.0.0.0", "255.0.0.0"); - interfaces = address.Assign (devices); -} - -void -AodvExample::InstallApplications () -{ - V4PingHelper ping (interfaces.GetAddress(size - 1)); - ping.SetAttribute ("Verbose", BooleanValue (true)); - - ApplicationContainer p = ping.Install (nodes.Get (0)); - p.Start (Seconds (0)); - p.Stop (Seconds (totalTime)); - - // move node away - Ptr node = nodes.Get (2); - Ptr mob = node->GetObject(); - Simulator::Schedule (Seconds (3), &MobilityModel::SetPosition, mob, Vector(1e5, 1e5, 1e5)); -} - diff --git a/examples/aodv_random_disc.cc b/examples/aodv_random_disc.cc deleted file mode 100644 index ddb739d88..000000000 --- a/examples/aodv_random_disc.cc +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2009 IITP RAS - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * This is an example script for AODV manet routing protocol. - * - * Authors: Pavel Boyko - */ - -#include "ns3/aodv-module.h" -#include "ns3/core-module.h" -#include "ns3/common-module.h" -#include "ns3/node-module.h" -#include "ns3/helper-module.h" -#include "ns3/mobility-module.h" -#include "ns3/contrib-module.h" -#include "ns3/wifi-module.h" -#include "ns3/v4ping-helper.h" -#include -#include - -using namespace ns3; - -/** - * \brief Test script. - */ -class AodvExample -{ -public: - AodvExample (); - /// Configure script parameters, \return true on successful configuration - bool Configure (int argc, char **argv); - /// Run simulation - void Run (); - /// Report results - void Report (std::ostream & os); - -private: - ///\name parameters - //\{ - /// Number of nodes in disc - uint32_t size; - /// Radius of disc, meters - double radius; - /// Simulation time, seconds - double totalTime; - /// Write per-device PCAP traces if true - bool pcap; - //\} - - ///\name network - //\{ - NodeContainer nodes; - NodeContainer node1; - NetDeviceContainer devices; - NetDeviceContainer device1; - Ipv4InterfaceContainer interfaces; - Ipv4InterfaceContainer interface1; - //\} - -private: - void CreateNodes (); - void CreateDevices (); - void InstallInternetStack (); - void InstallApplications (); -}; - -int main (int argc, char **argv) -{ - AodvExample test; - if (! test.Configure(argc, argv)) - NS_FATAL_ERROR ("Configuration failed. Aborted."); - - test.Run (); - test.Report (std::cout); - return 0; -} - -//----------------------------------------------------------------------------- -AodvExample::AodvExample () : - size (64), - radius (50), - totalTime (10), - pcap (true) -{ -} - -bool -AodvExample::Configure (int argc, char **argv) -{ - // Enable AODV logs by default. Comment this if too noisy - // LogComponentEnable("AodvRoutingProtocol", LOG_LEVEL_ALL); - - SeedManager::SetSeed(12345); - CommandLine cmd; - - cmd.AddValue ("pcap", "Write PCAP traces.", pcap); - cmd.AddValue ("size", "Number of nodes.", size); - cmd.AddValue ("time", "Simulation time, s.", totalTime); - cmd.AddValue ("radius", "Radius of disc, m", radius); - - cmd.Parse (argc, argv); - return true; -} - -void -AodvExample::Run () -{ - CreateNodes (); - CreateDevices (); - InstallInternetStack (); - InstallApplications (); - - std::cout << "Starting simulation for " << totalTime << " s ...\n"; - - Simulator::Stop (Seconds (totalTime)); - Simulator::Run (); - Simulator::Destroy (); -} - -void -AodvExample::Report (std::ostream &) -{ -} - -void -AodvExample::CreateNodes () -{ - std::cout << "Creating " << (unsigned)size << " nodes in disc " << radius << " m.\n"; - nodes.Create (size); - node1.Create(1); - // Name nodes - for (uint32_t i = 0; i < size; ++i) - { - std::ostringstream os; - os << "node-" << i; - Names::Add (os.str (), nodes.Get (i)); - } - - MobilityHelper mobility; - Ptr positionAlloc = CreateObject(); - positionAlloc->SetRho(UniformVariable (0.0, radius)); - positionAlloc->SetTheta(UniformVariable (0.0, 6.2830)); - positionAlloc->SetX(0.0); - positionAlloc->SetY(0.0); - mobility.SetPositionAllocator(positionAlloc); - mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); - mobility.Install (nodes); - - Ptr pos = CreateObject(); - pos->Add(Vector(155.0 + radius, 0.0, 0.0)); - mobility.SetPositionAllocator(pos); - mobility.Install (node1); -} - -void -AodvExample::CreateDevices () -{ - NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); - wifiMac.SetType ("ns3::AdhocWifiMac"); - YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); - YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); - wifiPhy.SetChannel (wifiChannel.Create ()); - WifiHelper wifi = WifiHelper::Default (); - wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("wifia-6mbs")); - devices = wifi.Install (wifiPhy, wifiMac, nodes); - device1 = wifi.Install (wifiPhy, wifiMac, node1); - - if (pcap) - { - wifiPhy.EnablePcapAll (std::string ("aodv")); - } -} - -void -AodvExample::InstallInternetStack () -{ - AodvHelper aodv; - // you can configure AODV attributes here using aodv.Set(name, value) - InternetStackHelper stack; - stack.SetRoutingHelper (aodv); - stack.Install (nodes); - stack.Install(node1); - Ipv4AddressHelper address; - address.SetBase ("10.0.0.0", "255.0.0.0"); - interfaces = address.Assign (devices); - interface1 = address.Assign (device1); - -} - -void -AodvExample::InstallApplications () -{ - V4PingHelper ping (interface1.GetAddress(0)); - ping.SetAttribute ("Verbose", BooleanValue (true)); - - ApplicationContainer p = ping.Install (nodes.Get (0)); - p.Start (Seconds (0)); - p.Stop (Seconds (totalTime)); -} - diff --git a/examples/wscript b/examples/wscript index 41000612d..9d720d13b 100644 --- a/examples/wscript +++ b/examples/wscript @@ -3,181 +3,198 @@ def build(bld): obj = bld.create_ns3_program('aodv') obj.source = 'aodv.cc' - - obj = bld.create_ns3_program('aodv2') - obj.source = 'aodv2.cc' - obj = bld.create_ns3_program('aodv_crash') - obj.source = 'aodv_random_disc.cc' + obj = bld.create_ns3_program('hello-simulator') + obj.source = 'hello-simulator.cc' + + obj = bld.create_ns3_program('first', + ['core', 'simulator', 'point-to-point', 'internet-stack']) + obj.source = 'first.cc' + + obj = bld.create_ns3_program('second', + ['core', 'simulator', 'point-to-point', 'csma', 'internet-stack']) + obj.source = 'second.cc' + + obj = bld.create_ns3_program('third', + ['core', 'simulator', 'point-to-point', 'csma', 'wifi', 'internet-stack']) + obj.source = 'third.cc' + + obj = bld.create_ns3_program('object-names', + ['core', 'simulator', 'csma', 'internet-stack']) + obj.source = 'object-names.cc' + + obj = bld.create_ns3_program('mixed-wireless', + ['core', 'simulator', 'mobility', 'wifi', 'point-to-point', 'internet-stack']) + obj.source = 'mixed-wireless.cc' + + obj = bld.create_ns3_program('dynamic-global-routing', + ['point-to-point', 'csma', 'internet-stack', 'global-routing']) + obj.source = 'dynamic-global-routing.cc' + + obj = bld.create_ns3_program('static-routing-slash32', + ['point-to-point', 'internet-stack', 'global-routing']) + obj.source = 'static-routing-slash32.cc' + + obj = bld.create_ns3_program('global-routing-slash32', + ['point-to-point', 'internet-stack', 'global-routing']) + obj.source = 'global-routing-slash32.cc' + + obj = bld.create_ns3_program('global-injection-slash32', + ['point-to-point', 'internet-stack', 'global-routing']) + obj.source = 'global-injection-slash32.cc' + + obj = bld.create_ns3_program('simple-global-routing', + ['point-to-point', 'internet-stack', 'global-routing']) + obj.source = 'simple-global-routing.cc' + + obj = bld.create_ns3_program('virtual-net-device', + ['point-to-point', 'internet-stack', 'global-routing', 'virtual-net-device']) + obj.source = 'virtual-net-device.cc' + + obj = bld.create_ns3_program('simple-alternate-routing', + ['point-to-point', 'internet-stack', 'global-routing']) + obj.source = 'simple-alternate-routing.cc' + + obj = bld.create_ns3_program('simple-error-model', + ['point-to-point', 'internet-stack']) + obj.source = 'simple-error-model.cc' + + obj = bld.create_ns3_program('csma-one-subnet', + ['csma', 'internet-stack']) + obj.source = 'csma-one-subnet.cc' + + obj = bld.create_ns3_program('csma-bridge', + ['bridge', 'csma', 'internet-stack']) + obj.source = 'csma-bridge.cc' + + obj = bld.create_ns3_program('csma-bridge-one-hop', + ['bridge', 'csma', 'internet-stack']) + obj.source = 'csma-bridge-one-hop.cc' + + obj = bld.create_ns3_program('udp-echo', + ['csma', 'internet-stack']) + obj.source = 'udp-echo.cc' + + obj = bld.create_ns3_program('realtime-udp-echo', + ['csma', 'internet-stack']) + obj.source = 'realtime-udp-echo.cc' + + obj = bld.create_ns3_program('csma-broadcast', + ['csma', 'internet-stack']) + obj.source = 'csma-broadcast.cc' + + obj = bld.create_ns3_program('csma-packet-socket', + ['csma', 'internet-stack']) + obj.source = 'csma-packet-socket.cc' + + obj = bld.create_ns3_program('csma-multicast', + ['csma', 'internet-stack']) + obj.source = 'csma-multicast.cc' + + obj = bld.create_ns3_program( 'mixed-global-routing', + ['point-to-point', 'internet-stack', 'global-routing' , 'csma-cd']) + obj.source = 'mixed-global-routing.cc' + + obj = bld.create_ns3_program('simple-point-to-point-olsr', + ['point-to-point', 'internet-stack', 'olsr']) + obj.source = 'simple-point-to-point-olsr.cc' + + obj = bld.create_ns3_program('tcp-large-transfer', + ['point-to-point', 'internet-stack']) + obj.source = 'tcp-large-transfer.cc' + + obj = bld.create_ns3_program('tcp-nsc-lfn', + ['point-to-point', 'internet-stack']) + obj.source = 'tcp-nsc-lfn.cc' + + obj = bld.create_ns3_program('tcp-nsc-zoo', + ['csma', 'internet-stack']) + obj.source = 'tcp-nsc-zoo.cc' + + obj = bld.create_ns3_program('tcp-star-server', + ['point-to-point', 'internet-stack']) + obj.source = 'tcp-star-server.cc' + + obj = bld.create_ns3_program('star', + ['point-to-point', 'internet-stack']) + obj.source = 'star.cc' + + obj = bld.create_ns3_program('csma-star', + ['csma', 'internet-stack']) + obj.source = 'csma-star.cc' + + obj = bld.create_ns3_program('wifi-adhoc', + ['core', 'simulator', 'mobility', 'wifi']) + obj.source = 'wifi-adhoc.cc' + + obj = bld.create_ns3_program('wifi-clear-channel-cmu', + ['core', 'simulator', 'mobility', 'wifi']) + obj.source = 'wifi-clear-channel-cmu.cc' + + obj = bld.create_ns3_program('wifi-ap', + ['core', 'simulator', 'mobility', 'wifi']) + obj.source = 'wifi-ap.cc' + + bld.add_subdirs('stats') + + obj = bld.create_ns3_program('wifi-wired-bridging', + ['core', 'simulator', 'mobility', 'wifi', + 'csma', 'helper', 'bridge']) + obj.source = 'wifi-wired-bridging.cc' + + obj = bld.create_ns3_program('csma-raw-ip-socket', + ['csma', 'internet-stack']) + obj.source = 'csma-raw-ip-socket.cc' - -# obj = bld.create_ns3_program('hello-simulator') -# obj.source = 'hello-simulator.cc' -# -# obj = bld.create_ns3_program('first', -# ['core', 'simulator', 'point-to-point', 'internet-stack']) -# obj.source = 'first.cc' -# -# obj = bld.create_ns3_program('second', -# ['core', 'simulator', 'point-to-point', 'csma', 'internet-stack']) -# obj.source = 'second.cc' -# -# obj = bld.create_ns3_program('third', -# ['core', 'simulator', 'point-to-point', 'csma', 'wifi', 'internet-stack']) -# obj.source = 'third.cc' -# -# obj = bld.create_ns3_program('object-names', -# ['core', 'simulator', 'csma', 'internet-stack']) -# obj.source = 'object-names.cc' -# -# obj = bld.create_ns3_program('mixed-wireless', -# ['core', 'simulator', 'mobility', 'wifi', 'point-to-point', 'internet-stack']) -# obj.source = 'mixed-wireless.cc' -# -# obj = bld.create_ns3_program('dynamic-global-routing', -# ['point-to-point', 'csma', 'internet-stack', 'global-routing']) -# obj.source = 'dynamic-global-routing.cc' -# -# obj = bld.create_ns3_program('static-routing-slash32', -# ['point-to-point', 'internet-stack', 'global-routing']) -# obj.source = 'static-routing-slash32.cc' -# -# obj = bld.create_ns3_program('global-routing-slash32', -# ['point-to-point', 'internet-stack', 'global-routing']) -# obj.source = 'global-routing-slash32.cc' -# -# obj = bld.create_ns3_program('simple-global-routing', -# ['point-to-point', 'internet-stack', 'global-routing']) -# obj.source = 'simple-global-routing.cc' -# -# obj = bld.create_ns3_program('virtual-net-device', -# ['point-to-point', 'internet-stack', 'global-routing', 'virtual-net-device']) -# obj.source = 'virtual-net-device.cc' -# -# obj = bld.create_ns3_program('simple-alternate-routing', -# ['point-to-point', 'internet-stack', 'global-routing']) -# obj.source = 'simple-alternate-routing.cc' -# -# obj = bld.create_ns3_program('simple-error-model', -# ['point-to-point', 'internet-stack']) -# obj.source = 'simple-error-model.cc' -# -# obj = bld.create_ns3_program('csma-one-subnet', -# ['csma', 'internet-stack']) -# obj.source = 'csma-one-subnet.cc' -# -# obj = bld.create_ns3_program('csma-bridge', -# ['bridge', 'csma', 'internet-stack']) -# obj.source = 'csma-bridge.cc' -# -# obj = bld.create_ns3_program('csma-bridge-one-hop', -# ['bridge', 'csma', 'internet-stack']) -# obj.source = 'csma-bridge-one-hop.cc' -# -# obj = bld.create_ns3_program('udp-echo', -# ['csma', 'internet-stack']) -# obj.source = 'udp-echo.cc' -# -# obj = bld.create_ns3_program('realtime-udp-echo', -# ['csma', 'internet-stack']) -# obj.source = 'realtime-udp-echo.cc' -# -# obj = bld.create_ns3_program('csma-broadcast', -# ['csma', 'internet-stack']) -# obj.source = 'csma-broadcast.cc' -# -# obj = bld.create_ns3_program('csma-packet-socket', -# ['csma', 'internet-stack']) -# obj.source = 'csma-packet-socket.cc' -# -# obj = bld.create_ns3_program('csma-multicast', -# ['csma', 'internet-stack']) -# obj.source = 'csma-multicast.cc' -# -# obj = bld.create_ns3_program( 'mixed-global-routing', -# ['point-to-point', 'internet-stack', 'global-routing' , 'csma-cd']) -# obj.source = 'mixed-global-routing.cc' -# -# obj = bld.create_ns3_program('simple-point-to-point-olsr', -# ['point-to-point', 'internet-stack', 'olsr']) -# obj.source = 'simple-point-to-point-olsr.cc' -# -# obj = bld.create_ns3_program('tcp-large-transfer', -# ['point-to-point', 'internet-stack']) -# obj.source = 'tcp-large-transfer.cc' -# -# obj = bld.create_ns3_program('tcp-nsc-lfn', -# ['point-to-point', 'internet-stack']) -# obj.source = 'tcp-nsc-lfn.cc' -# -# obj = bld.create_ns3_program('tcp-nsc-zoo', -# ['csma', 'internet-stack']) -# obj.source = 'tcp-nsc-zoo.cc' -# -# obj = bld.create_ns3_program('tcp-star-server', -# ['point-to-point', 'internet-stack']) -# obj.source = 'tcp-star-server.cc' -# -# obj = bld.create_ns3_program('star', -# ['point-to-point', 'internet-stack']) -# obj.source = 'star.cc' -# -# obj = bld.create_ns3_program('csma-star', -# ['csma', 'internet-stack']) -# obj.source = 'csma-star.cc' -# -# obj = bld.create_ns3_program('wifi-adhoc', -# ['core', 'simulator', 'mobility', 'wifi']) -# obj.source = 'wifi-adhoc.cc' -# -# obj = bld.create_ns3_program('wifi-clear-channel-cmu', -# ['core', 'simulator', 'mobility', 'wifi']) -# obj.source = 'wifi-clear-channel-cmu.cc' -# -# obj = bld.create_ns3_program('wifi-ap', -# ['core', 'simulator', 'mobility', 'wifi']) -# obj.source = 'wifi-ap.cc' -# -# bld.add_subdirs('stats') -# -# obj = bld.create_ns3_program('wifi-wired-bridging', -# ['core', 'simulator', 'mobility', 'wifi', -# 'csma', 'helper', 'bridge']) -# obj.source = 'wifi-wired-bridging.cc' -# -# obj = bld.create_ns3_program('csma-raw-ip-socket', -# ['csma', 'internet-stack']) -# obj.source = 'csma-raw-ip-socket.cc' -# obj = bld.create_ns3_program('csma-ping', ['csma', 'internet-stack', 'v4ping']) obj.source = 'csma-ping.cc' -# obj = bld.create_ns3_program('test-ipv6', -# ['point-to-point', 'internet-stack']) -# obj.source = 'test-ipv6.cc' -# -# env = bld.env_of_name('default') -# if env['ENABLE_EMU']: -# obj = bld.create_ns3_program('emu-udp-echo', ['emu', 'internet-stack']) -# obj.source = 'emu-udp-echo.cc' -# -# obj = bld.create_ns3_program('emu-ping', ['emu', 'internet-stack']) -# obj.source = 'emu-ping.cc' -# -# if env['ENABLE_TAP']: -# obj = bld.create_ns3_program('tap-wifi-dumbbell', -# ['wifi', 'csma', 'point-to-point', 'tap-bridge', 'internet-stack']) -# obj.source = 'tap-wifi-dumbbell.cc' -# -# obj = bld.create_ns3_program('simple-wifi-frame-aggregation', -# ['core', 'simulator', 'mobility', 'wifi']) -# obj.source = 'simple-wifi-frame-aggregation.cc' -# -# obj = bld.create_ns3_program('multi-rate-first', -# ['core', 'simulator', 'mobility', 'wifi']) -# obj.source = 'multi-rate-first.cc' -# -# obj = bld.create_ns3_program('multi-rate-second', -# ['core', 'simulator', 'mobility', 'wifi']) -# obj.source = 'multi-rate-second.cc' + obj = bld.create_ns3_program('test-ipv6', + ['point-to-point', 'internet-stack']) + obj.source = 'test-ipv6.cc' + + obj = bld.create_ns3_program('ping6', + ['csma', 'internet-stack']) + obj.source = 'ping6.cc' + + obj = bld.create_ns3_program('simple-routing-ping6', + ['csma', 'internet-stack']) + obj.source = 'simple-routing-ping6.cc' + + obj = bld.create_ns3_program('icmpv6-redirect', + ['csma', 'internet-stack']) + obj.source = 'icmpv6-redirect.cc' + + obj = bld.create_ns3_program('radvd', + ['csma', 'internet-stack']) + obj.source = 'radvd.cc' + + obj = bld.create_ns3_program('radvd-two-prefix', + ['csma', 'internet-stack']) + obj.source = 'radvd-two-prefix.cc' + + env = bld.env_of_name('default') + if env['ENABLE_EMU']: + obj = bld.create_ns3_program('emu-udp-echo', ['emu', 'internet-stack']) + obj.source = 'emu-udp-echo.cc' + + obj = bld.create_ns3_program('emu-ping', ['emu', 'internet-stack']) + obj.source = 'emu-ping.cc' + + if env['ENABLE_TAP']: + obj = bld.create_ns3_program('tap-wifi-dumbbell', + ['wifi', 'csma', 'point-to-point', 'tap-bridge', 'internet-stack']) + obj.source = 'tap-wifi-dumbbell.cc' + + obj = bld.create_ns3_program('simple-wifi-frame-aggregation', + ['core', 'simulator', 'mobility', 'wifi']) + obj.source = 'simple-wifi-frame-aggregation.cc' + + obj = bld.create_ns3_program('multi-rate-first', + ['core', 'simulator', 'mobility', 'wifi']) + obj.source = 'multi-rate-first.cc' + + obj = bld.create_ns3_program('multi-rate-second', + ['core', 'simulator', 'mobility', 'wifi']) + obj.source = 'multi-rate-second.cc' diff --git a/samples/wscript b/samples/wscript index d026c1382..c7f9e9a81 100644 --- a/samples/wscript +++ b/samples/wscript @@ -1,57 +1,56 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - print "Don't want to build samples" -# obj = bld.create_ns3_program('main-attribute-value') -# obj.source = 'main-attribute-value.cc' -# -# obj = bld.create_ns3_program('main-callback') -# obj.source = 'main-callback.cc' -# -# obj = bld.create_ns3_program('main-simulator') -# obj.source = 'main-simulator.cc' -# -# obj = bld.create_ns3_program('main-ptr') -# obj.source = 'main-ptr.cc' -# -# obj = bld.create_ns3_program('main-random-variable') -# obj.source = 'main-random-variable.cc' -# -# obj = bld.create_ns3_program('main-packet-header', ['common', 'simulator']) -# obj.source = 'main-packet-header.cc' -# -# obj = bld.create_ns3_program('main-packet-tag', ['common', 'simulator']) -# obj.source = 'main-packet-tag.cc' -# -# obj = bld.create_ns3_program('main-test') -# obj.source = 'main-test.cc' -# -# if bld.env['ENABLE_THREADING'] and bld.env["ENABLE_REAL_TIME"]: -# obj = bld.create_ns3_program('main-test-sync') -# obj.source = 'main-test-sync.cc' -# -# obj = bld.create_ns3_program('main-simple', -# ['node', 'internet-stack', 'onoff']) -# obj.source = 'main-simple.cc' -# -# obj = bld.create_ns3_program('main-grid-topology', -# ['core', 'simulator', 'mobility', 'internet-stack']) -# obj.source = 'main-grid-topology.cc' -# -# obj = bld.create_ns3_program('main-random-topology', -# ['core', 'simulator', 'mobility']) -# obj.source = 'main-random-topology.cc' -# -# obj = bld.create_ns3_program('main-random-walk', -# ['core', 'simulator', 'mobility']) -# obj.source = 'main-random-walk.cc' -# -# obj = bld.create_ns3_program('main-propagation-loss', -# ['core', 'simulator', 'mobility', 'wifi']) -# obj.source = 'main-propagation-loss.cc' -# -# obj = bld.create_ns3_program('main-ns2-mob', -# ['core', 'simulator', 'mobility', 'wifi']) -# obj.source = 'main-ns2-mob.cc' + obj = bld.create_ns3_program('main-attribute-value') + obj.source = 'main-attribute-value.cc' + + obj = bld.create_ns3_program('main-callback') + obj.source = 'main-callback.cc' + + obj = bld.create_ns3_program('main-simulator') + obj.source = 'main-simulator.cc' + + obj = bld.create_ns3_program('main-ptr') + obj.source = 'main-ptr.cc' + + obj = bld.create_ns3_program('main-random-variable') + obj.source = 'main-random-variable.cc' + + obj = bld.create_ns3_program('main-packet-header', ['common', 'simulator']) + obj.source = 'main-packet-header.cc' + + obj = bld.create_ns3_program('main-packet-tag', ['common', 'simulator']) + obj.source = 'main-packet-tag.cc' + + obj = bld.create_ns3_program('main-test') + obj.source = 'main-test.cc' + + if bld.env['ENABLE_THREADING'] and bld.env["ENABLE_REAL_TIME"]: + obj = bld.create_ns3_program('main-test-sync') + obj.source = 'main-test-sync.cc' + + obj = bld.create_ns3_program('main-simple', + ['node', 'internet-stack', 'onoff']) + obj.source = 'main-simple.cc' + + obj = bld.create_ns3_program('main-grid-topology', + ['core', 'simulator', 'mobility', 'internet-stack']) + obj.source = 'main-grid-topology.cc' + + obj = bld.create_ns3_program('main-random-topology', + ['core', 'simulator', 'mobility']) + obj.source = 'main-random-topology.cc' + + obj = bld.create_ns3_program('main-random-walk', + ['core', 'simulator', 'mobility']) + obj.source = 'main-random-walk.cc' + + obj = bld.create_ns3_program('main-propagation-loss', + ['core', 'simulator', 'mobility', 'wifi']) + obj.source = 'main-propagation-loss.cc' + + obj = bld.create_ns3_program('main-ns2-mob', + ['core', 'simulator', 'mobility', 'wifi']) + obj.source = 'main-ns2-mob.cc' diff --git a/src/internet-stack/wscript b/src/internet-stack/wscript index d6cabeb6a..d126c16f7 100644 --- a/src/internet-stack/wscript +++ b/src/internet-stack/wscript @@ -99,6 +99,18 @@ def build(bld): 'icmpv4.cc', 'icmpv4-l4-protocol.cc', 'loopback-net-device.cc', + 'ipv6-interface.cc', + 'ndisc-cache.cc', + 'icmpv6-header.cc', + 'ipv6-l3-protocol.cc', + 'ipv6-end-point.cc', + 'ipv6-end-point-demux.cc', + 'ipv6-l4-protocol.cc', + 'ipv6-raw-socket-factory-impl.cc', + 'ipv6-raw-socket-impl.cc', + 'ipv6-autoconfigured-prefix.cc', + 'icmpv6-l4-protocol.cc', + 'ipv6-test.cc' ] headers = bld.new_task_gen('ns3header') @@ -108,12 +120,18 @@ def build(bld): 'tcp-header.h', 'sequence-number.h', 'icmpv4.h', + 'icmpv6-header.h', # used by routing 'ipv4-interface.h', 'ipv4-l3-protocol.h', + 'arp-l3-protocol.h', + 'udp-l4-protocol.h', + 'tcp-l4-protocol.h', + 'icmpv4-l4-protocol.h', + 'ipv4-l4-protocol.h', 'arp-cache.h', - 'sgi-hashmap.h', - ] + ] + if bld.env['NSC_ENABLED']: obj.source.append ('nsc-tcp-socket-impl.cc')