build: remove waf files, tests and references

Gabriel Ferreira 2022-01-31 19:43:21 -03:00
parent 3b90d12335
commit e32c177e45
137 changed files with 51 additions and 11666 deletions

3
.gitignore vendored
View File

@ -29,8 +29,7 @@ massif.*
coverity
TAGS
.lock-waf_*_build
.waf*
.lock-ns3
build-dir/
build/

2
.vscode/tasks.json vendored
View File

@ -6,7 +6,7 @@
{
"label": "Build",
"type": "shell",
"command": "./waf",
"command": "./ns3",
"group": {
"kind": "build",
"isDefault": true

View File

@ -1,547 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
from __future__ import print_function
import types
import re
import os
import subprocess
import shutil
import sys
from waflib import Task, Options, Configure, TaskGen, Logs, Build, Utils, Errors
from waflib.Errors import WafError
# feature = TaskGen.feature
# after = TaskGen.after
# https://github.com/gjcarneiro/pybindgen
# If specifying a released pybindgen version, specify the required PYBINDGEN
# version as, e.g. '0.21.0'
# If specifying a commit on the development tree, specify it like this based
# on 'git describe --tags' command. Example, if the latest release was 0.21.0,
# and 'git describe --tags' reports "0.21.0-6-g8e7c0a9", then write the
# PYBINDGEN version string below as '0.21.0.post6+ng8e7c0a9'
REQUIRED_PYBINDGEN_VERSION = '0.22.0'
REQUIRED_PYGCCXML_VERSION = (2, 0, 1)
REQUIRED_CASTXML_VERSION = '0.2'
RUN_ME=-3
# return types of some APIs differ in Python 2/3 (type string vs class bytes)
# This method will decode('utf-8') a byte object in Python 3,
# and do nothing in Python 2
def maybe_decode(input):
if sys.version_info < (3,):
return input
else:
try:
return input.decode('utf-8')
except:
sys.exc_clear()
return input
def add_to_python_path(path):
if os.environ.get('PYTHONPATH', ''):
os.environ['PYTHONPATH'] = path + os.pathsep + os.environ.get('PYTHONPATH')
else:
os.environ['PYTHONPATH'] = path
def set_pybindgen_pythonpath(env):
if env['WITH_PYBINDGEN']:
add_to_python_path(env['WITH_PYBINDGEN'])
def options(opt):
opt.load('python')
opt.add_option('--disable-python',
help=("Don't build Python bindings."),
action="store_true", default=False,
dest='python_disable')
opt.add_option('--apiscan',
help=("Rescan the API for the indicated module(s), for Python bindings. "
"Needs working CastXML / pygccxml environment. "
"The metamodule 'all' expands to all available ns-3 modules."),
default=None, dest='apiscan', metavar="MODULE[,MODULE...]")
opt.add_option('--with-pybindgen',
help=('Path to an existing pybindgen source tree to use.'),
default=None,
dest='with_pybindgen', type="string")
opt.add_option('--with-python',
help=('Path to the Python interpreter to use.'),
default=None, dest='with_python', type="string")
def split_version(version):
if (re.search ('post', version)):
# Version format such as '0.17.0.post58+ngcf00cc0'
ver = re.split('[.+]', version)[:4]
return (int(ver[0]), int(ver[1]), int(ver[2]), int(ver[3].split('post')[1]))
else:
# Version format such as '0.18.0'
ver = re.split('[.]', version)[:3]
return (int(ver[0]), int(ver[1]), int(ver[2]), 0)
def configure(conf):
conf.env['ENABLE_PYTHON_BINDINGS'] = False
if Options.options.python_disable:
conf.report_optional_feature("python", "Python Bindings", False,
"disabled by user request")
return
# Disable python in static builds (bug #1253)
if ((conf.env['ENABLE_STATIC_NS3']) or \
(conf.env['ENABLE_SHARED_AND_STATIC_NS3'])):
conf.report_optional_feature("python", "Python Bindings", False,
"bindings incompatible with static build")
return
enabled_modules = list(conf.env['NS3_ENABLED_MODULES'])
enabled_modules.sort()
available_modules = list(conf.env['NS3_MODULES'])
available_modules.sort()
all_modules_enabled = (enabled_modules == available_modules)
conf.load('misc', tooldir=['waf-tools'])
if sys.platform == 'cygwin':
conf.report_optional_feature("python", "Python Bindings", False,
"unsupported platform 'cygwin'")
Logs.warn("Python is not supported in CygWin environment. Try MingW instead.")
return
## Check for Python
if Options.options.with_python is not None:
conf.env.PYTHON = Options.options.with_python
try:
conf.load('python')
except Errors.ConfigurationError as ex:
conf.report_optional_feature("python", "Python Bindings", False,
"The python interpreter was not found")
return
try:
conf.check_python_version((2,3))
except Errors.ConfigurationError as ex:
conf.report_optional_feature("python", "Python Bindings", False,
"The python found version is too low (2.3 required)")
return
try:
conf.check_python_headers()
except Errors.ConfigurationError as ex:
conf.report_optional_feature("python", "Python Bindings", False,
"Python library or headers missing")
return
# stupid Mac OSX Python wants to build extensions as "universal
# binaries", i386, x86_64, and ppc, but this way the type
# __uint128_t is not available. We need to disable the multiarch
# crap by removing the -arch parameters.
for flags_var in ["CFLAGS_PYEXT", "CFLAGS_PYEMBED", "CXXFLAGS_PYEMBED",
"CXXFLAGS_PYEXT", "LINKFLAGS_PYEMBED", "LINKFLAGS_PYEXT"]:
flags = conf.env[flags_var]
i = 0
while i < len(flags):
if flags[i] == '-arch':
del flags[i]
del flags[i]
continue
i += 1
conf.env[flags_var] = flags
# -fvisibility=hidden optimization
if (conf.env['CXX_NAME'] == 'gcc' and [int(x) for x in conf.env['CC_VERSION']] >= [4,0,0]
and conf.check_compilation_flag('-fvisibility=hidden')):
conf.env.append_value('CXXFLAGS_PYEXT', '-fvisibility=hidden')
conf.env.append_value('CCFLAGS_PYEXT', '-fvisibility=hidden')
if conf.check_compilation_flag('-Wno-array-bounds'):
conf.env.append_value('CXXFLAGS_PYEXT', '-Wno-array-bounds')
# Check for the location of pybindgen
if Options.options.with_pybindgen is not None:
if os.path.isdir(Options.options.with_pybindgen):
conf.msg("Checking for pybindgen location", ("%s (given)" % Options.options.with_pybindgen))
conf.env['WITH_PYBINDGEN'] = os.path.abspath(Options.options.with_pybindgen)
else:
# ns-3-dev uses ../pybindgen, while ns-3 releases use ../REQUIRED_PYBINDGEN_VERSION
pybindgen_dir = os.path.join('..', "pybindgen")
pybindgen_release_str = "pybindgen-" + REQUIRED_PYBINDGEN_VERSION
pybindgen_release_dir = os.path.join('..', pybindgen_release_str)
if os.path.isdir(pybindgen_dir):
conf.msg("Checking for pybindgen location", ("%s (guessed)" % pybindgen_dir))
conf.env['WITH_PYBINDGEN'] = os.path.abspath(pybindgen_dir)
elif os.path.isdir(pybindgen_release_dir):
conf.msg("Checking for pybindgen location", ("%s (guessed)" % pybindgen_release_dir))
conf.env['WITH_PYBINDGEN'] = os.path.abspath(pybindgen_release_dir)
del pybindgen_dir
del pybindgen_release_dir
if not conf.env['WITH_PYBINDGEN']:
conf.msg("Checking for pybindgen location", False)
# Check for pybindgen
set_pybindgen_pythonpath(conf.env)
try:
conf.check_python_module('pybindgen')
except Errors.ConfigurationError:
Logs.warn("pybindgen missing => no python bindings")
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen missing")
return
else:
out = subprocess.Popen([conf.env['PYTHON'][0], "-c",
"import pybindgen.version; "
"print(pybindgen.__version__)"],
stdout=subprocess.PIPE).communicate()[0]
pybindgen_version = maybe_decode(out.strip())
conf.msg('Checking for pybindgen version', pybindgen_version)
if not pybindgen_version:
Logs.warn("pybindgen_version is an empty string")
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen version not found")
return
if not (split_version(pybindgen_version) >= split_version(REQUIRED_PYBINDGEN_VERSION)):
Logs.warn("pybindgen (found %r), (need %r)" %
(pybindgen_version, REQUIRED_PYBINDGEN_VERSION))
conf.report_optional_feature("python", "Python Bindings", False,
"PyBindGen found but version %s is not the required version %s" % (pybindgen_version, REQUIRED_PYBINDGEN_VERSION))
return
def test(t1, t2):
test_program = '''
#include <stdint.h>
#include <vector>
int main ()
{
std::vector< %(type1)s > t = std::vector< %(type2)s > ();
return 0;
}
''' % dict(type1=t1, type2=t2)
try:
ret = conf.check(compiler='cxx', fragment=test_program, features='cxx')
except Errors.ConfigurationError:
ret = False
conf.msg('Checking for types %s and %s equivalence' % (t1, t2), (ret and 'no' or 'yes'))
return ret
uint64_is_long = test("uint64_t", "unsigned long")
uint64_is_long_long = test("uint64_t", "unsigned long long")
if uint64_is_long:
conf.env['PYTHON_BINDINGS_APIDEFS'] = 'gcc-LP64'
elif uint64_is_long_long:
conf.env['PYTHON_BINDINGS_APIDEFS'] = 'gcc-ILP32'
else:
conf.env['PYTHON_BINDINGS_APIDEFS'] = None
if conf.env['PYTHON_BINDINGS_APIDEFS'] is None:
msg = 'none available'
else:
msg = conf.env['PYTHON_BINDINGS_APIDEFS']
conf.msg('Checking for the apidefs that can be used for Python bindings', msg)
if conf.env['PYTHON_BINDINGS_APIDEFS'] is None:
conf.report_optional_feature("python", "Python Bindings", False,
"No apidefs are available that can be used in this system")
return
## If all has gone well, we finally enable the Python bindings
conf.env['ENABLE_PYTHON_BINDINGS'] = True
conf.report_optional_feature("python", "Python Bindings", True, None)
# check cxxabi stuff (which Mac OS X Lion breaks)
fragment = r"""
# include <cxxabi.h>
int main ()
{
const abi::__si_class_type_info *_typeinfo __attribute__((unused)) = NULL;
return 0;
}
"""
gcc_rtti_abi = conf.check_nonfatal(fragment=fragment, msg="Checking for internal GCC cxxabi",
okmsg="complete", errmsg='incomplete',
mandatory=False)
conf.env["GCC_RTTI_ABI_COMPLETE"] = str(bool(gcc_rtti_abi))
## Check for pygccxml
try:
conf.check_python_module('pygccxml')
except Errors.ConfigurationError:
conf.report_optional_feature("castxml", "Python API Scanning Support", False,
"Missing 'pygccxml' Python module")
return
try:
import pygccxml as pygccxml_imported
pygccxml_version_str = pygccxml_imported.__version__
except (ImportError, AttributeError):
Logs.warn("pygccxml version cannot be determined")
conf.report_optional_feature("castxml", "Python API Scanning Support", False,
"pygccxml Python module version is unknown")
return
# Bug 2013: pygccxml versions > 1.0.0 prepend a 'v' to version number
pygccxml_version_str = pygccxml_version_str.lstrip('v')
pygccxml_version = tuple([int(x) for x in pygccxml_version_str.split('.')])
conf.msg('Checking for pygccxml version', pygccxml_version_str)
if not (pygccxml_version >= REQUIRED_PYGCCXML_VERSION):
Logs.warn("pygccxml (found %s) is too old (need %s) => "
"automatic scanning of API definitions will not be possible" %
(pygccxml_version_str,
'.'.join([str(x) for x in REQUIRED_PYGCCXML_VERSION])))
conf.report_optional_feature("castxml", "Python API Scanning Support", False,
"pygccxml Python module too old")
return
## Check castxml version
try:
castxml = conf.find_program('castxml', var='CASTXML')
except WafError:
castxml = None
if not castxml:
Logs.warn("castxml missing; automatic scanning of API definitions will not be possible")
conf.report_optional_feature("castxml", "Python API Scanning Support", False,
"castxml missing")
return
out = subprocess.Popen([castxml[0], '--version'],
stdout=subprocess.PIPE).communicate()[0]
castxml_version_line = maybe_decode(out).split('\n', 1)[0].strip()
## Expecting version string such as 'castxml version 0.1-gfab9c47'
m = re.match( "^castxml version (\d\.\d)(-)?(\w+)?", castxml_version_line)
try:
castxml_version = m.group(1)
castxml_version_ok = castxml_version >= REQUIRED_CASTXML_VERSION
except AttributeError:
castxml_version = castxml_version_line
castxml_version_ok = False
conf.msg('Checking for castxml version', castxml_version)
if not castxml_version_ok:
Logs.warn("castxml version unknown or too old, need version >= %s; automatic scanning of API definitions will not be possible" % REQUIRED_CASTXML_VERSION)
conf.report_optional_feature("castxml", "Python API Scanning Support", False,
"castxml too old")
return
## If we reached
conf.env['ENABLE_PYTHON_SCANNING'] = True
conf.report_optional_feature("castxml", "Python API Scanning Support", True, None)
# ---------------------
def get_headers_map(bld):
headers_map = {} # header => module
for ns3headers in bld.all_task_gen:
if 'ns3header' in getattr(ns3headers, "features", []):
if ns3headers.module.endswith('-test'):
continue
for h in ns3headers.to_list(ns3headers.headers):
headers_map[os.path.basename(h)] = ns3headers.module
return headers_map
def get_module_path(bld, module):
for ns3headers in bld.all_task_gen:
if 'ns3header' in getattr(ns3headers, "features", []):
if ns3headers.module == module:
break
else:
raise ValueError("Module %r not found" % module)
return ns3headers.path.abspath()
class apiscan_task(Task.Task):
"""Uses castxml to scan the file 'everything.h' and extract API definitions.
"""
before = ['cxxprogram', 'cxxshlib', 'cxxstlib', 'command']
after = ['gen_ns3_module_header', 'ns3header']
color = "BLUE"
def __init__(self, curdirnode, env, bld, target, cflags, module):
self.bld = bld
super(apiscan_task, self).__init__(generator=self, env=env)
self.curdirnode = curdirnode
self.env = env
self.target = target
self.cflags = cflags
self.module = module
def display(self):
return 'api-scan-%s\n' % (self.target,)
def uid(self):
try:
return self.uid_
except AttributeError:
m = Utils.md5()
up = m.update
up(self.__class__.__name__.encode())
up(self.curdirnode.abspath().encode())
up(self.target.encode())
self.uid_ = m.digest()
return self.uid_
def run(self):
self.inputs = [self.bld.bldnode.find_resource("ns3/{0}-module.h".format(self.module))]
self.outputs = [self.bld.srcnode.find_resource("src/{}/bindings/modulegen__{}.py".format(self.module, self.target))]
if self.outputs[0] is None:
self.outputs = [self.bld.srcnode.find_resource("contrib/{}/bindings/modulegen__{}.py".format(self.module, self.target))]
top_builddir = self.bld.bldnode.abspath()
module_path = get_module_path(self.bld, self.module)
headers_map = get_headers_map(self.bld)
scan_header = os.path.join(top_builddir, "ns3", "%s-module.h" % self.module)
if not os.path.exists(scan_header):
Logs.error("Cannot apiscan module %r: %s does not exist" % (self.module, scan_header))
return 0
argv = [
self.env['PYTHON'][0],
os.path.join(self.curdirnode.abspath(), 'ns3modulescan-modular.py'), # scanning script
top_builddir,
self.module,
repr(get_headers_map(self.bld)),
os.path.join(module_path, "bindings", 'modulegen__%s.py' % (self.target)), # output file
self.cflags,
]
scan = subprocess.Popen(argv, stdin=subprocess.PIPE)
retval = scan.wait()
if retval >= 0 and "LP64" in self.target:
self.lp64_to_ilp32(
os.path.join(module_path, "bindings", 'modulegen__%s.py' % (self.target)),
os.path.join(module_path, "bindings", 'modulegen__%s.py' % "gcc_ILP32")
)
return retval
def runnable_status(self):
# By default, Waf Task will skip running a task if the signature of
# the build has not changed. We want this task to always run if
# invoked by the user, particularly since --apiscan=all will require
# invoking this task many times, once per module.
return RUN_ME
def lp64_to_ilp32(self, lp64path, ilp32path):
lp64file = open(lp64path, "r")
lp64bindings = lp64file.read()
lp64file.close()
ilp32file = open(ilp32path, "w")
ilp32bindings = re.sub("unsigned long(?!( long))", "unsigned long long", lp64bindings)
ilp32file.write(ilp32bindings)
ilp32file.close()
def get_modules_and_headers(bld):
"""
Gets a dict of
module_name => ([module_dep1, module_dep2, ...], [module_header1, module_header2, ...])
tuples, one for each module.
"""
retval = {}
for module in bld.all_task_gen:
if not module.name.startswith('ns3-'):
continue
if module.name.endswith('-test'):
continue
module_name = module.name[4:] # strip the ns3- prefix
## find the headers object for this module
headers = []
for ns3headers in bld.all_task_gen:
if 'ns3header' not in getattr(ns3headers, "features", []):
continue
if ns3headers.module != module_name:
continue
for source in ns3headers.to_list(ns3headers.headers):
headers.append(os.path.basename(source))
retval[module_name] = (list(module.module_deps), headers)
return retval
class gen_ns3_compat_pymod_task(Task.Task):
"""Generates a 'ns3.py' compatibility module."""
before = ['cxxprogram', 'cxxshlib', 'cxxstlib']
color = 'BLUE'
def run(self):
assert len(self.outputs) == 1
outfile = open(self.outputs[0].abspath(), "w")
print("import warnings", file=outfile)
print('warnings.warn("the ns3 module is a compatibility layer '\
'and should not be used in newly written code", DeprecationWarning, stacklevel=2)', file=outfile)
print(file=outfile)
for module in self.bld.env['PYTHON_MODULES_BUILT']:
print("from ns.%s import *" % (module.replace('-', '_')), file=outfile)
outfile.close()
return 0
def build(bld):
if Options.options.python_disable:
return
env = bld.env
set_pybindgen_pythonpath(env)
if Options.options.apiscan:
if not env['ENABLE_PYTHON_SCANNING']:
raise WafError("Cannot re-scan python bindings: (py)gccxml not available")
scan_targets = []
if sys.platform == 'cygwin':
scan_targets.append(('gcc_cygwin', ''))
else:
import struct
if struct.calcsize('I') == 4 and struct.calcsize('L') == 8 and struct.calcsize('P') == 8:
scan_targets.append(('gcc_LP64', '-m64'))
elif struct.calcsize('I') == 4 and struct.calcsize('L') == 4 and struct.calcsize('P') == 4:
scan_targets.append(('gcc_ILP32', ''))
else:
raise WafError("Cannot scan python bindings for unsupported data model")
test_module_path = bld.path.find_dir("../../src/test")
if Options.options.apiscan == 'all':
scan_modules = []
for mod in bld.all_task_gen:
if not mod.name.startswith('ns3-'):
continue
if mod.path.is_child_of(test_module_path):
continue
if mod.name.endswith('-test'):
continue
bindings_enabled = (mod.name in env.MODULAR_BINDINGS_MODULES)
#print mod.name, bindings_enabled
if bindings_enabled:
scan_modules.append(mod.name.split('ns3-')[1])
else:
scan_modules = Options.options.apiscan.split(',')
print("Modules to scan: ", scan_modules)
for target, cflags in scan_targets:
group = bld.get_group(bld.current_group)
for module in scan_modules:
group.append(apiscan_task(bld.path, env, bld, target, cflags, module))
return
if env['ENABLE_PYTHON_BINDINGS']:
task = gen_ns3_compat_pymod_task(env=env.derive())
task.set_outputs(bld.path.find_or_declare("ns3.py"))
task.dep_vars = ['PYTHON_MODULES_BUILT']
task.bld = bld
grp = bld.get_group(bld.current_group)
grp.append(task)
bld(features='copy', source="ns__init__.py", target='ns/__init__.py')
bld.install_as('${PYTHONARCHDIR}/ns/__init__.py', 'ns__init__.py')
# note: the actual build commands for the python bindings are in
# src/wscript, not here.

View File

@ -1,6 +1,6 @@
# cmake-format: off
#
# A sample of what Waf currently produces
# A sample of what Waf produced
# ---- Summary of optional NS-3 features:
# Build profile : debug
@ -210,6 +210,6 @@ macro(write_fakewaf_config)
string(APPEND out "\n")
endif()
file(WRITE ${PROJECT_BINARY_DIR}/ns3wafconfig.txt ${out})
file(WRITE ${PROJECT_BINARY_DIR}/ns3config.txt ${out})
message(STATUS ${out})
endmacro()

View File

@ -134,7 +134,7 @@
/**
* Indicates the build profile that was specified by the --build-profile option
* of "waf configure"
* of "ns3 configure"
*
* Type: string literal
*/

1
contrib/.gitignore vendored
View File

@ -2,5 +2,4 @@
*
# Include specific files that should be tracked by Git
!wscript
!.gitignore

View File

@ -1,326 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
from __future__ import print_function
from collections import deque
import os, os.path
import sys
import shutil
import types
import warnings
from waflib import TaskGen, Task, Options, Build, Utils, Context
from waflib.Errors import WafError
import wutils
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
# Allow mulitple modules to live in a single directory in contrib.
# For example, a directory structure like:
# contrib/package/module1
# /module2
# Useful for external projects that are building interdependent modules that
# are logically packaged together.
def find_contrib_modules(ctx, log=False):
modules = []
entries = deque( (ctx.path, d) for d in ctx.path.listdir() )
while entries:
parent, entry = entries.popleft()
if not entry or entry[0] == '.' or entry.endswith('CVS'):
continue
node = parent.find_node(entry)
if not node:
continue
if node.isdir():
#does this directory have a wscript file?
wscript_node = node.find_node('wscript')
if wscript_node:
#found a wscript file, treat this directory as a module.
#get the path relative to the context path
module_path = node.path_from(ctx.path)
modules.append(module_path)
if log:
ctx.msg("Found contrib module", module_path)
else:
#maybe this directory is a project,
#add its children to the list of entries to process
entries.extend( (node, d) for d in node.listdir() )
return sorted(modules)
def get_required_boost_libs(conf):
for module in find_contrib_modules(conf):
conf.recurse (module, name="required_boost_libs", mandatory=False)
def options(opt):
for module in find_contrib_modules(opt):
opt.recurse(module, mandatory=False)
def configure(conf):
all_contrib_modules = find_contrib_modules(conf, True)
# Append blddir to the module path before recursing into modules
# This is required for contrib modules with test suites
blddir = os.path.abspath(os.path.join(conf.bldnode.abspath(), conf.variant))
conf.env.append_value('NS3_MODULE_PATH', blddir)
# Remove duplicate path items
conf.env['NS3_MODULE_PATH'] = wutils.uniquify_list(conf.env['NS3_MODULE_PATH'])
for module in all_contrib_modules:
conf.recurse(module, mandatory=False)
## Used to link the 'test-runner' program with all of ns-3 code
conf.env['NS3_CONTRIBUTED_MODULES'] = ['ns3-' + module.split('/')[-1] for module in all_contrib_modules]
# we need the 'ns3module' waf "feature" to be created because code
# elsewhere looks for it to find the ns3 module objects.
def create_ns3_module(bld, name, dependencies=(), test=False):
static = bool(bld.env.ENABLE_STATIC_NS3)
# Create a separate library for this module.
if static:
module = bld(features='cxx cxxstlib ns3module')
else:
module = bld(features='cxx cxxshlib ns3module')
target = '%s/lib/ns%s-%s%s' % (bld.srcnode.path_from(module.path),
wutils.VERSION,
name, bld.env.BUILD_SUFFIX)
module.target = target
linkflags = []
cxxflags = []
ccflags = []
if not static:
cxxflags = module.env['shlib_CXXFLAGS']
ccflags = module.env['shlib_CXXFLAGS']
# Turn on the link flags for shared libraries if we have the
# proper compiler and platform.
if module.env['CXX_NAME'] in ['gcc', 'icc'] and module.env['WL_SONAME_SUPPORTED']:
# Get the module library name without any relative paths
# at its beginning because all of the libraries will end
# up in the same directory.
module_library_name = module.env.cshlib_PATTERN % (os.path.basename(module.target),)
linkflags = '-Wl,--soname=' + module_library_name
cxxdefines = ["NS3_MODULE_COMPILATION"]
ccdefines = ["NS3_MODULE_COMPILATION"]
module.env.append_value('CXXFLAGS', cxxflags)
module.env.append_value('CCFLAGS', ccflags)
module.env.append_value('LINKFLAGS', linkflags)
module.env.append_value('CXXDEFINES', cxxdefines)
module.env.append_value('CCDEFINES', ccdefines)
module.is_static = static
module.vnum = wutils.VNUM
# Add the proper path to the module's name.
# Set the libraries this module depends on.
module.module_deps = list(dependencies)
module.install_path = "${LIBDIR}"
module.name = "ns3-" + name
module.dependencies = dependencies
# Initially create an empty value for this because the pcfile
# writing task assumes every module has a uselib attribute.
module.uselib = ''
module.use = ['ns3-' + dep for dep in dependencies]
module.test = test
module.is_ns3_module = True
module.ns3_dir_location = bld.path.path_from(bld.srcnode)
module.env.append_value("INCLUDES", Context.out_dir)
module.pcfilegen = bld(features='ns3pcfile')
module.pcfilegen.module = module.name
return module
def create_ns3_module_test_library(bld, name):
# Create an ns3 module for the test library that depends only on
# the module being tested.
library_name = name + "-test"
library = bld.create_ns3_module(library_name, [name], test=True)
library.features += " ns3testlib"
# Modify attributes for the test library that are different from a
# normal module.
del library.is_ns3_module
library.is_ns3_module_test_library = True
library.module_name = 'ns3-' + name
# Add this module and test library to the list.
bld.env.append_value('NS3_MODULES_WITH_TEST_LIBRARIES', [(library.module_name, library.name)])
# Set the include path from the build directory to modules.
relative_path_from_build_to_here = bld.path.path_from(bld.bldnode)
include_flag = '-I' + relative_path_from_build_to_here
library.env.append_value('CXXFLAGS', include_flag)
library.env.append_value('CCFLAGS', include_flag)
return library
def create_obj(bld, *args):
warnings.warn("(in %s) Use bld(...) call now, instead of bld.create_obj(...)" % str(bld.path),
DeprecationWarning, stacklevel=2)
return bld(*args)
def ns3_python_bindings(bld):
# this method is called from a module wscript, so remember bld.path is not bindings/python!
module_abs_src_path = bld.path.abspath()
module = os.path.basename(module_abs_src_path)
env = bld.env
env.append_value("MODULAR_BINDINGS_MODULES", "ns3-"+module)
if Options.options.apiscan:
return
if not env['ENABLE_PYTHON_BINDINGS']:
return
bindings_dir = bld.path.find_dir("bindings")
if bindings_dir is None or not os.path.exists(bindings_dir.abspath()):
warnings.warn("(in %s) Requested to build modular python bindings, but apidefs dir not found "
"=> skipped the bindings." % str(bld.path),
Warning, stacklevel=2)
return
if ("ns3-%s" % (module,)) not in env.NS3_ENABLED_CONTRIBUTED_MODULES:
#print "bindings for module %s which is not enabled, skip" % module)
return
env.append_value('PYTHON_MODULES_BUILT', module)
try:
apidefs = env['PYTHON_BINDINGS_APIDEFS'].replace("-", "_")
except AttributeError:
# we likely got an empty list for env['PYTHON_BINDINGS_APIDEFS']
return
#debug = ('PYBINDGEN_DEBUG' in os.environ)
debug = True # XXX
source = [bld.srcnode.find_resource('bindings/python/ns3modulegen-modular.py'),
bld.path.find_resource("bindings/modulegen__%s.py" % apidefs)]
modulegen_customizations = bindings_dir.find_resource("modulegen_customizations.py")
if modulegen_customizations is not None:
source.append(modulegen_customizations)
modulegen_local = bld.path.find_resource("bindings/modulegen_local.py")
# the local customization file may or not exist
if modulegen_local is not None:
source.append("bindings/modulegen_local.py")
module_py_name = module.replace('-', '_')
module_target_dir = bld.srcnode.find_dir("bindings/python/ns").path_from(bld.path)
# if bindings/<module>.py exists, it becomes the module frontend, and the C extension befomes _<module>
if bld.path.find_resource("bindings/%s.py" % (module_py_name,)) is not None:
bld(features='copy',
source=("bindings/%s.py" % (module_py_name,)),
target=('%s/%s.py' % (module_target_dir, module_py_name)))
extension_name = '_%s' % (module_py_name,)
bld.install_files('${PYTHONARCHDIR}/ns', ["bindings/%s.py" % (module_py_name,)])
else:
extension_name = module_py_name
target = ['bindings/ns3module.cc', 'bindings/ns3module.h', 'bindings/ns3modulegen.log']
#if not debug:
# target.append('ns3modulegen.log')
argv = ['NS3_ENABLED_FEATURES=${FEATURES}',
'GCC_RTTI_ABI_COMPLETE=${GCC_RTTI_ABI_COMPLETE}',
'${PYTHON}']
#if debug:
# argv.extend(["-m", "pdb"])
argv.extend(['${SRC[0]}', module_abs_src_path, apidefs, extension_name, '${TGT[0]}'])
argv.extend(['2>', '${TGT[2]}']) # 2> ns3modulegen.log
features = []
for (name, caption, was_enabled, reason_not_enabled) in env['NS3_OPTIONAL_FEATURES']:
if was_enabled:
features.append(name)
bindgen = bld(features='command', source=source, target=target, command=argv)
bindgen.env['FEATURES'] = ','.join(features)
bindgen.dep_vars = ['FEATURES', "GCC_RTTI_ABI_COMPLETE"]
bindgen.before = ['cxxprogram', 'cxxshlib', 'cxxstlib']
bindgen.after = 'gen_ns3_module_header'
bindgen.name = "pybindgen(ns3 module %s)" % module
bindgen.module = module
bindgen.install_path = None
# generate the extension module
pymod = bld(features='cxx cxxshlib pyext')
pymod.source = ['bindings/ns3module.cc']
pymod.target = '%s/%s' % (module_target_dir, extension_name)
pymod.name = 'ns3module_%s' % module
pymod.module = module
pymod.use = ["%s" % mod for mod in pymod.env['NS3_ENABLED_CONTRIBUTED_MODULES']]
if pymod.env['ENABLE_STATIC_NS3']:
if sys.platform == 'darwin':
pymod.env.append_value('LINKFLAGS', '-Wl,-all_load')
for mod in pymod.usel:
#mod = mod.split("--lib")[0]
pymod.env.append_value('LINKFLAGS', '-l' + mod)
else:
pymod.env.append_value('LINKFLAGS', '-Wl,--whole-archive,-Bstatic')
for mod in pymod.use:
#mod = mod.split("--lib")[0]
pymod.env.append_value('LINKFLAGS', '-l' + mod)
pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive')
defines = list(pymod.env['DEFINES'])
defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H'])
defines.extend(['NS_DEPRECATED_3_35=', 'NS3_DEPRECATED_H'])
defines.extend(['NS_DEPRECATED_3_34=', 'NS3_DEPRECATED_H'])
if Utils.unversioned_sys_platform() == 'win32':
try:
defines.remove('_DEBUG') # causes undefined symbols on win32
except ValueError:
pass
pymod.env['DEFINES'] = defines
# The following string should lead to includes of
# '-I.', '-Isrc/core/bindings' when compiling module_helpers.cc
pymod.includes = Context.out_dir + ' ' + Context.out_dir + '/src/core/bindings'
pymod.install_path = '${PYTHONARCHDIR}/ns'
# Workaround to a WAF bug, remove this when ns-3 upgrades to WAF > 1.6.10
# https://www.nsnam.org/bugzilla/show_bug.cgi?id=1335
# http://code.google.com/p/waf/issues/detail?id=1098
if Utils.unversioned_sys_platform() == 'darwin':
pymod.mac_bundle = True
return pymod
def build(bld):
bld.create_ns3_module = types.MethodType(create_ns3_module, bld)
bld.create_ns3_module_test_library = types.MethodType(create_ns3_module_test_library, bld)
bld.create_obj = types.MethodType(create_obj, bld)
bld.ns3_python_bindings = types.MethodType(ns3_python_bindings, bld)
all_contrib_modules = find_contrib_modules(bld)
# Remove these modules from the list of all modules.
for not_built in bld.env['MODULES_NOT_BUILT']:
if not_built in all_contrib_modules:
all_contrib_modules.remove(not_built)
bld.recurse(list(all_contrib_modules))
for module in all_contrib_modules:
modheader = bld(features='ns3moduleheader')
modheader.module = module.split('/')[-1]

View File

@ -1,5 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('three-gpp-v2v-channel-example', ['core', 'mobility', 'propagation', 'spectrum', 'antenna', 'buildings'])
obj.source = 'three-gpp-v2v-channel-example.cc'

View File

@ -1,7 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('energy-model-example', ['core', 'mobility', 'wifi', 'energy', 'internet', 'config-store'])
obj.source = 'energy-model-example.cc'
obj = bld.create_ns3_program('energy-model-with-harvesting-example', ['core', 'mobility', 'wifi', 'energy', 'internet', 'config-store'])
obj.source = 'energy-model-with-harvesting-example.cc'

View File

@ -1,5 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('simple-error-model', ['point-to-point', 'internet', 'applications'])
obj.source = 'simple-error-model.cc'

View File

@ -1,32 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('icmpv6-redirect', ['csma', 'internet', 'internet-apps'])
obj.source = 'icmpv6-redirect.cc'
obj = bld.create_ns3_program('ping6', ['csma', 'internet', 'internet-apps'])
obj.source = 'ping6.cc'
obj = bld.create_ns3_program('radvd', ['csma', 'internet', 'internet-apps'])
obj.source = 'radvd.cc'
obj = bld.create_ns3_program('radvd-two-prefix', ['csma', 'internet', 'internet-apps'])
obj.source = 'radvd-two-prefix.cc'
obj = bld.create_ns3_program('test-ipv6', ['point-to-point', 'internet'])
obj.source = 'test-ipv6.cc'
obj = bld.create_ns3_program('fragmentation-ipv6', ['csma', 'internet', 'internet-apps'])
obj.source = 'fragmentation-ipv6.cc'
obj = bld.create_ns3_program('fragmentation-ipv6-two-MTU', ['csma', 'internet', 'internet-apps'])
obj.source = 'fragmentation-ipv6-two-MTU.cc'
obj = bld.create_ns3_program('loose-routing-ipv6', ['csma', 'internet', 'internet-apps'])
obj.source = 'loose-routing-ipv6.cc'
obj = bld.create_ns3_program('wsn-ping6', ['lr-wpan', 'internet', 'sixlowpan', 'mobility', 'internet-apps'])
obj.source = 'wsn-ping6.cc'
obj = bld.create_ns3_program('fragmentation-ipv6-PMTU', ['csma', 'internet', 'internet-apps', 'point-to-point'])
obj.source = 'fragmentation-ipv6-PMTU.cc'

View File

@ -1,6 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('matrix-topology',
['network', 'internet', 'netanim', 'point-to-point', 'mobility', 'applications'])
obj.source = 'matrix-topology.cc'

View File

@ -1,5 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('object-names', ['core', 'csma', 'internet', 'applications'])
obj.source = 'object-names.cc'

View File

@ -1,8 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if bld.env["ENABLE_REAL_TIME"]:
obj = bld.create_ns3_program('realtime-udp-echo', ['csma', 'internet', 'applications'])
obj.source = 'realtime-udp-echo.cc'
bld.register_ns3_script('realtime-udp-echo.py', ['csma', 'internet', 'applications'])

View File

@ -1,56 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('dynamic-global-routing',
['point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'dynamic-global-routing.cc'
obj = bld.create_ns3_program('static-routing-slash32',
['point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'static-routing-slash32.cc'
obj = bld.create_ns3_program('global-routing-slash32',
['point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'global-routing-slash32.cc'
obj = bld.create_ns3_program('global-injection-slash32',
['point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'global-injection-slash32.cc'
obj = bld.create_ns3_program('simple-global-routing',
['point-to-point', 'internet', 'applications', 'flow-monitor'])
obj.source = 'simple-global-routing.cc'
obj = bld.create_ns3_program('simple-alternate-routing',
['point-to-point', 'internet', 'applications'])
obj.source = 'simple-alternate-routing.cc'
obj = bld.create_ns3_program('mixed-global-routing',
['point-to-point', 'internet', 'csma', 'applications'])
obj.source = 'mixed-global-routing.cc'
obj = bld.create_ns3_program('simple-routing-ping6',
['csma', 'internet', 'internet-apps'])
obj.source = 'simple-routing-ping6.cc'
obj = bld.create_ns3_program('manet-routing-compare',
['wifi', 'dsr', 'dsdv', 'aodv', 'olsr', 'internet', 'applications'])
obj.source = 'manet-routing-compare.cc'
obj = bld.create_ns3_program('ripng-simple-network',
['csma', 'internet', 'internet-apps'])
obj.source = 'ripng-simple-network.cc'
bld.register_ns3_script('simple-routing-ping6.py', ['csma', 'internet', 'internet-apps'])
obj = bld.create_ns3_program('rip-simple-network',
['csma', 'internet', 'internet-apps'])
obj.source = 'rip-simple-network.cc'
obj = bld.create_ns3_program('global-routing-multi-switch-plus-router',
['core', 'network', 'applications', 'internet', 'bridge', 'csma', 'point-to-point', 'csma', 'internet'])
obj.source = 'global-routing-multi-switch-plus-router.cc'
obj = bld.create_ns3_program('simple-multicast-flooding',
['core', 'network', 'applications', 'internet'])
obj.source = 'simple-multicast-flooding.cc'

View File

@ -1,14 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('socket-bound-static-routing', ['network', 'csma', 'point-to-point', 'internet'])
obj.source = 'socket-bound-static-routing.cc'
obj = bld.create_ns3_program('socket-bound-tcp-static-routing', ['network', 'csma', 'point-to-point', 'internet', 'applications'])
obj.source = 'socket-bound-tcp-static-routing.cc'
obj = bld.create_ns3_program('socket-options-ipv4', ['network', 'csma', 'point-to-point', 'internet'])
obj.source = 'socket-options-ipv4.cc'
obj = bld.create_ns3_program('socket-options-ipv6', ['network', 'csma', 'point-to-point', 'internet'])
obj.source = 'socket-options-ipv6.cc'

View File

@ -1,6 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('wifi-example-sim', ['stats', 'internet', 'mobility', 'wifi'])
obj.source = ['wifi-example-sim.cc',
'wifi-example-apps.cc']

View File

@ -1,51 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('tcp-large-transfer',
['point-to-point', 'applications', 'internet'])
obj.source = 'tcp-large-transfer.cc'
obj = bld.create_ns3_program('tcp-star-server',
['point-to-point', 'applications', 'internet'])
obj.source = 'tcp-star-server.cc'
obj = bld.create_ns3_program('star',
['netanim', 'point-to-point', 'point-to-point-layout', 'applications', 'internet'])
obj.source = 'star.cc'
obj = bld.create_ns3_program('tcp-bulk-send',
['point-to-point', 'applications', 'internet'])
obj.source = 'tcp-bulk-send.cc'
obj = bld.create_ns3_program('tcp-pcap-nanosec-example',
['point-to-point', 'applications', 'internet'])
obj.source = 'tcp-pcap-nanosec-example.cc'
obj = bld.create_ns3_program('tcp-variants-comparison',
['point-to-point', 'internet', 'applications', 'flow-monitor'])
obj.source = 'tcp-variants-comparison.cc'
obj = bld.create_ns3_program('tcp-pacing',
['point-to-point', 'internet', 'applications', 'flow-monitor'])
obj.source = 'tcp-pacing.cc'
obj = bld.create_ns3_program('dctcp-example',
['core', 'network', 'internet', 'point-to-point', 'applications', 'traffic-control'])
obj.source = 'dctcp-example.cc'
obj = bld.create_ns3_program('tcp-linux-reno',
['point-to-point', 'internet', 'applications', 'traffic-control', 'network'])
obj.source = 'tcp-linux-reno.cc'
obj = bld.create_ns3_program('tcp-validation',
['point-to-point', 'internet', 'applications', 'traffic-control', 'network', 'internet-apps'])
obj.source = 'tcp-validation.cc'
obj = bld.create_ns3_program('tcp-bbr-example',
['point-to-point', 'internet', 'applications', 'traffic-control', 'network', 'internet-apps', 'flow-monitor'])
obj.source = 'tcp-bbr-example.cc'

View File

@ -1,25 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('traffic-control',
['internet', 'point-to-point', 'applications', 'traffic-control', 'flow-monitor'])
obj.source = 'traffic-control.cc'
obj = bld.create_ns3_program('queue-discs-benchmark',
['internet', 'point-to-point', 'applications', 'internet-apps', 'traffic-control', 'flow-monitor'])
obj.source = 'queue-discs-benchmark.cc'
obj = bld.create_ns3_program('red-vs-fengadaptive', ['point-to-point', 'point-to-point-layout', 'internet', 'applications', 'traffic-control'])
obj.source = 'red-vs-fengadaptive.cc'
obj = bld.create_ns3_program('red-vs-nlred', ['point-to-point', 'point-to-point-layout', 'internet', 'applications', 'traffic-control'])
obj.source = 'red-vs-nlred.cc'
obj = bld.create_ns3_program('tbf-example',
['internet', 'point-to-point', 'applications', 'traffic-control'])
obj.source = 'tbf-example.cc'
obj = bld.create_ns3_program('cobalt-vs-codel',
['internet', 'point-to-point', 'applications', 'traffic-control'])
obj.source = 'cobalt-vs-codel.cc'

View File

@ -1,33 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('hello-simulator', ['core'])
obj.source = 'hello-simulator.cc'
obj = bld.create_ns3_program('first', ['core', 'point-to-point', 'internet', 'applications'])
obj.source = 'first.cc'
bld.register_ns3_script('first.py', ['internet', 'point-to-point', 'applications'])
obj = bld.create_ns3_program('second', ['core', 'point-to-point', 'csma', 'internet', 'applications'])
obj.source = 'second.cc'
bld.register_ns3_script('second.py', ['core', 'point-to-point', 'csma', 'internet', 'applications'])
obj = bld.create_ns3_program('third', ['core', 'point-to-point', 'csma', 'wifi', 'internet', 'applications'])
obj.source = 'third.cc'
bld.register_ns3_script('third.py', ['core', 'point-to-point', 'csma', 'wifi', 'internet', 'applications'])
obj = bld.create_ns3_program('fourth', ['core'])
obj.source = 'fourth.cc'
obj = bld.create_ns3_program('fifth', ['core', 'point-to-point', 'internet', 'applications'])
obj.source = [ 'fifth.cc', 'tutorial-app.cc' ]
obj = bld.create_ns3_program('sixth', ['core', 'point-to-point', 'internet', 'applications'])
obj.source = [ 'sixth.cc', 'tutorial-app.cc' ]
obj = bld.create_ns3_program('seventh', ['core', 'stats', 'point-to-point', 'internet', 'applications'])
obj.source = [ 'seventh.cc', 'tutorial-app.cc' ]

View File

@ -1,8 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('udp-client-server', ['csma', 'internet', 'applications'])
obj.source = 'udp-client-server.cc'
obj = bld.create_ns3_program('udp-trace-client-server', ['csma', 'internet', 'applications'])
obj.source = 'udp-trace-client-server.cc'

View File

@ -1,5 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('udp-echo', ['csma', 'internet', 'applications'])
obj.source = 'udp-echo.cc'

View File

@ -1,123 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('mixed-wired-wireless', ['wifi', 'applications', 'olsr', 'netanim'])
obj.source = 'mixed-wired-wireless.cc'
bld.register_ns3_script('mixed-wired-wireless.py', ['wifi', 'applications', 'olsr'])
obj = bld.create_ns3_program('wifi-adhoc', ['wifi', 'applications'])
obj.source = 'wifi-adhoc.cc'
obj = bld.create_ns3_program('wifi-clear-channel-cmu', ['internet', 'wifi'])
obj.source = 'wifi-clear-channel-cmu.cc'
obj = bld.create_ns3_program('wifi-ap', ['wifi', 'applications'])
obj.source = 'wifi-ap.cc'
bld.register_ns3_script('wifi-ap.py', ['wifi', 'applications'])
obj = bld.create_ns3_program('wifi-wired-bridging', ['wifi', 'csma', 'bridge', 'applications'])
obj.source = 'wifi-wired-bridging.cc'
obj = bld.create_ns3_program('wifi-multirate', ['wifi', 'flow-monitor', 'olsr', 'applications'])
obj.source = 'wifi-multirate.cc'
obj = bld.create_ns3_program('wifi-simple-adhoc', ['internet', 'wifi'])
obj.source = 'wifi-simple-adhoc.cc'
obj = bld.create_ns3_program('wifi-simple-adhoc-grid', ['internet', 'wifi', 'olsr'])
obj.source = 'wifi-simple-adhoc-grid.cc'
obj = bld.create_ns3_program('wifi-simple-infra', ['internet', 'wifi'])
obj.source = 'wifi-simple-infra.cc'
obj = bld.create_ns3_program('wifi-simple-interference', ['internet', 'wifi'])
obj.source = 'wifi-simple-interference.cc'
obj = bld.create_ns3_program('wifi-blockack', ['wifi', 'applications'])
obj.source = 'wifi-blockack.cc'
obj = bld.create_ns3_program('wifi-dsss-validation', ['wifi'])
obj.source = 'wifi-dsss-validation.cc'
obj = bld.create_ns3_program('wifi-ofdm-validation', ['wifi'])
obj.source = 'wifi-ofdm-validation.cc'
obj = bld.create_ns3_program('wifi-ofdm-ht-validation', ['wifi'])
obj.source = 'wifi-ofdm-ht-validation.cc'
obj = bld.create_ns3_program('wifi-ofdm-vht-validation', ['wifi'])
obj.source = 'wifi-ofdm-vht-validation.cc'
obj = bld.create_ns3_program('wifi-hidden-terminal', ['wifi', 'applications', 'flow-monitor'])
obj.source = 'wifi-hidden-terminal.cc'
obj = bld.create_ns3_program('wifi-ht-network', ['wifi', 'applications'])
obj.source = 'wifi-ht-network.cc'
obj = bld.create_ns3_program('wifi-vht-network', ['wifi', 'applications'])
obj.source = 'wifi-vht-network.cc'
obj = bld.create_ns3_program('wifi-timing-attributes', ['wifi', 'applications'])
obj.source = 'wifi-timing-attributes.cc'
obj = bld.create_ns3_program('wifi-sleep', ['wifi', 'applications'])
obj.source = 'wifi-sleep.cc'
obj = bld.create_ns3_program('wifi-power-adaptation-distance', ['wifi', 'applications'])
obj.source = 'wifi-power-adaptation-distance.cc'
obj = bld.create_ns3_program('wifi-power-adaptation-interference', ['wifi', 'applications', 'flow-monitor'])
obj.source = 'wifi-power-adaptation-interference.cc'
obj = bld.create_ns3_program('wifi-rate-adaptation-distance', ['wifi', 'applications'])
obj.source = 'wifi-rate-adaptation-distance.cc'
obj = bld.create_ns3_program('wifi-aggregation', ['wifi', 'applications'])
obj.source = 'wifi-aggregation.cc'
obj = bld.create_ns3_program('wifi-txop-aggregation', ['wifi', 'applications'])
obj.source = 'wifi-txop-aggregation.cc'
obj = bld.create_ns3_program('wifi-simple-ht-hidden-stations', ['wifi', 'applications'])
obj.source = 'wifi-simple-ht-hidden-stations.cc'
obj = bld.create_ns3_program('wifi-80211n-mimo', ['wifi', 'applications'])
obj.source = 'wifi-80211n-mimo.cc'
obj = bld.create_ns3_program('wifi-mixed-network', ['wifi', 'applications'])
obj.source = 'wifi-mixed-network.cc'
obj = bld.create_ns3_program('wifi-tcp', ['wifi', 'applications'])
obj.source = 'wifi-tcp.cc'
obj = bld.create_ns3_program('wifi-80211e-txop', ['wifi', 'applications'])
obj.source = 'wifi-80211e-txop.cc'
obj = bld.create_ns3_program('wifi-spectrum-per-example', ['wifi', 'applications'])
obj.source = 'wifi-spectrum-per-example.cc'
obj = bld.create_ns3_program('wifi-spectrum-per-interference', ['wifi', 'applications'])
obj.source = 'wifi-spectrum-per-interference.cc'
obj = bld.create_ns3_program('wifi-spectrum-saturation-example', ['wifi', 'applications'])
obj.source = 'wifi-spectrum-saturation-example.cc'
obj = bld.create_ns3_program('wifi-ofdm-he-validation', ['wifi'])
obj.source = 'wifi-ofdm-he-validation.cc'
obj = bld.create_ns3_program('wifi-he-network', ['wifi', 'applications'])
obj.source = 'wifi-he-network.cc'
obj = bld.create_ns3_program('wifi-multi-tos', ['wifi', 'applications'])
obj.source = 'wifi-multi-tos.cc'
obj = bld.create_ns3_program('wifi-backward-compatibility', ['wifi', 'applications'])
obj.source = 'wifi-backward-compatibility.cc'
obj = bld.create_ns3_program('wifi-spatial-reuse', ['wifi', 'applications'])
obj.source = 'wifi-spatial-reuse.cc'
obj = bld.create_ns3_program('wifi-error-models-comparison', ['wifi'])
obj.source = 'wifi-error-models-comparison.cc'

8
ns3
View File

@ -152,7 +152,7 @@ def parse_args(argv):
help="Do not execute the commands",
action="store_true", default=None, dest="configure_dry_run")
parser_clean = sub_parser.add_parser('clean', help='Removes files created by waf and ns3')
parser_clean = sub_parser.add_parser('clean', help='Removes files created by ns3')
parser_clean.add_argument('clean', action="store_true", default=False)
parser_clean.add_argument('--dry-run',
help="Do not execute the commands",
@ -405,10 +405,10 @@ def project_not_configured(config_msg=""):
def check_config(current_cmake_cache_folder):
if current_cmake_cache_folder is None:
project_not_configured()
waf_like_config_table = current_cmake_cache_folder + os.sep + "ns3wafconfig.txt"
if not os.path.exists(waf_like_config_table):
config_table = current_cmake_cache_folder + os.sep + "ns3config.txt"
if not os.path.exists(config_table):
project_not_configured()
with open(waf_like_config_table, "r") as f:
with open(config_table, "r") as f:
print(f.read())

View File

@ -1,47 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('antenna', ['core'])
module.source = [
'model/angles.cc',
'model/antenna-model.cc',
'model/isotropic-antenna-model.cc',
'model/cosine-antenna-model.cc',
'model/parabolic-antenna-model.cc',
'model/three-gpp-antenna-model.cc',
'model/phased-array-model.cc',
'model/uniform-planar-array.cc',
]
module_test = bld.create_ns3_module_test_library('antenna')
module_test.source = [
'test/test-angles.cc',
'test/test-degrees-radians.cc',
'test/test-isotropic-antenna.cc',
'test/test-cosine-antenna.cc',
'test/test-parabolic-antenna.cc',
'test/test-uniform-planar-array.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/antenna-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'antenna'
headers.source = [
'model/angles.h',
'model/antenna-model.h',
'model/isotropic-antenna-model.h',
'model/cosine-antenna-model.h',
'model/parabolic-antenna-model.h',
'model/three-gpp-antenna-model.h',
'model/phased-array-model.h',
'model/uniform-planar-array.h',
]
bld.ns3_python_bindings()

View File

@ -1,6 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('aodv',
['wifi', 'internet', 'aodv', 'internet-apps'])
obj.source = 'aodv.cc'

View File

@ -1,48 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('aodv', ['internet', 'wifi'])
module.includes = '.'
module.source = [
'model/aodv-id-cache.cc',
'model/aodv-dpd.cc',
'model/aodv-rtable.cc',
'model/aodv-rqueue.cc',
'model/aodv-packet.cc',
'model/aodv-neighbor.cc',
'model/aodv-routing-protocol.cc',
'helper/aodv-helper.cc',
]
aodv_test = bld.create_ns3_module_test_library('aodv')
aodv_test.source = [
'test/aodv-id-cache-test-suite.cc',
'test/aodv-test-suite.cc',
'test/aodv-regression.cc',
'test/bug-772.cc',
'test/loopback.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
aodv_test.source.extend([
# 'test/aodv-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'aodv'
headers.source = [
'model/aodv-id-cache.h',
'model/aodv-dpd.h',
'model/aodv-rtable.h',
'model/aodv-rqueue.h',
'model/aodv-packet.h',
'model/aodv-neighbor.h',
'model/aodv-routing-protocol.h',
'helper/aodv-helper.h',
]
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,8 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('three-gpp-http-example', ['applications','point-to-point','internet','network'])
obj.source = 'three-gpp-http-example.cc'

View File

@ -1,75 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('applications', ['internet', 'stats'])
module.source = [
'model/bulk-send-application.cc',
'model/onoff-application.cc',
'model/packet-sink.cc',
'model/udp-client.cc',
'model/udp-server.cc',
'model/seq-ts-header.cc',
'model/seq-ts-size-header.cc',
'model/seq-ts-echo-header.cc',
'model/udp-trace-client.cc',
'model/packet-loss-counter.cc',
'model/udp-echo-client.cc',
'model/udp-echo-server.cc',
'model/application-packet-probe.cc',
'model/three-gpp-http-client.cc',
'model/three-gpp-http-server.cc',
'model/three-gpp-http-header.cc',
'model/three-gpp-http-variables.cc',
'helper/bulk-send-helper.cc',
'helper/on-off-helper.cc',
'helper/packet-sink-helper.cc',
'helper/udp-client-server-helper.cc',
'helper/udp-echo-helper.cc',
'helper/three-gpp-http-helper.cc',
]
applications_test = bld.create_ns3_module_test_library('applications')
applications_test.source = [
'test/three-gpp-http-client-server-test.cc',
'test/bulk-send-application-test-suite.cc',
'test/udp-client-server-test.cc'
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
applications_test.source.extend([
# 'test/applications-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'applications'
headers.source = [
'model/bulk-send-application.h',
'model/onoff-application.h',
'model/packet-sink.h',
'model/udp-client.h',
'model/udp-server.h',
'model/seq-ts-header.h',
'model/seq-ts-size-header.h',
'model/seq-ts-echo-header.h',
'model/udp-trace-client.h',
'model/packet-loss-counter.h',
'model/udp-echo-client.h',
'model/udp-echo-server.h',
'model/application-packet-probe.h',
'model/three-gpp-http-client.h',
'model/three-gpp-http-server.h',
'model/three-gpp-http-header.h',
'model/three-gpp-http-variables.h',
'helper/bulk-send-helper.h',
'helper/on-off-helper.h',
'helper/packet-sink-helper.h',
'helper/udp-client-server-helper.h',
'helper/udp-echo-helper.h',
'helper/three-gpp-http-helper.h'
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,12 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('csma-bridge', ['bridge', 'csma', 'internet', 'applications'])
obj.source = 'csma-bridge.cc'
bld.register_ns3_script('csma-bridge.py', ['bridge', 'csma', 'internet', 'applications'])
obj = bld.create_ns3_program('csma-bridge-one-hop', ['bridge', 'csma', 'internet', 'applications'])
obj.source = 'csma-bridge-one-hop.cc'

View File

@ -1,21 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_module('bridge', ['network'])
obj.source = [
'model/bridge-net-device.cc',
'model/bridge-channel.cc',
'helper/bridge-helper.cc',
]
headers = bld(features='ns3header')
headers.module = 'bridge'
headers.source = [
'model/bridge-net-device.h',
'model/bridge-channel.h',
'helper/bridge-helper.h',
]
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,7 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('brite-generic-example', ['brite', 'internet', 'point-to-point', 'nix-vector-routing', 'applications'])
obj.source = 'brite-generic-example.cc'
obj = bld.create_ns3_program('brite-MPI-example', ['brite', 'internet', 'point-to-point', 'nix-vector-routing', 'applications', 'mpi'])
obj.source = 'brite-MPI-example.cc'

View File

@ -1,116 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os
from waflib import Options
def options(opt):
opt.add_option('--with-brite',
help=('Use BRITE integration support, given by the indicated path,'
' to allow the use of the BRITE topology generator'),
default=False, dest='with_brite')
def configure(conf):
conf.env['ENABLE_BRITE'] = False
lib_to_check = 'libbrite.so'
if Options.options.with_brite:
conf.msg("Checking BRITE location", ("%s (given)" % Options.options.with_brite))
brite_dir = Options.options.with_brite
if os.path.exists(os.path.join(brite_dir, lib_to_check)):
conf.env['WITH_BRITE'] = os.path.abspath(Options.options.with_brite)
conf.env['ENABLE_BRITE'] = True
else:
conf.report_optional_feature("brite", "BRITE Integration", False,
"BRITE not found at requested location")
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('brite')
return
else:
# No user specified '--with-brite' option, try to guess
# bake.py uses ../../build, while ns-3-dev uses ../BRITE
brite_dir = os.path.join('..','BRITE')
brite_bake_build_dir = os.path.join('..', '..', 'build')
brite_bake_lib_dir = os.path.join(brite_bake_build_dir, 'lib')
if os.path.exists(os.path.join(brite_dir, lib_to_check)):
conf.msg("Checking for BRITE location", ("%s (guessed)" % brite_dir))
conf.env['WITH_BRITE'] = os.path.abspath(brite_dir)
conf.env['ENABLE_BRITE'] = True
# Below is not yet ready (bake does not install BRITE yet, just builds it)
# elif os.path.exists(os.path.join(brite_bake_lib_dir, lib_to_check)):
# conf.msg("Checking for BRITE location", ("%s (guessed)" % brite_bake_lib_dir))
# conf.env['WITH_BRITE'] = os.path.abspath(brite_bake_lib_dir)
else:
conf.report_optional_feature("brite", "BRITE Integration", False, 'BRITE not enabled (see option --with-brite)')
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('brite')
return
test_code = '''
#include "Brite.h"
int main()
{
return 0;
}
'''
conf.env['HAVE_DL'] = conf.check(mandatory=True, lib='dl', define_name='HAVE_DL', uselib_store='DL')
conf.env['LIBPATH_BRITE'] = [os.path.abspath(os.path.join(conf.env['WITH_BRITE'], '.'))]
conf.env['INCLUDES_BRITE'] = [
os.path.abspath(os.path.join(conf.env['WITH_BRITE'],'.')),
os.path.abspath(os.path.join(conf.env['WITH_BRITE'],'Models'))
]
conf.env['DEFINES_BRITE'] = ['NS3_BRITE']
conf.env['BRITE'] = conf.check(fragment=test_code, lib='brite', libpath=conf.env['LIBPATH_BRITE'], uselib='BRITE')
# This statement will get LD_LIBRARY_PATH set correctly when waf needs
# to load the brite shared library.
conf.env.append_value('NS3_MODULE_PATH',os.path.abspath(os.path.join(conf.env['WITH_BRITE'], '.')))
conf.report_optional_feature("brite", "BRITE Integration",
conf.env['BRITE'], "BRITE library not found")
def build(bld):
# Don't do anything for this module if brite's not enabled.
if 'brite' in bld.env['MODULES_NOT_BUILT']:
return
module = bld.create_ns3_module('brite', ['network', 'core', 'internet', 'point-to-point'])
module.source = [
]
module_test = bld.create_ns3_module_test_library('brite')
module_test.source = [
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/brite-examples-test-suite.cc',
])
if bld.env['BRITE'] and bld.env['HAVE_DL']:
module.use.extend(['BRITE', 'DL'])
module_test.use.extend(['BRITE', 'DL'])
headers = bld(features='ns3header')
headers.module = 'brite'
headers.source = [
]
if bld.env['ENABLE_BRITE']:
module.source.append ('helper/brite-topology-helper.cc')
headers.source.append ('helper/brite-topology-helper.h')
module_test.source.append('test/brite-test-topology.cc')
if bld.env['ENABLE_EXAMPLES'] and bld.env['ENABLE_BRITE']:
bld.recurse('examples')

View File

@ -1,12 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('buildings-pathloss-profiler',
['buildings'])
obj.source = 'buildings-pathloss-profiler.cc'
obj = bld.create_ns3_program('outdoor-random-walk-example',
['buildings'])
obj.source = 'outdoor-random-walk-example.cc'
obj = bld.create_ns3_program('outdoor-group-mobility-example',
['mobility', 'network', 'buildings'])
obj.source = 'outdoor-group-mobility-example.cc'

View File

@ -1,63 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('buildings', ['mobility', 'propagation', 'config-store'])
module.source = [
'model/building.cc',
'model/building-list.cc',
'model/mobility-building-info.cc',
'model/itu-r-1238-propagation-loss-model.cc',
'model/buildings-propagation-loss-model.cc',
'model/hybrid-buildings-propagation-loss-model.cc',
'model/oh-buildings-propagation-loss-model.cc',
'model/buildings-channel-condition-model.cc',
'model/three-gpp-v2v-channel-condition-model.cc',
'helper/building-container.cc',
'helper/building-position-allocator.cc',
'helper/building-allocator.cc',
'helper/buildings-helper.cc',
'model/random-walk-2d-outdoor-mobility-model.cc',
]
module_test = bld.create_ns3_module_test_library('buildings')
module_test.source = [
'test/buildings-helper-test.cc',
'test/building-position-allocator-test.cc',
'test/buildings-pathloss-test.cc',
'test/buildings-shadowing-test.cc',
'test/buildings-channel-condition-model-test.cc',
'test/outdoor-random-walk-test.cc',
'test/three-gpp-v2v-channel-condition-model-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/buildings-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'buildings'
headers.source = [
'model/building.h',
'model/building-list.h',
'model/mobility-building-info.h',
'model/itu-r-1238-propagation-loss-model.h',
'model/buildings-propagation-loss-model.h',
'model/hybrid-buildings-propagation-loss-model.h',
'model/oh-buildings-propagation-loss-model.h',
'model/buildings-channel-condition-model.h',
'model/three-gpp-v2v-channel-condition-model.h',
'helper/building-container.h',
'helper/building-allocator.h',
'helper/building-position-allocator.h',
'helper/buildings-helper.h',
'model/random-walk-2d-outdoor-mobility-model.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,26 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('nsclick-simple-lan',
['click', 'csma', 'internet', 'applications'])
obj.source = 'nsclick-simple-lan.cc'
obj = bld.create_ns3_program('nsclick-raw-wlan',
['click', 'wifi', 'internet', 'applications'])
obj.source = 'nsclick-raw-wlan.cc'
obj = bld.create_ns3_program('nsclick-udp-client-server-csma',
['click', 'csma', 'internet', 'applications'])
obj.source = 'nsclick-udp-client-server-csma.cc'
obj = bld.create_ns3_program('nsclick-udp-client-server-wifi',
['click', 'wifi', 'internet', 'applications'])
obj.source = 'nsclick-udp-client-server-wifi.cc'
obj = bld.create_ns3_program('nsclick-routing',
['click', 'csma', 'internet', 'applications'])
obj.source = 'nsclick-routing.cc'
obj = bld.create_ns3_program('nsclick-defines',
['click'])
obj.source = 'nsclick-defines.cc'

View File

@ -1,137 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os
from waflib import Options
def options(opt):
opt.add_option('--with-nsclick',
help=('Path to Click source or installation prefix for NS-3 Click Integration support'),
dest='with_nsclick', default=None)
opt.add_option('--disable-nsclick',
help=('Disable NS-3 Click Integration support'),
dest='disable_nsclick', default=False, action="store_true")
def configure(conf):
if Options.options.disable_nsclick:
conf.report_optional_feature("nsclick", "NS-3 Click Integration", False,
"disabled by user request")
return
if Options.options.with_nsclick:
if os.path.isdir(Options.options.with_nsclick):
conf.msg("Checking for libnsclick.so location", ("%s (given)" % Options.options.with_nsclick))
conf.env['WITH_NSCLICK'] = os.path.abspath(Options.options.with_nsclick)
else:
# bake.py uses ../../build, while ns-3-dev uses ../click.
lib_to_check = 'libnsclick.so'
nsclick_bake_build_dir = os.path.join('..', '..', 'build')
nsclick_bake_lib_dir = os.path.join(nsclick_bake_build_dir, 'lib')
nsclick_dir = os.path.join('..','click')
if os.path.exists(os.path.join(nsclick_bake_lib_dir, lib_to_check)):
conf.msg("Checking for click location",("%s (guessed)" % nsclick_bake_build_dir))
conf.env['WITH_NSCLICK'] = os.path.abspath(nsclick_bake_build_dir)
elif os.path.isdir(nsclick_dir):
conf.msg("Checking for click location", ("%s (guessed)" % nsclick_dir))
conf.env['WITH_NSCLICK'] = os.path.abspath(nsclick_dir)
del nsclick_bake_build_dir
del nsclick_bake_lib_dir
del nsclick_dir
if not conf.env['WITH_NSCLICK']:
conf.msg("Checking for click location", False)
conf.report_optional_feature("nsclick", "NS-3 Click Integration", False,
"nsclick not enabled (see option --with-nsclick)")
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('click')
return
test_code = '''
#include<sys/types.h>
#include<sys/time.h>
#include<click/simclick.h>
#ifdef __cplusplus
extern "C" {
#endif
int simclick_sim_send(simclick_node_t *sim,int ifid,int type, const unsigned char* data,int len,simclick_simpacketinfo *pinfo)
{
return 0;
}
int simclick_sim_command(simclick_node_t *sim, int cmd, ...)
{
return 0;
}
#ifdef __cplusplus
}
#endif
int main()
{
return 0;
}
'''
conf.env['HAVE_DL'] = conf.check(mandatory=True, lib='dl', define_name='HAVE_DL', uselib_store='DL')
for tmp in ['lib', 'ns']:
libdir = os.path.abspath(os.path.join(conf.env['WITH_NSCLICK'],tmp))
if os.path.isdir(libdir):
conf.env.append_value('NS3_MODULE_PATH',libdir)
conf.env['LIBPATH_NSCLICK'] = [libdir]
conf.env['INCLUDES_NSCLICK'] = [os.path.abspath(os.path.join(conf.env['WITH_NSCLICK'],'include'))]
conf.env['LIB_NSCLICK'] = ['nsclick']
conf.env['DEFINES_NSCLICK'] = ['NS3_CLICK']
conf.env['NSCLICK'] = conf.check_nonfatal(fragment=test_code, use='DL NSCLICK',
msg="Checking for library nsclick")
conf.report_optional_feature("nsclick", "NS-3 Click Integration",
conf.env['NSCLICK'], "nsclick library not found")
if not conf.env['NSCLICK']:
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('click')
def build(bld):
# Don't do anything for this module if click should not be built.
if 'click' in bld.env['MODULES_NOT_BUILT']:
return
module = bld.create_ns3_module('click', ['core', 'network', 'internet'])
module.source = [
'model/ipv4-click-routing.cc',
'model/ipv4-l3-click-protocol.cc',
'helper/click-internet-stack-helper.cc',
]
module_test = bld.create_ns3_module_test_library('click')
module_test.source = [
'test/ipv4-click-routing-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/click-examples-test-suite.cc',
])
if bld.env['NSCLICK'] and bld.env['HAVE_DL']:
module.use.extend(['NSCLICK', 'DL'])
module_test.use.extend(['NSCLICK', 'DL'])
headers = bld(features='ns3header')
headers.module = 'click'
headers.source = [
'model/ipv4-click-routing.h',
'model/ipv4-l3-click-protocol.h',
'helper/click-internet-stack-helper.h',
]
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,6 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('config-store-save', ['core', 'config-store'])
obj.source = 'config-store-save.cc'

View File

@ -1,96 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import wutils
import sys
import subprocess
from waflib import Options
# Bug 2936 gcc version issue for GTK+ and -Wparentheses
gcc_version_gtkplus_warning_issue = (8, 0, 0)
def options(opt):
opt.add_option('--disable-gtk',
help=('Disable GTK+ support'),
dest='disable_gtk', default=False, action="store_true")
def configure(conf):
if Options.options.disable_gtk:
conf.env['ENABLE_GTK'] = False
conf.report_optional_feature("GtkConfigStore", "GtkConfigStore",
conf.env['ENABLE_GTK'],
"--disable-gtk option given")
else:
have_gtk = conf.check_cfg(package='gtk+-3.0 >= 3.22',
args=['--cflags', '--libs'], uselib_store='GTK',
mandatory=False)
conf.env['ENABLE_GTK'] = have_gtk
conf.report_optional_feature("GtkConfigStore", "GtkConfigStore",
conf.env['ENABLE_GTK'],
"library 'gtk+-3 >= 3.22' not found")
# Bug 2936 and #340 -Wparentheses issue for gcc >= 8
# This have to be kept until we can bump the minimum GTK version to 3.24
if conf.env['ENABLE_GTK']:
if conf.env['CXX_NAME'] in ['gcc']:
if tuple(map(int, conf.env['CC_VERSION'])) >= gcc_version_gtkplus_warning_issue:
conf.env.append_value('CXXFLAGS', '-Wno-parentheses')
have_libxml2 = conf.check_cfg(package='libxml-2.0 >= 2.7',
args=['--cflags', '--libs'], uselib_store='LIBXML2',
mandatory=False)
conf.env['ENABLE_LIBXML2'] = have_libxml2
conf.report_optional_feature("XmlIo", "XmlIo",
conf.env['ENABLE_LIBXML2'],
"library 'libxml-2.0 >= 2.7' not found")
conf.write_config_header('ns3/config-store-config.h', top=True)
def build(bld):
bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/config-store-config.h')
module = bld.create_ns3_module('config-store', ['core', 'network'])
module.source = [
'model/attribute-iterator.cc',
'model/config-store.cc',
'model/attribute-default-iterator.cc',
'model/file-config.cc',
'model/raw-text-config.cc',
]
headers = bld(features='ns3header')
headers.module = 'config-store'
headers.source = [
'model/file-config.h',
'model/config-store.h',
]
if bld.env['ENABLE_GTK']:
headers.source.append('model/gtk-config-store.h')
module.source.extend(['model/gtk-config-store.cc',
'model/model-node-creator.cc',
'model/model-typeid-creator.cc',
'model/display-functions.cc',
])
module.use.append('GTK')
if bld.env['ENABLE_LIBXML2']:
module.source.append('model/xml-config.cc')
module.use.append('LIBXML2')
# Bug 2637: use xcrun utility to find where macOS puts headers
if sys.platform == 'darwin':
find_sdk_path = '/usr/bin/xcrun --show-sdk-path'.split()
try:
p = subprocess.Popen(find_sdk_path, stdout=subprocess.PIPE)
xcrun_output = p.stdout.read().strip().decode("utf-8")
module.includes = str(xcrun_output + u'/usr/include/libxml2')
except OSError:
pass
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -46,8 +46,6 @@
--dict=/usr/share/dict/propernames \
--dict=/usr/share/dict/connectives"
Waf: Entering directory `build'
Waf: Leaving directory `build'
'build' finished successfully (3.028s)
Hasher

View File

@ -1,68 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('main-callback', ['core'])
obj.source = 'main-callback.cc'
obj = bld.create_ns3_program('sample-simulator', ['core'])
obj.source = 'sample-simulator.cc'
bld.register_ns3_script('sample-simulator.py', ['core'])
obj = bld.create_ns3_program('main-ptr', ['core'] )
obj.source = 'main-ptr.cc'
obj = bld.create_ns3_program('main-random-variable-stream', ['core', 'config-store','stats'])
obj.source = 'main-random-variable-stream.cc'
obj = bld.create_ns3_program('sample-random-variable',
['core'])
obj.source = 'sample-random-variable.cc'
obj = bld.create_ns3_program('sample-random-variable-stream',
['core'])
obj.source = 'sample-random-variable-stream.cc'
obj = bld.create_ns3_program('command-line-example',
['core'])
obj.source = 'command-line-example.cc'
obj = bld.create_ns3_program('hash-example',
['core'])
obj.source = 'hash-example.cc'
obj = bld.create_ns3_program('sample-log-time-format', ['core'])
obj.source = 'sample-log-time-format.cc'
obj = bld.create_ns3_program('test-string-value-formatting', ['core'])
obj.source = 'test-string-value-formatting.cc'
obj = bld.create_ns3_program('sample-show-progress',
['core'])
obj.source = 'sample-show-progress.cc'
obj = bld.create_ns3_program('empirical-random-variable-example', ['core', 'flow-monitor'])
obj.source = 'empirical-random-variable-example.cc'
obj = bld.create_ns3_program('system-path-examples',
['core'])
obj.source = 'system-path-examples.cc'
obj = bld.create_ns3_program('fatal-example',
['core'])
obj.source = 'fatal-example.cc'
if bld.env['ENABLE_BUILD_VERSION']:
obj = bld.create_ns3_program('build-version-example',
['core'])
obj.source = 'build-version-example.cc'
if bld.env['ENABLE_THREADING'] and bld.env["ENABLE_REAL_TIME"]:
obj = bld.create_ns3_program('main-test-sync', ['network'])
obj.source = 'main-test-sync.cc'
obj = bld.create_ns3_program('length-example', ['core'])
obj.source = 'length-example.cc'

View File

@ -126,7 +126,7 @@ protected:
* \par Test Addition
*
* To use an example program as a test you need to create a test suite
* file and add it to the appropriate list in your module wscript
* file and add it to the appropriate list in your module CMakeLists.txt
* file. The "good" output reference file needs to be generated for
* detecting regressions.
*
@ -148,7 +148,7 @@ protected:
* the same example is run twice with different arguments.
*
* You then need to add that newly created test suite file to the list
* of test sources in `mymodule/wscript`. Building of examples
* of test sources in `mymodule/CMakeLists.txt`. Building of examples
* is an option so you need to guard the inclusion of the test suite:
*
* \code{.py}
@ -156,7 +156,7 @@ protected:
* module.source.append('model/mymodule-examples-test-suite.cc')
* \endcode
*
* Since you modified a wscript file you need to reconfigure and
* Since you modified a CMakeLists.txt file you need to reconfigure and
* rebuild everything.
*
* You just added new tests so you will need to generate the "good"

View File

@ -24,7 +24,7 @@
// Order is important here, as it determines which implementation
// will generate doxygen API docs. This order mimics the
// selection logic in wscript, so we generate docs from the
// selection logic in CMakeLists.txt, so we generate docs from the
// implementation actually chosen by the configuration.
#if defined (INT64X64_USE_128) && !defined (PYTHON_SCAN)
#include "int64x64-128.h"

View File

@ -1046,7 +1046,7 @@ protected:
* subdirectories, then the variable NS_TEST_SOURCEDIR may not work
* and the user may want to explicitly pass in a directory string.
*
* Note that NS_TEST_SOURCEDIR is set in src/wscript for each module
* Note that NS_TEST_SOURCEDIR is set in src/CMakeLists.txt for each module
*/
void SetDataDir (std::string directory);

View File

@ -1,514 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import sys
import re
from waflib import Context, Configure, Options, Utils
import wutils
int64x64 = {
# implementation name: [define, env, highprec]
'default': ['INT64X64_USE_128', 'INT64X64_USE_128', '128-bit integer'],
'int128': ['INT64X64_USE_128', 'INT64X64_USE_128', '128-bit integer'],
'cairo': ['INT64X64_USE_CAIRO', 'INT64X64_USE_CAIRO', 'cairo 128-bit integer'],
'double': ['INT64X64_USE_DOUBLE', 'INT64X64_USE_DOUBLE', 'long double'],
}
default_int64x64 = 'default'
def options(opt):
assert default_int64x64 in int64x64
opt.add_option('--int64x64',
action='store',
default=default_int64x64,
help=("Force the choice of int64x64_t implementation "
"(normally only for debugging). "
"The supported implementations use int128_t, "
"cairo_int128, or long double. "
"The int128_t implementation (the preferred option) "
"requires compiler support. "
"The cairo implementation fallback provides exactly "
"the same numerical results, but possibly at lower "
"execution speed. The long double implementation "
"may not provide the same numerical results because "
"the implementation-defined numerical precision may "
"be less than the other implementations. "
"[Allowed Values: %s]"
% ", ".join([repr(p) for p in list(int64x64.keys())])),
choices=list(int64x64.keys()),
dest='int64x64_impl')
opt.add_option('--disable-pthread',
help=('Whether to enable the use of POSIX threads'),
action="store_true", default=False,
dest='disable_pthread')
opt.add_option('--check-version',
help=("Print the current build version"),
action="store_true", default=False,
dest='check_version')
opt.add_option('--enable-build-version',
help=("Check git repository for changes and update build version "
"during waf build"),
action="store_true", default=False,
dest='enable_build_version')
def configure(conf):
conf.load('versioning', ['waf-tools'])
conf.require_boost_incs('core', 'ns-3 core module', required=False)
int64x64_impl = Options.options.int64x64_impl
if int64x64_impl == 'default' or int64x64_impl == 'int128':
code_snip_type='''
#include <stdint.h>
int main(int argc, char **argv) {
(void)argc; (void)argv;
if ((uint128_t *) 0) return 0;
if (sizeof (uint128_t)) return 0;
return 1;
}
'''
have_uint128 = conf.check_nonfatal(msg='checking for uint128_t',
define_name='HAVE_UINT128_T',
code=code_snip_type)
code_snip_type='''
#include <stdint.h>
int main(int argc, char **argv) {
(void)argc; (void)argv;
if ((__uint128_t *) 0) return 0;
if (sizeof (__uint128_t)) return 0;
return 1;
}
'''
have__uint128 = conf.check_nonfatal(msg='checking for __uint128_t',
define_name='HAVE___UINT128_T',
code=code_snip_type)
if have_uint128 or have__uint128:
int64x64_impl = 'int128'
else:
int64x64_impl = 'cairo'
def_flag, env_flag, highprec = int64x64[int64x64_impl]
# Add a tag confirming default choice
if Options.options.int64x64_impl == 'default':
highprec += ' (default)'
conf.define(def_flag, 1)
conf.env[env_flag] = 1
conf.msg('Checking high precision implementation', highprec)
conf.check_nonfatal(header_name='stdint.h', define_name='HAVE_STDINT_H')
conf.check_nonfatal(header_name='inttypes.h', define_name='HAVE_INTTYPES_H')
conf.check_nonfatal(header_name='sys/inttypes.h', define_name='HAVE_SYS_INT_TYPES_H')
conf.check_nonfatal(header_name='sys/types.h', define_name='HAVE_SYS_TYPES_H')
conf.check_nonfatal(header_name='sys/stat.h', define_name='HAVE_SYS_STAT_H')
conf.check_nonfatal(header_name='dirent.h', define_name='HAVE_DIRENT_H')
conf.check_nonfatal(header_name='signal.h', define_name='HAVE_SIGNAL_H')
# Check for POSIX threads
test_env = conf.env.derive()
if Utils.unversioned_sys_platform() != 'darwin' and Utils.unversioned_sys_platform() != 'cygwin':
test_env.append_value('LINKFLAGS', '-pthread')
test_env.append_value('CXXFLAGS', '-pthread')
test_env.append_value('CCFLAGS', '-pthread')
fragment = r"""
#include <pthread.h>
int main ()
{
pthread_mutex_t m;
pthread_mutex_init (&m, NULL);
return 0;
}
"""
if Options.options.disable_pthread:
conf.report_optional_feature("Threading", "Threading Primitives",
False,
"Disabled by user request (--disable-pthread)")
have_pthread = False
else:
have_pthread = conf.check_nonfatal(header_name='pthread.h', define_name='HAVE_PTHREAD_H',
env=test_env, fragment=fragment,
errmsg='Could not find pthread support (build/config.log for details)')
if have_pthread:
# darwin accepts -pthread but prints a warning saying it is ignored
if Utils.unversioned_sys_platform() != 'darwin' and Utils.unversioned_sys_platform() != 'cygwin':
conf.env['CXXFLAGS_PTHREAD'] = '-pthread'
conf.env['CCFLAGS_PTHREAD'] = '-pthread'
conf.env['LINKFLAGS_PTHREAD'] = '-pthread'
conf.env['ENABLE_THREADING'] = have_pthread
conf.report_optional_feature("Threading", "Threading Primitives",
conf.env['ENABLE_THREADING'],
"<pthread.h> include not detected")
if not conf.check_nonfatal(lib='rt', uselib='RT, PTHREAD', define_name='HAVE_RT'):
conf.report_optional_feature("RealTime", "Real Time Simulator",
False, "librt is not available")
else:
conf.report_optional_feature("RealTime", "Real Time Simulator",
conf.env['ENABLE_THREADING'],
"threading not enabled")
conf.env["ENABLE_REAL_TIME"] = conf.env['ENABLE_THREADING']
if Options.options.enable_build_version:
conf.env['ENABLE_BUILD_VERSION'] = True
conf.env.append_value('DEFINES', 'ENABLE_BUILD_VERSION=1')
else:
conf.env['ENABLE_BUILD_VERSION'] = False
conf.write_config_header('ns3/core-config.h', top=True)
def build(bld):
bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/core-config.h')
core = bld.create_ns3_module('core')
core.source = [
'model/time.cc',
'model/event-id.cc',
'model/scheduler.cc',
'model/list-scheduler.cc',
'model/map-scheduler.cc',
'model/heap-scheduler.cc',
'model/calendar-scheduler.cc',
'model/priority-queue-scheduler.cc',
'model/event-impl.cc',
'model/simulator.cc',
'model/simulator-impl.cc',
'model/default-simulator-impl.cc',
'model/timer.cc',
'model/watchdog.cc',
'model/synchronizer.cc',
'model/make-event.cc',
'model/log.cc',
'model/breakpoint.cc',
'model/type-id.cc',
'model/attribute-construction-list.cc',
'model/object-base.cc',
'model/ref-count-base.cc',
'model/object.cc',
'model/test.cc',
'model/random-variable-stream.cc',
'model/rng-seed-manager.cc',
'model/rng-stream.cc',
'model/command-line.cc',
'model/attribute.cc',
'model/boolean.cc',
'model/integer.cc',
'model/uinteger.cc',
'model/enum.cc',
'model/double.cc',
'model/int64x64.cc',
'model/string.cc',
'model/pointer.cc',
'model/object-ptr-container.cc',
'model/object-factory.cc',
'model/global-value.cc',
'model/trace-source-accessor.cc',
'model/config.cc',
'model/callback.cc',
'model/names.cc',
'model/vector.cc',
'model/fatal-impl.cc',
'model/system-path.cc',
'helper/random-variable-stream-helper.cc',
'helper/event-garbage-collector.cc',
'model/hash-function.cc',
'model/hash-murmur3.cc',
'model/hash-fnv.cc',
'model/hash.cc',
'model/des-metrics.cc',
'model/ascii-file.cc',
'model/node-printer.cc',
'model/time-printer.cc',
'model/show-progress.cc',
'model/system-wall-clock-timestamp.cc',
'helper/csv-reader.cc',
'model/length.cc',
'model/trickle-timer.cc',
]
if (bld.env['ENABLE_EXAMPLES']):
core.source.append('model/example-as-test.cc')
core_test = bld.create_ns3_module_test_library('core')
core_test.source = [
'test/attribute-test-suite.cc',
'test/attribute-container-test-suite.cc',
'test/build-profile-test-suite.cc',
'test/callback-test-suite.cc',
'test/command-line-test-suite.cc',
'test/config-test-suite.cc',
'test/global-value-test-suite.cc',
'test/int64x64-test-suite.cc',
'test/names-test-suite.cc',
'test/object-test-suite.cc',
'test/ptr-test-suite.cc',
'test/event-garbage-collector-test-suite.cc',
'test/many-uniform-random-variables-one-get-value-call-test-suite.cc',
'test/one-uniform-random-variable-many-get-value-calls-test-suite.cc',
'test/pair-value-test-suite.cc',
'test/tuple-value-test-suite.cc',
'test/sample-test-suite.cc',
'test/simulator-test-suite.cc',
'test/time-test-suite.cc',
'test/timer-test-suite.cc',
'test/traced-callback-test-suite.cc',
'test/type-traits-test-suite.cc',
'test/watchdog-test-suite.cc',
'test/hash-test-suite.cc',
'test/type-id-test-suite.cc',
'test/length-test-suite.cc',
'test/trickle-timer-test-suite.cc',
]
if (bld.env['ENABLE_EXAMPLES']):
core_test.source.extend([
'test/examples-as-tests-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'core'
headers.source = [
'model/nstime.h',
'model/event-id.h',
'model/event-impl.h',
'model/simulator.h',
'model/simulator-impl.h',
'model/default-simulator-impl.h',
'model/scheduler.h',
'model/list-scheduler.h',
'model/map-scheduler.h',
'model/heap-scheduler.h',
'model/calendar-scheduler.h',
'model/priority-queue-scheduler.h',
'model/simulation-singleton.h',
'model/singleton.h',
'model/timer.h',
'model/timer-impl.h',
'model/watchdog.h',
'model/synchronizer.h',
'model/make-event.h',
'model/system-wall-clock-ms.h',
'model/system-wall-clock-timestamp.h',
'model/empty.h',
'model/callback.h',
'model/object-base.h',
'model/ref-count-base.h',
'model/simple-ref-count.h',
'model/type-id.h',
'model/attribute-construction-list.h',
'model/ptr.h',
'model/object.h',
'model/log.h',
'model/log-macros-enabled.h',
'model/log-macros-disabled.h',
'model/assert.h',
'model/breakpoint.h',
'model/fatal-error.h',
'model/test.h',
'model/random-variable-stream.h',
'model/rng-seed-manager.h',
'model/rng-stream.h',
'model/command-line.h',
'model/type-name.h',
'model/type-traits.h',
'model/int-to-type.h',
'model/attribute.h',
'model/attribute-accessor-helper.h',
'model/boolean.h',
'model/int64x64.h',
'model/int64x64-double.h',
'model/integer.h',
'model/uinteger.h',
'model/double.h',
'model/enum.h',
'model/string.h',
'model/pointer.h',
'model/object-factory.h',
'model/attribute-helper.h',
'model/attribute-container.h',
'model/attribute-container-accessor-helper.h',
'model/global-value.h',
'model/traced-callback.h',
'model/traced-value.h',
'model/trace-source-accessor.h',
'model/config.h',
'model/object-ptr-container.h',
'model/object-vector.h',
'model/object-map.h',
'model/pair.h',
'model/tuple.h',
'model/deprecated.h',
'model/abort.h',
'model/names.h',
'model/vector.h',
'model/default-deleter.h',
'model/fatal-impl.h',
'model/system-path.h',
'model/unused.h',
'model/math.h',
'helper/event-garbage-collector.h',
'helper/random-variable-stream-helper.h',
'model/hash-function.h',
'model/hash-murmur3.h',
'model/hash-fnv.h',
'model/hash.h',
'model/valgrind.h',
'model/build-profile.h',
'model/des-metrics.h',
'model/ascii-file.h',
'model/ascii-test.h',
'model/node-printer.h',
'model/time-printer.h',
'model/show-progress.h',
'helper/csv-reader.h',
'model/length.h',
'model/trickle-timer.h',
]
if (bld.env['ENABLE_EXAMPLES']):
headers.source.append('model/example-as-test.h')
if sys.platform == 'win32':
core.source.extend([
'model/win32-system-wall-clock-ms.cc',
])
else:
core.source.extend([
'model/unix-system-wall-clock-ms.cc',
])
env = bld.env
if env['INT64X64_USE_DOUBLE']:
headers.source.extend(['model/int64x64-double.h'])
elif env['INT64X64_USE_128']:
headers.source.extend(['model/int64x64-128.h'])
core.source.extend(['model/int64x64-128.cc'])
elif env['INT64X64_USE_CAIRO']:
core.source.extend([
'model/int64x64-cairo.cc',
])
headers.source.extend([
'model/int64x64-cairo.h',
'model/cairo-wideint-private.h',
])
if env['ENABLE_REAL_TIME']:
headers.source.extend([
'model/realtime-simulator-impl.h',
'model/wall-clock-synchronizer.h',
])
core.source.extend([
'model/realtime-simulator-impl.cc',
'model/wall-clock-synchronizer.cc',
])
core.use.append('RT')
core_test.use.append('RT')
if env['ENABLE_THREADING']:
core.source.extend([
'model/system-thread.cc',
'model/unix-fd-reader.cc',
'model/unix-system-mutex.cc',
'model/unix-system-condition.cc',
])
core.use.append('PTHREAD')
core_test.use.append('PTHREAD')
core_test.source.extend(['test/threaded-test-suite.cc'])
headers.source.extend([
'model/unix-fd-reader.h',
'model/system-mutex.h',
'model/system-thread.h',
'model/system-condition.h',
])
if env['ENABLE_GSL']:
core.use.extend(['GSL', 'GSLCBLAS', 'M'])
core_test.use.extend(['GSL', 'GSLCBLAS', 'M'])
core_test.source.extend([
'test/rng-test-suite.cc',
'test/random-variable-stream-test-suite.cc'
])
vers_tg = None
if env['ENABLE_BUILD_VERSION']:
version_template = bld.path.find_node('model/version-defines.h.in')
version_header = bld.bldnode.make_node('ns3/version-defines.h')
vers_tg = bld(features='version-defines',
source=version_template,
target=version_header)
#silence errors about no mapping for version-defines.h.in
vers_tg.mappings['.h'] = lambda *a, **k: None
vers_tg.mappings['.h.in'] = lambda *a, **k: None
core.source.append('model/version.cc')
headers.source.append('model/version.h')
if bld.env['INCLUDES_BOOST']:
core.use.append('BOOST')
if Options.options.check_version:
print_version(bld, vers_tg)
raise SystemExit(0)
return
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
pymod = bld.ns3_python_bindings()
if pymod is not None:
pymod.source += ['bindings/module_helpers.cc']
def print_version(bld, tg):
if tg is None:
print ('Build version support is not enabled, reconfigure with --enable-build-version flag')
return
tg.post()
for task in tg.tasks:
if task.__class__.__name__ == 'git_ns3_version_info':
#manually run task
task.run()
break
handlers = {
'VERSION_TAG': lambda s: s.strip('"'),
'CLOSEST_TAG': lambda s: s.strip('"'),
'VERSION_TAG_DISTANCE': lambda s: '' if s == '0' else "+" + s,
'VERSION_COMMIT_HASH': lambda s: "@" + s.strip('"'),
'VERSION_DIRTY_FLAG': lambda s: '' if s == '0' else '-dirty',
'BUILD_PROFILE': lambda s: "-" + s
}
fields=('VERSION_TAG', 'CLOSEST_TAG', 'VERSION_TAG_DISTANCE',
'VERSION_COMMIT_HASH', 'VERSION_DIRTY_FLAG', 'BUILD_PROFILE')
parts = dict()
for field in fields:
if field in bld.env:
parts[field] = handlers[field](bld.env[field])
else:
parts[field] = ''
if parts['CLOSEST_TAG'] != parts['VERSION_TAG']:
parts['CLOSEST_TAG'] = "+" + parts['CLOSEST_TAG']
else:
parts['CLOSEST_TAG'] = ""
print(''.join([parts[f] for f in fields]))

View File

@ -1,5 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('csma-star', ['csma', 'csma-layout', 'internet', 'applications'])
obj.source = 'csma-star.cc'

View File

@ -1,18 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_module('csma-layout', ['csma', 'network', 'internet'])
obj.source = [
'model/csma-star-helper.cc',
]
headers = bld(features='ns3header')
headers.module = 'csma-layout'
headers.source = [
'model/csma-star-helper.h',
]
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,20 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('csma-one-subnet', ['csma', 'internet', 'applications'])
obj.source = 'csma-one-subnet.cc'
obj = bld.create_ns3_program('csma-broadcast', ['csma', 'internet', 'applications'])
obj.source = 'csma-broadcast.cc'
obj = bld.create_ns3_program('csma-packet-socket', ['csma', 'internet', 'applications'])
obj.source = 'csma-packet-socket.cc'
obj = bld.create_ns3_program('csma-multicast', ['csma', 'internet', 'applications'])
obj.source = 'csma-multicast.cc'
obj = bld.create_ns3_program('csma-raw-ip-socket', ['csma', 'internet', 'applications', 'internet-apps'])
obj.source = 'csma-raw-ip-socket.cc'
obj = bld.create_ns3_program('csma-ping', ['csma', 'internet', 'applications', 'internet-apps'])
obj.source = 'csma-ping.cc'

View File

@ -1,23 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_module('csma', ['network'])
obj.source = [
'model/backoff.cc',
'model/csma-net-device.cc',
'model/csma-channel.cc',
'helper/csma-helper.cc',
]
headers = bld(features='ns3header')
headers.module = 'csma'
headers.source = [
'model/backoff.h',
'model/csma-net-device.h',
'model/csma-channel.h',
'helper/csma-helper.h',
]
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,6 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('dsdv-manet', ['wifi', 'internet', 'dsdv', 'applications'])
obj.source = 'dsdv-manet.cc'

View File

@ -1,37 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('dsdv', ['internet'])
module.includes = '.'
module.source = [
'model/dsdv-rtable.cc',
'model/dsdv-packet-queue.cc',
'model/dsdv-packet.cc',
'model/dsdv-routing-protocol.cc',
'helper/dsdv-helper.cc',
]
module_test = bld.create_ns3_module_test_library('dsdv')
module_test.source = [
'test/dsdv-testcase.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/dsdv-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'dsdv'
headers.source = [
'model/dsdv-rtable.h',
'model/dsdv-packet-queue.h',
'model/dsdv-packet.h',
'model/dsdv-routing-protocol.h',
'helper/dsdv-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,6 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('dsr', ['core', 'network', 'internet', 'applications', 'mobility', 'config-store', 'wifi', 'dsr'])
obj.source = 'dsr.cc'

View File

@ -1,56 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('dsr', ['internet', 'wifi'])
module.includes = '.'
module.source = [
'model/dsr-routing.cc',
'model/dsr-options.cc',
'model/dsr-fs-header.cc',
'model/dsr-option-header.cc',
'model/dsr-maintain-buff.cc',
'model/dsr-passive-buff.cc',
'model/dsr-rsendbuff.cc',
'model/dsr-rcache.cc',
'model/dsr-rreq-table.cc',
'model/dsr-gratuitous-reply-table.cc',
'model/dsr-errorbuff.cc',
'model/dsr-network-queue.cc',
'helper/dsr-helper.cc',
'helper/dsr-main-helper.cc',
]
module_test = bld.create_ns3_module_test_library('dsr')
module_test.source = [
'test/dsr-test-suite.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/dsr-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'dsr'
headers.source = [
'model/dsr-routing.h',
'model/dsr-options.h',
'model/dsr-fs-header.h',
'model/dsr-option-header.h',
'model/dsr-maintain-buff.h',
'model/dsr-passive-buff.h',
'model/dsr-rsendbuff.h',
'model/dsr-rcache.h',
'model/dsr-rreq-table.h',
'model/dsr-gratuitous-reply-table.h',
'model/dsr-errorbuff.h',
'model/dsr-network-queue.h',
'helper/dsr-helper.h',
'helper/dsr-main-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,14 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('li-ion-energy-source', ['core', 'energy'])
obj.source = 'li-ion-energy-source.cc'
obj = bld.create_ns3_program('rv-battery-model-test', ['core', 'energy', 'wifi'])
obj.source = 'rv-battery-model-test.cc'
obj = bld.create_ns3_program('basic-energy-model-test', ['core', 'energy', 'wifi'])
obj.source = 'basic-energy-model-test.cc'

View File

@ -1,62 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_module('energy', ['network'])
obj.source = [
'model/energy-source.cc',
'model/basic-energy-source.cc',
'model/li-ion-energy-source.cc',
'model/rv-battery-model.cc',
'model/device-energy-model.cc',
'model/device-energy-model-container.cc',
'model/simple-device-energy-model.cc',
'model/energy-harvester.cc',
'model/basic-energy-harvester.cc',
'helper/energy-source-container.cc',
'helper/energy-model-helper.cc',
'helper/basic-energy-source-helper.cc',
'helper/li-ion-energy-source-helper.cc',
'helper/rv-battery-model-helper.cc',
'helper/energy-harvester-container.cc',
'helper/energy-harvester-helper.cc',
'helper/basic-energy-harvester-helper.cc',
]
obj_test = bld.create_ns3_module_test_library('energy')
obj_test.source = [
'test/li-ion-energy-source-test.cc',
'test/basic-energy-harvester-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
obj_test.source.extend([
# 'test/energy-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'energy'
headers.source = [
'model/energy-source.h',
'model/basic-energy-source.h',
'model/li-ion-energy-source.h',
'model/rv-battery-model.h',
'model/device-energy-model.h',
'model/device-energy-model-container.h',
'model/simple-device-energy-model.h',
'model/energy-harvester.h',
'model/basic-energy-harvester.h',
'helper/energy-source-container.h',
'helper/energy-model-helper.h',
'helper/basic-energy-source-helper.h',
'helper/li-ion-energy-source-helper.h',
'helper/rv-battery-model-helper.h',
'helper/energy-harvester-container.h',
'helper/energy-harvester-helper.h',
'helper/basic-energy-harvester-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,37 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
env = bld.env
if not env['ENABLE_FDNETDEV']:
return
obj = bld.create_ns3_program('dummy-network', ['fd-net-device', 'internet', 'internet-apps'])
obj.source = 'dummy-network.cc'
obj = bld.create_ns3_program('fd2fd-onoff', ['fd-net-device', 'internet', 'applications'])
obj.source = 'fd2fd-onoff.cc'
if bld.env["ENABLE_REAL_TIME"]:
obj = bld.create_ns3_program('realtime-dummy-network', ['fd-net-device', 'internet', 'internet-apps'])
obj.source = 'realtime-dummy-network.cc'
obj = bld.create_ns3_program('realtime-fd2fd-onoff', ['fd-net-device', 'internet', 'applications'])
obj.source = 'realtime-fd2fd-onoff.cc'
if bld.env['ENABLE_EMU' or 'ENABLE_NETMAP_EMU' or 'ENABLE_DPDKNETDEV']:
obj = bld.create_ns3_program('fd-emu-ping', ['fd-net-device', 'internet', 'internet-apps'])
obj.source = 'fd-emu-ping.cc'
obj = bld.create_ns3_program('fd-emu-onoff', ['fd-net-device', 'internet', 'applications'])
obj.source = 'fd-emu-onoff.cc'
obj = bld.create_ns3_program('fd-emu-tc', ['fd-net-device', 'internet', 'internet-apps', 'applications', 'traffic-control'])
obj.source = 'fd-emu-tc.cc'
obj = bld.create_ns3_program('fd-emu-send', ['fd-net-device', 'internet', 'internet-apps', 'applications', 'traffic-control'])
obj.source = 'fd-emu-send.cc'
if bld.env['ENABLE_EMU']:
obj = bld.create_ns3_program('fd-emu-udp-echo', ['fd-net-device', 'internet', 'applications'])
obj.source = 'fd-emu-udp-echo.cc'
if bld.env['ENABLE_TAP']:
obj = bld.create_ns3_program('fd-tap-ping', ['fd-net-device', 'internet', 'internet-apps'])
obj.source = 'fd-tap-ping.cc'
obj = bld.create_ns3_program('fd-tap-ping6', ['fd-net-device', 'internet', 'internet-apps', 'csma'])
obj.source = 'fd-tap-ping6.cc'

View File

@ -1,254 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os.path
from waflib import Options
def configure(conf):
conf.env['ENABLE_FDNETDEV'] = False
if conf.env['ENABLE_THREADING']:
# Check for system dependencies
have_sysioctl = conf.check_nonfatal(header_name='sys/ioctl.h',
define_name = 'HAVE_SYS_IOCTL_H')
have_netif = conf.check_nonfatal(header_name='net/if.h',
define_name = 'HAVE_IF_NETS_H')
# Enable the FdNetDevice module.
# Besides threading support, we also require ethernet.h
conf.env['ENABLE_FDNETDEV'] = conf.check_nonfatal(header_name='net/ethernet.h',
define_name='HAVE_NET_ETHERNET_H')
if conf.env['ENABLE_FDNETDEV']:
conf.report_optional_feature("FdNetDevice",
"File descriptor NetDevice",
True,
"FdNetDevice module enabled")
# Check if dpdk environment variables are set. Also check if we have correct paths set.
env_rte_sdk = os.environ.get('RTE_SDK', '')
env_rte_target = os.environ.get('RTE_TARGET', '')
have_dpdk_src = env_rte_sdk != '' and env_rte_target != '' and \
os.path.exists(os.path.join(env_rte_sdk, env_rte_target, 'include/rte_eal.h')) and \
os.path.exists(os.path.join(env_rte_sdk, env_rte_target, 'lib/librte_eal.so'))
have_dpdk_pkg = False
if not have_dpdk_src:
# Check if libdpdk is installed as package
have_dpdk_pkg = conf.check_cfg(package='libdpdk', uselib_store='DPDK',
args=['--cflags', '--libs'], mandatory=False)
conf.env['ENABLE_DPDKNETDEV'] = have_dpdk_pkg or have_dpdk_src
if conf.env['ENABLE_DPDKNETDEV']:
# Set DPDK Lib Mode. pkg if the package if installed or src if built from source.
dpdk_lib_mode = 'pkg' if have_dpdk_pkg else 'src'
conf.env.append_value('DPDK_LIB_MODE', [dpdk_lib_mode])
conf.env.append_value('DEFINES', ['HAVE_DPDK_USER_H'])
if have_dpdk_pkg:
conf.report_optional_feature("DpdkNetDevice",
"DPDK NetDevice",
True,
"DPDKNetDevice module enabled (from libdpdk)")
else:
conf.report_optional_feature("DpdkNetDevice",
"DPDK NetDevice",
True,
"DPDKNetDevice module enabled (from source)")
else:
conf.report_optional_feature("DpdkNetDevice",
"DPDK NetDevice",
False,
"libdpdk not found, $RTE_SDK and/or $RTE_TARGET environment variable not set or incorrect")
else:
conf.report_optional_feature("FdNetDevice",
"File descriptor NetDevice",
False,
"<net/ethernet.h> include not detected")
else:
conf.report_optional_feature("FdNetDevice",
"File descriptor NetDevice",
False,
"needs threading support which is not available")
if conf.env['ENABLE_FDNETDEV']:
blddir = os.path.abspath(os.path.join(conf.bldnode.abspath(), conf.variant))
dir = os.path.abspath(os.path.join(blddir, "src/fd-net-device"))
conf.env.append_value('NS3_EXECUTABLE_PATH', dir)
if conf.env['ENABLE_DPDKNETDEV']:
if 'src' in conf.env['DPDK_LIB_MODE']:
dpdk_build = os.path.join(os.environ['RTE_SDK'], os.environ['RTE_TARGET'])
conf.env.append_value('CXXFLAGS', ['-I' + os.path.join(dpdk_build, 'include'), '-mssse3'])
conf.env.append_value('LINKFLAGS', ['-I' + os.path.join(dpdk_build, 'include')])
conf.env.append_value('LINKFLAGS', ['-L' + os.path.join(dpdk_build, 'lib')])
conf.env.SHLIB_MARKER += ',-lrte_eal,-lrte_ethdev,-lrte_pmd_virtio,-lrte_pmd_e1000,-lrte_pmd_ixgbe,-lrte_pmd_i40e,-lnuma,-ldl,-lrte_mempool,-lrte_mbuf,-lrte_ring,-lrte_kvargs,-lrte_net'
else:
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('dpdk-net-device')
else:
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('fd-net-device')
# Next, check for whether specialized FdNetDevice features are enabled
# such as tap device support, raw socket support, and netmap support
if conf.env['ENABLE_FDNETDEV']:
conf.env['ENABLE_TAP'] = conf.check_nonfatal(
header_name='linux/if_tun.h',
define_name='HAVE_IF_TUN_H') and have_sysioctl and have_netif
if conf.env['ENABLE_TAP']:
conf.report_optional_feature("TapFdNetDevice",
"Tap FdNetDevice",
True,
"Tap support enabled")
else:
conf.report_optional_feature("TapFdNetDevice",
"Tap FdNetDevice",
False,
"needs linux/if_tun.h")
# Enable use of raw socket (EMU) helper.
conf.env['ENABLE_EMU'] = conf.check_nonfatal(
header_name='netpacket/packet.h',
define_name='HAVE_PACKET_H') and have_sysioctl and have_netif
if conf.env['ENABLE_EMU']:
conf.report_optional_feature("EmuFdNetDevice",
"Emulation FdNetDevice",
True,
"Emulation support enabled")
else:
conf.report_optional_feature("EmuFdNetDevice",
"Emulation FdNetDevice",
False,
"needs netpacket/packet.h")
# Enable use of netmap EMU support
conf.env['ENABLE_NETMAP_EMU'] = conf.check_nonfatal(
header_name='net/netmap_user.h',
define_name='HAVE_NETMAP_USER_H') and have_sysioctl and have_netif
if conf.env['ENABLE_NETMAP_EMU']:
conf.report_optional_feature("NetmapFdNetDevice",
"Netmap emulation FdNetDevice",
True,
"Netmap emulation support enabled")
else:
conf.report_optional_feature("NetmapFdNetDevice",
"Netmap emulation FdNetDevice",
False,
"needs net/netmap_user.h")
def build(bld):
# Don't do anything for this module if emu's not enabled.
if not bld.env['ENABLE_FDNETDEV']:
return
module = bld.create_ns3_module('fd-net-device', ['network'])
module.source = [
'model/fd-net-device.cc',
'helper/fd-net-device-helper.cc',
'helper/encode-decode.cc',
'helper/creator-utils.cc',
]
headers = bld(features='ns3header')
headers.module = 'fd-net-device'
headers.source = [
'model/fd-net-device.h',
'helper/fd-net-device-helper.h',
]
if bld.env['ENABLE_TAP']:
if not bld.env['PLATFORM'].startswith('freebsd'):
module.source.extend([
'helper/tap-fd-net-device-helper.cc',
])
headers.source.extend([
'helper/tap-fd-net-device-helper.h',
])
creator = bld.create_suid_program('tap-device-creator')
creator.source = [
'helper/tap-device-creator.cc',
'helper/encode-decode.cc',
'helper/creator-utils.cc',
]
module.env.append_value("DEFINES",
"TAP_DEV_CREATOR=\"%s\"" % (creator.target,))
if bld.env['ENABLE_DPDKNETDEV']:
module.use.append('DPDK')
module.source.extend([
'helper/dpdk-net-device-helper.cc',
'model/dpdk-net-device.cc'
])
headers.source.extend([
'helper/dpdk-net-device-helper.h',
'model/dpdk-net-device.h'
])
if 'src' in bld.env['DPDK_LIB_MODE']:
# Add DPDK libraries to library path
dpdk_build = os.path.join(os.environ['RTE_SDK'], os.environ['RTE_TARGET'])
if os.environ.get('LD_LIBRARY_PATH', '') == '':
os.environ['LD_LIBRARY_PATH'] = os.path.join(dpdk_build, 'lib')
else:
os.environ['LD_LIBRARY_PATH'] += ':' + os.path.join(dpdk_build, 'lib')
# Add $RTE_SDK/usertools to PATH env
if os.environ.get('PATH', '') == '':
os.environ['PATH'] = os.path.join(os.environ['RTE_SDK'], 'usertools')
else:
os.environ['PATH'] += ':' + os.path.join(os.environ['RTE_SDK'], 'usertools')
if bld.env['ENABLE_EMU']:
module.source.extend([
'helper/emu-fd-net-device-helper.cc',
])
headers.source.extend([
'helper/emu-fd-net-device-helper.h',
])
creator = bld.create_suid_program('raw-sock-creator')
creator.source = [
'helper/raw-sock-creator.cc',
'helper/encode-decode.cc',
'helper/creator-utils.cc',
]
module.env.append_value("DEFINES",
"RAW_SOCK_CREATOR=\"%s\"" % (creator.target,))
if bld.env['ENABLE_NETMAP_EMU']:
module.source.extend([
'model/netmap-net-device.cc',
'helper/netmap-net-device-helper.cc',
])
headers.source.extend([
'model/netmap-net-device.h',
'helper/netmap-net-device-helper.h',
])
creator = bld.create_suid_program('netmap-device-creator')
creator.source = [
'helper/netmap-device-creator.cc',
'helper/encode-decode.cc',
'helper/creator-utils.cc',
]
module.env.append_value("DEFINES",
"NETMAP_DEV_CREATOR=\"%s\"" % (creator.target,))
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,4 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
bld.register_ns3_script('wifi-olsr-flowmon.py', ['flow-monitor', 'internet', 'wifi', 'olsr', 'applications', 'mobility'])

View File

@ -1,41 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_module('flow-monitor', ['internet', 'config-store', 'stats'])
obj.source = ["model/%s" % s for s in [
'flow-monitor.cc',
'flow-classifier.cc',
'flow-probe.cc',
'ipv4-flow-classifier.cc',
'ipv4-flow-probe.cc',
'ipv6-flow-classifier.cc',
'ipv6-flow-probe.cc',
]]
obj.source.append("helper/flow-monitor-helper.cc")
module_test = bld.create_ns3_module_test_library('flow-monitor')
module_test.source = [ ]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/flow-monitor-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'flow-monitor'
headers.source = ["model/%s" % s for s in [
'flow-monitor.h',
'flow-probe.h',
'flow-classifier.h',
'ipv4-flow-classifier.h',
'ipv4-flow-probe.h',
'ipv6-flow-classifier.h',
'ipv6-flow-probe.h',
]]
headers.source.append("helper/flow-monitor-helper.h")
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,11 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('dhcp-example', ['internet', 'internet-apps', 'csma', 'point-to-point', 'applications'])
obj.source = 'dhcp-example.cc'
obj = bld.create_ns3_program('traceroute-example', ['aodv', 'core', 'network', 'internet', 'point-to-point', 'wifi','internet-apps'])
obj.source = 'traceroute-example.cc'

View File

@ -1,62 +0,0 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# def options(opt):
# pass
# def configure(conf):
# conf.check_nonfatal(header_name='stdint.h', define_name='HAVE_STDINT_H')
def build(bld):
module = bld.create_ns3_module('internet-apps', ['internet'])
module.source = [
'model/ping6.cc',
'model/radvd-interface.cc',
'model/radvd-prefix.cc',
'model/radvd.cc',
'model/v4ping.cc',
'model/v4traceroute.cc',
'model/dhcp-header.cc',
'model/dhcp-server.cc',
'model/dhcp-client.cc',
'helper/ping6-helper.cc',
'helper/radvd-helper.cc',
'helper/v4ping-helper.cc',
'helper/v4traceroute-helper.cc',
'helper/dhcp-helper.cc',
]
applications_test = bld.create_ns3_module_test_library('internet-apps')
applications_test.source = [
'test/dhcp-test.cc',
'test/ipv6-radvd-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
applications_test.source.extend([
# 'test/internet-apps-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'internet-apps'
headers.source = [
'model/ping6.h',
'model/radvd.h',
'model/radvd-interface.h',
'model/radvd-prefix.h',
'model/v4ping.h',
'model/v4traceroute.h',
'model/dhcp-header.h',
'model/dhcp-server.h',
'model/dhcp-client.h',
'helper/ping6-helper.h',
'helper/v4ping-helper.h',
'helper/v4traceroute-helper.h',
'helper/radvd-helper.h',
'helper/dhcp-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,9 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('main-simple',
['network', 'internet', 'applications'])
obj.source = 'main-simple.cc'

View File

@ -1,354 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os
import sys
from waflib import Options, Logs, Utils, Task
def build(bld):
# bridge dependency is due to global routing
obj = bld.create_ns3_module('internet', ['bridge', 'traffic-control', 'network', 'core'])
obj.source = [
'model/ip-l4-protocol.cc',
'model/udp-header.cc',
'model/tcp-header.cc',
'model/ipv4-interface.cc',
'model/ipv4-l3-protocol.cc',
'model/ipv4-end-point.cc',
'model/udp-l4-protocol.cc',
'model/tcp-l4-protocol.cc',
'model/arp-header.cc',
'model/arp-cache.cc',
'model/arp-l3-protocol.cc',
'model/arp-queue-disc-item.cc',
'model/udp-socket-impl.cc',
'model/ipv4-end-point-demux.cc',
'model/udp-socket-factory-impl.cc',
'model/tcp-socket-factory-impl.cc',
'model/pending-data.cc',
'model/rtt-estimator.cc',
'model/ipv4-raw-socket-factory-impl.cc',
'model/ipv4-raw-socket-impl.cc',
'model/icmpv4.cc',
'model/icmpv4-l4-protocol.cc',
'model/loopback-net-device.cc',
'model/ndisc-cache.cc',
'model/ipv6-interface.cc',
'model/icmpv6-header.cc',
'model/ipv6-l3-protocol.cc',
'model/ipv6-end-point.cc',
'model/ipv6-end-point-demux.cc',
'model/ipv6-raw-socket-factory-impl.cc',
'model/ipv6-raw-socket-impl.cc',
'model/ipv6-autoconfigured-prefix.cc',
'model/ipv6-extension.cc',
'model/ipv6-extension-header.cc',
'model/ipv6-extension-demux.cc',
'model/ipv6-option.cc',
'model/ipv6-option-header.cc',
'model/ipv6-option-demux.cc',
'model/icmpv6-l4-protocol.cc',
'model/tcp-socket-base.cc',
'model/tcp-socket-state.cc',
'model/tcp-highspeed.cc',
'model/tcp-hybla.cc',
'model/tcp-vegas.cc',
'model/tcp-congestion-ops.cc',
'model/tcp-linux-reno.cc',
'model/tcp-westwood.cc',
'model/tcp-scalable.cc',
'model/tcp-veno.cc',
'model/tcp-bic.cc',
'model/tcp-cubic.cc',
'model/tcp-yeah.cc',
'model/tcp-ledbat.cc',
'model/tcp-illinois.cc',
'model/tcp-htcp.cc',
'model/tcp-lp.cc',
'model/tcp-dctcp.cc',
'model/tcp-bbr.cc',
'model/tcp-rx-buffer.cc',
'model/tcp-tx-buffer.cc',
'model/tcp-tx-item.cc',
'model/tcp-rate-ops.cc',
'model/tcp-option.cc',
'model/tcp-option-rfc793.cc',
'model/tcp-option-winscale.cc',
'model/tcp-option-ts.cc',
'model/tcp-option-sack-permitted.cc',
'model/tcp-option-sack.cc',
'model/ipv4-packet-info-tag.cc',
'model/ipv6-packet-info-tag.cc',
'model/ipv4-interface-address.cc',
'model/ipv4-address-generator.cc',
'model/ipv4-header.cc',
'model/ipv4-queue-disc-item.cc',
'model/ipv4-packet-filter.cc',
'model/ipv4-route.cc',
'model/ipv4-routing-protocol.cc',
'model/udp-socket.cc',
'model/udp-socket-factory.cc',
'model/tcp-socket.cc',
'model/tcp-socket-factory.cc',
'model/tcp-recovery-ops.cc',
'model/tcp-prr-recovery.cc',
'model/ipv4.cc',
'model/ipv4-raw-socket-factory.cc',
'model/ipv6-header.cc',
'model/ipv6-queue-disc-item.cc',
'model/ipv6-packet-filter.cc',
'model/ipv6-interface-address.cc',
'model/ipv6-route.cc',
'model/ipv6.cc',
'model/ipv6-raw-socket-factory.cc',
'model/ipv6-routing-protocol.cc',
'model/ipv4-list-routing.cc',
'model/ipv6-list-routing.cc',
'helper/ipv4-list-routing-helper.cc',
'helper/ipv6-list-routing-helper.cc',
'model/ipv4-static-routing.cc',
'model/ipv4-routing-table-entry.cc',
'model/ipv6-static-routing.cc',
'model/ipv6-routing-table-entry.cc',
'helper/ipv4-static-routing-helper.cc',
'helper/ipv6-static-routing-helper.cc',
'model/global-router-interface.cc',
'model/global-route-manager.cc',
'model/global-route-manager-impl.cc',
'model/candidate-queue.cc',
'model/ipv4-global-routing.cc',
'helper/ipv4-global-routing-helper.cc',
'helper/internet-stack-helper.cc',
'helper/internet-trace-helper.cc',
'helper/ipv4-address-helper.cc',
'helper/ipv4-interface-container.cc',
'helper/ipv4-routing-helper.cc',
'helper/ipv6-address-helper.cc',
'helper/ipv6-interface-container.cc',
'helper/ipv6-routing-helper.cc',
'model/ipv6-address-generator.cc',
'model/ipv4-packet-probe.cc',
'model/ipv6-packet-probe.cc',
'model/ipv6-pmtu-cache.cc',
'model/ripng.cc',
'model/ripng-header.cc',
'helper/ripng-helper.cc',
'model/rip.cc',
'model/rip-header.cc',
'helper/rip-helper.cc',
]
internet_test = bld.create_ns3_module_test_library('internet')
internet_test.source = [
'test/global-route-manager-impl-test-suite.cc',
'test/ipv4-address-generator-test-suite.cc',
'test/ipv4-address-helper-test-suite.cc',
'test/ipv4-list-routing-test-suite.cc',
'test/ipv4-packet-info-tag-test-suite.cc',
'test/ipv4-raw-test.cc',
'test/ipv4-header-test.cc',
'test/ipv4-fragmentation-test.cc',
'test/ipv4-forwarding-test.cc',
'test/ipv4-test.cc',
'test/ipv4-static-routing-test-suite.cc',
'test/ipv4-global-routing-test-suite.cc',
'test/ipv6-extension-header-test-suite.cc',
'test/ipv6-list-routing-test-suite.cc',
'test/ipv6-packet-info-tag-test-suite.cc',
'test/ipv6-test.cc',
'test/ipv6-raw-test.cc',
'test/ipv6-address-duplication-test.cc',
'test/tcp-test.cc',
'test/tcp-timestamp-test.cc',
'test/tcp-sack-permitted-test.cc',
'test/tcp-wscaling-test.cc',
'test/tcp-option-test.cc',
'test/tcp-header-test.cc',
'test/tcp-ecn-test.cc',
'test/tcp-general-test.cc',
'test/tcp-error-model.cc',
'test/tcp-slow-start-test.cc',
'test/tcp-cong-avoid-test.cc',
'test/tcp-fast-retr-test.cc',
'test/tcp-rto-test.cc',
'test/tcp-highspeed-test.cc',
'test/tcp-hybla-test.cc',
'test/tcp-vegas-test.cc',
'test/tcp-scalable-test.cc',
'test/tcp-veno-test.cc',
'test/tcp-bic-test.cc',
'test/tcp-yeah-test.cc',
'test/tcp-illinois-test.cc',
'test/tcp-htcp-test.cc',
'test/tcp-lp-test.cc',
'test/tcp-ledbat-test.cc',
'test/tcp-zero-window-test.cc',
'test/tcp-pkts-acked-test.cc',
'test/tcp-rtt-estimation.cc',
'test/tcp-bytes-in-flight-test.cc',
'test/tcp-advertised-window-test.cc',
'test/tcp-classic-recovery-test.cc',
'test/tcp-prr-recovery-test.cc',
'test/tcp-loss-test.cc',
'test/tcp-linux-reno-test.cc',
'test/udp-test.cc',
'test/ipv6-address-generator-test-suite.cc',
'test/ipv6-dual-stack-test-suite.cc',
'test/ipv6-fragmentation-test.cc',
'test/ipv6-forwarding-test.cc',
'test/ipv6-ripng-test.cc',
'test/ipv6-address-helper-test-suite.cc',
'test/rtt-test.cc',
'test/tcp-tx-buffer-test.cc',
'test/tcp-rx-buffer-test.cc',
'test/tcp-endpoint-bug2211.cc',
'test/tcp-datasentcb-test.cc',
'test/tcp-rate-ops-test.cc',
'test/ipv4-rip-test.cc',
'test/tcp-close-test.cc',
'test/icmp-test.cc',
'test/ipv4-deduplication-test.cc',
'test/tcp-dctcp-test.cc',
'test/tcp-syn-connection-failed-test.cc',
'test/tcp-pacing-test.cc',
'test/tcp-bbr-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
internet_test.source.extend([
# 'test/internet-examples-test-suite.cc',
])
privateheaders = bld(features='ns3privateheader')
privateheaders.module = 'internet'
privateheaders.source = [
]
headers = bld(features='ns3header')
headers.module = 'internet'
headers.source = [
'model/udp-header.h',
'model/tcp-header.h',
'model/tcp-option.h',
'model/tcp-option-winscale.h',
'model/tcp-option-ts.h',
'model/tcp-option-sack-permitted.h',
'model/tcp-option-sack.h',
'model/tcp-option-rfc793.h',
'model/icmpv4.h',
'model/icmpv6-header.h',
# used by routing
'model/ipv4-interface.h',
'model/ipv4-l3-protocol.h',
'model/ipv4-end-point.h',
'model/ipv4-end-point-demux.h',
'model/ipv6-l3-protocol.h',
'model/ipv6-extension.h',
'model/ipv6-extension-demux.h',
'model/ipv6-extension-header.h',
'model/ipv6-option.h',
'model/ipv6-option-header.h',
'model/ipv6-end-point.h',
'model/ipv6-end-point-demux.h',
'model/arp-l3-protocol.h',
'model/udp-l4-protocol.h',
'model/tcp-l4-protocol.h',
'model/icmpv4-l4-protocol.h',
'model/ip-l4-protocol.h',
'model/arp-header.h',
'model/arp-cache.h',
'model/arp-queue-disc-item.h',
'model/icmpv6-l4-protocol.h',
'model/ipv6-interface.h',
'model/ndisc-cache.h',
'model/loopback-net-device.h',
'model/ipv4-packet-info-tag.h',
'model/ipv6-packet-info-tag.h',
'model/ipv4-interface-address.h',
'model/ipv4-address-generator.h',
'model/ipv4-header.h',
'model/ipv4-queue-disc-item.h',
'model/ipv4-packet-filter.h',
'model/ipv4-route.h',
'model/ipv4-routing-protocol.h',
'model/udp-socket.h',
'model/udp-socket-factory.h',
'model/tcp-socket.h',
'model/tcp-socket-factory.h',
'model/ipv4.h',
'model/ipv4-raw-socket-factory.h',
'model/ipv4-raw-socket-impl.h',
'model/ipv6-header.h',
'model/ipv6-queue-disc-item.h',
'model/ipv6-packet-filter.h',
'model/ipv6-interface-address.h',
'model/ipv6-route.h',
'model/ipv6.h',
'model/ipv6-raw-socket-factory.h',
'model/ipv6-routing-protocol.h',
'model/ipv4-list-routing.h',
'model/ipv6-list-routing.h',
'helper/ipv4-list-routing-helper.h',
'helper/ipv6-list-routing-helper.h',
'model/ipv4-static-routing.h',
'model/ipv4-routing-table-entry.h',
'model/ipv6-static-routing.h',
'model/ipv6-routing-table-entry.h',
'helper/ipv4-static-routing-helper.h',
'helper/ipv6-static-routing-helper.h',
'model/global-router-interface.h',
'model/global-route-manager.h',
'model/global-route-manager-impl.h',
'model/candidate-queue.h',
'model/ipv4-global-routing.h',
'helper/ipv4-global-routing-helper.h',
'helper/internet-stack-helper.h',
'helper/internet-trace-helper.h',
'helper/ipv4-address-helper.h',
'helper/ipv4-interface-container.h',
'helper/ipv4-routing-helper.h',
'helper/ipv6-address-helper.h',
'helper/ipv6-interface-container.h',
'helper/ipv6-routing-helper.h',
'model/ipv6-address-generator.h',
'model/tcp-highspeed.h',
'model/tcp-hybla.h',
'model/tcp-vegas.h',
'model/tcp-congestion-ops.h',
'model/tcp-linux-reno.h',
'model/tcp-westwood.h',
'model/tcp-scalable.h',
'model/tcp-veno.h',
'model/tcp-bic.h',
'model/tcp-cubic.h',
'model/tcp-yeah.h',
'model/tcp-illinois.h',
'model/tcp-htcp.h',
'model/tcp-lp.h',
'model/tcp-dctcp.h',
'model/windowed-filter.h',
'model/tcp-bbr.h',
'model/tcp-ledbat.h',
'model/tcp-socket-base.h',
'model/tcp-socket-state.h',
'model/tcp-tx-buffer.h',
'model/tcp-tx-item.h',
'model/tcp-rate-ops.h',
'model/tcp-rx-buffer.h',
'model/tcp-recovery-ops.h',
'model/tcp-prr-recovery.h',
'model/rtt-estimator.h',
'model/ipv4-packet-probe.h',
'model/ipv6-packet-probe.h',
'model/ipv6-pmtu-cache.h',
'model/ripng.h',
'model/ripng-header.h',
'helper/ripng-helper.h',
'model/rip.h',
'model/rip-header.h',
'helper/rip-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,20 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('lr-wpan-packet-print', ['lr-wpan'])
obj.source = 'lr-wpan-packet-print.cc'
obj = bld.create_ns3_program('lr-wpan-phy-test', ['lr-wpan'])
obj.source = 'lr-wpan-phy-test.cc'
obj = bld.create_ns3_program('lr-wpan-data', ['lr-wpan'])
obj.source = 'lr-wpan-data.cc'
obj = bld.create_ns3_program('lr-wpan-error-model-plot', ['lr-wpan', 'stats'])
obj.source = 'lr-wpan-error-model-plot.cc'
obj = bld.create_ns3_program('lr-wpan-error-distance-plot', ['lr-wpan', 'stats'])
obj.source = 'lr-wpan-error-distance-plot.cc'
obj = bld.create_ns3_program('lr-wpan-mlme', ['lr-wpan'])
obj.source = 'lr-wpan-mlme.cc'

View File

@ -1,64 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_module('lr-wpan', ['core', 'network', 'mobility', 'spectrum', 'propagation'])
obj.source = [
'model/lr-wpan-error-model.cc',
'model/lr-wpan-interference-helper.cc',
'model/lr-wpan-phy.cc',
'model/lr-wpan-mac.cc',
'model/lr-wpan-mac-header.cc',
'model/lr-wpan-mac-pl-headers.cc',
'model/lr-wpan-fields.cc',
'model/lr-wpan-mac-trailer.cc',
'model/lr-wpan-csmaca.cc',
'model/lr-wpan-net-device.cc',
'model/lr-wpan-spectrum-value-helper.cc',
'model/lr-wpan-spectrum-signal-parameters.cc',
'model/lr-wpan-lqi-tag.cc',
'helper/lr-wpan-helper.cc',
]
module_test = bld.create_ns3_module_test_library('lr-wpan')
module_test.source = [
'test/lr-wpan-ack-test.cc',
'test/lr-wpan-cca-test.cc',
'test/lr-wpan-collision-test.cc',
'test/lr-wpan-ed-test.cc',
'test/lr-wpan-error-model-test.cc',
'test/lr-wpan-packet-test.cc',
'test/lr-wpan-pd-plme-sap-test.cc',
'test/lr-wpan-spectrum-value-helper-test.cc',
'test/lr-wpan-ifs-test.cc',
'test/lr-wpan-slotted-csmaca-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/lr-wpan-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'lr-wpan'
headers.source = [
'model/lr-wpan-error-model.h',
'model/lr-wpan-interference-helper.h',
'model/lr-wpan-phy.h',
'model/lr-wpan-mac.h',
'model/lr-wpan-mac-header.h',
'model/lr-wpan-mac-pl-headers.h',
'model/lr-wpan-fields.h',
'model/lr-wpan-mac-trailer.h',
'model/lr-wpan-csmaca.h',
'model/lr-wpan-net-device.h',
'model/lr-wpan-spectrum-value-helper.h',
'model/lr-wpan-spectrum-signal-parameters.h',
'model/lr-wpan-lqi-tag.h',
'helper/lr-wpan-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,75 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('lena-cqi-threshold',
['lte'])
obj.source = 'lena-cqi-threshold.cc'
obj = bld.create_ns3_program('lena-dual-stripe',
['lte'])
obj.source = 'lena-dual-stripe.cc'
obj = bld.create_ns3_program('lena-fading',
['lte'])
obj.source = 'lena-fading.cc'
obj = bld.create_ns3_program('lena-intercell-interference',
['lte'])
obj.source = 'lena-intercell-interference.cc'
obj = bld.create_ns3_program('lena-ipv6-addr-conf',
['lte'])
obj.source = 'lena-ipv6-addr-conf.cc'
obj = bld.create_ns3_program('lena-ipv6-ue-rh',
['lte'])
obj.source = 'lena-ipv6-ue-rh.cc'
obj = bld.create_ns3_program('lena-ipv6-ue-ue',
['lte'])
obj.source = 'lena-ipv6-ue-ue.cc'
obj = bld.create_ns3_program('lena-pathloss-traces',
['lte'])
obj.source = 'lena-pathloss-traces.cc'
obj = bld.create_ns3_program('lena-profiling',
['lte'])
obj.source = 'lena-profiling.cc'
obj = bld.create_ns3_program('lena-rem',
['lte'])
obj.source = 'lena-rem.cc'
obj = bld.create_ns3_program('lena-rem-sector-antenna',
['lte'])
obj.source = 'lena-rem-sector-antenna.cc'
obj = bld.create_ns3_program('lena-rlc-traces',
['lte'])
obj.source = 'lena-rlc-traces.cc'
obj = bld.create_ns3_program('lena-simple',
['lte'])
obj.source = 'lena-simple.cc'
obj = bld.create_ns3_program('lena-simple-epc',
['lte'])
obj.source = 'lena-simple-epc.cc'
obj = bld.create_ns3_program('lena-simple-epc-backhaul',
['lte'])
obj.source = 'lena-simple-epc-backhaul.cc'
obj = bld.create_ns3_program('lena-deactivate-bearer',
['lte'])
obj.source = 'lena-deactivate-bearer.cc'
obj = bld.create_ns3_program('lena-x2-handover',
['lte'])
obj.source = 'lena-x2-handover.cc'
obj = bld.create_ns3_program('lena-x2-handover-measures',
['lte'])
obj.source = 'lena-x2-handover-measures.cc'
obj = bld.create_ns3_program('lena-frequency-reuse',
['lte'])
obj.source = 'lena-frequency-reuse.cc'
obj = bld.create_ns3_program('lena-distributed-ffr',
['lte'])
obj.source = 'lena-distributed-ffr.cc'
obj = bld.create_ns3_program('lena-uplink-power-control',
['lte'])
obj.source = 'lena-uplink-power-control.cc'
obj = bld.create_ns3_program('lena-radio-link-failure',
['lte'])
obj.source = 'lena-radio-link-failure.cc'
if bld.env['ENABLE_EMU']:
obj = bld.create_ns3_program('lena-simple-epc-emu',
['lte', 'fd-net-device'])
obj.source = 'lena-simple-epc-emu.cc'

View File

@ -1,345 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
lte_module_dependencies = ['core', 'network', 'spectrum', 'stats', 'buildings', 'virtual-net-device','point-to-point','applications','internet','csma']
if (bld.env['ENABLE_EMU']):
lte_module_dependencies.append('fd-net-device')
module = bld.create_ns3_module('lte', lte_module_dependencies)
module.source = [
'model/lte-common.cc',
'model/lte-spectrum-phy.cc',
'model/lte-spectrum-signal-parameters.cc',
'model/lte-phy.cc',
'model/lte-enb-phy.cc',
'model/lte-ue-phy.cc',
'model/lte-spectrum-value-helper.cc',
'model/lte-amc.cc',
'model/lte-enb-rrc.cc',
'model/lte-ue-rrc.cc',
'model/lte-rrc-sap.cc',
'model/lte-rrc-protocol-ideal.cc',
'model/lte-rrc-protocol-real.cc',
'model/lte-rlc-sap.cc',
'model/lte-rlc.cc',
'model/lte-rlc-sequence-number.cc',
'model/lte-rlc-header.cc',
'model/lte-rlc-am-header.cc',
'model/lte-rlc-tm.cc',
'model/lte-rlc-um.cc',
'model/lte-rlc-am.cc',
'model/lte-rlc-tag.cc',
'model/lte-rlc-sdu-status-tag.cc',
'model/lte-pdcp-sap.cc',
'model/lte-pdcp.cc',
'model/lte-pdcp-header.cc',
'model/lte-pdcp-tag.cc',
'model/eps-bearer.cc',
'model/lte-radio-bearer-info.cc',
'model/lte-net-device.cc',
'model/lte-enb-net-device.cc',
'model/lte-ue-net-device.cc',
'model/lte-control-messages.cc',
'helper/lte-helper.cc',
'helper/lte-stats-calculator.cc',
'helper/epc-helper.cc',
'helper/no-backhaul-epc-helper.cc',
'helper/point-to-point-epc-helper.cc',
'helper/radio-bearer-stats-calculator.cc',
'helper/radio-bearer-stats-connector.cc',
'helper/phy-stats-calculator.cc',
'helper/mac-stats-calculator.cc',
'helper/phy-tx-stats-calculator.cc',
'helper/phy-rx-stats-calculator.cc',
'helper/radio-environment-map-helper.cc',
'helper/lte-hex-grid-enb-topology-helper.cc',
'helper/lte-global-pathloss-database.cc',
'model/rem-spectrum-phy.cc',
'model/ff-mac-common.cc',
'model/ff-mac-csched-sap.cc',
'model/ff-mac-sched-sap.cc',
'model/lte-mac-sap.cc',
'model/ff-mac-scheduler.cc',
'model/lte-enb-cmac-sap.cc',
'model/lte-ue-cmac-sap.cc',
'model/rr-ff-mac-scheduler.cc',
'model/lte-enb-mac.cc',
'model/lte-ue-mac.cc',
'model/lte-radio-bearer-tag.cc',
'model/eps-bearer-tag.cc',
'model/lte-phy-tag.cc',
'model/lte-enb-phy-sap.cc',
'model/lte-enb-cphy-sap.cc',
'model/lte-ue-phy-sap.cc',
'model/lte-ue-cphy-sap.cc',
'model/lte-interference.cc',
'model/lte-chunk-processor.cc',
'model/pf-ff-mac-scheduler.cc',
'model/fdmt-ff-mac-scheduler.cc',
'model/tdmt-ff-mac-scheduler.cc',
'model/tta-ff-mac-scheduler.cc',
'model/fdbet-ff-mac-scheduler.cc',
'model/tdbet-ff-mac-scheduler.cc',
'model/fdtbfq-ff-mac-scheduler.cc',
'model/tdtbfq-ff-mac-scheduler.cc',
'model/pss-ff-mac-scheduler.cc',
'model/cqa-ff-mac-scheduler.cc',
'model/epc-gtpu-header.cc',
'model/epc-gtpc-header.cc',
'model/epc-enb-application.cc',
'model/epc-sgw-application.cc',
'model/epc-pgw-application.cc',
'model/epc-mme-application.cc',
'model/epc-x2-sap.cc',
'model/epc-x2-header.cc',
'model/epc-x2.cc',
'model/epc-tft.cc',
'model/epc-tft-classifier.cc',
'model/lte-mi-error-model.cc',
'model/lte-vendor-specific-parameters.cc',
'model/epc-enb-s1-sap.cc',
'model/epc-s1ap-sap.cc',
'model/epc-s11-sap.cc',
'model/lte-as-sap.cc',
'model/epc-ue-nas.cc',
'model/lte-harq-phy.cc',
'model/lte-asn1-header.cc',
'model/lte-rrc-header.cc',
'model/lte-handover-management-sap.cc',
'model/lte-handover-algorithm.cc',
'model/a2-a4-rsrq-handover-algorithm.cc',
'model/a3-rsrp-handover-algorithm.cc',
'model/no-op-handover-algorithm.cc',
'model/lte-anr-sap.cc',
'model/lte-anr.cc',
'model/lte-ffr-algorithm.cc',
'model/lte-ffr-sap.cc',
'model/lte-ffr-rrc-sap.cc',
'model/lte-fr-no-op-algorithm.cc',
'model/lte-fr-hard-algorithm.cc',
'model/lte-fr-strict-algorithm.cc',
'model/lte-fr-soft-algorithm.cc',
'model/lte-ffr-soft-algorithm.cc',
'model/lte-ffr-enhanced-algorithm.cc',
'model/lte-ffr-distributed-algorithm.cc',
'model/lte-ue-power-control.cc',
'model/lte-ccm-rrc-sap.cc',
'model/lte-ue-ccm-rrc-sap.cc',
'model/lte-ccm-mac-sap.cc',
'model/lte-enb-component-carrier-manager.cc',
'model/lte-ue-component-carrier-manager.cc',
'model/no-op-component-carrier-manager.cc',
'model/simple-ue-component-carrier-manager.cc',
'model/component-carrier.cc',
'helper/cc-helper.cc',
'model/component-carrier-ue.cc',
'model/component-carrier-enb.cc'
]
module_test = bld.create_ns3_module_test_library('lte')
module_test.source = [
'test/lte-test-downlink-sinr.cc',
'test/lte-test-uplink-sinr.cc',
'test/lte-test-link-adaptation.cc',
'test/lte-test-interference.cc',
'test/lte-test-ue-phy.cc',
'test/lte-test-rr-ff-mac-scheduler.cc',
'test/lte-test-pf-ff-mac-scheduler.cc',
'test/lte-test-fdmt-ff-mac-scheduler.cc',
'test/lte-test-tdmt-ff-mac-scheduler.cc',
'test/lte-test-tta-ff-mac-scheduler.cc',
'test/lte-test-fdbet-ff-mac-scheduler.cc',
'test/lte-test-tdbet-ff-mac-scheduler.cc',
'test/lte-test-fdtbfq-ff-mac-scheduler.cc',
'test/lte-test-tdtbfq-ff-mac-scheduler.cc',
'test/lte-test-pss-ff-mac-scheduler.cc',
'test/lte-test-cqa-ff-mac-scheduler.cc',
'test/lte-test-earfcn.cc',
'test/lte-test-spectrum-value-helper.cc',
'test/lte-test-pathloss-model.cc',
'test/lte-test-entities.cc',
'test/lte-simple-helper.cc',
'test/lte-simple-net-device.cc',
'test/test-lte-rlc-header.cc',
'test/lte-test-rlc-um-transmitter.cc',
'test/lte-test-rlc-am-transmitter.cc',
'test/lte-test-rlc-um-e2e.cc',
'test/lte-test-rlc-am-e2e.cc',
'test/epc-test-gtpu.cc',
'test/test-epc-tft-classifier.cc',
'test/epc-test-s1u-downlink.cc',
'test/epc-test-s1u-uplink.cc',
'test/test-lte-epc-e2e-data.cc',
'test/test-lte-antenna.cc',
'test/lte-test-phy-error-model.cc',
'test/lte-test-mimo.cc',
'test/lte-test-harq.cc',
'test/test-lte-rrc.cc',
'test/test-lte-x2-handover.cc',
'test/test-lte-x2-handover-measures.cc',
'test/test-asn1-encoding.cc',
'test/lte-test-ue-measurements.cc',
'test/lte-test-cell-selection.cc',
'test/test-lte-handover-delay.cc',
'test/test-lte-handover-target.cc',
'test/lte-test-deactivate-bearer.cc',
'test/lte-ffr-simple.cc',
'test/lte-test-downlink-power-control.cc',
'test/lte-test-uplink-power-control.cc',
'test/lte-test-frequency-reuse.cc',
'test/lte-test-interference-fr.cc',
'test/lte-test-cqi-generation.cc',
'test/lte-simple-spectrum-phy.cc',
'test/lte-test-carrier-aggregation.cc',
'test/lte-test-aggregation-throughput-scale.cc',
'test/lte-test-ipv6-routing.cc',
'test/lte-test-carrier-aggregation-configuration.cc',
'test/lte-test-radio-link-failure.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/lte-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'lte'
headers.source = [
'model/lte-common.h',
'model/lte-spectrum-phy.h',
'model/lte-spectrum-signal-parameters.h',
'model/lte-phy.h',
'model/lte-enb-phy.h',
'model/lte-ue-phy.h',
'model/lte-spectrum-value-helper.h',
'model/lte-amc.h',
'model/lte-enb-rrc.h',
'model/lte-ue-rrc.h',
'model/lte-rrc-sap.h',
'model/lte-rrc-protocol-ideal.h',
'model/lte-rrc-protocol-real.h',
'model/lte-rlc-sap.h',
'model/lte-rlc.h',
'model/lte-rlc-header.h',
'model/lte-rlc-sequence-number.h',
'model/lte-rlc-am-header.h',
'model/lte-rlc-tm.h',
'model/lte-rlc-um.h',
'model/lte-rlc-am.h',
'model/lte-rlc-tag.h',
'model/lte-rlc-sdu-status-tag.h',
'model/lte-pdcp-sap.h',
'model/lte-pdcp.h',
'model/lte-pdcp-header.h',
'model/lte-pdcp-tag.h',
'model/eps-bearer.h',
'model/lte-radio-bearer-info.h',
'model/lte-net-device.h',
'model/lte-enb-net-device.h',
'model/lte-ue-net-device.h',
'model/lte-control-messages.h',
'helper/lte-helper.h',
'helper/lte-stats-calculator.h',
'helper/epc-helper.h',
'helper/no-backhaul-epc-helper.h',
'helper/point-to-point-epc-helper.h',
'helper/phy-stats-calculator.h',
'helper/mac-stats-calculator.h',
'helper/phy-tx-stats-calculator.h',
'helper/phy-rx-stats-calculator.h',
'helper/radio-bearer-stats-calculator.h',
'helper/radio-bearer-stats-connector.h',
'helper/radio-environment-map-helper.h',
'helper/lte-hex-grid-enb-topology-helper.h',
'helper/lte-global-pathloss-database.h',
'model/rem-spectrum-phy.h',
'model/ff-mac-common.h',
'model/ff-mac-csched-sap.h',
'model/ff-mac-sched-sap.h',
'model/lte-enb-cmac-sap.h',
'model/lte-ue-cmac-sap.h',
'model/lte-mac-sap.h',
'model/ff-mac-scheduler.h',
'model/rr-ff-mac-scheduler.h',
'model/lte-enb-mac.h',
'model/lte-ue-mac.h',
'model/lte-radio-bearer-tag.h',
'model/eps-bearer-tag.h',
'model/lte-phy-tag.h',
'model/lte-enb-phy-sap.h',
'model/lte-enb-cphy-sap.h',
'model/lte-ue-phy-sap.h',
'model/lte-ue-cphy-sap.h',
'model/lte-interference.h',
'model/lte-chunk-processor.h',
'model/pf-ff-mac-scheduler.h',
'model/fdmt-ff-mac-scheduler.h',
'model/tdmt-ff-mac-scheduler.h',
'model/tta-ff-mac-scheduler.h',
'model/fdbet-ff-mac-scheduler.h',
'model/tdbet-ff-mac-scheduler.h',
'model/fdtbfq-ff-mac-scheduler.h',
'model/tdtbfq-ff-mac-scheduler.h',
'model/pss-ff-mac-scheduler.h',
'model/cqa-ff-mac-scheduler.h',
'model/epc-gtpu-header.h',
'model/epc-gtpc-header.h',
'model/epc-enb-application.h',
'model/epc-sgw-application.h',
'model/epc-pgw-application.h',
'model/epc-mme-application.h',
'model/lte-vendor-specific-parameters.h',
'model/epc-x2-sap.h',
'model/epc-x2-header.h',
'model/epc-x2.h',
'model/epc-tft.h',
'model/epc-tft-classifier.h',
'model/lte-mi-error-model.h',
'model/epc-enb-s1-sap.h',
'model/epc-s1ap-sap.h',
'model/epc-s11-sap.h',
'model/lte-as-sap.h',
'model/epc-ue-nas.h',
'model/lte-harq-phy.h',
'model/lte-asn1-header.h',
'model/lte-rrc-header.h',
'model/lte-handover-management-sap.h',
'model/lte-handover-algorithm.h',
'model/a2-a4-rsrq-handover-algorithm.h',
'model/a3-rsrp-handover-algorithm.h',
'model/no-op-handover-algorithm.h',
'model/lte-anr-sap.h',
'model/lte-anr.h',
'model/lte-ffr-algorithm.h',
'model/lte-ffr-sap.h',
'model/lte-ffr-rrc-sap.h',
'model/lte-fr-no-op-algorithm.h',
'model/lte-fr-hard-algorithm.h',
'model/lte-fr-strict-algorithm.h',
'model/lte-fr-soft-algorithm.h',
'model/lte-ffr-soft-algorithm.h',
'model/lte-ffr-enhanced-algorithm.h',
'model/lte-ffr-distributed-algorithm.h',
'model/lte-ue-power-control.h',
'model/lte-ccm-rrc-sap.h',
'model/lte-ue-ccm-rrc-sap.h',
'model/lte-ccm-mac-sap.h',
'model/lte-enb-component-carrier-manager.h',
'model/lte-ue-component-carrier-manager.h',
'model/no-op-component-carrier-manager.h',
'model/simple-ue-component-carrier-manager.h',
'helper/cc-helper.h',
'model/component-carrier.h',
'model/component-carrier-ue.h',
'model/component-carrier-enb.h'
]
if (bld.env['ENABLE_EMU']):
module.source.append ('helper/emu-epc-helper.cc')
headers.source.append ('helper/emu-epc-helper.h')
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,5 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('mesh', ['internet', 'mobility', 'wifi', 'mesh', 'applications'])
obj.source = 'mesh.cc'

View File

@ -1,101 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_module('mesh', ['internet', 'wifi'])
obj.source = [
'model/mesh-information-element-vector.cc',
'model/mesh-point-device.cc',
'model/mesh-l2-routing-protocol.cc',
'model/mesh-wifi-beacon.cc',
'model/mesh-wifi-interface-mac.cc',
'model/dot11s/ie-dot11s-beacon-timing.cc',
'model/dot11s/ie-dot11s-configuration.cc',
'model/dot11s/ie-dot11s-id.cc',
'model/dot11s/ie-dot11s-peer-management.cc',
'model/dot11s/ie-dot11s-preq.cc',
'model/dot11s/ie-dot11s-prep.cc',
'model/dot11s/ie-dot11s-perr.cc',
'model/dot11s/ie-dot11s-rann.cc',
'model/dot11s/ie-dot11s-peering-protocol.cc',
'model/dot11s/ie-dot11s-metric-report.cc',
'model/dot11s/dot11s-mac-header.cc',
'model/dot11s/peer-link-frame.cc',
'model/dot11s/peer-link.cc',
'model/dot11s/peer-management-protocol-mac.cc',
'model/dot11s/peer-management-protocol.cc',
'model/dot11s/hwmp-tag.cc',
'model/dot11s/hwmp-rtable.cc',
'model/dot11s/hwmp-protocol-mac.cc',
'model/dot11s/hwmp-protocol.cc',
'model/dot11s/airtime-metric.cc',
'model/flame/flame-header.cc',
'model/flame/flame-rtable.cc',
'model/flame/flame-protocol-mac.cc',
'model/flame/flame-protocol.cc',
'helper/mesh-helper.cc',
'helper/mesh-stack-installer.cc',
'helper/dot11s/dot11s-installer.cc',
'helper/flame/flame-installer.cc',
]
obj_test = bld.create_ns3_module_test_library('mesh')
obj_test.source = [
'test/mesh-information-element-vector-test-suite.cc',
'test/dot11s/dot11s-test-suite.cc',
'test/dot11s/pmp-regression.cc',
'test/dot11s/hwmp-reactive-regression.cc',
'test/dot11s/hwmp-proactive-regression.cc',
'test/dot11s/hwmp-simplest-regression.cc',
'test/dot11s/hwmp-target-flags-regression.cc',
'test/dot11s/regression.cc',
'test/flame/flame-test-suite.cc',
'test/flame/flame-regression.cc',
'test/flame/regression.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
obj_test.source.extend([
# 'test/mesh-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'mesh'
headers.source = [
'model/mesh-information-element-vector.h',
'model/mesh-point-device.h',
'model/mesh-l2-routing-protocol.h',
'model/mesh-wifi-beacon.h',
'model/mesh-wifi-interface-mac.h',
'model/mesh-wifi-interface-mac-plugin.h',
'model/dot11s/hwmp-protocol.h',
'model/dot11s/peer-management-protocol.h',
'model/dot11s/ie-dot11s-beacon-timing.h',
'model/dot11s/ie-dot11s-configuration.h',
'model/dot11s/ie-dot11s-peer-management.h',
'model/dot11s/ie-dot11s-id.h',
'model/dot11s/peer-link.h',
'model/dot11s/dot11s-mac-header.h',
'model/dot11s/peer-link-frame.h',
'model/dot11s/hwmp-rtable.h',
'model/dot11s/ie-dot11s-peering-protocol.h',
'model/dot11s/ie-dot11s-metric-report.h',
'model/dot11s/ie-dot11s-perr.h',
'model/dot11s/ie-dot11s-prep.h',
'model/dot11s/ie-dot11s-preq.h',
'model/dot11s/ie-dot11s-rann.h',
'model/flame/flame-protocol.h',
'model/flame/flame-header.h',
'model/flame/flame-rtable.h',
'model/flame/flame-protocol-mac.h',
'helper/mesh-helper.h',
'helper/mesh-stack-installer.h',
'helper/dot11s/dot11s-installer.h',
'helper/flame/flame-installer.h',
]
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,33 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('main-grid-topology',
['core', 'mobility', 'network'])
obj.source = 'main-grid-topology.cc'
obj = bld.create_ns3_program('main-random-topology',
['core', 'mobility'])
obj.source = 'main-random-topology.cc'
obj = bld.create_ns3_program('main-random-walk',
['core', 'mobility'])
obj.source = 'main-random-walk.cc'
obj = bld.create_ns3_program('mobility-trace-example',
['core', 'mobility', 'network'])
obj.source = 'mobility-trace-example.cc'
obj = bld.create_ns3_program('ns2-mobility-trace',
['core', 'mobility'])
obj.source = 'ns2-mobility-trace.cc'
obj = bld.create_ns3_program('bonnmotion-ns2-example',
['core', 'mobility'])
obj.source = 'bonnmotion-ns2-example.cc'
obj = bld.create_ns3_program('reference-point-group-mobility-example',
['core', 'network', 'mobility'])
obj.source = 'reference-point-group-mobility-example.cc'

View File

@ -1,74 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
mobility = bld.create_ns3_module('mobility', ['network'])
mobility.source = [
'model/box.cc',
'model/constant-acceleration-mobility-model.cc',
'model/constant-position-mobility-model.cc',
'model/constant-velocity-helper.cc',
'model/constant-velocity-mobility-model.cc',
'model/gauss-markov-mobility-model.cc',
'model/geographic-positions.cc',
'model/hierarchical-mobility-model.cc',
'model/mobility-model.cc',
'model/position-allocator.cc',
'model/random-direction-2d-mobility-model.cc',
'model/random-walk-2d-mobility-model.cc',
'model/random-waypoint-mobility-model.cc',
'model/rectangle.cc',
'model/steady-state-random-waypoint-mobility-model.cc',
'model/waypoint.cc',
'model/waypoint-mobility-model.cc',
'helper/mobility-helper.cc',
'helper/ns2-mobility-helper.cc',
'helper/group-mobility-helper.cc',
]
mobility_test = bld.create_ns3_module_test_library('mobility')
mobility_test.source = [
'test/mobility-test-suite.cc',
'test/mobility-trace-test-suite.cc',
'test/ns2-mobility-helper-test-suite.cc',
'test/steady-state-random-waypoint-mobility-model-test.cc',
'test/waypoint-mobility-model-test.cc',
'test/geo-to-cartesian-test.cc',
'test/rand-cart-around-geo-test.cc',
'test/box-line-intersection-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
mobility_test.source.extend([
# 'test/mobility-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'mobility'
headers.source = [
'model/box.h',
'model/constant-acceleration-mobility-model.h',
'model/constant-position-mobility-model.h',
'model/constant-velocity-helper.h',
'model/constant-velocity-mobility-model.h',
'model/gauss-markov-mobility-model.h',
'model/geographic-positions.h',
'model/hierarchical-mobility-model.h',
'model/mobility-model.h',
'model/position-allocator.h',
'model/rectangle.h',
'model/random-direction-2d-mobility-model.h',
'model/random-walk-2d-mobility-model.h',
'model/random-waypoint-mobility-model.h',
'model/steady-state-random-waypoint-mobility-model.h',
'model/waypoint.h',
'model/waypoint-mobility-model.h',
'helper/mobility-helper.h',
'helper/ns2-mobility-helper.h',
'helper/group-mobility-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,25 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('simple-distributed',
['mpi', 'point-to-point', 'internet', 'nix-vector-routing', 'applications'])
obj.source = ['simple-distributed.cc', 'mpi-test-fixtures.cc']
obj = bld.create_ns3_program('simple-distributed-empty-node',
['mpi', 'point-to-point', 'internet', 'nix-vector-routing', 'applications'])
obj.source = ['simple-distributed-empty-node.cc', 'mpi-test-fixtures.cc']
obj = bld.create_ns3_program('simple-distributed-mpi-comm',
['point-to-point', 'internet', 'nix-vector-routing', 'applications'])
obj.source = ['simple-distributed-mpi-comm.cc', 'mpi-test-fixtures.cc']
obj = bld.create_ns3_program('third-distributed',
['mpi', 'point-to-point', 'internet', 'mobility', 'wifi', 'csma', 'applications'])
obj.source = ['third-distributed.cc', 'mpi-test-fixtures.cc']
obj = bld.create_ns3_program('nms-p2p-nix-distributed',
['mpi', 'point-to-point', 'internet', 'nix-vector-routing', 'applications'])
obj.source = ['nms-p2p-nix-distributed.cc', 'mpi-test-fixtures.cc']

View File

@ -1,78 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import sys
import subprocess
from waflib import Options
from waflib.Errors import WafError
def configure(conf):
if Options.options.enable_mpi:
# try to detect openmpi installation
mpi = conf.check_cfg(path='mpic++', args='-showme',
package='', uselib_store='MPI', mandatory=False)
if mpi:
conf.env.append_value('DEFINES_MPI', 'NS3_OPENMPI')
else:
# try the MPICH2 flags
mpi = conf.check_cfg(path='mpic++', args='-compile-info -link-info',
package='', uselib_store='MPI', mandatory=False)
if mpi:
conf.env.append_value('DEFINES_MPI', 'NS3_MPICH')
if mpi:
conf.env.append_value('DEFINES_MPI', 'NS3_MPI')
conf.env['ENABLE_MPI'] = True
for libpath in conf.env.LIBPATH_MPI:
if 'mpi' in libpath:
conf.env.append_value('LINKFLAGS_MPI', '-Wl,-rpath,'+libpath)
# Bug #2437, using OpenMPI 1.6.5 (possibly later versions)
# if upstream OpenMPI bug clears at some point, this
# can be removed
# conf.env.append_value('CXXFLAGS', '-Wno-literal-suffix')
conf.report_optional_feature("mpi", "MPI Support", True, '')
else:
conf.report_optional_feature("mpi", "MPI Support", False, 'mpic++ not found')
conf.env['MODULES_NOT_BUILT'].append('mpi')
else:
conf.report_optional_feature("mpi", "MPI Support", False, 'option --enable-mpi not selected')
conf.env['MODULES_NOT_BUILT'].append('mpi')
def build(bld):
# Don't do anything for this module if mpi's not enabled.
if 'mpi' in bld.env['MODULES_NOT_BUILT']:
return
sim = bld.create_ns3_module('mpi', ['core', 'network'])
sim.source = [
'model/distributed-simulator-impl.cc',
'model/granted-time-window-mpi-interface.cc',
'model/mpi-receiver.cc',
'model/null-message-simulator-impl.cc',
'model/null-message-mpi-interface.cc',
'model/remote-channel-bundle.cc',
'model/remote-channel-bundle-manager.cc',
'model/mpi-interface.cc',
]
# MPI tests are based on examples that are run as tests, only test when examples are built.
if bld.env['ENABLE_EXAMPLES']:
module_test = bld.create_ns3_module_test_library('mpi')
module_test.source = [
'test/mpi-test-suite.cc',
]
headers = bld(features='ns3header')
headers.module = 'mpi'
headers.source = [
'model/mpi-receiver.h',
'model/mpi-interface.h',
'model/parallel-communication-interface.h',
]
if bld.env['ENABLE_MPI']:
sim.use.append('MPI')
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -153,7 +153,7 @@ The above will create an XML file dumbbell-animation.xml
Mandatory
#########
1. Ensure that your program's wscript includes the "netanim" module. An example of such a wscript is at src/netanim/examples/wscript.
1. Ensure that your program's CMakeLists.txt includes the "netanim" module. An example of such a CMakeLists.txt is at src/netanim/examples/CMakeLists.txt.
2. Include the header [#include "ns3/netanim-module.h"] in your test program
3. Add the statement

View File

@ -1,30 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('dumbbell-animation',
['netanim', 'applications', 'point-to-point-layout'])
obj.source = 'dumbbell-animation.cc'
obj = bld.create_ns3_program('grid-animation',
['netanim', 'applications', 'point-to-point-layout'])
obj.source = 'grid-animation.cc'
obj = bld.create_ns3_program('star-animation',
['netanim', 'applications', 'point-to-point-layout'])
obj.source = 'star-animation.cc'
obj = bld.create_ns3_program('wireless-animation',
['netanim', 'applications', 'point-to-point', 'csma', 'wifi', 'mobility', 'network'])
obj.source = 'wireless-animation.cc'
obj = bld.create_ns3_program('uan-animation',
['netanim', 'internet', 'mobility', 'applications', 'uan'])
obj.source = 'uan-animation.cc'
obj = bld.create_ns3_program('colors-link-description',
['netanim', 'applications', 'point-to-point-layout'])
obj.source = 'colors-link-description.cc'
obj = bld.create_ns3_program('resources-counters',
['netanim', 'applications', 'point-to-point-layout'])
obj.source = 'resources-counters.cc'

View File

@ -1,25 +0,0 @@
## -*-Mode : python; py-indent-offset : 4; indent-tabs-mode : nil; coding : utf-8; -*-
import wutils
# Required NetAnim version
NETANIM_RELEASE_NAME = "netanim-3.108"
def build (bld) :
module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma', 'lte', 'uan', 'lr-wpan', 'energy', 'wave', 'point-to-point-layout'])
module.includes = '.'
module.source = [ 'model/animation-interface.cc', ]
netanim_test = bld.create_ns3_module_test_library('netanim')
netanim_test.source = ['test/netanim-test.cc', ]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
netanim_test.source.extend([
# 'test/netanim-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'netanim'
headers.source = ['model/animation-interface.h', ]
if (bld.env['ENABLE_EXAMPLES']) :
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,20 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('main-packet-header', ['network'])
obj.source = 'main-packet-header.cc'
obj = bld.create_ns3_program('main-packet-tag', ['network'])
obj.source = 'main-packet-tag.cc'
obj = bld.create_ns3_program('packet-socket-apps', ['core', 'network'])
obj.source = 'packet-socket-apps.cc'
obj = bld.create_ns3_program('lollipop-comparisions', ['core', 'network'])
obj.source = 'lollipop-comparisions.cc'
obj = bld.create_ns3_program('bit-serializer', ['core', 'network'])
obj.source = 'bit-serializer.cc'

View File

@ -1,181 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
network = bld.create_ns3_module('network', ['core', 'stats'])
network.source = [
'model/address.cc',
'model/application.cc',
'model/buffer.cc',
'model/byte-tag-list.cc',
'model/channel.cc',
'model/channel-list.cc',
'model/chunk.cc',
'model/header.cc',
'model/nix-vector.cc',
'model/node.cc',
'model/node-list.cc',
'model/net-device.cc',
'model/packet.cc',
'model/packet-metadata.cc',
'model/packet-tag-list.cc',
'model/socket.cc',
'model/socket-factory.cc',
'model/tag.cc',
'model/tag-buffer.cc',
'model/trailer.cc',
'utils/address-utils.cc',
'utils/bit-deserializer.cc',
'utils/bit-serializer.cc',
'utils/crc32.cc',
'utils/data-rate.cc',
'utils/drop-tail-queue.cc',
'utils/dynamic-queue-limits.cc',
'utils/error-channel.cc',
'utils/error-model.cc',
'utils/ethernet-header.cc',
'utils/ethernet-trailer.cc',
'utils/flow-id-tag.cc',
'utils/inet-socket-address.cc',
'utils/inet6-socket-address.cc',
'utils/ipv4-address.cc',
'utils/ipv6-address.cc',
'utils/mac16-address.cc',
'utils/mac48-address.cc',
'utils/mac64-address.cc',
'utils/llc-snap-header.cc',
'utils/output-stream-wrapper.cc',
'utils/packetbb.cc',
'utils/packet-burst.cc',
'utils/packet-socket.cc',
'utils/packet-socket-address.cc',
'utils/packet-socket-factory.cc',
'utils/pcap-file.cc',
'utils/pcap-file-wrapper.cc',
'utils/queue.cc',
'utils/queue-item.cc',
'utils/queue-limits.cc',
'utils/queue-size.cc',
'utils/net-device-queue-interface.cc',
'utils/radiotap-header.cc',
'utils/simple-channel.cc',
'utils/simple-net-device.cc',
'utils/sll-header.cc',
'utils/packet-socket-client.cc',
'utils/packet-socket-server.cc',
'utils/packet-data-calculators.cc',
'utils/packet-probe.cc',
'utils/mac8-address.cc',
'helper/application-container.cc',
'helper/net-device-container.cc',
'helper/node-container.cc',
'helper/packet-socket-helper.cc',
'helper/trace-helper.cc',
'helper/delay-jitter-estimation.cc',
'helper/simple-net-device-helper.cc',
]
network_test = bld.create_ns3_module_test_library('network')
network_test.source = [
'test/bit-serializer-test.cc',
'test/buffer-test.cc',
'test/drop-tail-queue-test-suite.cc',
'test/error-model-test-suite.cc',
'test/ipv6-address-test-suite.cc',
'test/packetbb-test-suite.cc',
'test/packet-test-suite.cc',
'test/packet-metadata-test.cc',
'test/pcap-file-test-suite.cc',
'test/sequence-number-test-suite.cc',
'test/packet-socket-apps-test-suite.cc',
'test/lollipop-counter-test.cc',
'test/test-data-rate.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
network_test.source.extend([
# 'test/network-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'network'
headers.source = [
'model/address.h',
'model/application.h',
'model/buffer.h',
'model/byte-tag-list.h',
'model/channel.h',
'model/channel-list.h',
'model/chunk.h',
'model/header.h',
'model/net-device.h',
'model/nix-vector.h',
'model/node.h',
'model/node-list.h',
'model/packet.h',
'model/packet-metadata.h',
'model/packet-tag-list.h',
'model/socket.h',
'model/socket-factory.h',
'model/tag.h',
'model/tag-buffer.h',
'model/trailer.h',
'utils/address-utils.h',
'utils/bit-deserializer.h',
'utils/bit-serializer.h',
'utils/crc32.h',
'utils/data-rate.h',
'utils/drop-tail-queue.h',
'utils/dynamic-queue-limits.h',
'utils/error-channel.h',
'utils/error-model.h',
'utils/ethernet-header.h',
'utils/ethernet-trailer.h',
'utils/flow-id-tag.h',
'utils/inet-socket-address.h',
'utils/inet6-socket-address.h',
'utils/ipv4-address.h',
'utils/ipv6-address.h',
'utils/llc-snap-header.h',
'utils/mac16-address.h',
'utils/mac48-address.h',
'utils/mac64-address.h',
'utils/output-stream-wrapper.h',
'utils/packetbb.h',
'utils/packet-burst.h',
'utils/packet-socket.h',
'utils/packet-socket-address.h',
'utils/packet-socket-factory.h',
'utils/pcap-file.h',
'utils/pcap-file-wrapper.h',
'utils/generic-phy.h',
'utils/queue.h',
'utils/queue-item.h',
'utils/queue-limits.h',
'utils/queue-size.h',
'utils/net-device-queue-interface.h',
'utils/radiotap-header.h',
'utils/sequence-number.h',
'utils/simple-channel.h',
'utils/simple-net-device.h',
'utils/sll-header.h',
'utils/packet-socket-client.h',
'utils/packet-socket-server.h',
'utils/pcap-test.h',
'utils/packet-data-calculators.h',
'utils/packet-probe.h',
'utils/mac8-address.h',
'utils/lollipop-counter.h',
'helper/application-container.h',
'helper/net-device-container.h',
'helper/node-container.h',
'helper/packet-socket-helper.h',
'helper/trace-helper.h',
'helper/delay-jitter-estimation.h',
'helper/simple-net-device-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,18 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('nix-simple',
['point-to-point', 'applications', 'internet', 'nix-vector-routing'])
obj.source = 'nix-simple.cc'
obj = bld.create_ns3_program('nms-p2p-nix',
['point-to-point', 'applications', 'internet', 'nix-vector-routing'])
obj.source = 'nms-p2p-nix.cc'
obj = bld.create_ns3_program('nix-simple-multi-address',
['point-to-point', 'applications', 'internet', 'nix-vector-routing'])
obj.source = 'nix-simple-multi-address.cc'
obj = bld.create_ns3_program('nix-double-wifi',
['point-to-point', 'wifi', 'applications', 'internet', 'nix-vector-routing'])
obj.source = 'nix-double-wifi.cc'

View File

@ -1,30 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('nix-vector-routing', ['internet'])
module.includes = '.'
module.source = [
'model/nix-vector-routing.cc',
'helper/nix-vector-helper.cc',
]
nix_vector_test = bld.create_ns3_module_test_library('nix-vector-routing')
nix_vector_test.source = [
'test/nix-test.cc',
]
headers = bld(features='ns3header')
headers.module = 'nix-vector-routing'
headers.source = [
'model/nix-vector-routing.h',
'helper/nix-vector-helper.h',
]
headers.deprecated = [
'model/ipv4-nix-vector-routing.h',
'helper/ipv4-nix-vector-helper.h',
]
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,10 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('simple-point-to-point-olsr',
['point-to-point', 'internet', 'olsr', 'applications', 'wifi'])
obj.source = 'simple-point-to-point-olsr.cc'
obj = bld.create_ns3_program('olsr-hna',
['core', 'mobility', 'wifi', 'csma', 'olsr'])
obj.source = 'olsr-hna.cc'

View File

@ -1,43 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('olsr', ['internet'])
module.includes = '.'
module.source = [
'model/olsr-header.cc',
'model/olsr-state.cc',
'model/olsr-routing-protocol.cc',
'helper/olsr-helper.cc',
]
module_test = bld.create_ns3_module_test_library('olsr')
module_test.source = [
'test/bug780-test.cc',
'test/hello-regression-test.cc',
'test/olsr-header-test-suite.cc',
'test/regression-test-suite.cc',
'test/olsr-routing-protocol-test-suite.cc',
'test/tc-regression-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/olsr-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'olsr'
headers.source = [
'model/olsr-routing-protocol.h',
'model/olsr-header.h',
'model/olsr-state.h',
'model/olsr-repositories.h',
'helper/olsr-helper.h',
]
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,6 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('openflow-switch',
['openflow', 'csma', 'internet', 'applications'])
obj.source = 'openflow-switch.cc'

View File

@ -1,164 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os
from waflib import Logs, Options
from waflib.Errors import WafError
def options(opt):
opt.add_option('--with-openflow',
help=('Path to OFSID source for NS-3 OpenFlow Integration support'),
default='', dest='with_openflow')
def configure(conf):
if Options.options.with_openflow:
if os.path.isdir(Options.options.with_openflow):
conf.msg("Checking for OpenFlow location", ("%s (given)" % Options.options.with_openflow))
conf.env['WITH_OPENFLOW'] = os.path.abspath(Options.options.with_openflow)
else:
# bake.py uses ../../build, while ns-3-dev uses ../openflow.
lib_to_check = 'libopenflow.a'
openflow_bake_build_dir = os.path.join('..', '..', 'build')
openflow_bake_lib_dir = os.path.join(openflow_bake_build_dir, 'lib')
openflow_dir = os.path.join('..','openflow')
if os.path.exists(os.path.join(openflow_bake_lib_dir, lib_to_check)):
conf.msg("Checking for OpenFlow location",("%s (guessed)" % openflow_bake_build_dir))
conf.env['WITH_OPENFLOW'] = os.path.abspath(openflow_bake_build_dir)
elif os.path.isdir(openflow_dir):
conf.msg("Checking for OpenFlow location", ("%s (guessed)" % openflow_dir))
conf.env['WITH_OPENFLOW'] = os.path.abspath(openflow_dir)
del openflow_bake_build_dir
del openflow_bake_lib_dir
del openflow_dir
if not conf.env['WITH_OPENFLOW']:
conf.msg("Checking for OpenFlow location", False)
conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False,
"OpenFlow not enabled (see option --with-openflow)")
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('openflow')
return
if not conf.require_boost_incs('openflow', 'NS-3 OpenFlow Integration'):
conf.env['MODULES_NOT_BUILT'].append('openflow')
return
test_code = '''
#include "openflow/openflow.h"
#include "openflow/nicira-ext.h"
#include "openflow/ericsson-ext.h"
extern "C"
{
#define private _private
#define delete _delete
#define list List
#include "openflow/private/csum.h"
#include "openflow/private/poll-loop.h"
#include "openflow/private/rconn.h"
#include "openflow/private/stp.h"
#include "openflow/private/vconn.h"
#include "openflow/private/xtoxll.h"
#include "openflow/private/chain.h"
#include "openflow/private/table.h"
#include "openflow/private/datapath.h" // The functions below are defined in datapath.c
uint32_t save_buffer (ofpbuf *);
ofpbuf * retrieve_buffer (uint32_t id);
void discard_buffer (uint32_t id);
#include "openflow/private/dp_act.h" // The functions below are defined in dp_act.c
void set_vlan_vid (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
void set_vlan_pcp (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
void strip_vlan (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
void set_dl_addr (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
void set_nw_addr (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
void set_tp_port (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
void set_mpls_label (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
void set_mpls_exp (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
#include "openflow/private/pt_act.h" // The function below is defined in pt_act.c
void update_checksums (ofpbuf *buffer, const sw_flow_key *key, uint32_t old_word, uint32_t new_word);
#undef list
#undef private
#undef delete
}
int main()
{
return 0;
}
'''
conf.env['HAVE_DL'] = conf.check(mandatory=True, lib='dl', define_name='HAVE_DL', uselib_store='DL')
conf.env.append_value('NS3_MODULE_PATH',os.path.abspath(os.path.join(conf.env['WITH_OPENFLOW'],'build')))
conf.env.append_value('NS3_MODULE_PATH',os.path.abspath(os.path.join(conf.env['WITH_OPENFLOW'],'lib')))
conf.env['INCLUDES_OPENFLOW'] = [
os.path.abspath(os.path.join(conf.env['WITH_OPENFLOW'],'include'))]
conf.env['LIBPATH_OPENFLOW'] = [
os.path.abspath(os.path.join(conf.env['WITH_OPENFLOW'],'build')),
os.path.abspath(os.path.join(conf.env['WITH_OPENFLOW'],'lib'))]
conf.env['DEFINES_OPENFLOW'] = ['NS3_OPENFLOW']
conf.env['OPENFLOW'] = conf.check_nonfatal(fragment=test_code, lib='openflow',
libpath=conf.env['LIBPATH_OPENFLOW'],
use='OPENFLOW DL')
conf.env.append_value('LIB_OPENFLOW', 'dl')
conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration",
conf.env['OPENFLOW'], "openflow library not found")
if conf.env['OPENFLOW']:
conf.env['ENABLE_OPENFLOW'] = True
# Openflow library has some strncpy() usage that can trigger warnings
if conf.env['BUILD_PROFILE'] == 'optimized':
conf.env.append_value('CXXFLAGS', '-Wno-stringop-truncation')
else:
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('openflow')
def build(bld):
# Don't do anything for this module if openflow's not enabled.
if 'openflow' in bld.env['MODULES_NOT_BUILT']:
return
# Build the Switch module
obj = bld.create_ns3_module('openflow', ['internet'])
obj.use.append('BOOST')
obj.source = [
]
obj_test = bld.create_ns3_module_test_library('openflow')
obj_test.source = [
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
obj_test.source.extend([
# 'test/openflow-examples-test-suite.cc',
])
if bld.env['OPENFLOW'] and bld.env['HAVE_DL']:
obj.use.extend('OPENFLOW DL'.split())
obj_test.use.extend('OPENFLOW DL'.split())
headers = bld(features='ns3header')
headers.module = 'openflow'
headers.source = [
]
if bld.env['ENABLE_OPENFLOW']:
obj.source.append('model/openflow-interface.cc')
obj.source.append('model/openflow-switch-net-device.cc')
obj.source.append('helper/openflow-switch-helper.cc')
obj.env.append_value('DEFINES', 'NS3_OPENFLOW')
obj_test.source.append('test/openflow-switch-test-suite.cc')
headers.source.append('model/openflow-interface.h')
headers.source.append('model/openflow-switch-net-device.h')
headers.source.append('helper/openflow-switch-helper.h')
if bld.env['ENABLE_EXAMPLES'] and bld.env['ENABLE_OPENFLOW']:
bld.recurse('examples')

View File

@ -1,23 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('point-to-point-layout', ['internet', 'point-to-point', 'mobility'])
module.includes = '.'
module.source = [
'model/point-to-point-dumbbell.cc',
'model/point-to-point-grid.cc',
'model/point-to-point-star.cc',
]
headers = bld(features='ns3header')
headers.module = 'point-to-point-layout'
headers.source = [
'model/point-to-point-dumbbell.h',
'model/point-to-point-grid.h',
'model/point-to-point-star.h',
]
bld.ns3_python_bindings()

View File

@ -1,8 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('main-attribute-value', ['network', 'point-to-point'])
obj.source = 'main-attribute-value.cc'

View File

@ -1,43 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if bld.env['ENABLE_MPI']:
module = bld.create_ns3_module('point-to-point', ['network', 'mpi'])
else:
module = bld.create_ns3_module('point-to-point', ['network'])
module.source = [
'model/point-to-point-net-device.cc',
'model/point-to-point-channel.cc',
'model/ppp-header.cc',
'helper/point-to-point-helper.cc',
]
if bld.env['ENABLE_MPI']:
module.source.append('model/point-to-point-remote-channel.cc')
module_test = bld.create_ns3_module_test_library('point-to-point')
module_test.source = [
'test/point-to-point-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/point-to-point-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'point-to-point'
headers.source = [
'model/point-to-point-net-device.h',
'model/point-to-point-channel.h',
'model/ppp-header.h',
'helper/point-to-point-helper.h',
]
if bld.env['ENABLE_MPI']:
headers.source.append('model/point-to-point-remote-channel.h')
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,13 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('main-propagation-loss',
['core', 'mobility', 'config-store', 'stats', 'propagation', 'buildings'])
obj.source = 'main-propagation-loss.cc'
obj = bld.create_ns3_program('jakes-propagation-model-example',
['core', 'propagation', 'buildings'])
obj.source = 'jakes-propagation-model-example.cc'

View File

@ -1,63 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('propagation', ['network', 'mobility'])
module.includes = '.'
module.source = [
'model/propagation-delay-model.cc',
'model/propagation-loss-model.cc',
'model/jakes-propagation-loss-model.cc',
'model/jakes-process.cc',
'model/cost231-propagation-loss-model.cc',
'model/okumura-hata-propagation-loss-model.cc',
'model/itu-r-1411-los-propagation-loss-model.cc',
'model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.cc',
'model/kun-2600-mhz-propagation-loss-model.cc',
'model/channel-condition-model.cc',
'model/probabilistic-v2v-channel-condition-model.cc',
'model/three-gpp-propagation-loss-model.cc',
'model/three-gpp-v2v-propagation-loss-model.cc',
]
module_test = bld.create_ns3_module_test_library('propagation')
module_test.source = [
'test/propagation-loss-model-test-suite.cc',
'test/okumura-hata-test-suite.cc',
'test/itu-r-1411-los-test-suite.cc',
'test/kun-2600-mhz-test-suite.cc',
'test/itu-r-1411-nlos-over-rooftop-test-suite.cc',
'test/channel-condition-model-test-suite.cc',
'test/three-gpp-propagation-loss-model-test-suite.cc',
'test/probabilistic-v2v-channel-condition-model-test.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/propagation-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'propagation'
headers.source = [
'model/propagation-delay-model.h',
'model/propagation-loss-model.h',
'model/jakes-propagation-loss-model.h',
'model/jakes-process.h',
'model/propagation-cache.h',
'model/cost231-propagation-loss-model.h',
'model/propagation-environment.h',
'model/okumura-hata-propagation-loss-model.h',
'model/itu-r-1411-los-propagation-loss-model.h',
'model/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h',
'model/kun-2600-mhz-propagation-loss-model.h',
'model/channel-condition-model.h',
'model/probabilistic-v2v-channel-condition-model.h',
'model/three-gpp-propagation-loss-model.h',
'model/three-gpp-v2v-propagation-loss-model.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,21 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('example-sixlowpan',
['network', 'sixlowpan', 'internet', 'csma', 'internet-apps'])
obj.source = 'example-sixlowpan.cc'
obj = bld.create_ns3_program('example-ping-lr-wpan',
['network', 'sixlowpan', 'internet', 'lr-wpan', 'internet-apps'])
obj.source = 'example-ping-lr-wpan.cc'
obj = bld.create_ns3_program('example-ping-lr-wpan-beacon',
['network', 'sixlowpan', 'internet', 'lr-wpan', 'internet-apps'])
obj.source = 'example-ping-lr-wpan-beacon.cc'
obj = bld.create_ns3_program('example-ping-lr-wpan-mesh-under',
['network', 'sixlowpan', 'internet', 'lr-wpan', 'internet-apps', 'csma'])
obj.source = 'example-ping-lr-wpan-mesh-under.cc'

View File

@ -1,40 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('sixlowpan', ['internet', 'network', 'core'])
module.includes = '.'
module.source = [
'model/sixlowpan-net-device.cc',
'model/sixlowpan-header.cc',
'helper/sixlowpan-helper.cc',
]
module_test = bld.create_ns3_module_test_library('sixlowpan')
module_test.source = [
'test/mock-net-device.cc',
'test/sixlowpan-hc1-test.cc',
'test/sixlowpan-iphc-test.cc',
'test/sixlowpan-iphc-stateful-test.cc',
'test/sixlowpan-fragmentation-test.cc',
]
# This suite runs an example, only include if examples are built
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
'test/sixlowpan-examples-test-suite.cc',
])
headers = bld(features=['ns3header'])
headers.module = 'sixlowpan'
headers.source = [
'model/sixlowpan-net-device.h',
'model/sixlowpan-header.h',
'helper/sixlowpan-helper.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,26 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('adhoc-aloha-ideal-phy',
['spectrum', 'mobility', 'internet', 'applications'])
obj.source = 'adhoc-aloha-ideal-phy.cc'
obj = bld.create_ns3_program('adhoc-aloha-ideal-phy-matrix-propagation-loss-model',
['spectrum', 'mobility', 'internet', 'applications'])
obj.source = 'adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc'
obj = bld.create_ns3_program('adhoc-aloha-ideal-phy-with-microwave-oven',
['spectrum', 'mobility', 'internet', 'applications'])
obj.source = 'adhoc-aloha-ideal-phy-with-microwave-oven.cc'
obj = bld.create_ns3_program('tv-trans-example',
['spectrum', 'mobility', 'core'])
obj.source = 'tv-trans-example.cc'
obj = bld.create_ns3_program('tv-trans-regional-example',
['spectrum', 'mobility', 'core'])
obj.source = 'tv-trans-regional-example.cc'
obj = bld.create_ns3_program('three-gpp-channel-example',
['spectrum', 'mobility', 'core', 'lte'])
obj.source = 'three-gpp-channel-example.cc'

View File

@ -1,106 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
module = bld.create_ns3_module('spectrum', ['propagation', 'antenna'])
module.source = [
'model/spectrum-model.cc',
'model/spectrum-value.cc',
'model/spectrum-converter.cc',
'model/spectrum-signal-parameters.cc',
'model/spectrum-propagation-loss-model.cc',
'model/phased-array-spectrum-propagation-loss-model.cc',
'model/friis-spectrum-propagation-loss.cc',
'model/constant-spectrum-propagation-loss.cc',
'model/spectrum-phy.cc',
'model/spectrum-channel.cc',
'model/single-model-spectrum-channel.cc',
'model/multi-model-spectrum-channel.cc',
'model/spectrum-interference.cc',
'model/spectrum-error-model.cc',
'model/spectrum-model-ism2400MHz-res1MHz.cc',
'model/spectrum-model-300kHz-300GHz-log.cc',
'model/wifi-spectrum-value-helper.cc',
'model/waveform-generator.cc',
'model/spectrum-analyzer.cc',
'model/aloha-noack-mac-header.cc',
'model/aloha-noack-net-device.cc',
'model/half-duplex-ideal-phy.cc',
'model/half-duplex-ideal-phy-signal-parameters.cc',
'model/non-communicating-net-device.cc',
'model/microwave-oven-spectrum-value-helper.cc',
'model/tv-spectrum-transmitter.cc',
'model/trace-fading-loss-model.cc',
'model/three-gpp-spectrum-propagation-loss-model.cc',
'model/three-gpp-channel-model.cc',
'model/matrix-based-channel-model.cc',
'helper/spectrum-helper.cc',
'helper/adhoc-aloha-noack-ideal-phy-helper.cc',
'helper/waveform-generator-helper.cc',
'helper/spectrum-analyzer-helper.cc',
'helper/tv-spectrum-transmitter-helper.cc',
]
module_test = bld.create_ns3_module_test_library('spectrum')
module_test.source = [
'test/spectrum-interference-test.cc',
'test/spectrum-value-test.cc',
'test/spectrum-ideal-phy-test.cc',
'test/spectrum-waveform-generator-test.cc',
'test/tv-helper-distribution-test.cc',
'test/tv-spectrum-transmitter-test.cc',
'test/three-gpp-channel-test-suite.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/spectrum-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'spectrum'
headers.source = [
'model/spectrum-model.h',
'model/spectrum-value.h',
'model/spectrum-converter.h',
'model/spectrum-signal-parameters.h',
'model/spectrum-propagation-loss-model.h',
'model/phased-array-spectrum-propagation-loss-model.h',
'model/friis-spectrum-propagation-loss.h',
'model/constant-spectrum-propagation-loss.h',
'model/spectrum-phy.h',
'model/spectrum-channel.h',
'model/single-model-spectrum-channel.h',
'model/multi-model-spectrum-channel.h',
'model/spectrum-interference.h',
'model/spectrum-error-model.h',
'model/spectrum-model-ism2400MHz-res1MHz.h',
'model/spectrum-model-300kHz-300GHz-log.h',
'model/wifi-spectrum-value-helper.h',
'model/waveform-generator.h',
'model/spectrum-analyzer.h',
'model/aloha-noack-mac-header.h',
'model/aloha-noack-net-device.h',
'model/half-duplex-ideal-phy.h',
'model/half-duplex-ideal-phy-signal-parameters.h',
'model/non-communicating-net-device.h',
'model/microwave-oven-spectrum-value-helper.h',
'model/tv-spectrum-transmitter.h',
'model/trace-fading-loss-model.h',
'model/three-gpp-spectrum-propagation-loss-model.h',
'model/three-gpp-channel-model.h',
'model/matrix-based-channel-model.h',
'helper/spectrum-helper.h',
'helper/adhoc-aloha-noack-ideal-phy-helper.h',
'helper/waveform-generator-helper.h',
'helper/spectrum-analyzer-helper.h',
'helper/tv-spectrum-transmitter-helper.h',
'test/spectrum-test.h',
]
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -184,7 +184,7 @@ users to temporarily insert Probe statements like `printf` statements within
existing |ns3| models. Note that in order to be able to use the DoubleProbe in this example like this, 2 things were necessary:
1. the stats module header file was included in the example .cc file
2. the example was made dependent on the stats module in its wscript file.
2. the example was made dependent on the stats module in its CMakeLists.txt file.
Analogous things need to be done in order to add other Probes in other places in the |ns3| code base.

View File

@ -1,28 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
if not bld.env['ENABLE_EXAMPLES']:
return;
obj = bld.create_ns3_program('gnuplot-example', ['network', 'stats'])
obj.source = 'gnuplot-example.cc'
program = bld.create_ns3_program('double-probe-example', ['network', 'stats'])
program.source = 'double-probe-example.cc'
program = bld.create_ns3_program('time-probe-example', ['stats'])
program.source = 'time-probe-example.cc'
program = bld.create_ns3_program('gnuplot-aggregator-example', ['network', 'stats'])
program.source = 'gnuplot-aggregator-example.cc'
program = bld.create_ns3_program('gnuplot-helper-example', ['network', 'stats'])
program.source = 'gnuplot-helper-example.cc'
program = bld.create_ns3_program('file-aggregator-example', ['network', 'stats'])
program.source = 'file-aggregator-example.cc'
program = bld.create_ns3_program('file-helper-example', ['network', 'stats'])
program.source = 'file-helper-example.cc'

View File

@ -1,95 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def configure(conf):
have_sqlite3 = conf.check_cfg(package='sqlite3', uselib_store='SQLITE3',
args=['--cflags', '--libs'],
mandatory=False)
conf.env['SQLITE_STATS'] = have_sqlite3
have_sem = conf.check_nonfatal(header_name='semaphore.h', define_name='HAVE_SEMAPHORE_H')
conf.env['SEMAPHORE_ENABLED'] = have_sem
conf.report_optional_feature("SQLiteStats", "SQLite stats support",
conf.env['SQLITE_STATS'] and conf.env['SEMAPHORE_ENABLED'],
"library 'sqlite3' and/or semaphore.h not found")
def build(bld):
obj = bld.create_ns3_module('stats', ['core'])
obj.source = [
'helper/file-helper.cc',
'helper/gnuplot-helper.cc',
'model/data-calculator.cc',
'model/time-data-calculators.cc',
'model/data-output-interface.cc',
'model/omnet-data-output.cc',
'model/data-collector.cc',
'model/gnuplot.cc',
'model/data-collection-object.cc',
'model/probe.cc',
'model/boolean-probe.cc',
'model/double-probe.cc',
'model/time-probe.cc',
'model/uinteger-8-probe.cc',
'model/uinteger-16-probe.cc',
'model/uinteger-32-probe.cc',
'model/time-series-adaptor.cc',
'model/file-aggregator.cc',
'model/gnuplot-aggregator.cc',
'model/get-wildcard-matches.cc',
'model/histogram.cc',
]
module_test = bld.create_ns3_module_test_library('stats')
module_test.source = [
'test/basic-data-calculators-test-suite.cc',
'test/average-test-suite.cc',
'test/double-probe-test-suite.cc',
'test/histogram-test-suite.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/stats-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'stats'
headers.source = [
'helper/file-helper.h',
'helper/gnuplot-helper.h',
'model/data-calculator.h',
'model/time-data-calculators.h',
'model/basic-data-calculators.h',
'model/data-output-interface.h',
'model/omnet-data-output.h',
'model/data-collector.h',
'model/gnuplot.h',
'model/average.h',
'model/data-collection-object.h',
'model/probe.h',
'model/boolean-probe.h',
'model/double-probe.h',
'model/time-probe.h',
'model/uinteger-8-probe.h',
'model/uinteger-16-probe.h',
'model/uinteger-32-probe.h',
'model/time-series-adaptor.h',
'model/file-aggregator.h',
'model/gnuplot-aggregator.h',
'model/get-wildcard-matches.h',
'model/histogram.h',
]
if bld.env['SQLITE_STATS']:
headers.source.append('model/sqlite-data-output.h')
obj.source.append('model/sqlite-data-output.cc')
obj.use.append('SQLITE3')
if bld.env['SQLITE_STATS'] and bld.env['SEMAPHORE_ENABLED']:
obj.source.append('model/sqlite-output.cc')
headers.source.append('model/sqlite-output.h')
if (bld.env['ENABLE_EXAMPLES']):
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,15 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
env = bld.env
if env['ENABLE_TAP']:
obj = bld.create_ns3_program('tap-csma', ['csma', 'tap-bridge', 'internet', 'wifi'])
obj.source = 'tap-csma.cc'
obj = bld.create_ns3_program('tap-csma-virtual-machine', ['csma', 'tap-bridge', 'internet'])
obj.source = 'tap-csma-virtual-machine.cc'
bld.register_ns3_script('tap-csma-virtual-machine.py', ['csma', 'tap-bridge', 'internet'])
obj = bld.create_ns3_program('tap-wifi-virtual-machine', ['csma', 'tap-bridge', 'internet', 'wifi', 'mobility'])
obj.source = 'tap-wifi-virtual-machine.cc'
bld.register_ns3_script('tap-wifi-virtual-machine.py', ['csma', 'tap-bridge', 'internet', 'wifi', 'mobility'])
obj = bld.create_ns3_program('tap-wifi-dumbbell', ['wifi', 'csma', 'point-to-point', 'tap-bridge', 'internet', 'applications'])
obj.source = 'tap-wifi-dumbbell.cc'

View File

@ -1,57 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os.path
def configure(conf):
if conf.env['ENABLE_THREADING']:
conf.env['ENABLE_TAP'] = conf.check_nonfatal(header_name='linux/if_tun.h',
define_name='HAVE_IF_TUN_H')
conf.report_optional_feature("TapBridge", "Tap Bridge",
conf.env['ENABLE_TAP'],
"<linux/if_tun.h> include not detected")
else:
conf.report_optional_feature("TapBridge", "Tap Bridge",
False,
"needs threading support which is not available")
if conf.env['ENABLE_TAP']:
blddir = os.path.abspath(os.path.join(conf.bldnode.abspath(), conf.variant))
tapcreatordir = os.path.abspath(os.path.join(blddir, "src/tap-bridge"))
conf.env.append_value('NS3_EXECUTABLE_PATH', tapcreatordir)
else:
# Add this module to the list of modules that won't be built
# if they are enabled.
conf.env['MODULES_NOT_BUILT'].append('tap-bridge')
def build(bld):
# Don't do anything for this module if tap-bridge's not enabled.
if not bld.env['ENABLE_TAP']:
return
module = bld.create_ns3_module('tap-bridge', ['internet', 'network', 'core'])
module.source = [
'model/tap-bridge.cc',
'model/tap-encode-decode.cc',
'helper/tap-bridge-helper.cc',
]
headers = bld(features='ns3header')
headers.module = 'tap-bridge'
headers.source = [
'model/tap-bridge.h',
'helper/tap-bridge-helper.h',
'doc/tap.h',
]
if not bld.env['PLATFORM'].startswith('freebsd'):
tap_creator = bld.create_suid_program('tap-creator')
tap_creator.source = [
'model/tap-creator.cc',
'model/tap-encode-decode.cc',
]
module.env.append_value("DEFINES", "TAP_CREATOR=\"%s\"" % (tap_creator.target,))
if bld.env['ENABLE_EXAMPLES']:
bld.recurse('examples')
bld.ns3_python_bindings()

View File

@ -1,55 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import sys
def configure(conf):
# Add the test module to the list of enabled modules that should
# not be built if this is a static build on Darwin. They don't
# work there for the test module, and this is probably because the
# test module has no source files.
if conf.env['ENABLE_STATIC_NS3'] and sys.platform == 'darwin':
conf.env['MODULES_NOT_BUILT'].append('test')
def build(bld):
# Don't do anything for this module if it should not be built.
if 'test' in bld.env['MODULES_NOT_BUILT']:
return
test = bld.create_ns3_module('test',
['applications', 'bridge', 'config-store',
'csma', 'csma-layout', 'dsr',
'flow-monitor', 'internet', 'lr-wpan',
'lte', 'mesh', 'mobility', 'olsr',
'point-to-point', 'sixlowpan', 'stats',
'uan', 'wifi', 'internet-apps',
'point-to-point-layout', 'traffic-control'])
headers = bld(features='ns3header')
headers.module = 'test'
test_test = bld.create_ns3_module_test_library('test')
test_test.source = [
'csma-system-test-suite.cc',
'ns3tc/fq-codel-queue-disc-test-suite.cc',
'ns3tc/fq-cobalt-queue-disc-test-suite.cc',
'ns3tc/fq-pie-queue-disc-test-suite.cc',
'ns3tc/pfifo-fast-queue-disc-test-suite.cc',
'ns3tcp/ns3tcp-loss-test-suite.cc',
'ns3tcp/ns3tcp-no-delay-test-suite.cc',
'ns3tcp/ns3tcp-socket-test-suite.cc',
'ns3tcp/ns3tcp-state-test-suite.cc',
'ns3tcp/ns3tcp-socket-writer.cc',
'ns3wifi/wifi-msdu-aggregator-test-suite.cc',
'ns3wifi/wifi-ac-mapping-test-suite.cc',
'ns3wifi/wifi-issue-211-test-suite.cc',
'traced/traced-callback-typedef-test-suite.cc',
'traced/traced-value-callback-typedef-test-suite.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
test_test.source.extend([
# 'test/test-examples-test-suite.cc',
])

View File

@ -1,5 +0,0 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def build(bld):
obj = bld.create_ns3_program('topology-example-sim', ['topology-read', 'internet', 'nix-vector-routing', 'point-to-point', 'applications'])
obj.source = 'topology-example-sim.cc'

Some files were not shown because too many files have changed in this diff Show More