From 344f51c8af2543ef1e45fe870efe9fdcaee7c7ce Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Sat, 5 Mar 2011 10:51:26 -0800 Subject: [PATCH] Add netanim module --- examples/tcp/star.cc | 2 +- src/aodv/examples/aodv.cc | 2 +- src/helper/wscript | 10 ------ .../netanim/examples}/dumbbell-animation.cc | 2 +- .../netanim/examples}/grid-animation.cc | 2 +- .../netanim/examples}/star-animation.cc | 2 +- .../animation => src/netanim/examples}/waf | 0 .../netanim/examples}/wscript | 6 ++-- .../helper/point-to-point-dumbbell-helper.cc | 0 .../helper/point-to-point-dumbbell-helper.h | 0 .../helper/point-to-point-grid-helper.cc | 0 .../helper/point-to-point-grid-helper.h | 0 .../helper/point-to-point-star-helper.cc | 0 .../helper/point-to-point-star-helper.h | 0 .../model}/animation-interface.cc | 0 .../model}/animation-interface.h | 0 .../model}/canvas-location.cc | 0 .../model}/canvas-location.h | 0 src/netanim/waf | 1 + src/netanim/wscript | 31 +++++++++++++++++++ src/point-to-point/wscript | 6 ---- src/wscript | 3 +- 22 files changed, 42 insertions(+), 25 deletions(-) rename {examples/animation => src/netanim/examples}/dumbbell-animation.cc (99%) rename {examples/animation => src/netanim/examples}/grid-animation.cc (99%) rename {examples/animation => src/netanim/examples}/star-animation.cc (99%) rename {examples/animation => src/netanim/examples}/waf (100%) rename {examples/animation => src/netanim/examples}/wscript (65%) rename src/{point-to-point => netanim}/helper/point-to-point-dumbbell-helper.cc (100%) rename src/{point-to-point => netanim}/helper/point-to-point-dumbbell-helper.h (100%) rename src/{point-to-point => netanim}/helper/point-to-point-grid-helper.cc (100%) rename src/{point-to-point => netanim}/helper/point-to-point-grid-helper.h (100%) rename src/{point-to-point => netanim}/helper/point-to-point-star-helper.cc (100%) rename src/{point-to-point => netanim}/helper/point-to-point-star-helper.h (100%) rename src/{helper => netanim/model}/animation-interface.cc (100%) rename src/{helper => netanim/model}/animation-interface.h (100%) rename src/{helper => netanim/model}/canvas-location.cc (100%) rename src/{helper => netanim/model}/canvas-location.h (100%) create mode 100755 src/netanim/waf create mode 100644 src/netanim/wscript diff --git a/examples/tcp/star.cc b/examples/tcp/star.cc index 78d0a1e7e..56adc831a 100644 --- a/examples/tcp/star.cc +++ b/examples/tcp/star.cc @@ -17,7 +17,7 @@ #include "ns3/core-module.h" #include "ns3/network-module.h" -#include "ns3/helper-module.h" +#include "ns3/netanim-module.h" #include "ns3/internet-module.h" #include "ns3/point-to-point-module.h" #include "ns3/applications-module.h" diff --git a/src/aodv/examples/aodv.cc b/src/aodv/examples/aodv.cc index a8f6a673a..b41e6d98e 100644 --- a/src/aodv/examples/aodv.cc +++ b/src/aodv/examples/aodv.cc @@ -23,7 +23,7 @@ #include "ns3/aodv-module.h" #include "ns3/core-module.h" #include "ns3/network-module.h" -#include "ns3/helper-module.h" +#include "ns3/internet-module.h" #include "ns3/mobility-module.h" #include "ns3/point-to-point-module.h" #include "ns3/wifi-module.h" diff --git a/src/helper/wscript b/src/helper/wscript index 0a385ceaa..6c6a3ce04 100644 --- a/src/helper/wscript +++ b/src/helper/wscript @@ -4,22 +4,12 @@ def build(bld): helper = bld.create_ns3_module('helper', ['mobility', 'network', 'internet', 'wifi', 'point-to-point', 'spectrum']) helper.source = [ 'athstats-helper.cc', - 'animation-interface.cc', - 'canvas-location.cc', ] headers = bld.new_task_gen('ns3header') headers.module = 'helper' headers.source = [ 'athstats-helper.h', - 'animation-interface.h', - 'canvas-location.h', ] env = bld.env_of_name('default') - -def configure(conf): - conf.check(header_name='sys/socket.h', define_name='HAVE_SYS_SOCKET_H') - conf.check(header_name='netinet/in.h', define_name='HAVE_NETINET_IN_H') - conf.write_config_header('ns3/net-anim-config.h', top=True) - diff --git a/examples/animation/dumbbell-animation.cc b/src/netanim/examples/dumbbell-animation.cc similarity index 99% rename from examples/animation/dumbbell-animation.cc rename to src/netanim/examples/dumbbell-animation.cc index efbbff6cd..0f6051ef2 100644 --- a/examples/animation/dumbbell-animation.cc +++ b/src/netanim/examples/dumbbell-animation.cc @@ -22,7 +22,7 @@ #include "ns3/network-module.h" #include "ns3/internet-module.h" #include "ns3/point-to-point-module.h" -#include "ns3/helper-module.h" +#include "ns3/netanim-module.h" #include "ns3/applications-module.h" #include "ns3/ipv4-global-routing-helper.h" diff --git a/examples/animation/grid-animation.cc b/src/netanim/examples/grid-animation.cc similarity index 99% rename from examples/animation/grid-animation.cc rename to src/netanim/examples/grid-animation.cc index a039739f8..a1da726ef 100644 --- a/examples/animation/grid-animation.cc +++ b/src/netanim/examples/grid-animation.cc @@ -22,7 +22,7 @@ #include "ns3/network-module.h" #include "ns3/internet-module.h" #include "ns3/point-to-point-module.h" -#include "ns3/helper-module.h" +#include "ns3/netanim-module.h" #include "ns3/applications-module.h" #include "ns3/ipv4-global-routing-helper.h" diff --git a/examples/animation/star-animation.cc b/src/netanim/examples/star-animation.cc similarity index 99% rename from examples/animation/star-animation.cc rename to src/netanim/examples/star-animation.cc index 6d6f87c8f..319fb561d 100644 --- a/examples/animation/star-animation.cc +++ b/src/netanim/examples/star-animation.cc @@ -17,7 +17,7 @@ #include "ns3/core-module.h" #include "ns3/network-module.h" -#include "ns3/helper-module.h" +#include "ns3/netanim-module.h" #include "ns3/internet-module.h" #include "ns3/point-to-point-module.h" #include "ns3/applications-module.h" diff --git a/examples/animation/waf b/src/netanim/examples/waf similarity index 100% rename from examples/animation/waf rename to src/netanim/examples/waf diff --git a/examples/animation/wscript b/src/netanim/examples/wscript similarity index 65% rename from examples/animation/wscript rename to src/netanim/examples/wscript index f1cae9815..3f7d530ee 100644 --- a/examples/animation/wscript +++ b/src/netanim/examples/wscript @@ -2,13 +2,13 @@ def build(bld): obj = bld.create_ns3_program('dumbbell-animation', - ['point-to-point', 'internet']) + ['netanim']) obj.source = 'dumbbell-animation.cc' obj = bld.create_ns3_program('grid-animation', - ['point-to-point', 'internet']) + ['netanim']) obj.source = 'grid-animation.cc' obj = bld.create_ns3_program('star-animation', - ['point-to-point', 'internet']) + ['netanim']) obj.source = 'star-animation.cc' diff --git a/src/point-to-point/helper/point-to-point-dumbbell-helper.cc b/src/netanim/helper/point-to-point-dumbbell-helper.cc similarity index 100% rename from src/point-to-point/helper/point-to-point-dumbbell-helper.cc rename to src/netanim/helper/point-to-point-dumbbell-helper.cc diff --git a/src/point-to-point/helper/point-to-point-dumbbell-helper.h b/src/netanim/helper/point-to-point-dumbbell-helper.h similarity index 100% rename from src/point-to-point/helper/point-to-point-dumbbell-helper.h rename to src/netanim/helper/point-to-point-dumbbell-helper.h diff --git a/src/point-to-point/helper/point-to-point-grid-helper.cc b/src/netanim/helper/point-to-point-grid-helper.cc similarity index 100% rename from src/point-to-point/helper/point-to-point-grid-helper.cc rename to src/netanim/helper/point-to-point-grid-helper.cc diff --git a/src/point-to-point/helper/point-to-point-grid-helper.h b/src/netanim/helper/point-to-point-grid-helper.h similarity index 100% rename from src/point-to-point/helper/point-to-point-grid-helper.h rename to src/netanim/helper/point-to-point-grid-helper.h diff --git a/src/point-to-point/helper/point-to-point-star-helper.cc b/src/netanim/helper/point-to-point-star-helper.cc similarity index 100% rename from src/point-to-point/helper/point-to-point-star-helper.cc rename to src/netanim/helper/point-to-point-star-helper.cc diff --git a/src/point-to-point/helper/point-to-point-star-helper.h b/src/netanim/helper/point-to-point-star-helper.h similarity index 100% rename from src/point-to-point/helper/point-to-point-star-helper.h rename to src/netanim/helper/point-to-point-star-helper.h diff --git a/src/helper/animation-interface.cc b/src/netanim/model/animation-interface.cc similarity index 100% rename from src/helper/animation-interface.cc rename to src/netanim/model/animation-interface.cc diff --git a/src/helper/animation-interface.h b/src/netanim/model/animation-interface.h similarity index 100% rename from src/helper/animation-interface.h rename to src/netanim/model/animation-interface.h diff --git a/src/helper/canvas-location.cc b/src/netanim/model/canvas-location.cc similarity index 100% rename from src/helper/canvas-location.cc rename to src/netanim/model/canvas-location.cc diff --git a/src/helper/canvas-location.h b/src/netanim/model/canvas-location.h similarity index 100% rename from src/helper/canvas-location.h rename to src/netanim/model/canvas-location.h diff --git a/src/netanim/waf b/src/netanim/waf new file mode 100755 index 000000000..3dcf598bc --- /dev/null +++ b/src/netanim/waf @@ -0,0 +1 @@ +exec "`dirname "$0"`"/../../waf "$@" \ No newline at end of file diff --git a/src/netanim/wscript b/src/netanim/wscript new file mode 100644 index 000000000..5d32ace73 --- /dev/null +++ b/src/netanim/wscript @@ -0,0 +1,31 @@ +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- + +def build(bld): + module = bld.create_ns3_module('netanim', ['internet', 'point-to-point']) + module.includes = '.' + module.source = [ + 'model/animation-interface.cc', + 'model/canvas-location.cc', + 'helper/point-to-point-dumbbell-helper.cc', + 'helper/point-to-point-grid-helper.cc', + 'helper/point-to-point-star-helper.cc', + ] + + headers = bld.new_task_gen('ns3header') + headers.module = 'netanim' + headers.source = [ + 'model/animation-interface.h', + 'model/canvas-location.h', + 'helper/point-to-point-dumbbell-helper.h', + 'helper/point-to-point-grid-helper.h', + 'helper/point-to-point-star-helper.h', + ] + + if (bld.env['ENABLE_EXAMPLES']): + bld.add_subdirs('examples') + +def configure(conf): + conf.check(header_name='sys/socket.h', define_name='HAVE_SYS_SOCKET_H') + conf.check(header_name='netinet/in.h', define_name='HAVE_NETINET_IN_H') + conf.write_config_header('ns3/net-anim-config.h', top=True) + diff --git a/src/point-to-point/wscript b/src/point-to-point/wscript index 9f58054a5..b1438f613 100644 --- a/src/point-to-point/wscript +++ b/src/point-to-point/wscript @@ -10,9 +10,6 @@ def build(bld): 'model/point-to-point-test.cc', 'model/ppp-header.cc', 'helper/point-to-point-helper.cc', - 'helper/point-to-point-grid-helper.cc', - 'helper/point-to-point-dumbbell-helper.cc', - 'helper/point-to-point-star-helper.cc', ] headers = bld.new_task_gen('ns3header') headers.module = 'point-to-point' @@ -22,8 +19,5 @@ def build(bld): 'model/point-to-point-remote-channel.h', 'model/ppp-header.h', 'helper/point-to-point-helper.h', - 'helper/point-to-point-grid-helper.h', - 'helper/point-to-point-dumbbell-helper.h', - 'helper/point-to-point-star-helper.h', ] diff --git a/src/wscript b/src/wscript index 97e492bab..b657d4650 100644 --- a/src/wscript +++ b/src/wscript @@ -38,6 +38,7 @@ all_modules = ( 'mobility', 'wifi', 'helper', + 'netanim', 'stats', 'uan', 'spectrum', @@ -79,7 +80,7 @@ def configure(conf): conf.sub_config('tap-bridge') conf.sub_config('contrib') conf.sub_config('internet') - conf.sub_config('helper') + conf.sub_config('netanim') conf.sub_config('test') conf.sub_config('click')