NFD: Removing parts irrelevant for the simulator
diff --git a/NFD/.gitignore b/NFD/.gitignore
deleted file mode 100644
index 4629c34..0000000
--- a/NFD/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.DS*
-.waf-1*
-.waf3-*
-.lock*
-**/*.pyc
-build/
-VERSION
-unit-tests.conf
diff --git a/NFD/.gitmodules b/NFD/.gitmodules
deleted file mode 100644
index 0b8f2ee..0000000
--- a/NFD/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "websocketpp"]
- path = websocketpp
- url = https://github.com/zaphoyd/websocketpp.git
diff --git a/NFD/.jenkins b/NFD/.jenkins
deleted file mode 100755
index 674d751..0000000
--- a/NFD/.jenkins
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-
-for file in "$DIR"/.jenkins.d/*; do
- [[ -f $file && -x $file ]] || continue
- echo "Run: $file"
- "$file"
-done
diff --git a/NFD/.jenkins.d/00-deps-ndn-cxx.sh b/NFD/.jenkins.d/00-deps-ndn-cxx.sh
deleted file mode 100755
index 951e3f9..0000000
--- a/NFD/.jenkins.d/00-deps-ndn-cxx.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env bash
-set -x
-set -e
-
-cd /tmp
-BUILD="no"
-if [ ! -d ndn-cxx ]; then
- git clone --depth 1 git://github.com/named-data/ndn-cxx
- cd ndn-cxx
- BUILD="yes"
-else
- cd ndn-cxx
- INSTALLED_VERSION=`git rev-parse HEAD || echo NONE`
- sudo rm -Rf latest-version
- git clone --depth 1 git://github.com/named-data/ndn-cxx latest-version
- cd latest-version
- LATEST_VERSION=`git rev-parse HEAD || echo UNKNOWN`
- cd ..
- rm -Rf latest-version
- if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
- cd ..
- sudo rm -Rf ndn-cxx
- git clone --depth 1 git://github.com/named-data/ndn-cxx
- cd ndn-cxx
- BUILD="yes"
- fi
-fi
-
-sudo rm -Rf /usr/local/include/ndn-cxx
-sudo rm -f /usr/local/lib/libndn-cxx*
-sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
-
-if [ "$BUILD" = "yes" ]; then
- sudo ./waf distclean -j1 --color=yes
-fi
-
-./waf configure -j1 --color=yes --without-osx-keychain
-./waf -j1 --color=yes
-sudo ./waf install -j1 --color=yes
diff --git a/NFD/.jenkins.d/10-build.sh b/NFD/.jenkins.d/10-build.sh
deleted file mode 100755
index 1c4fdf2..0000000
--- a/NFD/.jenkins.d/10-build.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-set -x
-set -e
-
-git submodule init
-git submodule sync
-git submodule update
-
-COVERAGE=$( python -c "print '--with-coverage' if 'code-coverage' in '$JOB_NAME' else ''" )
-
-# Cleanup
-sudo ./waf -j1 --color=yes distclean
-
-# Configure/build in debug mode
-./waf -j1 --color=yes configure --with-tests --debug
-./waf -j1 --color=yes build
-
-# Cleanup
-sudo ./waf -j1 --color=yes distclean
-
-# Configure/build in optimized mode without tests with precompiled headers
-./waf -j1 --color=yes configure
-./waf -j1 --color=yes build
-
-# Cleanup
-sudo ./waf -j1 --color=yes distclean
-
-# Configure/build in optimized mode
-./waf -j1 --color=yes configure --with-tests --without-pch $COVERAGE
-./waf -j1 --color=yes build
-
-# (tests will be run against optimized version)
-
-# Install
-sudo ./waf -j1 --color=yes install
diff --git a/NFD/.jenkins.d/20-tests.sh b/NFD/.jenkins.d/20-tests.sh
deleted file mode 100755
index 6385fc9..0000000
--- a/NFD/.jenkins.d/20-tests.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-set -x
-set -e
-
-# Prepare environment
-rm -Rf ~/.ndnx ~/.ndn
-
-echo $NODE_LABELS
-IS_OSX=$( python -c "print 'yes' if 'OSX' in '$NODE_LABELS'.strip().split(' ') else 'no'" )
-IS_LINUX=$( python -c "print 'yes' if 'Linux' in '$NODE_LABELS'.strip().split(' ') else 'no'" )
-
-if [[ $IS_OSX == "yes" ]]; then
- security unlock-keychain -p "named-data"
- sudo chgrp admin /dev/bpf*
- sudo chmod g+rw /dev/bpf*
-fi
-if [[ $IS_LINUX = "yes" ]]; then
- sudo setcap cap_net_raw,cap_net_admin=eip `pwd`/build/unit-tests-core || true
- sudo setcap cap_net_raw,cap_net_admin=eip `pwd`/build/unit-tests-daemon || true
- sudo setcap cap_net_raw,cap_net_admin=eip `pwd`/build/unit-tests-rib || true
-fi
-
-ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
-
-# Run unit tests
-# Core
-./build/unit-tests-core -l test_suite
-
-# Daemon
-./build/unit-tests-daemon -l test_suite
-
-# RIB
-./build/unit-tests-rib -l test_suite
diff --git a/NFD/.jenkins.d/30-coverage.sh b/NFD/.jenkins.d/30-coverage.sh
deleted file mode 100755
index e462884..0000000
--- a/NFD/.jenkins.d/30-coverage.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-set -x
-set -e
-
-IS_COVR=$( python -c "print 'yes' if 'code-coverage' in '$JOB_NAME' else 'no'" )
-
-if [[ $IS_COVR == "yes" ]]; then
- BASE="`pwd | sed -e 's|/|\\\/|g'`\\"
- (cd build && gcovr -x -f $BASE/core -f $BASE/daemon -f $BASE/rib -r ../ -o coverage.xml ./)
-fi
diff --git a/NFD/.travis.yml b/NFD/.travis.yml
deleted file mode 100644
index a4e4b2c..0000000
--- a/NFD/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-# For Ubuntu only
-language: cpp
-os:
- - linux
-compiler:
- - gcc
-notifications:
- email:
- on_success: always
- on_failure: always
-before_install:
- - travis_retry sudo apt-get update
- - travis_retry sudo apt-get install -qq libssl-dev libpcap-dev libboost1.48-all-dev libcrypto++-dev libsqlite3-dev
-script:
- - ./.jenkins
diff --git a/NFD/.waf-tools/boost-kqueue.py b/NFD/.waf-tools/boost-kqueue.py
deleted file mode 100644
index d4d5139..0000000
--- a/NFD/.waf-tools/boost-kqueue.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-#
-# Copyright (c) 2014, Regents of the University of California
-#
-# GPL 3.0 license, see the COPYING.md file for more information
-
-from waflib import Configure
-
-BOOST_ASIO_HAS_KQUEUE_CHECK = '''
-#include <boost/asio.hpp>
-#if defined(BOOST_ASIO_HAS_KQUEUE) and BOOST_VERSION == 105600
-#error "Ethernet face support cannot be enabled on this platform with boost 1.56"
-#endif
-'''
-
-@Configure.conf
-def check_asio_pcap_support(conf):
- # https://svn.boost.org/trac/boost/ticket/10367
- if conf.check_cxx(msg='Checking if Ethernet face support can be enabled',
- fragment=BOOST_ASIO_HAS_KQUEUE_CHECK,
- features='cxx', use='BOOST', mandatory=False):
- conf.define('HAVE_ASIO_PCAP_SUPPORT', 1)
- conf.env['HAVE_ASIO_PCAP_SUPPORT'] = True
diff --git a/NFD/.waf-tools/boost.py b/NFD/.waf-tools/boost.py
deleted file mode 100644
index 305945a..0000000
--- a/NFD/.waf-tools/boost.py
+++ /dev/null
@@ -1,378 +0,0 @@
-#!/usr/bin/env python
-# encoding: utf-8
-#
-# partially based on boost.py written by Gernot Vormayr
-# written by Ruediger Sonderfeld <ruediger@c-plusplus.de>, 2008
-# modified by Bjoern Michaelsen, 2008
-# modified by Luca Fossati, 2008
-# rewritten for waf 1.5.1, Thomas Nagy, 2008
-# rewritten for waf 1.6.2, Sylvain Rouquette, 2011
-
-'''
-
-This is an extra tool, not bundled with the default waf binary.
-To add the boost tool to the waf file:
-$ ./waf-light --tools=compat15,boost
- or, if you have waf >= 1.6.2
-$ ./waf update --files=boost
-
-When using this tool, the wscript will look like:
-
- def options(opt):
- opt.load('compiler_cxx boost')
-
- def configure(conf):
- conf.load('compiler_cxx boost')
- conf.check_boost(lib='system filesystem')
-
- def build(bld):
- bld(source='main.cpp', target='app', use='BOOST')
-
-Options are generated, in order to specify the location of boost includes/libraries.
-The `check_boost` configuration function allows to specify the used boost libraries.
-It can also provide default arguments to the --boost-static and --boost-mt command-line arguments.
-Everything will be packaged together in a BOOST component that you can use.
-
-When using MSVC, a lot of compilation flags need to match your BOOST build configuration:
- - you may have to add /EHsc to your CXXFLAGS or define boost::throw_exception if BOOST_NO_EXCEPTIONS is defined.
- Errors: C4530
- - boost libraries will try to be smart and use the (pretty but often not useful) auto-linking feature of MSVC
- So before calling `conf.check_boost` you might want to disabling by adding:
- conf.env.DEFINES_BOOST += ['BOOST_ALL_NO_LIB']
- Errors:
- - boost might also be compiled with /MT, which links the runtime statically.
- If you have problems with redefined symbols,
- self.env['DEFINES_%s' % var] += ['BOOST_ALL_NO_LIB']
- self.env['CXXFLAGS_%s' % var] += ['/MD', '/EHsc']
-Passing `--boost-linkage_autodetect` might help ensuring having a correct linkage in some basic cases.
-
-'''
-
-import sys
-import re
-from waflib import Utils, Logs, Errors
-from waflib.Configure import conf
-
-BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib', '/usr/lib/x86_64-linux-gnu', '/usr/lib/i386-linux-gnu', '/usr/local/ndn/lib']
-BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include', '/usr/local/ndn/include']
-BOOST_VERSION_FILE = 'boost/version.hpp'
-BOOST_VERSION_CODE = '''
-#include <iostream>
-#include <boost/version.hpp>
-int main() { std::cout << BOOST_LIB_VERSION << ":" << BOOST_VERSION << std::endl; }
-'''
-BOOST_SYSTEM_CODE = '''
-#include <boost/system/error_code.hpp>
-int main() { boost::system::error_code c; }
-'''
-BOOST_THREAD_CODE = '''
-#include <boost/thread.hpp>
-int main() { boost::thread t; }
-'''
-
-# toolsets from {boost_dir}/tools/build/v2/tools/common.jam
-PLATFORM = Utils.unversioned_sys_platform()
-detect_intel = lambda env: (PLATFORM == 'win32') and 'iw' or 'il'
-detect_clang = lambda env: (PLATFORM == 'darwin') and 'clang-darwin' or 'clang'
-detect_mingw = lambda env: (re.search('MinGW', env.CXX[0])) and 'mgw' or 'gcc'
-BOOST_TOOLSETS = {
- 'borland': 'bcb',
- 'clang': detect_clang,
- 'como': 'como',
- 'cw': 'cw',
- 'darwin': 'xgcc',
- 'edg': 'edg',
- 'g++': detect_mingw,
- 'gcc': detect_mingw,
- 'icpc': detect_intel,
- 'intel': detect_intel,
- 'kcc': 'kcc',
- 'kylix': 'bck',
- 'mipspro': 'mp',
- 'mingw': 'mgw',
- 'msvc': 'vc',
- 'qcc': 'qcc',
- 'sun': 'sw',
- 'sunc++': 'sw',
- 'tru64cxx': 'tru',
- 'vacpp': 'xlc'
-}
-
-
-def options(opt):
- opt = opt.add_option_group('Boost Options')
-
- opt.add_option('--boost-includes', type='string',
- default='', dest='boost_includes',
- help='''path to the directory where the boost includes are, e.g., /path/to/boost_1_55_0/stage/include''')
- opt.add_option('--boost-libs', type='string',
- default='', dest='boost_libs',
- help='''path to the directory where the boost libs are, e.g., /path/to/boost_1_55_0/stage/lib''')
- opt.add_option('--boost-static', action='store_true',
- default=False, dest='boost_static',
- help='link with static boost libraries (.lib/.a)')
- opt.add_option('--boost-mt', action='store_true',
- default=False, dest='boost_mt',
- help='select multi-threaded libraries')
- opt.add_option('--boost-abi', type='string', default='', dest='boost_abi',
- help='''select libraries with tags (dgsyp, d for debug), see doc Boost, Getting Started, chapter 6.1''')
- opt.add_option('--boost-linkage_autodetect', action="store_true", dest='boost_linkage_autodetect',
- help="auto-detect boost linkage options (don't get used to it / might break other stuff)")
- opt.add_option('--boost-toolset', type='string',
- default='', dest='boost_toolset',
- help='force a toolset e.g. msvc, vc90, gcc, mingw, mgw45 (default: auto)')
- py_version = '%d%d' % (sys.version_info[0], sys.version_info[1])
- opt.add_option('--boost-python', type='string',
- default=py_version, dest='boost_python',
- help='select the lib python with this version (default: %s)' % py_version)
-
-
-@conf
-def __boost_get_version_file(self, d):
- dnode = self.root.find_dir(d)
- if dnode:
- return dnode.find_node(BOOST_VERSION_FILE)
- return None
-
-@conf
-def boost_get_version(self, d):
- """silently retrieve the boost version number"""
- node = self.__boost_get_version_file(d)
- if node:
- try:
- txt = node.read()
- except (OSError, IOError):
- Logs.error("Could not read the file %r" % node.abspath())
- else:
- re_but1 = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.+)"', re.M)
- m1 = re_but1.search(txt)
-
- re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+(\\d+)', re.M)
- m2 = re_but2.search(txt)
-
- if m1 and m2:
- return (m1.group(1), m2.group(1))
-
- return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True).split(":")
-
-@conf
-def boost_get_includes(self, *k, **kw):
- includes = k and k[0] or kw.get('includes', None)
- if includes and self.__boost_get_version_file(includes):
- return includes
- for d in Utils.to_list(self.environ.get('INCLUDE', '')) + BOOST_INCLUDES:
- if self.__boost_get_version_file(d):
- return d
- if includes:
- self.end_msg('headers not found in %s' % includes)
- self.fatal('The configuration failed')
- else:
- self.end_msg('headers not found, please provide a --boost-includes argument (see help)')
- self.fatal('The configuration failed')
-
-
-@conf
-def boost_get_toolset(self, cc):
- toolset = cc
- if not cc:
- build_platform = Utils.unversioned_sys_platform()
- if build_platform in BOOST_TOOLSETS:
- cc = build_platform
- else:
- cc = self.env.CXX_NAME
- if cc in BOOST_TOOLSETS:
- toolset = BOOST_TOOLSETS[cc]
- return isinstance(toolset, str) and toolset or toolset(self.env)
-
-
-@conf
-def __boost_get_libs_path(self, *k, **kw):
- ''' return the lib path and all the files in it '''
- if 'files' in kw:
- return self.root.find_dir('.'), Utils.to_list(kw['files'])
- libs = k and k[0] or kw.get('libs', None)
- if libs:
- path = self.root.find_dir(libs)
- files = path.ant_glob('*boost_*')
- if not libs or not files:
- for d in Utils.to_list(self.environ.get('LIB', [])) + BOOST_LIBS:
- path = self.root.find_dir(d)
- if path:
- files = path.ant_glob('*boost_*')
- if files:
- break
- path = self.root.find_dir(d + '64')
- if path:
- files = path.ant_glob('*boost_*')
- if files:
- break
- if not path:
- if libs:
- self.end_msg('libs not found in %s' % libs)
- self.fatal('The configuration failed')
- else:
- self.end_msg('libs not found, please provide a --boost-libs argument (see help)')
- self.fatal('The configuration failed')
-
- self.to_log('Found the boost path in %r with the libraries:' % path)
- for x in files:
- self.to_log(' %r' % x)
- return path, files
-
-@conf
-def boost_get_libs(self, *k, **kw):
- '''
- return the lib path and the required libs
- according to the parameters
- '''
- path, files = self.__boost_get_libs_path(**kw)
- t = []
- if kw.get('mt', False):
- t.append('mt')
- if kw.get('abi', None):
- t.append(kw['abi'])
- tags = t and '(-%s)+' % '-'.join(t) or ''
- toolset = self.boost_get_toolset(kw.get('toolset', ''))
- toolset_pat = '(-%s[0-9]{0,3})+' % toolset
- version = '(-%s)+' % self.env.BOOST_VERSION
-
- def find_lib(re_lib, files):
- for file in files:
- if re_lib.search(file.name):
- self.to_log('Found boost lib %s' % file)
- return file
- return None
-
- def format_lib_name(name):
- if name.startswith('lib') and self.env.CC_NAME != 'msvc':
- name = name[3:]
- return name[:name.rfind('.')]
-
- libs = []
- for lib in Utils.to_list(k and k[0] or kw.get('lib', None)):
- py = (lib == 'python') and '(-py%s)+' % kw['python'] or ''
- # Trying libraries, from most strict match to least one
- for pattern in ['boost_%s%s%s%s%s' % (lib, toolset_pat, tags, py, version),
- 'boost_%s%s%s%s' % (lib, tags, py, version),
- 'boost_%s%s%s' % (lib, tags, version),
- # Give up trying to find the right version
- 'boost_%s%s%s%s' % (lib, toolset_pat, tags, py),
- 'boost_%s%s%s' % (lib, tags, py),
- 'boost_%s%s' % (lib, tags)]:
- self.to_log('Trying pattern %s' % pattern)
- file = find_lib(re.compile(pattern), files)
- if file:
- libs.append(format_lib_name(file.name))
- break
- else:
- self.end_msg('lib %s not found in %s' % (lib, path.abspath()))
- self.fatal('The configuration failed')
-
- return path.abspath(), libs
-
-
-@conf
-def check_boost(self, *k, **kw):
- """
- Initialize boost libraries to be used.
-
- Keywords: you can pass the same parameters as with the command line (without "--boost-").
- Note that the command line has the priority, and should preferably be used.
- """
- if not self.env['CXX']:
- self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
-
- params = {'lib': k and k[0] or kw.get('lib', None)}
- for key, value in self.options.__dict__.items():
- if not key.startswith('boost_'):
- continue
- key = key[len('boost_'):]
- params[key] = value and value or kw.get(key, '')
-
- var = kw.get('uselib_store', 'BOOST')
-
- self.start_msg('Checking boost includes')
- self.env['INCLUDES_%s' % var] = inc = self.boost_get_includes(**params)
- versions = self.boost_get_version(inc)
- self.env.BOOST_VERSION = versions[0]
- self.env.BOOST_VERSION_NUMBER = int(versions[1])
- self.end_msg("%d.%d.%d" % (int(versions[1]) / 100000,
- int(versions[1]) / 100 % 1000,
- int(versions[1]) % 100))
- if Logs.verbose:
- Logs.pprint('CYAN', ' path : %s' % self.env['INCLUDES_%s' % var])
-
- if not params['lib']:
- return
- self.start_msg('Checking boost libs')
- suffix = params.get('static', None) and 'ST' or ''
- path, libs = self.boost_get_libs(**params)
- self.env['%sLIBPATH_%s' % (suffix, var)] = [path]
- self.env['%sLIB_%s' % (suffix, var)] = libs
- self.end_msg('ok')
- if Logs.verbose:
- Logs.pprint('CYAN', ' path : %s' % path)
- Logs.pprint('CYAN', ' libs : %s' % libs)
-
-
- def try_link():
- if 'system' in params['lib']:
- self.check_cxx(
- fragment=BOOST_SYSTEM_CODE,
- use=var,
- execute=False,
- )
- if 'thread' in params['lib']:
- self.check_cxx(
- fragment=BOOST_THREAD_CODE,
- use=var,
- execute=False,
- )
-
- if params.get('linkage_autodetect', False):
- self.start_msg("Attempting to detect boost linkage flags")
- toolset = self.boost_get_toolset(kw.get('toolset', ''))
- if toolset in ['vc']:
- # disable auto-linking feature, causing error LNK1181
- # because the code wants to be linked against
- self.env['DEFINES_%s' % var] += ['BOOST_ALL_NO_LIB']
-
- # if no dlls are present, we guess the .lib files are not stubs
- has_dlls = False
- for x in Utils.listdir(path):
- if x.endswith(self.env.cxxshlib_PATTERN % ''):
- has_dlls = True
- break
- if not has_dlls:
- self.env['STLIBPATH_%s' % var] = [path]
- self.env['STLIB_%s' % var] = libs
- del self.env['LIB_%s' % var]
- del self.env['LIBPATH_%s' % var]
-
- # we attempt to play with some known-to-work CXXFLAGS combinations
- for cxxflags in (['/MD', '/EHsc'], []):
- self.env.stash()
- self.env["CXXFLAGS_%s" % var] += cxxflags
- try:
- try_link()
- self.end_msg("ok: winning cxxflags combination: %s" % (self.env["CXXFLAGS_%s" % var]))
- e = None
- break
- except Errors.ConfigurationError as exc:
- self.env.revert()
- e = exc
-
- if e is not None:
- self.end_msg("Could not auto-detect boost linking flags combination, you may report it to boost.py author", ex=e)
- self.fatal('The configuration failed')
- else:
- self.end_msg("Boost linkage flags auto-detection not implemented (needed ?) for this toolchain")
- self.fatal('The configuration failed')
- else:
- self.start_msg('Checking for boost linkage')
- try:
- try_link()
- except Errors.ConfigurationError as e:
- self.end_msg("Could not link against boost libraries using supplied options")
- self.fatal('The configuration failed')
- self.end_msg('ok')
diff --git a/NFD/.waf-tools/compiler-features.py b/NFD/.waf-tools/compiler-features.py
deleted file mode 100644
index 5344939..0000000
--- a/NFD/.waf-tools/compiler-features.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-from waflib.Configure import conf
-
-OVERRIDE = '''
-class Base
-{
- virtual void
- f(int a);
-};
-
-class Derived : public Base
-{
- virtual void
- f(int a) override;
-};
-'''
-
-@conf
-def check_override(self):
- if self.check_cxx(msg='Checking for override specifier',
- fragment=OVERRIDE,
- features='cxx', mandatory=False):
- self.define('HAVE_CXX_OVERRIDE', 1)
-
-def configure(conf):
- conf.check_override()
diff --git a/NFD/.waf-tools/coverage.py b/NFD/.waf-tools/coverage.py
deleted file mode 100644
index 0a3db65..0000000
--- a/NFD/.waf-tools/coverage.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-#
-# Copyright (c) 2014, Regents of the University of California
-#
-# GPL 3.0 license, see the COPYING.md file for more information
-
-from waflib import TaskGen
-
-def options(opt):
- opt.add_option('--with-coverage', action='store_true', default=False, dest='with_coverage',
- help='''Set compiler flags for gcc to enable code coverage information''')
-
-def configure(conf):
- if conf.options.with_coverage:
- conf.check_cxx(cxxflags=['-fprofile-arcs', '-ftest-coverage', '-fPIC'],
- linkflags=['-fprofile-arcs'], uselib_store='GCOV', mandatory=True)
-
-@TaskGen.feature('cxx','cc')
-@TaskGen.after('process_source')
-def add_coverage(self):
- if getattr(self, 'use', ''):
- self.use += ' GCOV'
- else:
- self.use = 'GCOV'
diff --git a/NFD/.waf-tools/default-compiler-flags.py b/NFD/.waf-tools/default-compiler-flags.py
deleted file mode 100644
index 1bb2563..0000000
--- a/NFD/.waf-tools/default-compiler-flags.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-#
-# Copyright (c) 2014, Regents of the University of California
-#
-# GPL 3.0 license, see the COPYING.md file for more information
-
-from waflib import Logs, Configure
-
-def options(opt):
- opt.add_option('--debug', '--with-debug', action='store_true', default=False, dest='debug',
- help='''Compile in debugging mode without optimizations (-O0 or -Og)''')
-
-def configure(conf):
- areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
- defaultFlags = ['-std=c++0x', '-std=c++11',
- '-stdlib=libc++', # clang on OSX < 10.9 by default uses gcc's
- # libstdc++, which is not C++11 compatible
- '-pedantic', '-Wall']
-
- if conf.options.debug:
- conf.define('_DEBUG', 1)
- defaultFlags += ['-O0',
- '-Og', # gcc >= 4.8
- '-g3',
- '-fcolor-diagnostics', # clang
- '-fdiagnostics-color', # gcc >= 4.9
- '-Werror',
- '-Wno-error=maybe-uninitialized', # Bug #1560
- '-Wno-error=unneeded-internal-declaration', # Bug #1588
- '-Wno-error=deprecated-register', # Bug #2288
- ]
- if areCustomCxxflagsPresent:
- missingFlags = [x for x in defaultFlags if x not in conf.env.CXXFLAGS]
- if len(missingFlags) > 0:
- Logs.warn("Selected debug mode, but CXXFLAGS is set to a custom value '%s'"
- % " ".join(conf.env.CXXFLAGS))
- Logs.warn("Default flags '%s' are not activated" % " ".join(missingFlags))
- else:
- conf.add_supported_cxxflags(defaultFlags)
- else:
- defaultFlags += ['-O2', '-g']
- if not areCustomCxxflagsPresent:
- conf.add_supported_cxxflags(defaultFlags)
-
- # clang on OSX < 10.9 by default uses gcc's libstdc++, which is not C++11 compatible
- conf.add_supported_linkflags(['-stdlib=libc++'])
-
-@Configure.conf
-def add_supported_cxxflags(self, cxxflags):
- """
- Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
- """
- self.start_msg('Checking supported CXXFLAGS')
-
- supportedFlags = []
- for flag in cxxflags:
- if self.check_cxx(cxxflags=['-Werror', flag], mandatory=False):
- supportedFlags += [flag]
-
- self.end_msg(' '.join(supportedFlags))
- self.env.CXXFLAGS = supportedFlags + self.env.CXXFLAGS
-
-@Configure.conf
-def add_supported_linkflags(self, linkflags):
- """
- Check which linkflags are supported by compiler and add them to env.LINKFLAGS variable
- """
- self.start_msg('Checking supported LINKFLAGS')
-
- supportedFlags = []
- for flag in linkflags:
- if self.check_cxx(linkflags=['-Werror', flag], mandatory=False):
- supportedFlags += [flag]
-
- self.end_msg(' '.join(supportedFlags))
- self.env.LINKFLAGS = supportedFlags + self.env.LINKFLAGS
diff --git a/NFD/.waf-tools/dependency-checker.py b/NFD/.waf-tools/dependency-checker.py
deleted file mode 100644
index 629fbfd..0000000
--- a/NFD/.waf-tools/dependency-checker.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# encoding: utf-8
-
-from waflib import Options, Logs
-from waflib.Configure import conf
-
-def addDependencyOptions(self, opt, name, extraHelp=''):
- opt.add_option('--with-%s' % name, type='string', default=None,
- dest='with_%s' % name,
- help='Path to %s, e.g., /usr/local %s' % (name, extraHelp))
-setattr(Options.OptionsContext, "addDependencyOptions", addDependencyOptions)
-
-@conf
-def checkDependency(self, name, **kw):
- root = kw.get('path', getattr(Options.options, 'with_%s' % name))
- kw['msg'] = kw.get('msg', 'Checking for %s library' % name)
- kw['uselib_store'] = kw.get('uselib_store', name.upper())
- kw['define_name'] = kw.get('define_name', 'HAVE_%s' % kw['uselib_store'])
- kw['mandatory'] = kw.get('mandatory', True)
-
- if root:
- isOk = self.check_cxx(includes="%s/include" % root,
- libpath="%s/lib" % root,
- **kw)
- else:
- isOk = self.check_cxx(**kw)
-
- if isOk:
- self.env[kw['define_name']] = True
diff --git a/NFD/.waf-tools/doxygen.py b/NFD/.waf-tools/doxygen.py
deleted file mode 100644
index ac8c70b..0000000
--- a/NFD/.waf-tools/doxygen.py
+++ /dev/null
@@ -1,214 +0,0 @@
-#! /usr/bin/env python
-# encoding: UTF-8
-# Thomas Nagy 2008-2010 (ita)
-
-"""
-
-Doxygen support
-
-Variables passed to bld():
-* doxyfile -- the Doxyfile to use
-
-When using this tool, the wscript will look like:
-
- def options(opt):
- opt.load('doxygen')
-
- def configure(conf):
- conf.load('doxygen')
- # check conf.env.DOXYGEN, if it is mandatory
-
- def build(bld):
- if bld.env.DOXYGEN:
- bld(features="doxygen", doxyfile='Doxyfile', ...)
-
- def doxygen(bld):
- if bld.env.DOXYGEN:
- bld(features="doxygen", doxyfile='Doxyfile', ...)
-"""
-
-from fnmatch import fnmatchcase
-import os, os.path, re, stat
-from waflib import Task, Utils, Node, Logs, Errors, Build
-from waflib.TaskGen import feature
-
-DOXY_STR = '"${DOXYGEN}" - '
-DOXY_FMTS = 'html latex man rft xml'.split()
-DOXY_FILE_PATTERNS = '*.' + ' *.'.join('''
-c cc cxx cpp c++ java ii ixx ipp i++ inl h hh hxx hpp h++ idl odl cs php php3
-inc m mm py f90c cc cxx cpp c++ java ii ixx ipp i++ inl h hh hxx
-'''.split())
-
-re_rl = re.compile('\\\\\r*\n', re.MULTILINE)
-re_nl = re.compile('\r*\n', re.M)
-def parse_doxy(txt):
- tbl = {}
- txt = re_rl.sub('', txt)
- lines = re_nl.split(txt)
- for x in lines:
- x = x.strip()
- if not x or x.startswith('#') or x.find('=') < 0:
- continue
- if x.find('+=') >= 0:
- tmp = x.split('+=')
- key = tmp[0].strip()
- if key in tbl:
- tbl[key] += ' ' + '+='.join(tmp[1:]).strip()
- else:
- tbl[key] = '+='.join(tmp[1:]).strip()
- else:
- tmp = x.split('=')
- tbl[tmp[0].strip()] = '='.join(tmp[1:]).strip()
- return tbl
-
-class doxygen(Task.Task):
- vars = ['DOXYGEN', 'DOXYFLAGS']
- color = 'BLUE'
-
- def runnable_status(self):
- '''
- self.pars are populated in runnable_status - because this function is being
- run *before* both self.pars "consumers" - scan() and run()
-
- set output_dir (node) for the output
- '''
-
- for x in self.run_after:
- if not x.hasrun:
- return Task.ASK_LATER
-
- if not getattr(self, 'pars', None):
- txt = self.inputs[0].read()
- self.pars = parse_doxy(txt)
- if not self.pars.get('OUTPUT_DIRECTORY'):
- self.pars['OUTPUT_DIRECTORY'] = self.inputs[0].parent.get_bld().abspath()
-
- # Override with any parameters passed to the task generator
- if getattr(self.generator, 'pars', None):
- for k, v in self.generator.pars.iteritems():
- self.pars[k] = v
-
- self.doxy_inputs = getattr(self, 'doxy_inputs', [])
- if not self.pars.get('INPUT'):
- self.doxy_inputs.append(self.inputs[0].parent)
- else:
- for i in self.pars.get('INPUT').split():
- if os.path.isabs(i):
- node = self.generator.bld.root.find_node(i)
- else:
- node = self.generator.path.find_node(i)
- if not node:
- self.generator.bld.fatal('Could not find the doxygen input %r' % i)
- self.doxy_inputs.append(node)
-
- if not getattr(self, 'output_dir', None):
- bld = self.generator.bld
- # First try to find an absolute path, then find or declare a relative path
- self.output_dir = bld.root.find_dir(self.pars['OUTPUT_DIRECTORY'])
- if not self.output_dir:
- self.output_dir = bld.path.find_or_declare(self.pars['OUTPUT_DIRECTORY'])
-
- self.signature()
- return Task.Task.runnable_status(self)
-
- def scan(self):
- exclude_patterns = self.pars.get('EXCLUDE_PATTERNS','').split()
- file_patterns = self.pars.get('FILE_PATTERNS','').split()
- if not file_patterns:
- file_patterns = DOXY_FILE_PATTERNS
- if self.pars.get('RECURSIVE') == 'YES':
- file_patterns = ["**/%s" % pattern for pattern in file_patterns]
- nodes = []
- names = []
- for node in self.doxy_inputs:
- if os.path.isdir(node.abspath()):
- for m in node.ant_glob(incl=file_patterns, excl=exclude_patterns):
- nodes.append(m)
- else:
- nodes.append(node)
- return (nodes, names)
-
- def run(self):
- dct = self.pars.copy()
- dct['INPUT'] = ' '.join(['"%s"' % x.abspath() for x in self.doxy_inputs])
- code = '\n'.join(['%s = %s' % (x, dct[x]) for x in self.pars])
- code = code.encode() # for python 3
- #fmt = DOXY_STR % (self.inputs[0].parent.abspath())
- cmd = Utils.subst_vars(DOXY_STR, self.env)
- env = self.env.env or None
- proc = Utils.subprocess.Popen(cmd, shell=True, stdin=Utils.subprocess.PIPE, env=env, cwd=self.generator.bld.path.get_bld().abspath())
- proc.communicate(code)
- return proc.returncode
-
- def post_run(self):
- nodes = self.output_dir.ant_glob('**/*', quiet=True)
- for x in nodes:
- x.sig = Utils.h_file(x.abspath())
- self.outputs += nodes
- return Task.Task.post_run(self)
-
-class tar(Task.Task):
- "quick tar creation"
- run_str = '${TAR} ${TAROPTS} ${TGT} ${SRC}'
- color = 'RED'
- after = ['doxygen']
- def runnable_status(self):
- for x in getattr(self, 'input_tasks', []):
- if not x.hasrun:
- return Task.ASK_LATER
-
- if not getattr(self, 'tar_done_adding', None):
- # execute this only once
- self.tar_done_adding = True
- for x in getattr(self, 'input_tasks', []):
- self.set_inputs(x.outputs)
- if not self.inputs:
- return Task.SKIP_ME
- return Task.Task.runnable_status(self)
-
- def __str__(self):
- tgt_str = ' '.join([a.nice_path(self.env) for a in self.outputs])
- return '%s: %s\n' % (self.__class__.__name__, tgt_str)
-
-@feature('doxygen')
-def process_doxy(self):
- if not getattr(self, 'doxyfile', None):
- self.generator.bld.fatal('no doxyfile??')
-
- node = self.doxyfile
- if not isinstance(node, Node.Node):
- node = self.path.find_resource(node)
- if not node:
- raise ValueError('doxygen file not found')
-
- # the task instance
- dsk = self.create_task('doxygen', node)
-
- if getattr(self, 'doxy_tar', None):
- tsk = self.create_task('tar')
- tsk.input_tasks = [dsk]
- tsk.set_outputs(self.path.find_or_declare(self.doxy_tar))
- if self.doxy_tar.endswith('bz2'):
- tsk.env['TAROPTS'] = ['cjf']
- elif self.doxy_tar.endswith('gz'):
- tsk.env['TAROPTS'] = ['czf']
- else:
- tsk.env['TAROPTS'] = ['cf']
-
-def configure(conf):
- '''
- Check if doxygen and tar commands are present in the system
-
- If the commands are present, then conf.env.DOXYGEN and conf.env.TAR
- variables will be set. Detection can be controlled by setting DOXYGEN and
- TAR environmental variables.
- '''
-
- conf.find_program('doxygen', var='DOXYGEN', mandatory=False)
- conf.find_program('tar', var='TAR', mandatory=False)
-
-# doxygen docs
-from waflib.Build import BuildContext
-class doxy(BuildContext):
- cmd = "doxygen"
- fun = "doxygen"
diff --git a/NFD/.waf-tools/pch.py b/NFD/.waf-tools/pch.py
deleted file mode 100644
index 08cc5de..0000000
--- a/NFD/.waf-tools/pch.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# Alexander Afanasyev (UCLA), 2014
-
-"""
-Enable precompiled C++ header support (currently only clang++ and g++ are supported)
-
-To use this tool, wscript should look like:
-
- def options(opt):
- opt.load('pch')
- # This will add `--with-pch` configure option.
- # Unless --with-pch during configure stage specified, the precompiled header support is disabled
-
- def configure(conf):
- conf.load('pch')
- # this will set conf.env.WITH_PCH if --with-pch is specified and the supported compiler is used
- # Unless conf.env.WITH_PCH is set, the precompiled header support is disabled
-
- def build(bld):
- bld(features='cxx pch',
- target='precompiled-headers',
- name='precompiled-headers',
- headers='a.h b.h c.h', # headers to pre-compile into `precompiled-headers`
-
- # Other parameters to compile precompiled headers
- # includes=...,
- # export_includes=...,
- # use=...,
- # ...
-
- # Exported parameters will be propagated even if precompiled headers are disabled
- )
-
- bld(
- target='test',
- features='cxx cxxprogram',
- source='a.cpp b.cpp d.cpp main.cpp',
- use='precompiled-headers',
- )
-
- # or
-
- bld(
- target='test',
- features='pch cxx cxxprogram',
- source='a.cpp b.cpp d.cpp main.cpp',
- headers='a.h b.h c.h',
- )
-
-Note that precompiled header must have multiple inclusion guards. If the guards are missing, any benefit of precompiled header will be voided and compilation may fail in some cases.
-"""
-
-import os
-from waflib import Task, TaskGen, Logs, Utils
-from waflib.Tools import c_preproc, cxx
-
-
-PCH_COMPILER_OPTIONS = {
- 'clang++': [['-include'], '.pch', ['-x', 'c++-header']],
- 'g++': [['-include'], '.gch', ['-x', 'c++-header']],
-}
-
-
-def options(opt):
- opt.add_option('--without-pch', action='store_false', default=True, dest='with_pch', help='''Try to use precompiled header to speed up compilation (only g++ and clang++)''')
-
-def configure(conf):
- if (conf.options.with_pch and conf.env['COMPILER_CXX'] in PCH_COMPILER_OPTIONS.keys()):
- conf.env.WITH_PCH = True
- flags = PCH_COMPILER_OPTIONS[conf.env['COMPILER_CXX']]
- conf.env.CXXPCH_F = flags[0]
- conf.env.CXXPCH_EXT = flags[1]
- conf.env.CXXPCH_FLAGS = flags[2]
-
-
-@TaskGen.feature('pch')
-@TaskGen.before('process_source')
-def apply_pch(self):
- if not self.env.WITH_PCH:
- return
-
- if getattr(self.bld, 'pch_tasks', None) is None:
- self.bld.pch_tasks = {}
-
- if getattr(self, 'headers', None) is None:
- return
-
- self.headers = self.to_nodes(self.headers)
-
- if getattr(self, 'name', None):
- try:
- task = self.bld.pch_tasks[self.name]
- self.bld.fatal("Duplicated 'pch' task with name %r" % self.name)
- except KeyError:
- pass
-
- out = '%s.%d%s' % (self.target, self.idx, self.env['CXXPCH_EXT'])
- out = self.path.find_or_declare(out)
- task = self.create_task('gchx', self.headers, out)
-
- # target should be an absolute path of `out`, but without precompiled header extension
- task.target = out.abspath()[:-len(out.suffix())]
-
- self.pch_task = task
- if getattr(self, 'name', None):
- self.bld.pch_tasks[self.name] = task
-
-@TaskGen.feature('cxx')
-@TaskGen.after_method('process_source', 'propagate_uselib_vars')
-def add_pch(self):
- if not (self.env['WITH_PCH'] and getattr(self, 'use', None) and getattr(self, 'compiled_tasks', None) and getattr(self.bld, 'pch_tasks', None)):
- return
-
- pch = None
- # find pch task, if any
-
- if getattr(self, 'pch_task', None):
- pch = self.pch_task
- else:
- for use in Utils.to_list(self.use):
- try:
- pch = self.bld.pch_tasks[use]
- except KeyError:
- pass
-
- if pch:
- for x in self.compiled_tasks:
- x.env.append_value('CXXFLAGS', self.env['CXXPCH_F'] + [pch.target])
-
-class gchx(Task.Task):
- run_str = '${CXX} ${ARCH_ST:ARCH} ${CXXFLAGS} ${CPPFLAGS} ${CXXPCH_FLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXXPCH_F:SRC} ${CXX_SRC_F}${SRC[0].abspath()} ${CXX_TGT_F}${TGT[0].abspath()}'
- scan = c_preproc.scan
- color = 'BLUE'
- ext_out=['.h']
-
- def runnable_status(self):
- try:
- node_deps = self.generator.bld.node_deps[self.uid()]
- except KeyError:
- node_deps = []
- ret = Task.Task.runnable_status(self)
- if ret == Task.SKIP_ME and self.env.CXX_NAME == 'clang':
- t = os.stat(self.outputs[0].abspath()).st_mtime
- for n in self.inputs + node_deps:
- if os.stat(n.abspath()).st_mtime > t:
- return Task.RUN_ME
- return ret
diff --git a/NFD/.waf-tools/sphinx_build.py b/NFD/.waf-tools/sphinx_build.py
deleted file mode 100644
index e61da6e..0000000
--- a/NFD/.waf-tools/sphinx_build.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env python
-# encoding: utf-8
-
-# inspired by code by Hans-Martin von Gaudecker, 2012
-
-import os
-from waflib import Node, Task, TaskGen, Errors, Logs, Build, Utils
-
-class sphinx_build(Task.Task):
- color = 'BLUE'
- run_str = '${SPHINX_BUILD} -D ${VERSION} -D ${RELEASE} -q -b ${BUILDERNAME} -d ${DOCTREEDIR} ${SRCDIR} ${OUTDIR}'
-
- def __str__(self):
- env = self.env
- src_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.inputs])
- tgt_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.outputs])
- if self.outputs: sep = ' -> '
- else: sep = ''
- return'%s [%s]: %s%s%s\n'%(self.__class__.__name__.replace('_task',''),
- self.env['BUILDERNAME'], src_str, sep, tgt_str)
-
-@TaskGen.extension('.py', '.rst')
-def sig_hook(self, node):
- node.sig=Utils.h_file(node.abspath())
-
-@TaskGen.feature("sphinx")
-@TaskGen.before_method("process_source")
-def apply_sphinx(self):
- """Set up the task generator with a Sphinx instance and create a task."""
-
- inputs = []
- for i in Utils.to_list(self.source):
- if not isinstance(i, Node.Node):
- node = self.path.find_node(node)
- else:
- node = i
- if not node:
- raise ValueError('[%s] file not found' % i)
- inputs.append(node)
-
- task = self.create_task('sphinx_build', inputs)
-
- conf = self.path.find_node(self.config)
- task.inputs.append(conf)
-
- confdir = conf.parent.abspath()
- buildername = getattr(self, "builder", "html")
- srcdir = getattr(self, "srcdir", confdir)
- outdir = self.path.find_or_declare(getattr(self, "outdir", buildername)).get_bld()
- doctreedir = getattr(self, "doctreedir", os.path.join(outdir.abspath(), ".doctrees"))
-
- task.env['BUILDERNAME'] = buildername
- task.env['SRCDIR'] = srcdir
- task.env['DOCTREEDIR'] = doctreedir
- task.env['OUTDIR'] = outdir.abspath()
- task.env['VERSION'] = "version=%s" % self.VERSION
- task.env['RELEASE'] = "release=%s" % self.VERSION
-
- import imp
- confData = imp.load_source('sphinx_conf', conf.abspath())
-
- if buildername == "man":
- for i in confData.man_pages:
- target = outdir.find_or_declare('%s.%d' % (i[1], i[4]))
- task.outputs.append(target)
-
- if self.install_path:
- self.bld.install_files("%s/man%d/" % (self.install_path, i[4]), target)
- else:
- task.outputs.append(outdir)
-
-def configure(conf):
- conf.find_program('sphinx-build', var='SPHINX_BUILD', mandatory=False)
-
-# sphinx docs
-from waflib.Build import BuildContext
-class sphinx(BuildContext):
- cmd = "sphinx"
- fun = "sphinx"
diff --git a/NFD/.waf-tools/type_traits.py b/NFD/.waf-tools/type_traits.py
deleted file mode 100644
index 07eb129..0000000
--- a/NFD/.waf-tools/type_traits.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-#
-# Copyright (c) 2014, Regents of the University of California
-#
-# GPL 3.0 license, see the COPYING.md file for more information
-
-from waflib import Configure
-
-IS_DEFAULT_CONSTRUCTIBLE_CHECK = '''
-#include <type_traits>
-static_assert(std::is_default_constructible<int>::value, "");
-'''
-
-IS_MOVE_CONSTRUCTIBLE_CHECK = '''
-#include <type_traits>
-static_assert(std::is_move_constructible<int>::value, "");
-'''
-
-def configure(conf):
- if conf.check_cxx(msg='Checking for std::is_default_constructible',
- fragment=IS_DEFAULT_CONSTRUCTIBLE_CHECK,
- features='cxx', mandatory=False):
- conf.define('HAVE_IS_DEFAULT_CONSTRUCTIBLE', 1)
- conf.env['HAVE_IS_DEFAULT_CONSTRUCTIBLE'] = True
-
- if conf.check_cxx(msg='Checking for std::is_move_constructible',
- fragment=IS_MOVE_CONSTRUCTIBLE_CHECK,
- features='cxx', mandatory=False):
- conf.define('HAVE_IS_MOVE_CONSTRUCTIBLE', 1)
- conf.env['HAVE_IS_MOVE_CONSTRUCTIBLE'] = True
diff --git a/NFD/.waf-tools/unix-socket.py b/NFD/.waf-tools/unix-socket.py
deleted file mode 100644
index 52e038a..0000000
--- a/NFD/.waf-tools/unix-socket.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-#
-# Copyright (c) 2014, Regents of the University of California
-#
-# GPL 3.0 license, see the COPYING.md file for more information
-
-from waflib import Options
-
-BOOST_ASIO_HAS_LOCAL_SOCKETS_CHECK = '''
-#include <boost/asio.hpp>
-#ifndef BOOST_ASIO_HAS_LOCAL_SOCKETS
-#error "Unix sockets are not available on this platform"
-#endif
-'''
-
-def addUnixOptions(self, opt):
- opt.add_option('--force-unix-socket', action='store_true', default=False,
- dest='force_unix_socket', help='''Forcefully enable Unix sockets support''')
-setattr(Options.OptionsContext, "addUnixOptions", addUnixOptions)
-
-def configure(conf):
- def boost_asio_has_local_sockets():
- return conf.check_cxx(msg='Checking if Unix sockets are supported',
- fragment=BOOST_ASIO_HAS_LOCAL_SOCKETS_CHECK,
- features='cxx', use='BOOST', mandatory=False)
-
- if conf.options.force_unix_socket or boost_asio_has_local_sockets():
- conf.define('HAVE_UNIX_SOCKETS', 1)
- conf.env['HAVE_UNIX_SOCKETS'] = True
diff --git a/NFD/.waf-tools/websocket.py b/NFD/.waf-tools/websocket.py
deleted file mode 100644
index f8d2e33..0000000
--- a/NFD/.waf-tools/websocket.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# encoding: utf-8
-
-from waflib import Options, Logs, Errors
-from waflib.Configure import conf
-
-import re
-
-def addWebsocketOptions(self, opt):
- opt.add_option('--without-websocket', action='store_false', default=True,
- dest='with_websocket',
- help='Disable WebSocket face support')
-setattr(Options.OptionsContext, "addWebsocketOptions", addWebsocketOptions)
-
-@conf
-def checkWebsocket(self, **kw):
- if not self.options.with_websocket:
- return
-
- isMandatory = kw.get('mandatory', True)
-
- self.start_msg('Checking for WebSocket includes')
-
- try:
- websocketDir = self.path.find_dir('websocketpp/websocketpp')
- if not websocketDir:
- raise Errors.WafError('Not found')
-
- versionFile = websocketDir.find_node('version.hpp')
- if not websocketDir:
- raise Errors.WafError('Corrupted: WebSocket version file not found')
-
- try:
- txt = versionFile.read()
- except (OSError, IOError):
- raise Errors.WafError('Corrupted: cannot read WebSocket version file')
-
- # Looking for the following:
- # static int const major_version = 0;
- # static int const minor_version = 3;
- # static int const patch_version = 0;
-
- version = [None, None, None]
-
- majorVersion = re.compile('^static int const major_version = (\\d+);$', re.M)
- version[0] = majorVersion.search(txt)
-
- minorVersion = re.compile('^static int const minor_version = (\\d+);$', re.M)
- version[1] = minorVersion.search(txt)
-
- patchVersion = re.compile('^static int const patch_version = (\\d+);$', re.M)
- version[2] = patchVersion.search(txt)
-
- if not version[0] or not version[1] or not version[2]:
- raise Errors.WafError('Corrupted: cannot detect websocket version')
-
- self.env['WEBSOCKET_VERSION'] = [i.group(1) for i in version]
-
- # todo: version checking, if necessary
-
- self.end_msg('.'.join(self.env['WEBSOCKET_VERSION']))
-
- self.env['INCLUDES_WEBSOCKET'] = websocketDir.parent.abspath()
- self.env['HAVE_WEBSOCKET'] = True
- self.define('HAVE_WEBSOCKET', 1)
- self.define('_WEBSOCKETPP_CPP11_STL_', 1)
-
- except Errors.WafError as error:
- if isMandatory:
- self.end_msg(str(error), color='RED')
- Logs.warn('If you are using git NFD repository, checkout websocketpp submodule: ')
- Logs.warn(' git submodule init && git submodule update')
- Logs.warn('Otherwise, manually download and extract websocketpp library:')
- Logs.warn(' mkdir websocketpp')
- Logs.warn(' curl -L https://github.com/zaphoyd/websocketpp/tarball/4309749dd98937b8a7be5dc0bfe679ba201c5512 > websocket.tar.gz')
- Logs.warn(' tar zxf websocket.tar.gz -C websocketpp/ --strip 1')
- Logs.warn('Alternatively, WebSocket support can be disabled with --without-websocket')
- self.fatal("The configuration failed")
- else:
- self.end_msg(str(error))
diff --git a/NFD/INSTALL.md b/NFD/INSTALL.md
deleted file mode 100644
index 7ea2ce3..0000000
--- a/NFD/INSTALL.md
+++ /dev/null
@@ -1,5 +0,0 @@
-NFD Installation Instructions
-=============================
-
-See [`docs/INSTALL.rst`](https://github.com/named-data/NFD/blob/master/docs/INSTALL.rst)
-for detailed NFD installation instructions.
diff --git a/NFD/README-dev.md b/NFD/README-dev.md
deleted file mode 100644
index 17af2ee..0000000
--- a/NFD/README-dev.md
+++ /dev/null
@@ -1,98 +0,0 @@
-Notes for NFD developers
-========================
-
-Requirements
-------------
-
-Include the following license boilerplate into all `.hpp` and `.cpp` files:
-
- /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
- /**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- ////// [optional part] //////
- *
- * \author Author's Name <email@domain>
- * \author Other Author's Name <another.email@domain>
- ////// [end of optional part] //////
- */
-
-Recommendations
----------------
-
-NFD code is subject to NFD [code style](http://redmine.named-data.net/projects/nfd/wiki/CodeStyle).
-
-
-Running unit-tests
-------------------
-
-To run unit tests, NFD needs to be configured and build with unit test support:
-
- ./waf configure --with-tests
- ./waf
-
-The simplest way to run tests, is just to run the compiled binary without any parameters:
-
- # Run core tests
- ./build/unit-tests-core
-
- # Run NFD daemon tests
- ./build/unit-tests-daemon
-
- # Run NFD RIB management tests
- ./build/unit-tests-rib
-
-However, [Boost.Test framework](http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/)
-is very flexible and allows a number of run-time customization of what tests should be run.
-For example, it is possible to choose to run only a specific test suite, only a specific
-test case within a suite, or specific test cases within specific test suites:
-
- # Run only TCP Face test suite of NFD daemon tests (see tests/daemon/face/tcp.cpp)
- ./build/unit-tests-daemon -t FaceTcp
-
- # Run only test case EndToEnd4 from the same test suite
- ./build/unit-tests-daemon -t FaceTcp/EndToEnd4
-
- # Run Basic test case from all core test suites
- ./build/unit-tests-core -t */Basic
-
-By default, Boost.Test framework will produce verbose output only when a test case fails.
-If it is desired to see verbose output (result of each test assertion), add `-l all`
-option to `./build/unit-tests` command. To see test progress, you can use `-l test_suite`
-or `-p` to show progress bar:
-
- # Show report all log messages including the passed test notification
- ./build/unit-tests-daemon -l all
-
- # Show test suite messages
- ./build/unit-tests-daemon -l test_suite
-
- # Show nothing
- ./build/unit-tests-daemon -l nothing
-
- # Show progress bar
- ./build/unit-tests-core -p
-
-There are many more command line options available, information about
-which can be obtained either from the command line using `--help`
-switch, or online on [Boost.Test library](http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/)
-website.
diff --git a/NFD/README.md b/NFD/README.md
deleted file mode 100644
index 455be28..0000000
--- a/NFD/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-NFD - Named Data Networking Forwarding Daemon
-=============================================
-
-For complete documentation, including step-by-step installation instructions and
-tutorials, please visit the [NFD homepage](http://named-data.net/doc/NFD/).
-
-## Overview
-
-NFD is a network forwarder that implements and evolves together with the Named Data
-Networking (NDN) [protocol](http://named-data.net/doc/ndn-tlv/). After the initial
-release, NFD will become a core component of the
-[NDN Platform](http://named-data.net/codebase/platform/) and will follow the same release
-cycle.
-
-NFD is an open and free software package licensed under GPL 3.0 license and is the
-centerpiece of our committement to making NDN's core technology open and free to all
-Internet users and developers. For more information about the licensing details and
-limitation, refer to
-[`COPYING.md`](https://github.com/named-data/NFD/blob/master/COPYING.md).
-
-NFD is developed by a community effort. Although the first release was mostly done by the
-members of [NSF-sponsored NDN project team](http://named-data.net/project/participants/),
-it already contains significant contributions from people outside the project team (for
-more details, refer to
-[`AUTHORS.md`](https://github.com/named-data/NFD/blob/master/AUTHORS.md)). We strongly
-encourage participation from all interested parties, since broader community support is
-key for NDN to succeed as a new Internet architecture. Bug reports and feedback are
-highly appreciated and can be made through
-[Redmine site](http://redmine.named-data.net/projects/nfd) and the
-[ndn-interest mailing list](http://www.lists.cs.ucla.edu/mailman/listinfo/ndn-interest).
-
-The main design goal of NFD is to support diverse experimentation of NDN technology. The
-design emphasizes *modularity* and *extensibility* to allow easy experiments with new
-protocol features, algorithms, new applications. We have not fully optimized the code for
-performance. The intention is that performance optimizations are one type of experiments
-that developers can conduct by trying out different data structures and different
-algorithms; over time, better implementations may emerge within the same design framework.
-
-NFD will keep evolving in three aspects: improvement of the modularity framework, keeping
-up with the NDN protocol spec, and addition of other new features. We hope to keep the
-modular framework stable and lean, allowing researchers to implement and experiment with
-various features, some of which may eventually work into the protocol spec.
diff --git a/NFD/contrib/osx-launchd/README.md b/NFD/contrib/osx-launchd/README.md
deleted file mode 100644
index 68d3b9b..0000000
--- a/NFD/contrib/osx-launchd/README.md
+++ /dev/null
@@ -1,138 +0,0 @@
-Starting NFD on OSX >= 10.8
-===========================
-
-OSX provides a standard way to start system daemons, monitor their health, and restart
-when they die.
-
-Initial setup
--------------
-
-Edit `net.named-data.nfd` and `net.named-data.nrd` correcting paths for `nfd` and `nfd`
-binaries, configuration file, and log files.
-
- # Copy launchd.plist for nfd (forwarding daemon)
- sudo cp net.named-data.nfd.plist /Library/LaunchDaemons/
- sudo chown root /Library/LaunchDaemons/net.named-data.nfd.plist
-
- # Copy launchd.plist for nrd (RIB management daemon)
- sudo cp net.named-data.nrd.plist /Library/LaunchDaemons/
- sudo chown root /Library/LaunchDaemons/net.named-data.nrd.plist
-
-### Assumptions in the default scripts
-
-* `nfd` and `nrd` are installed into `/usr/local/bin`
-* Configuration file is `/usr/local/etc/ndn/nfd.conf`
-* `nfd` will be run as root
-* `nrd` will be run as user `ndn` and group `ndn`
-* Log files will be written to `/usr/local/var/log/ndn` folder, which is owned by user `ndn`
-
-### Creating users
-
-If `ndn` user does not exists, it needs to be manually created (procedure copied from
-[macports script](https://trac.macports.org/browser/trunk/base/src/port1.0/portutil.tcl)).
-Update uid/gid if 6363 is already used.
-
- # Create user `ndn`
- sudo dscl . -create /Users/ndn UniqueID 6363
-
- # These are implicitly added on Mac OSX Lion. AuthenticationAuthority
- # causes the user to be visible in the Users & Groups Preference Pane,
- # and the others are just noise, so delete them.
- # https://trac.macports.org/ticket/30168
- sudo dscl . -delete /Users/ndn AuthenticationAuthority
- sudo dscl . -delete /Users/ndn PasswordPolicyOptions
- sudo dscl . -delete /Users/ndn dsAttrTypeNative:KerberosKeys
- sudo dscl . -delete /Users/ndn dsAttrTypeNative:ShadowHashData
-
- sudo dscl . -create /Users/ndn RealName "NDN User"
- sudo dscl . -create /Users/ndn Password "{*}"
- sudo dscl . -create /Users/ndn PrimaryGroupID 6363
- sudo dscl . -create /Users/ndn NFSHomeDirectory /var/empty
- sudo dscl . -create /Users/ndn UserShell /usr/bin/false
-
- # Create group `ndn`
- sudo dscl . -create /Groupsndn Password "{*}"
- sudo dscl . -create /Groups/ndn RealName "NDN User"
- sudo dscl . -create /Groups/ndn PrimaryGroupID 6363
-
-### Creating folders
-
-Folder `/usr/local/var/log/ndn` should be created and assigned proper user and group:
-
- sudo mkdir -p /usr/local/var/log/ndn
- sudo chown -R ndn:ndn /usr/local/var/log/ndn
-
-`HOME` directories for `nfd` and `nrd` should be created and configured with correct
-library's config file and contain proper NDN security credentials for signing Data
-packets. This is necessary since default private key storage on OSX (`osx-keychain`) does
-not support non-interactive access, and file-based private key storage needs to be used:
-
- # Generate self-signed NDN certificate for nfd (owned by root)
- sudo mkdir -p /usr/local/var/lib/ndn/nfd/.ndn
- sudo sh -c 'echo tpm=file > /usr/local/var/lib/ndn/nfd/.ndn/client.conf'
- sudo HOME=/usr/local/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \
- sudo HOME=/usr/local/var/lib/ndn/nfd ndnsec-install-cert -
-
- # Generate self-signed NDN certificate for nrd (owned by ndn)
- sudo mkdir -p /usr/local/var/lib/ndn/nrd/.ndn
- sudo chown -R ndn:ndn /usr/local/var/lib/ndn/nrd
- sudo -u ndn -g ndn sh -c 'echo tpm=file > /usr/local/var/lib/ndn/nrd/.ndn/client.conf'
- sudo -u ndn -g ndn HOME=/usr/local/var/lib/ndn/nrd ndnsec-keygen /localhost/daemons/nrd | \
- sudo -u ndn -g ndn HOME=/usr/local/var/lib/ndn/nrd ndnsec-install-cert -
-
-### Configuring NFD's security
-
-NFD sample configuration allows anybody to create faces, add nexthops to FIB,
-and set strategy choice for namespaces. While such settings could be a good start, it is
-generally not a good idea to run NFD in this mode.
-
-While thorough discussion about security configuration of NFD is outside the scope of this
-document, at least the following change should be done to nfd.conf in authorize section:
-
- authorizations
- {
- authorize
- {
- certfile certs/localhost_daemons_nrd.ndncert
- privileges
- {
- faces
- fib
- strategy-choice
- }
- }
-
- authorize
- {
- certfile any
- privileges
- {
- faces
- strategy-choice
- }
- }
- }
-
-While this configuration still allows management of faces and updating strategy choice by
-anybody, only NFD's RIB Manager Daemon (`nrd`) is allowed to manage FIB.
-
-As the final step to make this configuration work, nrd's self-signed certificate needs to
-be exported into `localhost_daemons_nrd.ndncert` file:
-
- sudo mkdir /usr/local/etc/ndn/certs
- sudo sh -c 'sudo -u ndn -g ndn HOME=/usr/local/var/lib/ndn/nrd \
- ndnsec-dump-certificate -i /localhost/daemons/nrd \
- > /usr/local/etc/ndn/certs/localhost_daemons_nrd.ndncert'
-
-
-Enable auto-start
------------------
-
- sudo launchctl load -w /Library/LaunchDaemons/net.named-data.nfd.plist
- sudo launchctl load -w /Library/LaunchDaemons/net.named-data.nrd.plist
-
-Disable auto-start
-------------------
-
- sudo launchctl unload -w /Library/LaunchDaemons/net.named-data.nfd.plist
- sudo launchctl unload -w /Library/LaunchDaemons/net.named-data.nrd.plist
diff --git a/NFD/contrib/osx-launchd/net.named-data.nfd.plist b/NFD/contrib/osx-launchd/net.named-data.nfd.plist
deleted file mode 100644
index a8da970..0000000
--- a/NFD/contrib/osx-launchd/net.named-data.nfd.plist
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
-<plist version='1.0'>
-<dict>
-<key>Label</key><string>net.named-data.nfd</string>
-<key>ProgramArguments</key>
-<array>
- <string>/usr/local/bin/nfd</string>
- <string>--config</string>
- <string>/usr/local/etc/ndn/nfd.conf</string>
-</array>
-<key>EnvironmentVariables</key>
-<dict>
- <key>HOME</key><string>/usr/local/var/lib/ndn/nfd</string>
-</dict>
-<key>Debug</key><true/>
-<key>Disabled</key><true/>
-<key>KeepAlive</key><true/>
-<key>StandardErrorPath</key><string>/usr/local/var/log/ndn/nfd.log</string>
-<key>ProcessType</key><string>Background</string>
-</dict>
-</plist>
diff --git a/NFD/contrib/osx-launchd/net.named-data.nrd.plist b/NFD/contrib/osx-launchd/net.named-data.nrd.plist
deleted file mode 100644
index 3cd7aaa..0000000
--- a/NFD/contrib/osx-launchd/net.named-data.nrd.plist
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
-"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
-<plist version='1.0'>
-<dict>
-<key>Label</key><string>net.named-data.nrd</string>
-<key>ProgramArguments</key>
-<array>
- <string>/usr/local/bin/nrd</string>
- <string>--config</string>
- <string>/usr/local/etc/ndn/nfd.conf</string>
-</array>
-<key>UserName</key><string>ndn</string>
-<key>GroupName</key><string>ndn</string>
-<key>EnvironmentVariables</key>
-<dict>
- <key>HOME</key><string>/usr/local/var/lib/ndn/nrd</string>
-</dict>
-<key>Debug</key><true/>
-<key>Disabled</key><true/>
-<key>KeepAlive</key><true/>
-<key>StandardErrorPath</key><string>/usr/local/var/log/ndn/nrd.log</string>
-<key>ProcessType</key><string>Background</string>
-</dict>
-</plist>
diff --git a/NFD/contrib/upstart/README.md b/NFD/contrib/upstart/README.md
deleted file mode 100644
index 760e8a8..0000000
--- a/NFD/contrib/upstart/README.md
+++ /dev/null
@@ -1,144 +0,0 @@
-Starting NFD on Linux with upstart
-==================================
-
-Some Linux distributions, such as Ubuntu, use [upstart](http://upstart.ubuntu.com/) as a
-standard mechanism to start system daemons, monitor their health, and restart
-when they die.
-
-Initial setup
--------------
-
-Edit `nfd.conf` and `nrd.conf` correcting paths for `nfd` and `nfd` binaries,
-configuration file, and log files.
-
- # Copy upstart config file for nfd (forwarding daemon)
- sudo cp nfd.conf /etc/init/
-
- # Copy upstart config file for nrd (RIB management daemon)
- sudo cp nrd.conf /etc/init/
-
- # Copy upstart config file for nfd-watcher (will restart NFD when network change detected)
- sudo cp nfd-watcher.conf /etc/init/
-
-### Assumptions in the default scripts
-
-* `nfd` and `nrd` are installed into `/usr/local/bin`
-* Configuration file is `/usr/local/etc/ndn/nfd.conf`
-* `nfd` will be run as root
-* `nrd` will be run as user `ndn` and group `ndn`
-* Log files will be written to `/usr/local/var/log/ndn` folder, which is owned by user `ndn`
-* Whenever network connectivity changes, both `nfd` and `nrd` are restarted
-
-### Creating users
-
-If `ndn` user and group does not exists, they need to be manually created.
-
- # Create group `ndn`
- addgroup --system ndn
-
- # Create user `ndn`
- sudo adduser --system \
- --disabled-login \
- --ingroup ndn \
- --home /nonexistent \
- --gecos "NDN User" \
- --shell /bin/false \
- ndn
-
-
-### Creating folders
-
-Folder `/usr/local/var/log/ndn` should be created and assigned proper user and group:
-
- sudo mkdir -p /usr/local/var/log/ndn
- sudo chown -R ndn:ndn /usr/local/var/log/ndn
-
-`HOME` directories for `nfd` and `nrd` should be created prior to starting. This is
-necessary to manage unique security credentials for the deamons.
-
- # Create HOME and generate self-signed NDN certificate for nfd
- sudo mkdir -p /usr/local/var/lib/ndn/nfd/.ndn
- sudo HOME=/usr/local/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \
- sudo HOME=/usr/local/var/lib/ndn/nfd ndnsec-install-cert -
-
- # Create HOME and generate self-signed NDN certificate for nrd
- sudo mkdir -p /usr/local/var/lib/ndn/nrd/.ndn
- sudo chown -R ndn:ndn /usr/local/var/lib/ndn/nrd
- sudo -u ndn -g ndn HOME=/usr/local/var/lib/ndn/nrd ndnsec-keygen /localhost/daemons/nrd | \
- sudo -u ndn -g ndn HOME=/usr/local/var/lib/ndn/nrd ndnsec-install-cert -
-
-### Configuring NFD's security
-
-NFD sample configuration allows anybody to create faces, add nexthops to FIB, and set
-strategy choice for namespaces. While such settings could be a good start, it is
-generally not a good idea to run NFD in this mode.
-
-While thorough discussion about security configuration of NFD is outside the scope of this
-document, at least the following change should be done to ``nfd.conf`` in authorize
-section:
-
- authorizations
- {
- authorize
- {
- certfile certs/localhost_daemons_nrd.ndncert
- privileges
- {
- faces
- fib
- strategy-choice
- }
- }
-
- authorize
- {
- certfile any
- privileges
- {
- faces
- strategy-choice
- }
- }
- }
-
-While this configuration still allows management of faces and updating strategy choice by
-anybody, only NFD's RIB Manager Daemon (`nrd`) is allowed to manage FIB.
-
-As the final step to make this configuration work, nrd's self-signed certificate needs to
-be exported into `localhost_daemons_nrd.ndncert` file:
-
- sudo mkdir /usr/local/etc/ndn/certs
- sudo sh -c 'sudo -u ndn -g ndn HOME=/usr/local/var/lib/ndn/nrd \
- ndnsec-dump-certificate -i /localhost/daemons/nrd \
- > /usr/local/etc/ndn/certs/localhost_daemons_nrd.ndncert'
-
-
-Enable auto-start
------------------
-
-After copying the provided upstart scripts, `nfd` and `nrd` daemons will automatically run
-after the reboot. To manually start them, use the following commands:
-
- sudo start nfd
- # nrd will be automatically started by upstart
-
-Note that an additional upstart job, ``nfd-watcher``, will automatically monitor for
-network connectivity changes, such as when network interface gets connected, disconnected,
-or IP addresses of the network interface get updated. When ``nfd-watcher`` detects the
-event, it will restart `nfd` and `nrd`.
-
-Disable auto-start
-------------------
-
-To stop `nrd` and `nfd` daemon, use the following commands:
-
- sudo stop nfd
- # nrd will be automatically stopped by upstart
-
-Note that as long as upstart files are present in `/etc/init/`, the daemons will
-automatically start after the reboot. To permanently stop `nfd` and `nrd` daemons, delete
-the upstart files:
-
- sudo rm /etc/init/nfd.conf
- sudo rm /etc/init/nrd.conf
- sudo rm /etc/init/nfd-watcher.conf
diff --git a/NFD/contrib/upstart/nfd-watcher.conf b/NFD/contrib/upstart/nfd-watcher.conf
deleted file mode 100644
index 392af52..0000000
--- a/NFD/contrib/upstart/nfd-watcher.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# nfd-watcher.conf
-#
-# Restarting NDN Forwarding Daemon on network connectivity changes
-
-start on (net-device-up or
- net-device-removed or
- net-device-changed)
-task
-
-script
- status nfd | grep -q start/ || stop
- restart nfd
-end script
diff --git a/NFD/contrib/upstart/nfd.conf b/NFD/contrib/upstart/nfd.conf
deleted file mode 100644
index 97179a2..0000000
--- a/NFD/contrib/upstart/nfd.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# nfd.conf
-#
-# NDN Forwarding Daemon
-
-description "NDN forwarding daemon"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-stop on runlevel [!2345]
-
-respawn
-respawn limit unlimited
-
-env HOME=/usr/local/var/lib/ndn/nfd
-export HOME
-
-exec /usr/local/bin/nfd --config /usr/local/etc/ndn/nfd.conf 2>> /usr/local/var/log/ndn/nfd.log
-post-stop exec sleep 2
diff --git a/NFD/contrib/upstart/nrd.conf b/NFD/contrib/upstart/nrd.conf
deleted file mode 100644
index 574b81c..0000000
--- a/NFD/contrib/upstart/nrd.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-# nrd.conf
-#
-# NDN RIB Manager Daemon
-
-description "NDN RIB Manager Daemon"
-
-start on started nfd
-stop on stopping nfd
-
-respawn
-respawn limit unlimited
-
-setuid ndn
-setgid ndn
-
-pre-start exec sleep 2
-script
- export HOME=/usr/local/var/lib/ndn/nrd
- /usr/local/bin/nrd --config /usr/local/etc/ndn/nfd.conf 2>> /usr/local/var/log/ndn/nrd.log
-end script
-
-post-stop exec sleep 2
diff --git a/NFD/core/network-interface.cpp b/NFD/core/network-interface.cpp
deleted file mode 100644
index 1aad63e..0000000
--- a/NFD/core/network-interface.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "network-interface.hpp"
-#include "core/logger.hpp"
-
-#include <cerrno>
-#include <cstring>
-#include <type_traits>
-#include <unordered_map>
-
-#include <arpa/inet.h> // for inet_ntop()
-#include <netinet/in.h> // for struct sockaddr_in{,6}
-#include <ifaddrs.h> // for getifaddrs()
-
-#if defined(__linux__)
-#include <net/if_arp.h> // for ARPHRD_* constants
-#include <netpacket/packet.h> // for struct sockaddr_ll
-#elif defined(__APPLE__) || defined(__FreeBSD__)
-#include <net/if_dl.h> // for struct sockaddr_dl
-#include <net/if_types.h> // for IFT_* constants
-#endif
-
-NFD_LOG_INIT("NetworkInterfaceInfo");
-
-namespace nfd {
-
-static_assert(std::is_standard_layout<NetworkInterfaceInfo>::value,
- "NetworkInterfaceInfo must be a standard layout type");
-#ifdef HAVE_IS_DEFAULT_CONSTRUCTIBLE
-static_assert(std::is_default_constructible<NetworkInterfaceInfo>::value,
- "NetworkInterfaceInfo must provide a default constructor");
-#endif
-
-#ifdef WITH_TESTS
-static shared_ptr<std::vector<NetworkInterfaceInfo>> s_debugNetworkInterfaces = nullptr;
-
-void
-setDebugNetworkInterfaces(shared_ptr<std::vector<NetworkInterfaceInfo>> interfaces)
-{
- s_debugNetworkInterfaces = interfaces;
-}
-#endif
-
-std::vector<NetworkInterfaceInfo>
-listNetworkInterfaces()
-{
-#ifdef WITH_TESTS
- if (s_debugNetworkInterfaces != nullptr) {
- return *s_debugNetworkInterfaces;
- }
-#endif
-
- using namespace boost::asio::ip;
- using std::strerror;
-
- std::unordered_map<std::string, NetworkInterfaceInfo> ifmap;
- ifaddrs* ifa_list = nullptr;
-
- if (::getifaddrs(&ifa_list) < 0)
- throw std::runtime_error(std::string("getifaddrs() failed: ") + strerror(errno));
-
- for (ifaddrs* ifa = ifa_list; ifa != nullptr; ifa = ifa->ifa_next) {
- std::string ifname(ifa->ifa_name);
- NetworkInterfaceInfo& netif = ifmap[ifname];
- netif.name = ifa->ifa_name;
- netif.flags = ifa->ifa_flags;
-
- if (ifa->ifa_addr == nullptr)
- continue;
-
- switch (ifa->ifa_addr->sa_family) {
-
- case AF_INET: {
- const sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(ifa->ifa_addr);
- char address[INET_ADDRSTRLEN];
- if (::inet_ntop(AF_INET, &sin->sin_addr, address, sizeof(address))) {
- netif.ipv4Addresses.push_back(address_v4::from_string(address));
- NFD_LOG_TRACE(ifname << ": added IPv4 address " << address);
- }
- else
- NFD_LOG_WARN(ifname << ": inet_ntop(AF_INET) failed: " << strerror(errno));
- break;
- }
-
- case AF_INET6: {
- const sockaddr_in6* sin6 = reinterpret_cast<sockaddr_in6*>(ifa->ifa_addr);
- char address[INET6_ADDRSTRLEN];
- if (::inet_ntop(AF_INET6, &sin6->sin6_addr, address, sizeof(address))) {
- netif.ipv6Addresses.push_back(address_v6::from_string(address));
- NFD_LOG_TRACE(ifname << ": added IPv6 address " << address);
- }
- else
- NFD_LOG_WARN(ifname << ": inet_ntop(AF_INET6) failed: " << strerror(errno));
- break;
- }
-
-#if defined(__linux__)
- case AF_PACKET: {
- const sockaddr_ll* sll = reinterpret_cast<sockaddr_ll*>(ifa->ifa_addr);
- netif.index = sll->sll_ifindex;
- if (sll->sll_hatype == ARPHRD_ETHER && sll->sll_halen == ethernet::ADDR_LEN) {
- netif.etherAddress = ethernet::Address(sll->sll_addr);
- NFD_LOG_TRACE(ifname << ": added Ethernet address " << netif.etherAddress);
- }
- else if (sll->sll_hatype != ARPHRD_LOOPBACK) {
- NFD_LOG_DEBUG(ifname << ": ignoring link-layer address for unhandled hardware type "
- << sll->sll_hatype);
- }
- break;
- }
-
-#elif defined(__APPLE__) || defined(__FreeBSD__)
- case AF_LINK: {
- const sockaddr_dl* sdl = reinterpret_cast<sockaddr_dl*>(ifa->ifa_addr);
- netif.index = sdl->sdl_index;
- if (sdl->sdl_type == IFT_ETHER && sdl->sdl_alen == ethernet::ADDR_LEN) {
- netif.etherAddress = ethernet::Address(reinterpret_cast<uint8_t*>(LLADDR(sdl)));
- NFD_LOG_TRACE(ifname << ": added Ethernet address " << netif.etherAddress);
- }
- else if (sdl->sdl_type != IFT_LOOP) {
- NFD_LOG_DEBUG(ifname << ": ignoring link-layer address for unhandled interface type "
- << sdl->sdl_type);
- }
- break;
- }
-#endif
- }
-
- if (netif.isBroadcastCapable() && ifa->ifa_broadaddr != nullptr) {
- const sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(ifa->ifa_broadaddr);
- char address[INET_ADDRSTRLEN];
- if (::inet_ntop(AF_INET, &sin->sin_addr, address, sizeof(address))) {
- netif.broadcastAddress = address_v4::from_string(address);
- NFD_LOG_TRACE(ifname << ": added IPv4 broadcast address " << address);
- }
- else
- NFD_LOG_WARN(ifname << ": inet_ntop(AF_INET) for broadaddr failed: " << strerror(errno));
- }
- }
-
- ::freeifaddrs(ifa_list);
-
- std::vector<NetworkInterfaceInfo> v;
- v.reserve(ifmap.size());
- for (auto&& element : ifmap) {
- v.push_back(element.second);
- }
-
- return v;
-}
-
-} // namespace nfd
diff --git a/NFD/core/network-interface.hpp b/NFD/core/network-interface.hpp
deleted file mode 100644
index 0034052..0000000
--- a/NFD/core/network-interface.hpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_CORE_NETWORK_INTERFACE_HPP
-#define NFD_CORE_NETWORK_INTERFACE_HPP
-
-#include "common.hpp"
-
-#include <ndn-cxx/util/ethernet.hpp>
-
-#include <net/if.h>
-
-namespace nfd {
-
-namespace ethernet = ndn::util::ethernet;
-
-/** \brief contains information about a network interface
- */
-class NetworkInterfaceInfo
-{
-public:
-
- int index;
- std::string name;
- ethernet::Address etherAddress;
- std::vector<boost::asio::ip::address_v4> ipv4Addresses;
- std::vector<boost::asio::ip::address_v6> ipv6Addresses;
- boost::asio::ip::address_v4 broadcastAddress;
- unsigned int flags;
-
- bool
- isLoopback() const;
-
- bool
- isMulticastCapable() const;
-
- bool
- isBroadcastCapable() const;
-
- bool
- isUp() const;
-
-};
-
-inline bool
-NetworkInterfaceInfo::isLoopback() const
-{
- return (flags & IFF_LOOPBACK) != 0;
-}
-
-inline bool
-NetworkInterfaceInfo::isMulticastCapable() const
-{
- return (flags & IFF_MULTICAST) != 0;
-}
-
-inline bool
-NetworkInterfaceInfo::isBroadcastCapable() const
-{
- return (flags & IFF_BROADCAST) != 0;
-}
-
-inline bool
-NetworkInterfaceInfo::isUp() const
-{
- return (flags & IFF_UP) != 0;
-}
-
-/** \brief List configured network interfaces on the system and their info
- * \warning invalid IP addresses (e.g., 0.0.0.0) may be returned in some environments
- */
-std::vector<NetworkInterfaceInfo>
-listNetworkInterfaces();
-
-#ifdef WITH_TESTS
-/** \brief Set a list of network interfaces to be returned by subsequent listNetworkInterfaces call
- * \note To reset to normal behavior, use `setDebugNetworkInterfaces(nullptr);`
- */
-void
-setDebugNetworkInterfaces(shared_ptr<std::vector<NetworkInterfaceInfo>> interfaces);
-#endif
-
-} // namespace nfd
-
-#endif // NFD_CORE_NETWORK_INTERFACE_HPP
diff --git a/NFD/core/resolver.hpp b/NFD/core/resolver.hpp
deleted file mode 100644
index d4dc31c..0000000
--- a/NFD/core/resolver.hpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_CORE_RESOLVER_H
-#define NFD_CORE_RESOLVER_H
-
-#include "common.hpp"
-#include "core/global-io.hpp"
-#include "core/scheduler.hpp"
-
-namespace nfd {
-namespace resolver {
-
-typedef function<bool (const boost::asio::ip::address& address)> AddressSelector;
-
-struct AnyAddress {
- bool
- operator()(const boost::asio::ip::address& address)
- {
- return true;
- }
-};
-
-struct Ipv4Address {
- bool
- operator()(const boost::asio::ip::address& address)
- {
- return address.is_v4();
- }
-};
-
-struct Ipv6Address {
- bool
- operator()(const boost::asio::ip::address& address)
- {
- return address.is_v6();
- }
-};
-
-} // namespace resolver
-
-template<class Protocol>
-class Resolver
-{
-public:
- struct Error : public std::runtime_error
- {
- Error(const std::string& what) : std::runtime_error(what) {}
- };
-
- typedef function<void (const typename Protocol::endpoint& endpoint)> SuccessCallback;
- typedef function<void (const std::string& reason)> ErrorCallback;
-
- typedef boost::asio::ip::basic_resolver< Protocol > resolver;
-
- /** \brief Asynchronously resolve host and port
- *
- * If an address selector predicate is specified, then each resolved IP address
- * is checked against the predicate.
- *
- * Available address selector predicates:
- *
- * - resolver::AnyAddress()
- * - resolver::Ipv4Address()
- * - resolver::Ipv6Address()
- */
- static void
- asyncResolve(const std::string& host, const std::string& port,
- const SuccessCallback& onSuccess,
- const ErrorCallback& onError,
- const nfd::resolver::AddressSelector& addressSelector = nfd::resolver::AnyAddress(),
- const time::seconds& timeout = time::seconds(4))
- {
- shared_ptr<Resolver> resolver =
- shared_ptr<Resolver>(new Resolver(onSuccess, onError,
- addressSelector));
-
- resolver->asyncResolve(host, port, timeout, resolver);
- // resolver will be destroyed when async operation finishes or global IO service stops
- }
-
- /** \brief Synchronously resolve host and port
- *
- * If an address selector predicate is specified, then each resolved IP address
- * is checked against the predicate.
- *
- * Available address selector predicates:
- *
- * - resolver::AnyAddress()
- * - resolver::Ipv4Address()
- * - resolver::Ipv6Address()
- */
- static typename Protocol::endpoint
- syncResolve(const std::string& host, const std::string& port,
- const nfd::resolver::AddressSelector& addressSelector = nfd::resolver::AnyAddress())
- {
- Resolver resolver(SuccessCallback(), ErrorCallback(), addressSelector);
-
- typename resolver::query query(host, port
-#if not defined(__FreeBSD__)
- , resolver::query::all_matching
-#endif
- );
-
- typename resolver::iterator remoteEndpoint = resolver.m_resolver.resolve(query);
- typename resolver::iterator end;
- for (; remoteEndpoint != end; ++remoteEndpoint)
- {
- if (addressSelector(typename Protocol::endpoint(*remoteEndpoint).address()))
- return *remoteEndpoint;
- }
- throw Error("No endpoint matching the specified address selector found");
- }
-
-private:
- Resolver(const SuccessCallback& onSuccess,
- const ErrorCallback& onError,
- const nfd::resolver::AddressSelector& addressSelector)
- : m_resolver(getGlobalIoService())
- , m_addressSelector(addressSelector)
- , m_onSuccess(onSuccess)
- , m_onError(onError)
- {
- }
-
- void
- asyncResolve(const std::string& host, const std::string& port,
- const time::seconds& timeout,
- const shared_ptr<Resolver>& self)
- {
- typename resolver::query query(host, port
-#if not defined(__FreeBSD__)
- , resolver::query::all_matching
-#endif
- );
-
- m_resolver.async_resolve(query,
- bind(&Resolver::onResolveSuccess, this, _1, _2, self));
-
- m_resolveTimeout = scheduler::schedule(timeout,
- bind(&Resolver::onResolveError, this,
- "Timeout", self));
- }
-
- void
- onResolveSuccess(const boost::system::error_code& error,
- typename resolver::iterator remoteEndpoint,
- const shared_ptr<Resolver>& self)
- {
- scheduler::cancel(m_resolveTimeout);
-
- if (error)
- {
- if (error == boost::system::errc::operation_canceled)
- return;
-
- return m_onError("Remote endpoint hostname or port cannot be resolved: " +
- error.category().message(error.value()));
- }
-
- typename resolver::iterator end;
- for (; remoteEndpoint != end; ++remoteEndpoint)
- {
- if (m_addressSelector(typename Protocol::endpoint(*remoteEndpoint).address()))
- return m_onSuccess(*remoteEndpoint);
- }
-
- m_onError("No endpoint matching the specified address selector found");
- }
-
- void
- onResolveError(const std::string& errorInfo,
- const shared_ptr<Resolver>& self)
- {
- m_resolver.cancel();
- m_onError(errorInfo);
- }
-
-private:
- resolver m_resolver;
- EventId m_resolveTimeout;
-
- nfd::resolver::AddressSelector m_addressSelector;
- SuccessCallback m_onSuccess;
- ErrorCallback m_onError;
-};
-
-typedef Resolver<boost::asio::ip::tcp> TcpResolver;
-typedef Resolver<boost::asio::ip::udp> UdpResolver;
-
-} // namespace nfd
-
-#endif // NFD_CORE_RESOLVER_H
diff --git a/NFD/daemon/face/datagram-face.hpp b/NFD/daemon/face/datagram-face.hpp
deleted file mode 100644
index 5b1b3d9..0000000
--- a/NFD/daemon/face/datagram-face.hpp
+++ /dev/null
@@ -1,342 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_DATAGRAM_FACE_HPP
-#define NFD_DAEMON_FACE_DATAGRAM_FACE_HPP
-
-#include "face.hpp"
-#include "core/logger.hpp"
-
-namespace nfd {
-
-class Unicast {};
-class Multicast {};
-
-template<class Protocol, class Type = Unicast>
-class DatagramFace : public Face
-{
-public:
- typedef Protocol protocol;
-
- /** \brief Construct datagram face
- *
- * \param socket Protocol-specific socket for the created face
- * \param isOnDemand If true, the face can be closed after it remains
- * unused for a certain amount of time
- */
- DatagramFace(const FaceUri& remoteUri, const FaceUri& localUri,
- const shared_ptr<typename protocol::socket>& socket,
- bool isOnDemand);
-
- virtual
- ~DatagramFace();
-
- // from Face
- virtual void
- sendInterest(const Interest& interest);
-
- virtual void
- sendData(const Data& data);
-
- virtual void
- close();
-
- void
- receiveDatagram(const uint8_t* buffer,
- size_t nBytesReceived,
- const boost::system::error_code& error);
-
- /**
- * \brief Set m_hasBeenUsedRecently to false
- */
- void
- resetRecentUsage();
-
- bool
- hasBeenUsedRecently() const;
-
- void
- setOnDemand(bool isOnDemand);
-
-protected:
- void
- handleSend(const boost::system::error_code& error,
- size_t nBytesSent,
- const Block& payload);
-
- void
- handleReceive(const boost::system::error_code& error,
- size_t nBytesReceived);
-
- void
- keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face);
-
- void
- closeSocket();
-
-protected:
- shared_ptr<typename protocol::socket> m_socket;
- uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
- bool m_hasBeenUsedRecently;
-
- NFD_LOG_INCLASS_DECLARE();
-};
-
-
-template<class T, class U>
-inline
-DatagramFace<T, U>::DatagramFace(const FaceUri& remoteUri, const FaceUri& localUri,
- const shared_ptr<typename DatagramFace::protocol::socket>& socket,
- bool isOnDemand)
- : Face(remoteUri, localUri)
- , m_socket(socket)
-{
- setOnDemand(isOnDemand);
-
- m_socket->async_receive(boost::asio::buffer(m_inputBuffer, ndn::MAX_NDN_PACKET_SIZE), 0,
- bind(&DatagramFace<T, U>::handleReceive, this, _1, _2));
-}
-
-template<class T, class U>
-inline
-DatagramFace<T, U>::~DatagramFace()
-{
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::sendInterest(const Interest& interest)
-{
- this->onSendInterest(interest);
- const Block& payload = interest.wireEncode();
- m_socket->async_send(boost::asio::buffer(payload.wire(), payload.size()),
- bind(&DatagramFace<T, U>::handleSend, this, _1, _2, payload));
-
- // anything else should be done here?
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::sendData(const Data& data)
-{
- this->onSendData(data);
- const Block& payload = data.wireEncode();
- m_socket->async_send(boost::asio::buffer(payload.wire(), payload.size()),
- bind(&DatagramFace<T, U>::handleSend, this, _1, _2, payload));
-
- // anything else should be done here?
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::handleSend(const boost::system::error_code& error,
- size_t nBytesSent,
- const Block& payload)
-// 'payload' is unused; it's needed to retain the underlying Buffer
-{
- if (error != 0) {
- if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
- return;
-
- if (!m_socket->is_open()) {
- fail("Tunnel closed");
- return;
- }
-
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Send operation failed, closing socket: "
- << error.category().message(error.value()));
-
- closeSocket();
-
- if (error == boost::asio::error::eof) {
- fail("Tunnel closed");
- }
- else {
- fail("Send operation failed, closing socket: " +
- error.category().message(error.value()));
- }
- return;
- }
-
- NFD_LOG_TRACE("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Successfully sent: " << nBytesSent << " bytes");
- this->getMutableCounters().getNOutBytes() += nBytesSent;
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::close()
-{
- if (!m_socket->is_open())
- return;
-
- NFD_LOG_INFO("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Close tunnel");
-
- closeSocket();
- fail("Close tunnel");
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::handleReceive(const boost::system::error_code& error,
- size_t nBytesReceived)
-{
- NFD_LOG_DEBUG("handleReceive: " << nBytesReceived);
- receiveDatagram(m_inputBuffer, nBytesReceived, error);
- if (m_socket->is_open())
- m_socket->async_receive(boost::asio::buffer(m_inputBuffer, ndn::MAX_NDN_PACKET_SIZE), 0,
- bind(&DatagramFace<T, U>::handleReceive, this, _1, _2));
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::receiveDatagram(const uint8_t* buffer,
- size_t nBytesReceived,
- const boost::system::error_code& error)
-{
- if (error != 0 || nBytesReceived == 0) {
- if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
- return;
-
- // this should be unnecessary, but just in case
- if (!m_socket->is_open()) {
- fail("Tunnel closed");
- return;
- }
-
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Receive operation failed: "
- << error.category().message(error.value()));
-
- closeSocket();
-
- if (error == boost::asio::error::eof) {
- fail("Tunnel closed");
- }
- else {
- fail("Receive operation failed, closing socket: " +
- error.category().message(error.value()));
- }
- return;
- }
-
- NFD_LOG_TRACE("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Received: " << nBytesReceived << " bytes");
- this->getMutableCounters().getNInBytes() += nBytesReceived;
-
- Block element;
- bool isOk = Block::fromBuffer(buffer, nBytesReceived, element);
- if (!isOk)
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Failed to parse incoming packet");
- // This message won't extend the face lifetime
- return;
- }
-
- if (element.size() != nBytesReceived)
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Received datagram size and decoded "
- << "element size don't match");
- // This message won't extend the face lifetime
- return;
- }
-
- if (!this->decodeAndDispatchInput(element))
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Received unrecognized block of type ["
- << element.type() << "]");
- // This message won't extend the face lifetime
- return;
- }
-
- m_hasBeenUsedRecently = true;
-}
-
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face)
-{
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::closeSocket()
-{
- NFD_LOG_DEBUG("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] closeSocket");
-
- boost::asio::io_service& io = m_socket->get_io_service();
-
- // use the non-throwing variants and ignore errors, if any
- boost::system::error_code error;
- m_socket->shutdown(protocol::socket::shutdown_both, error);
- m_socket->close(error);
- // after this, handlers will be called with an error code
-
- // ensure that the Face object is alive at least until all pending
- // handlers are dispatched
- io.post(bind(&DatagramFace<T, U>::keepFaceAliveUntilAllHandlersExecuted,
- this, this->shared_from_this()));
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::setOnDemand(bool isOnDemand)
-{
- Face::setOnDemand(isOnDemand);
-}
-
-template<class T, class U>
-inline void
-DatagramFace<T, U>::resetRecentUsage()
-{
- m_hasBeenUsedRecently = false;
-}
-
-template<class T, class U>
-inline bool
-DatagramFace<T, U>::hasBeenUsedRecently() const
-{
- return m_hasBeenUsedRecently;
-}
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_DATAGRAM_FACE_HPP
diff --git a/NFD/daemon/face/ethernet-face.cpp b/NFD/daemon/face/ethernet-face.cpp
deleted file mode 100644
index c63e38e..0000000
--- a/NFD/daemon/face/ethernet-face.cpp
+++ /dev/null
@@ -1,464 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ethernet-face.hpp"
-#include "core/global-io.hpp"
-#include "core/logger.hpp"
-
-#include <pcap/pcap.h>
-
-#include <cerrno> // for errno
-#include <cstdio> // for std::snprintf()
-#include <cstring> // for std::strerror() and std::strncpy()
-#include <arpa/inet.h> // for htons() and ntohs()
-#include <net/ethernet.h> // for struct ether_header
-#include <net/if.h> // for struct ifreq
-#include <sys/ioctl.h> // for ioctl()
-#include <unistd.h> // for dup()
-
-#if defined(__linux__)
-#include <netpacket/packet.h> // for struct packet_mreq
-#include <sys/socket.h> // for setsockopt()
-#endif
-
-#ifdef SIOCADDMULTI
-#if defined(__APPLE__) || defined(__FreeBSD__)
-#include <net/if_dl.h> // for struct sockaddr_dl
-#endif
-#endif
-
-#if !defined(PCAP_NETMASK_UNKNOWN)
-/*
- * Value to pass to pcap_compile() as the netmask if you don't know what
- * the netmask is.
- */
-#define PCAP_NETMASK_UNKNOWN 0xffffffff
-#endif
-
-namespace nfd {
-
-NFD_LOG_INIT("EthernetFace");
-
-const time::nanoseconds EthernetFace::REASSEMBLER_LIFETIME = time::seconds(60);
-
-EthernetFace::EthernetFace(const shared_ptr<boost::asio::posix::stream_descriptor>& socket,
- const NetworkInterfaceInfo& interface,
- const ethernet::Address& address)
- : Face(FaceUri(address), FaceUri::fromDev(interface.name))
- , m_pcap(nullptr, pcap_close)
- , m_socket(socket)
-#if defined(__linux__)
- , m_interfaceIndex(interface.index)
-#endif
- , m_interfaceName(interface.name)
- , m_srcAddress(interface.etherAddress)
- , m_destAddress(address)
-{
- NFD_LOG_INFO("Creating ethernet face on " << m_interfaceName << ": "
- << m_srcAddress << " <--> " << m_destAddress);
- pcapInit();
-
- int fd = pcap_get_selectable_fd(m_pcap.get());
- if (fd < 0)
- throw Error("pcap_get_selectable_fd failed");
-
- // need to duplicate the fd, otherwise both pcap_close()
- // and stream_descriptor::close() will try to close the
- // same fd and one of them will fail
- m_socket->assign(::dup(fd));
-
- m_interfaceMtu = getInterfaceMtu();
- NFD_LOG_DEBUG("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Interface MTU is: " << m_interfaceMtu);
-
- m_slicer.reset(new ndnlp::Slicer(m_interfaceMtu));
-
- char filter[100];
- std::snprintf(filter, sizeof(filter),
- "(ether proto 0x%x) && (ether dst %s) && (not ether src %s)",
- ethernet::ETHERTYPE_NDN,
- m_destAddress.toString().c_str(),
- m_srcAddress.toString().c_str());
- setPacketFilter(filter);
-
- if (!m_destAddress.isBroadcast() && !joinMulticastGroup())
- {
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Falling back to promiscuous mode");
- pcap_set_promisc(m_pcap.get(), 1);
- }
-
- m_socket->async_read_some(boost::asio::null_buffers(),
- bind(&EthernetFace::handleRead, this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred));
-}
-
-EthernetFace::~EthernetFace()
-{
-}
-
-void
-EthernetFace::sendInterest(const Interest& interest)
-{
- onSendInterest(interest);
- ndnlp::PacketArray pa = m_slicer->slice(interest.wireEncode());
- for (const auto& packet : *pa) {
- sendPacket(packet);
- }
-}
-
-void
-EthernetFace::sendData(const Data& data)
-{
- onSendData(data);
- ndnlp::PacketArray pa = m_slicer->slice(data.wireEncode());
- for (const auto& packet : *pa) {
- sendPacket(packet);
- }
-}
-
-void
-EthernetFace::close()
-{
- if (!m_pcap)
- return;
-
- NFD_LOG_INFO("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Closing face");
-
- boost::system::error_code error;
- m_socket->cancel(error); // ignore errors
- m_socket->close(error); // ignore errors
- m_pcap.reset(nullptr);
-
- fail("Face closed");
-}
-
-void
-EthernetFace::pcapInit()
-{
- char errbuf[PCAP_ERRBUF_SIZE] = {};
- m_pcap.reset(pcap_create(m_interfaceName.c_str(), errbuf));
- if (!m_pcap)
- throw Error("pcap_create: " + std::string(errbuf));
-
-#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
- // Enable "immediate mode", effectively disabling any read buffering in the kernel.
- // This corresponds to the BIOCIMMEDIATE ioctl on BSD-like systems (including OS X)
- // where libpcap uses a BPF device. On Linux this forces libpcap not to use TPACKET_V3,
- // even if the kernel supports it, thus preventing bug #1511.
- pcap_set_immediate_mode(m_pcap.get(), 1);
-#endif
-
- if (pcap_activate(m_pcap.get()) < 0)
- throw Error("pcap_activate failed");
-
- if (pcap_set_datalink(m_pcap.get(), DLT_EN10MB) < 0)
- throw Error("pcap_set_datalink: " + std::string(pcap_geterr(m_pcap.get())));
-
- if (pcap_setdirection(m_pcap.get(), PCAP_D_IN) < 0)
- // no need to throw on failure, BPF will filter unwanted packets anyway
- NFD_LOG_WARN("pcap_setdirection: " << pcap_geterr(m_pcap.get()));
-}
-
-void
-EthernetFace::setPacketFilter(const char* filterString)
-{
- bpf_program filter;
- if (pcap_compile(m_pcap.get(), &filter, filterString, 1, PCAP_NETMASK_UNKNOWN) < 0)
- throw Error("pcap_compile: " + std::string(pcap_geterr(m_pcap.get())));
-
- int ret = pcap_setfilter(m_pcap.get(), &filter);
- pcap_freecode(&filter);
- if (ret < 0)
- throw Error("pcap_setfilter: " + std::string(pcap_geterr(m_pcap.get())));
-}
-
-bool
-EthernetFace::joinMulticastGroup()
-{
-#if defined(__linux__)
- packet_mreq mr{};
- mr.mr_ifindex = m_interfaceIndex;
- mr.mr_type = PACKET_MR_MULTICAST;
- mr.mr_alen = m_destAddress.size();
- std::copy(m_destAddress.begin(), m_destAddress.end(), mr.mr_address);
-
- if (::setsockopt(m_socket->native_handle(), SOL_PACKET,
- PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) == 0)
- return true; // success
-
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] setsockopt(PACKET_ADD_MEMBERSHIP) failed: " << std::strerror(errno));
-#endif
-
-#if defined(SIOCADDMULTI)
- ifreq ifr{};
- std::strncpy(ifr.ifr_name, m_interfaceName.c_str(), sizeof(ifr.ifr_name) - 1);
-
-#if defined(__APPLE__) || defined(__FreeBSD__)
- // see bug #2327
- using boost::asio::ip::udp;
- udp::socket sock(ref(getGlobalIoService()), udp::v4());
- int fd = sock.native_handle();
-
- /*
- * Differences between Linux and the BSDs (including OS X):
- * o BSD does not have ifr_hwaddr; use ifr_addr instead.
- * o While OS X seems to accept both AF_LINK and AF_UNSPEC as the address
- * family, FreeBSD explicitly requires AF_LINK, so we have to use AF_LINK
- * and sockaddr_dl instead of the generic sockaddr structure.
- * o BSD's sockaddr (and sockaddr_dl in particular) contains an additional
- * field, sa_len (sdl_len), which must be set to the total length of the
- * structure, including the length field itself.
- * o We do not specify the interface name, thus sdl_nlen is left at 0 and
- * LLADDR is effectively the same as sdl_data.
- */
- sockaddr_dl* sdl = reinterpret_cast<sockaddr_dl*>(&ifr.ifr_addr);
- sdl->sdl_len = sizeof(ifr.ifr_addr);
- sdl->sdl_family = AF_LINK;
- sdl->sdl_alen = m_destAddress.size();
- std::copy(m_destAddress.begin(), m_destAddress.end(), LLADDR(sdl));
-
- static_assert(sizeof(ifr.ifr_addr) >= offsetof(sockaddr_dl, sdl_data) + ethernet::ADDR_LEN,
- "ifr_addr in struct ifreq is too small on this platform");
-#else
- int fd = m_socket->native_handle();
-
- ifr.ifr_hwaddr.sa_family = AF_UNSPEC;
- std::copy(m_destAddress.begin(), m_destAddress.end(), ifr.ifr_hwaddr.sa_data);
-
- static_assert(sizeof(ifr.ifr_hwaddr) >= offsetof(sockaddr, sa_data) + ethernet::ADDR_LEN,
- "ifr_hwaddr in struct ifreq is too small on this platform");
-#endif
-
- if (::ioctl(fd, SIOCADDMULTI, &ifr) == 0)
- return true; // success
-
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] ioctl(SIOCADDMULTI) failed: " << std::strerror(errno));
-#endif
-
- return false;
-}
-
-void
-EthernetFace::sendPacket(const ndn::Block& block)
-{
- if (!m_pcap)
- {
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Trying to send on closed face");
- return fail("Face closed");
- }
-
- BOOST_ASSERT(block.size() <= m_interfaceMtu);
-
- /// \todo Right now there is no reserve when packet is received, but
- /// we should reserve some space at the beginning and at the end
- ndn::EncodingBuffer buffer(block);
-
- // pad with zeroes if the payload is too short
- if (block.size() < ethernet::MIN_DATA_LEN)
- {
- static const uint8_t padding[ethernet::MIN_DATA_LEN] = {};
- buffer.appendByteArray(padding, ethernet::MIN_DATA_LEN - block.size());
- }
-
- // construct and prepend the ethernet header
- static uint16_t ethertype = htons(ethernet::ETHERTYPE_NDN);
- buffer.prependByteArray(reinterpret_cast<const uint8_t*>(ðertype), ethernet::TYPE_LEN);
- buffer.prependByteArray(m_srcAddress.data(), m_srcAddress.size());
- buffer.prependByteArray(m_destAddress.data(), m_destAddress.size());
-
- // send the packet
- int sent = pcap_inject(m_pcap.get(), buffer.buf(), buffer.size());
- if (sent < 0)
- {
- return fail("pcap_inject: " + std::string(pcap_geterr(m_pcap.get())));
- }
- else if (static_cast<size_t>(sent) < buffer.size())
- {
- return fail("Failed to inject frame");
- }
-
- NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Successfully sent: " << block.size() << " bytes");
- this->getMutableCounters().getNOutBytes() += block.size();
-}
-
-void
-EthernetFace::handleRead(const boost::system::error_code& error, size_t)
-{
- if (!m_pcap)
- return fail("Face closed");
-
- if (error)
- return processErrorCode(error);
-
- pcap_pkthdr* header;
- const uint8_t* packet;
- int ret = pcap_next_ex(m_pcap.get(), &header, &packet);
- if (ret < 0)
- {
- return fail("pcap_next_ex: " + std::string(pcap_geterr(m_pcap.get())));
- }
- else if (ret == 0)
- {
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName << "] Read timeout");
- }
- else
- {
- processIncomingPacket(header, packet);
- }
-
- m_socket->async_read_some(boost::asio::null_buffers(),
- bind(&EthernetFace::handleRead, this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred));
-}
-
-void
-EthernetFace::processIncomingPacket(const pcap_pkthdr* header, const uint8_t* packet)
-{
- size_t length = header->caplen;
- if (length < ethernet::HDR_LEN + ethernet::MIN_DATA_LEN)
- {
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Received frame is too short (" << length << " bytes)");
- return;
- }
-
- const ether_header* eh = reinterpret_cast<const ether_header*>(packet);
- const ethernet::Address sourceAddress(eh->ether_shost);
-
- // assert in case BPF fails to filter unwanted frames
- BOOST_ASSERT_MSG(ethernet::Address(eh->ether_dhost) == m_destAddress,
- "Received frame addressed to a different multicast group");
- BOOST_ASSERT_MSG(sourceAddress != m_srcAddress,
- "Received frame sent by this host");
- BOOST_ASSERT_MSG(ntohs(eh->ether_type) == ethernet::ETHERTYPE_NDN,
- "Received frame with unrecognized ethertype");
-
- packet += ethernet::HDR_LEN;
- length -= ethernet::HDR_LEN;
-
- /// \todo Reserve space in front and at the back of the underlying buffer
- Block fragment;
- bool isOk = Block::fromBuffer(packet, length, fragment);
- if (!isOk)
- {
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Block received from " << sourceAddress.toString()
- << " is invalid or too large to process");
- return;
- }
-
- NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Received: " << fragment.size() << " bytes from "
- << sourceAddress.toString());
- this->getMutableCounters().getNInBytes() += fragment.size();
-
- Reassembler& reassembler = m_reassemblers[sourceAddress];
- if (!reassembler.pms)
- {
- // new sender, setup a PartialMessageStore for it
- reassembler.pms.reset(new ndnlp::PartialMessageStore);
- reassembler.pms->onReceive +=
- [this, sourceAddress] (const Block& block) {
- NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] All fragments received from " << sourceAddress.toString());
- if (!decodeAndDispatchInput(block))
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Received unrecognized TLV block of type " << block.type()
- << " from " << sourceAddress.toString());
- };
- }
-
- scheduler::cancel(reassembler.expireEvent);
- reassembler.expireEvent = scheduler::schedule(REASSEMBLER_LIFETIME,
- [this, sourceAddress] {
- BOOST_VERIFY(m_reassemblers.erase(sourceAddress) == 1);
- });
-
- try {
- reassembler.pms->receiveNdnlpData(fragment);
- }
- catch (const ndnlp::ParseError& e) {
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Received invalid NDNLP fragment from "
- << sourceAddress.toString() << " : " << e.what());
- }
-}
-
-void
-EthernetFace::processErrorCode(const boost::system::error_code& error)
-{
- if (error == boost::asio::error::operation_aborted)
- // cancel() has been called on the socket
- return;
-
- std::string msg;
- if (error == boost::asio::error::eof)
- {
- msg = "Face closed";
- NFD_LOG_DEBUG("[id:" << getId() << ",endpoint:" << m_interfaceName << "] " << msg);
- }
- else
- {
- msg = "Receive operation failed: " + error.message();
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName << "] " << msg);
- }
- fail(msg);
-}
-
-size_t
-EthernetFace::getInterfaceMtu() const
-{
-#ifdef SIOCGIFMTU
-#if defined(__APPLE__) || defined(__FreeBSD__)
- // see bug #2328
- using boost::asio::ip::udp;
- udp::socket sock(ref(getGlobalIoService()), udp::v4());
- int fd = sock.native_handle();
-#else
- int fd = m_socket->native_handle();
-#endif
-
- ifreq ifr{};
- std::strncpy(ifr.ifr_name, m_interfaceName.c_str(), sizeof(ifr.ifr_name) - 1);
-
- if (::ioctl(fd, SIOCGIFMTU, &ifr) == 0)
- return static_cast<size_t>(ifr.ifr_mtu);
-
- NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
- << "] Failed to get interface MTU: " << std::strerror(errno));
-#endif
-
- return ethernet::MAX_DATA_LEN;
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/ethernet-face.hpp b/NFD/daemon/face/ethernet-face.hpp
deleted file mode 100644
index ce72a62..0000000
--- a/NFD/daemon/face/ethernet-face.hpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_ETHERNET_FACE_HPP
-#define NFD_DAEMON_FACE_ETHERNET_FACE_HPP
-
-#include "common.hpp"
-#include "face.hpp"
-#include "ndnlp-partial-message-store.hpp"
-#include "ndnlp-slicer.hpp"
-#include "core/network-interface.hpp"
-
-#include <unordered_map>
-
-#ifndef HAVE_LIBPCAP
-#error "Cannot include this file when libpcap is not available"
-#endif
-
-// forward declarations
-struct pcap;
-typedef pcap pcap_t;
-struct pcap_pkthdr;
-
-namespace nfd {
-
-/**
- * @brief Implementation of Face abstraction that uses raw
- * Ethernet frames as underlying transport mechanism
- */
-class EthernetFace : public Face
-{
-public:
- /**
- * @brief EthernetFace-related error
- */
- struct Error : public Face::Error
- {
- Error(const std::string& what) : Face::Error(what) {}
- };
-
- EthernetFace(const shared_ptr<boost::asio::posix::stream_descriptor>& socket,
- const NetworkInterfaceInfo& interface,
- const ethernet::Address& address);
-
- virtual
- ~EthernetFace();
-
- /// send an Interest
- virtual void
- sendInterest(const Interest& interest);
-
- /// send a Data
- virtual void
- sendData(const Data& data);
-
- /**
- * @brief Closes the face
- *
- * This terminates all communication on the face and triggers the onFail() event.
- */
- virtual void
- close();
-
-private:
- /**
- * @brief Allocates and initializes a libpcap context for live capture
- */
- void
- pcapInit();
-
- /**
- * @brief Installs a BPF filter on the receiving socket
- *
- * @param filterString string containing the source BPF program
- */
- void
- setPacketFilter(const char* filterString);
-
- /**
- * @brief Enables receiving frames addressed to our MAC multicast group
- *
- * @return true if successful, false otherwise
- */
- bool
- joinMulticastGroup();
-
- /**
- * @brief Sends the specified TLV block on the network wrapped in an Ethernet frame
- */
- void
- sendPacket(const ndn::Block& block);
-
- /**
- * @brief Receive callback
- */
- void
- handleRead(const boost::system::error_code& error, size_t nBytesRead);
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
- /**
- * @brief Processes an incoming frame as captured by libpcap
- *
- * @param header pointer to capture metadata
- * @param packet pointer to the received frame, including the link-layer header
- */
- void
- processIncomingPacket(const pcap_pkthdr* header, const uint8_t* packet);
-
-private:
- /**
- * @brief Handles errors encountered by Boost.Asio on the receive path
- */
- void
- processErrorCode(const boost::system::error_code& error);
-
- /**
- * @brief Returns the MTU of the underlying network interface
- */
- size_t
- getInterfaceMtu() const;
-
-private:
- struct Reassembler
- {
- unique_ptr<ndnlp::PartialMessageStore> pms;
- EventId expireEvent;
- };
-
- unique_ptr<pcap_t, void(*)(pcap_t*)> m_pcap;
- shared_ptr<boost::asio::posix::stream_descriptor> m_socket;
-
-#if defined(__linux__)
- int m_interfaceIndex;
-#endif
- std::string m_interfaceName;
- ethernet::Address m_srcAddress;
- ethernet::Address m_destAddress;
-
- size_t m_interfaceMtu;
- unique_ptr<ndnlp::Slicer> m_slicer;
- std::unordered_map<ethernet::Address, Reassembler> m_reassemblers;
- static const time::nanoseconds REASSEMBLER_LIFETIME;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_ETHERNET_FACE_HPP
diff --git a/NFD/daemon/face/ethernet-factory.cpp b/NFD/daemon/face/ethernet-factory.cpp
deleted file mode 100644
index a4579f4..0000000
--- a/NFD/daemon/face/ethernet-factory.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ethernet-factory.hpp"
-#include "face/ethernet-face.hpp"
-
-#include "core/logger.hpp"
-#include "core/global-io.hpp"
-
-namespace nfd {
-
-NFD_LOG_INIT("EthernetFactory");
-
-shared_ptr<EthernetFace>
-EthernetFactory::createMulticastFace(const NetworkInterfaceInfo& interface,
- const ethernet::Address &address)
-{
- if (!address.isMulticast())
- throw Error(address.toString() + " is not a multicast address");
-
- shared_ptr<EthernetFace> face = findMulticastFace(interface.name, address);
- if (face)
- return face;
-
- auto socket = make_shared<boost::asio::posix::stream_descriptor>(ref(getGlobalIoService()));
- face = make_shared<EthernetFace>(socket, interface, address);
-
- auto key = std::make_pair(interface.name, address);
- face->onFail += [this, key] (const std::string& reason) {
- m_multicastFaces.erase(key);
- };
- m_multicastFaces.insert({key, face});
-
- return face;
-}
-
-shared_ptr<EthernetFace>
-EthernetFactory::findMulticastFace(const std::string& interfaceName,
- const ethernet::Address& address) const
-{
- auto it = m_multicastFaces.find({interfaceName, address});
- if (it != m_multicastFaces.end())
- return it->second;
- else
- return {};
-}
-
-void
-EthernetFactory::createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed)
-{
- throw Error("EthernetFactory does not support 'createFace' operation");
-}
-
-std::list<shared_ptr<const Channel>>
-EthernetFactory::getChannels() const
-{
- return {};
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/ethernet-factory.hpp b/NFD/daemon/face/ethernet-factory.hpp
deleted file mode 100644
index ed81f5f..0000000
--- a/NFD/daemon/face/ethernet-factory.hpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
-#define NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
-
-#include "protocol-factory.hpp"
-#include "core/network-interface.hpp"
-
-namespace nfd {
-
-class EthernetFace;
-
-class EthernetFactory : public ProtocolFactory
-{
-public:
- /**
- * \brief Exception of EthernetFactory
- */
- class Error : public ProtocolFactory::Error
- {
- public:
- explicit
- Error(const std::string& what)
- : ProtocolFactory::Error(what)
- {
- }
- };
-
- typedef std::map<std::pair<std::string, ethernet::Address>,
- shared_ptr<EthernetFace>> MulticastFaceMap;
-
- // from ProtocolFactory
- virtual void
- createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed);
-
- /**
- * \brief Create an EthernetFace to communicate with the given multicast group
- *
- * If this method is called twice with the same interface and group, only
- * one face will be created. Instead, the second call will just retrieve
- * the existing face.
- *
- * \param interface Local network interface
- * \param address Ethernet broadcast/multicast destination address
- *
- * \returns always a valid shared pointer to an EthernetFace object,
- * an exception will be thrown if the creation fails
- *
- * \throws EthernetFactory::Error or EthernetFace::Error
- */
- shared_ptr<EthernetFace>
- createMulticastFace(const NetworkInterfaceInfo& interface,
- const ethernet::Address& address);
-
- /**
- * \brief Get map of configured multicast faces
- */
- const MulticastFaceMap&
- getMulticastFaces() const;
-
- virtual std::list<shared_ptr<const Channel>>
- getChannels() const;
-
-private:
- /**
- * \brief Look up EthernetFace using specified interface and address
- *
- * \returns shared pointer to the existing EthernetFace object or
- * empty shared pointer when such face does not exist
- *
- * \throws never
- */
- shared_ptr<EthernetFace>
- findMulticastFace(const std::string& interfaceName,
- const ethernet::Address& address) const;
-
-private:
- MulticastFaceMap m_multicastFaces;
-};
-
-inline const EthernetFactory::MulticastFaceMap&
-EthernetFactory::getMulticastFaces() const
-{
- return m_multicastFaces;
-}
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
diff --git a/NFD/daemon/face/multicast-udp-face.cpp b/NFD/daemon/face/multicast-udp-face.cpp
deleted file mode 100644
index 34c6cd2..0000000
--- a/NFD/daemon/face/multicast-udp-face.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "multicast-udp-face.hpp"
-
-namespace nfd {
-
-NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(DatagramFace,
- MulticastUdpFace::protocol, Multicast,
- "MulticastUdpFace");
-
-MulticastUdpFace::MulticastUdpFace(const shared_ptr<MulticastUdpFace::protocol::socket>& recvSocket,
- const shared_ptr<MulticastUdpFace::protocol::socket>& sendSocket,
- const MulticastUdpFace::protocol::endpoint& localEndpoint,
- const MulticastUdpFace::protocol::endpoint& multicastEndpoint)
- : DatagramFace<protocol, Multicast>(FaceUri(multicastEndpoint),
- FaceUri(localEndpoint),
- recvSocket, false)
- , m_multicastGroup(multicastEndpoint)
- , m_sendSocket(sendSocket)
-{
- NFD_LOG_INFO("Creating multicast UDP face for group " << m_multicastGroup);
-}
-
-const MulticastUdpFace::protocol::endpoint&
-MulticastUdpFace::getMulticastGroup() const
-{
- return m_multicastGroup;
-}
-
-void
-MulticastUdpFace::sendBlock(const Block& block)
-{
- m_sendSocket->async_send_to(boost::asio::buffer(block.wire(), block.size()),
- m_multicastGroup,
- bind(&MulticastUdpFace::handleSend, this, _1, _2, block));
-}
-
-void
-MulticastUdpFace::sendInterest(const Interest& interest)
-{
- onSendInterest(interest);
-
- NFD_LOG_DEBUG("Sending interest");
- sendBlock(interest.wireEncode());
-}
-
-void
-MulticastUdpFace::sendData(const Data& data)
-{
- /// \todo After this method implements duplicate suppression, onSendData event should
- /// be triggered only when data is actually sent out
- onSendData(data);
-
- NFD_LOG_DEBUG("Sending data");
- sendBlock(data.wireEncode());
-}
-
-bool
-MulticastUdpFace::isMultiAccess() const
-{
- return true;
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/multicast-udp-face.hpp b/NFD/daemon/face/multicast-udp-face.hpp
deleted file mode 100644
index 0ac857e..0000000
--- a/NFD/daemon/face/multicast-udp-face.hpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_MULTICAST_UDP_FACE_HPP
-#define NFD_DAEMON_FACE_MULTICAST_UDP_FACE_HPP
-
-#include "datagram-face.hpp"
-
-namespace nfd {
-
-/**
- * \brief Implementation of Face abstraction that uses
- * multicast UDP as underlying transport mechanism
- */
-class MulticastUdpFace : public DatagramFace<boost::asio::ip::udp, Multicast>
-{
-public:
- /**
- * \brief Creates a UDP-based face for multicast communication
- */
- MulticastUdpFace(const shared_ptr<protocol::socket>& recvSocket,
- const shared_ptr<protocol::socket>& sendSocket,
- const protocol::endpoint& localEndpoint,
- const protocol::endpoint& multicastEndpoint);
-
- const protocol::endpoint&
- getMulticastGroup() const;
-
- // from Face
- virtual void
- sendInterest(const Interest& interest);
-
- virtual void
- sendData(const Data& data);
-
- virtual bool
- isMultiAccess() const;
-
-private:
- void
- sendBlock(const Block& block);
-
-private:
- protocol::endpoint m_multicastGroup;
- shared_ptr<protocol::socket> m_sendSocket;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_MULTICAST_UDP_FACE_HPP
diff --git a/NFD/daemon/face/ndnlp-parse.cpp b/NFD/daemon/face/ndnlp-parse.cpp
deleted file mode 100644
index 21d959f..0000000
--- a/NFD/daemon/face/ndnlp-parse.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "ndnlp-parse.hpp"
-
-namespace nfd {
-namespace ndnlp {
-
-void
-NdnlpData::wireDecode(const Block& wire)
-{
- if (wire.type() != tlv::NdnlpData) {
- throw ParseError("top element is not NdnlpData");
- }
- wire.parse();
- const Block::element_container& elements = wire.elements();
- if (elements.size() < 2) {
- throw ParseError("NdnlpData element has incorrect number of children");
- }
-
- const Block& sequenceElement = elements.front();
- if (sequenceElement.type() != tlv::NdnlpSequence) {
- throw ParseError("NdnlpSequence element is missing");
- }
- if (sequenceElement.value_size() != sizeof(uint64_t)) {
- throw ParseError("NdnlpSequence element has incorrect length");
- }
- m_seq = be64toh(*reinterpret_cast<const uint64_t*>(&*sequenceElement.value_begin()));
-
- const Block& payloadElement = elements.back();
- if (payloadElement.type() != tlv::NdnlpPayload) {
- throw ParseError("NdnlpPayload element is missing");
- }
- m_payload = payloadElement;
-
- if (elements.size() == 2) { // single wire packet
- m_fragIndex = 0;
- m_fragCount = 1;
- return;
- }
- if (elements.size() != 4) {
- throw ParseError("NdnlpData element has incorrect number of children");
- }
-
- const Block& fragIndexElement = elements.at(1);
- if (fragIndexElement.type() != tlv::NdnlpFragIndex) {
- throw ParseError("NdnlpFragIndex element is missing");
- }
- uint64_t fragIndex = ndn::readNonNegativeInteger(fragIndexElement);
- if (fragIndex > std::numeric_limits<uint16_t>::max()) {
- throw ParseError("NdnlpFragIndex is too large");
- }
- m_fragIndex = static_cast<uint16_t>(fragIndex);
-
- const Block& fragCountElement = elements.at(2);
- if (fragCountElement.type() != tlv::NdnlpFragCount) {
- throw ParseError("NdnlpFragCount element is missing");
- }
- uint64_t fragCount = ndn::readNonNegativeInteger(fragCountElement);
- if (fragCount > std::numeric_limits<uint16_t>::max()) {
- throw ParseError("NdnlpFragCount is too large");
- }
- m_fragCount = static_cast<uint16_t>(fragCount);
-
- if (m_fragIndex >= m_fragCount) {
- throw ParseError("NdnlpFragIndex must be less than NdnlpFragCount");
- }
-}
-
-} // namespace ndnlp
-} // namespace nfd
diff --git a/NFD/daemon/face/ndnlp-parse.hpp b/NFD/daemon/face/ndnlp-parse.hpp
deleted file mode 100644
index f40c910..0000000
--- a/NFD/daemon/face/ndnlp-parse.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_NDNLP_PARSE_HPP
-#define NFD_DAEMON_FACE_NDNLP_PARSE_HPP
-
-#include "common.hpp"
-#include "ndnlp-tlv.hpp"
-
-namespace nfd {
-namespace ndnlp {
-
-struct ParseError : public std::runtime_error
-{
- ParseError(const std::string& what)
- : std::runtime_error(what)
- {
- }
-};
-
-/** \brief represents a NdnlpData packet
- *
- * NdnlpData ::= NDNLP-DATA-TYPE TLV-LENGTH
- * NdnlpSequence
- * NdnlpFragIndex?
- * NdnlpFragCount?
- * NdnlpPayload
- */
-class NdnlpData
-{
-public:
- /** \brief parse a NdnlpData packet
- *
- * \exception ParseError packet is malformated
- */
- void
- wireDecode(const Block& wire);
-
-public:
- uint64_t m_seq;
- uint16_t m_fragIndex;
- uint16_t m_fragCount;
- Block m_payload;
-};
-
-} // namespace ndnlp
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_NDNLP_PARSE_HPP
diff --git a/NFD/daemon/face/ndnlp-partial-message-store.cpp b/NFD/daemon/face/ndnlp-partial-message-store.cpp
deleted file mode 100644
index 54a5537..0000000
--- a/NFD/daemon/face/ndnlp-partial-message-store.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "ndnlp-partial-message-store.hpp"
-
-namespace nfd {
-namespace ndnlp {
-
-PartialMessage::PartialMessage()
- : m_fragCount(0)
- , m_received(0)
- , m_totalLength(0)
-{
-}
-
-bool
-PartialMessage::add(uint16_t fragIndex, uint16_t fragCount, const Block& payload)
-{
- if (m_received == 0) { // first packet
- m_fragCount = fragCount;
- m_payloads.resize(fragCount);
- }
-
- if (m_fragCount != fragCount || fragIndex >= m_fragCount) {
- return false;
- }
-
- if (!m_payloads[fragIndex].empty()) { // duplicate
- return false;
- }
-
- m_payloads[fragIndex] = payload;
- ++m_received;
- m_totalLength += payload.value_size();
- return true;
-}
-
-bool
-PartialMessage::isComplete() const
-{
- return m_received == m_fragCount;
-}
-
-Block
-PartialMessage::reassemble()
-{
- BOOST_ASSERT(this->isComplete());
-
- ndn::BufferPtr buffer = make_shared<ndn::Buffer>(m_totalLength);
- uint8_t* buf = buffer->get();
- for (std::vector<Block>::const_iterator it = m_payloads.begin();
- it != m_payloads.end(); ++it) {
- const Block& payload = *it;
- memcpy(buf, payload.value(), payload.value_size());
- buf += payload.value_size();
- }
-
- return Block(buffer);
-}
-
-PartialMessageStore::PartialMessageStore(const time::nanoseconds& idleDuration)
- : m_idleDuration(idleDuration)
-{
-}
-
-PartialMessageStore::~PartialMessageStore()
-{
-}
-
-void
-PartialMessageStore::receiveNdnlpData(const Block& pkt)
-{
- NdnlpData parsed;
- parsed.wireDecode(pkt);
- if (parsed.m_fragCount == 1) { // single fragment
- this->onReceive(parsed.m_payload.blockFromValue());
- return;
- }
-
- uint64_t messageIdentifier = parsed.m_seq - parsed.m_fragIndex;
- shared_ptr<PartialMessage> pm = m_partialMessages[messageIdentifier];
- if (!static_cast<bool>(pm)) {
- m_partialMessages[messageIdentifier] = pm = make_shared<PartialMessage>();
- }
- this->scheduleCleanup(messageIdentifier, pm);
-
- pm->add(parsed.m_fragIndex, parsed.m_fragCount, parsed.m_payload);
- if (pm->isComplete()) {
- this->onReceive(pm->reassemble());
- this->cleanup(messageIdentifier);
- }
-}
-
-void
-PartialMessageStore::scheduleCleanup(uint64_t messageIdentifier,
- shared_ptr<PartialMessage> partialMessage)
-{
- partialMessage->m_expiry = scheduler::schedule(m_idleDuration,
- bind(&PartialMessageStore::cleanup, this, messageIdentifier));
-}
-
-void
-PartialMessageStore::cleanup(uint64_t messageIdentifier)
-{
- std::map<uint64_t, shared_ptr<PartialMessage> >::iterator it =
- m_partialMessages.find(messageIdentifier);
- if (it == m_partialMessages.end()) {
- return;
- }
-
- scheduler::cancel(it->second->m_expiry);
- m_partialMessages.erase(it);
-}
-
-} // namespace ndnlp
-} // namespace nfd
diff --git a/NFD/daemon/face/ndnlp-partial-message-store.hpp b/NFD/daemon/face/ndnlp-partial-message-store.hpp
deleted file mode 100644
index c707d92..0000000
--- a/NFD/daemon/face/ndnlp-partial-message-store.hpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_NDNLP_PARTIAL_MESSAGE_STORE_HPP
-#define NFD_DAEMON_FACE_NDNLP_PARTIAL_MESSAGE_STORE_HPP
-
-#include "ndnlp-parse.hpp"
-#include "core/scheduler.hpp"
-
-namespace nfd {
-namespace ndnlp {
-
-/** \brief represents a partially received message
- */
-class PartialMessage : noncopyable
-{
-public:
- PartialMessage();
-
- bool
- add(uint16_t fragIndex, uint16_t fragCount, const Block& payload);
-
- bool
- isComplete() const;
-
- /** \brief reassemble network layer packet
- *
- * isComplete() must be true before calling this method
- *
- * \exception ndn::Block::Error packet is malformated
- * \return network layer packet
- */
- Block
- reassemble();
-
-public:
- EventId m_expiry;
-
-private:
- size_t m_fragCount;
- size_t m_received;
- std::vector<Block> m_payloads;
- size_t m_totalLength;
-};
-
-/** \brief provides reassembly feature at receiver
- */
-class PartialMessageStore : noncopyable
-{
-public:
- explicit
- PartialMessageStore(const time::nanoseconds& idleDuration = time::milliseconds(100));
-
- virtual
- ~PartialMessageStore();
-
- /** \brief receive a NdnlpData packet
- *
- * \exception ParseError NDNLP packet is malformated
- * \exception ndn::Block::Error network layer packet is malformated
- */
- void
- receiveNdnlpData(const Block& pkt);
-
- /// fires when network layer packet is received
- EventEmitter<Block> onReceive;
-
-private:
- void
- scheduleCleanup(uint64_t messageIdentifier, shared_ptr<PartialMessage> partialMessage);
-
- void
- cleanup(uint64_t messageIdentifier);
-
-private:
- std::map<uint64_t, shared_ptr<PartialMessage> > m_partialMessages;
-
- time::nanoseconds m_idleDuration;
-};
-
-} // namespace ndnlp
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_NDNLP_PARTIAL_MESSAGE_STORE_HPP
diff --git a/NFD/daemon/face/ndnlp-sequence-generator.cpp b/NFD/daemon/face/ndnlp-sequence-generator.cpp
deleted file mode 100644
index 842a319..0000000
--- a/NFD/daemon/face/ndnlp-sequence-generator.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "ndnlp-sequence-generator.hpp"
-
-namespace nfd {
-namespace ndnlp {
-
-SequenceBlock::SequenceBlock(uint64_t start, size_t count)
- : m_start(start)
- , m_count(count)
-{
-}
-
-SequenceGenerator::SequenceGenerator()
- : m_next(0)
-{
-}
-
-SequenceBlock
-SequenceGenerator::nextBlock(size_t count)
-{
- SequenceBlock sb(m_next, count);
- m_next += count;
- return sb;
-}
-
-} // namespace ndnlp
-} // namespace nfd
diff --git a/NFD/daemon/face/ndnlp-sequence-generator.hpp b/NFD/daemon/face/ndnlp-sequence-generator.hpp
deleted file mode 100644
index a3baa6b..0000000
--- a/NFD/daemon/face/ndnlp-sequence-generator.hpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
-#define NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
-
-#include "common.hpp"
-
-namespace nfd {
-namespace ndnlp {
-
-/** \brief represents a block of sequence numbers
- */
-class SequenceBlock
-{
-public:
- SequenceBlock(uint64_t start, size_t count);
-
- /** \return{ the pos-th sequence number }
- */
- uint64_t
- operator[](size_t pos) const;
-
- size_t
- count() const;
-
-private:
- uint64_t m_start;
- size_t m_count;
-};
-
-inline uint64_t
-SequenceBlock::operator[](size_t pos) const
-{
- if (pos >= m_count)
- throw std::out_of_range("pos");
- return m_start + static_cast<uint64_t>(pos);
-}
-
-inline size_t
-SequenceBlock::count() const
-{
- return m_count;
-}
-
-/** \class SequenceGenerator
- * \brief generates sequence numbers
- */
-class SequenceGenerator : noncopyable
-{
-public:
- SequenceGenerator();
-
- /** \brief generates a block of consecutive sequence numbers
- *
- * This block must not overlap with a recent block.
- */
- SequenceBlock
- nextBlock(size_t count);
-
-private:
- /// next sequence number
- uint64_t m_next;
-};
-
-} // namespace ndnlp
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_NDNLP_SEQUENCE_GENERATOR_HPP
diff --git a/NFD/daemon/face/ndnlp-slicer.cpp b/NFD/daemon/face/ndnlp-slicer.cpp
deleted file mode 100644
index 285f79f..0000000
--- a/NFD/daemon/face/ndnlp-slicer.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ndnlp-slicer.hpp"
-
-#include <ndn-cxx/encoding/encoding-buffer.hpp>
-
-namespace nfd {
-namespace ndnlp {
-
-Slicer::Slicer(size_t mtu)
- : m_mtu(mtu)
-{
- this->estimateOverhead();
-}
-
-Slicer::~Slicer()
-{
-}
-
-template<bool T>
-size_t
-Slicer::encodeFragment(ndn::EncodingImpl<T>& blk,
- uint64_t seq, uint16_t fragIndex, uint16_t fragCount,
- const uint8_t* payload, size_t payloadSize)
-{
- size_t totalLength = 0;
-
- // NdnlpPayload
- size_t payloadLength = blk.prependByteArray(payload, payloadSize);
- totalLength += payloadLength;
- totalLength += blk.prependVarNumber(payloadLength);
- totalLength += blk.prependVarNumber(tlv::NdnlpPayload);
-
- bool needFragIndexAndCount = fragCount > 1;
- if (needFragIndexAndCount) {
- // NdnlpFragCount
- size_t fragCountLength = blk.prependNonNegativeInteger(fragCount);
- totalLength += fragCountLength;
- totalLength += blk.prependVarNumber(fragCountLength);
- totalLength += blk.prependVarNumber(tlv::NdnlpFragCount);
-
- // NdnlpFragIndex
- size_t fragIndexLength = blk.prependNonNegativeInteger(fragIndex);
- totalLength += fragIndexLength;
- totalLength += blk.prependVarNumber(fragIndexLength);
- totalLength += blk.prependVarNumber(tlv::NdnlpFragIndex);
- }
-
- // NdnlpSequence
- uint64_t sequenceBE = htobe64(seq);
- size_t sequenceLength = blk.prependByteArray(
- reinterpret_cast<uint8_t*>(&sequenceBE), sizeof(sequenceBE));
- totalLength += sequenceLength;
- totalLength += blk.prependVarNumber(sequenceLength);
- totalLength += blk.prependVarNumber(tlv::NdnlpSequence);
-
- // NdnlpData
- totalLength += blk.prependVarNumber(totalLength);
- totalLength += blk.prependVarNumber(tlv::NdnlpData);
-
- return totalLength;
-}
-
-void
-Slicer::estimateOverhead()
-{
- // estimate fragment size with all header fields at largest possible size
- ndn::EncodingEstimator estimator;
- size_t estimatedSize = this->encodeFragment(estimator,
- std::numeric_limits<uint64_t>::max(),
- std::numeric_limits<uint16_t>::max() - 1,
- std::numeric_limits<uint16_t>::max(),
- nullptr, m_mtu);
-
- size_t overhead = estimatedSize - m_mtu; // minus payload length in estimation
- m_maxPayload = m_mtu - overhead;
-}
-
-PacketArray
-Slicer::slice(const Block& block)
-{
- BOOST_ASSERT(block.hasWire());
- const uint8_t* networkPacket = block.wire();
- size_t networkPacketSize = block.size();
-
- uint16_t fragCount = static_cast<uint16_t>(
- (networkPacketSize / m_maxPayload) +
- (networkPacketSize % m_maxPayload == 0 ? 0 : 1)
- );
- PacketArray pa = make_shared<std::vector<Block>>();
- pa->reserve(fragCount);
- SequenceBlock seqBlock = m_seqgen.nextBlock(fragCount);
-
- for (uint16_t fragIndex = 0; fragIndex < fragCount; ++fragIndex) {
- size_t payloadOffset = fragIndex * m_maxPayload;
- const uint8_t* payload = networkPacket + payloadOffset;
- size_t payloadSize = std::min(m_maxPayload, networkPacketSize - payloadOffset);
-
- ndn::EncodingBuffer buffer(m_mtu, 0);
- size_t pktSize = this->encodeFragment(buffer,
- seqBlock[fragIndex], fragIndex, fragCount, payload, payloadSize);
-
- BOOST_VERIFY(pktSize <= m_mtu);
-
- pa->push_back(buffer.block());
- }
-
- return pa;
-}
-
-} // namespace ndnlp
-} // namespace nfd
diff --git a/NFD/daemon/face/ndnlp-slicer.hpp b/NFD/daemon/face/ndnlp-slicer.hpp
deleted file mode 100644
index f5d9056..0000000
--- a/NFD/daemon/face/ndnlp-slicer.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_NDNLP_SLICER_HPP
-#define NFD_DAEMON_FACE_NDNLP_SLICER_HPP
-
-#include "ndnlp-tlv.hpp"
-#include "ndnlp-sequence-generator.hpp"
-
-namespace nfd {
-namespace ndnlp {
-
-typedef shared_ptr<std::vector<Block>> PacketArray;
-
-/** \brief provides fragmentation feature at sender
- */
-class Slicer : noncopyable
-{
-public:
- /** \param mtu maximum size of NDNLP header and payload
- * \note If NDNLP packets are to be encapsulated in an additional header
- * (eg. in UDP packets), the caller must deduct such overhead.
- */
- explicit
- Slicer(size_t mtu);
-
- virtual
- ~Slicer();
-
- PacketArray
- slice(const Block& block);
-
-private:
- template<bool T>
- size_t
- encodeFragment(ndn::EncodingImpl<T>& blk,
- uint64_t seq, uint16_t fragIndex, uint16_t fragCount,
- const uint8_t* payload, size_t payloadSize);
-
- /// estimate the size of NDNLP header and maximum payload size per packet
- void
- estimateOverhead();
-
-private:
- SequenceGenerator m_seqgen;
-
- /// maximum packet size
- size_t m_mtu;
-
- /// maximum payload size
- size_t m_maxPayload;
-};
-
-} // namespace ndnlp
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_NDNLP_SLICER_HPP
diff --git a/NFD/daemon/face/ndnlp-tlv.hpp b/NFD/daemon/face/ndnlp-tlv.hpp
deleted file mode 100644
index 0c41f52..0000000
--- a/NFD/daemon/face/ndnlp-tlv.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_NDNLP_TLV_HPP
-#define NFD_DAEMON_FACE_NDNLP_TLV_HPP
-
-namespace nfd {
-namespace tlv {
-
-enum
-{
- NdnlpData = 80,
- NdnlpSequence = 81,
- NdnlpFragIndex = 82,
- NdnlpFragCount = 83,
- NdnlpPayload = 84
-};
-
-} // namespace tlv
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_NDNLP_TLV_HPP
diff --git a/NFD/daemon/face/stream-face.hpp b/NFD/daemon/face/stream-face.hpp
deleted file mode 100644
index e719da3..0000000
--- a/NFD/daemon/face/stream-face.hpp
+++ /dev/null
@@ -1,394 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_STREAM_FACE_HPP
-#define NFD_DAEMON_FACE_STREAM_FACE_HPP
-
-#include "face.hpp"
-#include "local-face.hpp"
-#include "core/logger.hpp"
-
-namespace nfd {
-
-// forward declaration
-template<class T, class U, class V> struct StreamFaceSenderImpl;
-
-template<class Protocol, class FaceBase = Face>
-class StreamFace : public FaceBase
-{
-public:
- typedef Protocol protocol;
-
- /**
- * \brief Create instance of StreamFace
- */
- StreamFace(const FaceUri& remoteUri, const FaceUri& localUri,
- const shared_ptr<typename protocol::socket>& socket,
- bool isOnDemand);
-
- virtual
- ~StreamFace();
-
- // from Face
- virtual void
- sendInterest(const Interest& interest);
-
- virtual void
- sendData(const Data& data);
-
- virtual void
- close();
-
-protected:
- void
- processErrorCode(const boost::system::error_code& error);
-
- void
- sendFromQueue();
-
- void
- handleSend(const boost::system::error_code& error,
- size_t nBytesSent);
-
- void
- handleReceive(const boost::system::error_code& error,
- size_t nBytesReceived);
-
- void
- shutdownSocket();
-
- void
- deferredClose(const shared_ptr<Face>& face);
-
-protected:
- shared_ptr<typename protocol::socket> m_socket;
-
-private:
- uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
- size_t m_inputBufferSize;
- std::queue<Block> m_sendQueue;
-
- friend struct StreamFaceSenderImpl<Protocol, FaceBase, Interest>;
- friend struct StreamFaceSenderImpl<Protocol, FaceBase, Data>;
-
- NFD_LOG_INCLASS_DECLARE();
-};
-
-// All inherited classes must use
-// NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(StreamFace, <specialization-parameter>, "Name");
-
-
-/** \brief Class allowing validation of the StreamFace use
- *
- * For example, partial specialization based on boost::asio::ip::tcp should check
- * that local endpoint is loopback
- *
- * @throws Face::Error if validation failed
- */
-template<class Protocol, class U>
-struct StreamFaceValidator
-{
- static void
- validateSocket(typename Protocol::socket& socket)
- {
- }
-};
-
-
-template<class T, class FaceBase>
-inline
-StreamFace<T, FaceBase>::StreamFace(const FaceUri& remoteUri, const FaceUri& localUri,
- const shared_ptr<typename StreamFace::protocol::socket>& socket,
- bool isOnDemand)
- : FaceBase(remoteUri, localUri)
- , m_socket(socket)
- , m_inputBufferSize(0)
-{
- FaceBase::setOnDemand(isOnDemand);
- StreamFaceValidator<T, FaceBase>::validateSocket(*socket);
- m_socket->async_receive(boost::asio::buffer(m_inputBuffer, ndn::MAX_NDN_PACKET_SIZE), 0,
- bind(&StreamFace<T, FaceBase>::handleReceive, this, _1, _2));
-}
-
-template<class T, class U>
-inline
-StreamFace<T, U>::~StreamFace()
-{
-}
-
-
-template<class Protocol, class FaceBase, class Packet>
-struct StreamFaceSenderImpl
-{
- static void
- send(StreamFace<Protocol, FaceBase>& face, const Packet& packet)
- {
- bool wasQueueEmpty = face.m_sendQueue.empty();
- face.m_sendQueue.push(packet.wireEncode());
-
- if (wasQueueEmpty)
- face.sendFromQueue();
- }
-};
-
-// partial specialization (only classes can be partially specialized)
-template<class Protocol, class Packet>
-struct StreamFaceSenderImpl<Protocol, LocalFace, Packet>
-{
- static void
- send(StreamFace<Protocol, LocalFace>& face, const Packet& packet)
- {
- bool wasQueueEmpty = face.m_sendQueue.empty();
-
- if (!face.isEmptyFilteredLocalControlHeader(packet.getLocalControlHeader()))
- {
- face.m_sendQueue.push(face.filterAndEncodeLocalControlHeader(packet));
- }
- face.m_sendQueue.push(packet.wireEncode());
-
- if (wasQueueEmpty)
- face.sendFromQueue();
- }
-};
-
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::sendInterest(const Interest& interest)
-{
- this->onSendInterest(interest);
- StreamFaceSenderImpl<T, U, Interest>::send(*this, interest);
-}
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::sendData(const Data& data)
-{
- this->onSendData(data);
- StreamFaceSenderImpl<T, U, Data>::send(*this, data);
-}
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::close()
-{
- if (!m_socket->is_open())
- return;
-
- NFD_LOG_INFO("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Close connection");
-
- shutdownSocket();
- this->fail("Close connection");
-}
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::processErrorCode(const boost::system::error_code& error)
-{
- if (error == boost::asio::error::operation_aborted || // when cancel() is called
- error == boost::asio::error::shut_down) // after shutdown() is called
- return;
-
- if (!m_socket->is_open())
- {
- this->fail("Connection closed");
- return;
- }
-
- if (error == boost::asio::error::eof)
- {
- NFD_LOG_INFO("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Connection closed");
- }
- else
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Send or receive operation failed, closing face: "
- << error.message());
- }
-
- shutdownSocket();
-
- if (error == boost::asio::error::eof)
- {
- this->fail("Connection closed");
- }
- else
- {
- this->fail("Send or receive operation failed, closing face: " + error.message());
- }
-}
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::sendFromQueue()
-{
- const Block& block = this->m_sendQueue.front();
- boost::asio::async_write(*this->m_socket, boost::asio::buffer(block),
- bind(&StreamFace<T, U>::handleSend, this, _1, _2));
-}
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::handleSend(const boost::system::error_code& error,
- size_t nBytesSent)
-{
- if (error)
- return processErrorCode(error);
-
- BOOST_ASSERT(!m_sendQueue.empty());
-
- NFD_LOG_TRACE("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Successfully sent: " << nBytesSent << " bytes");
- this->getMutableCounters().getNOutBytes() += nBytesSent;
-
- m_sendQueue.pop();
- if (!m_sendQueue.empty())
- sendFromQueue();
-}
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::handleReceive(const boost::system::error_code& error,
- size_t nBytesReceived)
-{
- if (error)
- return processErrorCode(error);
-
- NFD_LOG_TRACE("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Received: " << nBytesReceived << " bytes");
- this->getMutableCounters().getNInBytes() += nBytesReceived;
-
- m_inputBufferSize += nBytesReceived;
-
- size_t offset = 0;
-
- bool isOk = true;
- Block element;
- while (m_inputBufferSize - offset > 0)
- {
- isOk = Block::fromBuffer(m_inputBuffer + offset, m_inputBufferSize - offset, element);
- if (!isOk)
- break;
-
- offset += element.size();
-
- BOOST_ASSERT(offset <= m_inputBufferSize);
-
- if (!this->decodeAndDispatchInput(element))
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Received unrecognized block of type ["
- << element.type() << "]");
- // ignore unknown packet and proceed
- }
- }
- if (!isOk && m_inputBufferSize == ndn::MAX_NDN_PACKET_SIZE && offset == 0)
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Failed to parse incoming packet or packet too large to process, "
- << "closing down the face");
- shutdownSocket();
- this->fail("Failed to parse incoming packet or packet too large to process, "
- "closing down the face");
- return;
- }
-
- if (offset > 0)
- {
- if (offset != m_inputBufferSize)
- {
- std::copy(m_inputBuffer + offset, m_inputBuffer + m_inputBufferSize,
- m_inputBuffer);
- m_inputBufferSize -= offset;
- }
- else
- {
- m_inputBufferSize = 0;
- }
- }
-
- m_socket->async_receive(boost::asio::buffer(m_inputBuffer + m_inputBufferSize,
- ndn::MAX_NDN_PACKET_SIZE - m_inputBufferSize), 0,
- bind(&StreamFace<T, U>::handleReceive, this, _1, _2));
-}
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::shutdownSocket()
-{
- // Cancel all outstanding operations and shutdown the socket
- // so that no further sends or receives are possible.
- // Use the non-throwing variants and ignore errors, if any.
- boost::system::error_code error;
- m_socket->cancel(error);
- m_socket->shutdown(protocol::socket::shutdown_both, error);
-
- boost::asio::io_service& io = m_socket->get_io_service();
- // ensure that the Face object is alive at least until all pending
- // handlers are dispatched
- io.post(bind(&StreamFace<T, U>::deferredClose, this, this->shared_from_this()));
-
- // Some bug or feature of Boost.Asio (see http://redmine.named-data.net/issues/1856):
- //
- // When shutdownSocket is called from within a socket event (e.g., from handleReceive),
- // m_socket->shutdown() does not trigger the cancellation of the handleSend callback.
- // Instead, handleSend is invoked as nothing bad happened.
- //
- // In order to prevent the assertion in handleSend from failing, we clear the queue
- // and close the socket in deferredClose, i.e., after all callbacks scheduled up to
- // this point have been executed. If more send operations are scheduled after this
- // point, they will fail because the socket has been shutdown, and their callbacks
- // will be invoked with error code == asio::error::shut_down.
-}
-
-template<class T, class U>
-inline void
-StreamFace<T, U>::deferredClose(const shared_ptr<Face>& face)
-{
- NFD_LOG_DEBUG("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Clearing send queue");
-
- // clear send queue
- std::queue<Block> emptyQueue;
- std::swap(emptyQueue, m_sendQueue);
-
- // use the non-throwing variant and ignore errors, if any
- boost::system::error_code error;
- m_socket->close(error);
-}
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_STREAM_FACE_HPP
diff --git a/NFD/daemon/face/tcp-channel.cpp b/NFD/daemon/face/tcp-channel.cpp
deleted file mode 100644
index cd2744d..0000000
--- a/NFD/daemon/face/tcp-channel.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "tcp-channel.hpp"
-#include "core/global-io.hpp"
-
-namespace nfd {
-
-NFD_LOG_INIT("TcpChannel");
-
-using namespace boost::asio;
-
-TcpChannel::TcpChannel(const tcp::Endpoint& localEndpoint)
- : m_localEndpoint(localEndpoint)
- , m_isListening(false)
-{
- this->setUri(FaceUri(localEndpoint));
-}
-
-TcpChannel::~TcpChannel()
-{
-}
-
-void
-TcpChannel::listen(const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onAcceptFailed,
- int backlog/* = tcp::acceptor::max_connections*/)
-{
- m_acceptor = make_shared<ip::tcp::acceptor>(ref(getGlobalIoService()));
- m_acceptor->open(m_localEndpoint.protocol());
- m_acceptor->set_option(ip::tcp::acceptor::reuse_address(true));
- if (m_localEndpoint.address().is_v6())
- {
- m_acceptor->set_option(ip::v6_only(true));
- }
- m_acceptor->bind(m_localEndpoint);
- m_acceptor->listen(backlog);
-
- shared_ptr<ip::tcp::socket> clientSocket =
- make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
- m_acceptor->async_accept(*clientSocket,
- bind(&TcpChannel::handleSuccessfulAccept, this, _1,
- clientSocket,
- onFaceCreated, onAcceptFailed));
-
- m_isListening = true;
-}
-
-void
-TcpChannel::connect(const tcp::Endpoint& remoteEndpoint,
- const TcpChannel::FaceCreatedCallback& onFaceCreated,
- const TcpChannel::ConnectFailedCallback& onConnectFailed,
- const time::seconds& timeout/* = time::seconds(4)*/)
-{
- ChannelFaceMap::iterator i = m_channelFaces.find(remoteEndpoint);
- if (i != m_channelFaces.end()) {
- onFaceCreated(i->second);
- return;
- }
-
- shared_ptr<ip::tcp::socket> clientSocket =
- make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
-
- EventId connectTimeoutEvent = scheduler::schedule(timeout,
- bind(&TcpChannel::handleFailedConnect, this,
- clientSocket, onConnectFailed));
-
- clientSocket->async_connect(remoteEndpoint,
- bind(&TcpChannel::handleSuccessfulConnect, this, _1,
- clientSocket, connectTimeoutEvent,
- onFaceCreated, onConnectFailed));
-}
-
-void
-TcpChannel::connect(const std::string& remoteHost, const std::string& remotePort,
- const TcpChannel::FaceCreatedCallback& onFaceCreated,
- const TcpChannel::ConnectFailedCallback& onConnectFailed,
- const time::seconds& timeout/* = time::seconds(4)*/)
-{
- shared_ptr<ip::tcp::socket> clientSocket =
- make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
-
- ip::tcp::resolver::query query(remoteHost, remotePort);
- shared_ptr<ip::tcp::resolver> resolver =
- make_shared<ip::tcp::resolver>(ref(getGlobalIoService()));
-
- EventId connectTimeoutEvent = scheduler::schedule(timeout,
- bind(&TcpChannel::handleFailedConnect, this,
- clientSocket, onConnectFailed));
-
- resolver->async_resolve(query,
- bind(&TcpChannel::handleEndpointResolution, this, _1, _2,
- clientSocket, connectTimeoutEvent,
- onFaceCreated, onConnectFailed,
- resolver));
-}
-
-size_t
-TcpChannel::size() const
-{
- return m_channelFaces.size();
-}
-
-void
-TcpChannel::createFace(const shared_ptr<ip::tcp::socket>& socket,
- const FaceCreatedCallback& onFaceCreated,
- bool isOnDemand)
-{
- tcp::Endpoint remoteEndpoint = socket->remote_endpoint();
-
- shared_ptr<Face> face;
-
- ChannelFaceMap::iterator faceMapPos = m_channelFaces.find(remoteEndpoint);
- if (faceMapPos == m_channelFaces.end())
- {
- if (socket->local_endpoint().address().is_loopback())
- face = make_shared<TcpLocalFace>(socket, isOnDemand);
- else
- face = make_shared<TcpFace>(socket, isOnDemand);
-
- face->onFail += bind(&TcpChannel::afterFaceFailed, this, remoteEndpoint);
-
- m_channelFaces[remoteEndpoint] = face;
- }
- else
- {
- // we've already created a a face for this endpoint, just reuse it
- face = faceMapPos->second;
-
- boost::system::error_code error;
- socket->shutdown(ip::tcp::socket::shutdown_both, error);
- socket->close(error);
- }
-
- // Need to invoke the callback regardless of whether or not we have already created
- // the face so that control responses and such can be sent.
- onFaceCreated(face);
-}
-
-void
-TcpChannel::afterFaceFailed(tcp::Endpoint &remoteEndpoint)
-{
- NFD_LOG_DEBUG("afterFaceFailed: " << remoteEndpoint);
- m_channelFaces.erase(remoteEndpoint);
-}
-
-void
-TcpChannel::handleSuccessfulAccept(const boost::system::error_code& error,
- const shared_ptr<boost::asio::ip::tcp::socket>& socket,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onAcceptFailed)
-{
- if (error) {
- if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
- return;
-
- NFD_LOG_DEBUG("Connect to remote endpoint failed: "
- << error.category().message(error.value()));
-
- if (static_cast<bool>(onAcceptFailed))
- onAcceptFailed("Connect to remote endpoint failed: " +
- error.category().message(error.value()));
- return;
- }
-
- // prepare accepting the next connection
- shared_ptr<ip::tcp::socket> clientSocket =
- make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
- m_acceptor->async_accept(*clientSocket,
- bind(&TcpChannel::handleSuccessfulAccept, this, _1,
- clientSocket,
- onFaceCreated, onAcceptFailed));
-
- NFD_LOG_DEBUG("[" << m_localEndpoint << "] "
- "<< Connection from " << socket->remote_endpoint());
- createFace(socket, onFaceCreated, true);
-}
-
-void
-TcpChannel::handleSuccessfulConnect(const boost::system::error_code& error,
- const shared_ptr<ip::tcp::socket>& socket,
- const EventId& connectTimeoutEvent,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed)
-{
- scheduler::cancel(connectTimeoutEvent);
-
-#if (BOOST_VERSION == 105400)
- // To handle regression in Boost 1.54
- // https://svn.boost.org/trac/boost/ticket/8795
- boost::system::error_code anotherErrorCode;
- socket->remote_endpoint(anotherErrorCode);
- if (error || anotherErrorCode) {
-#else
- if (error) {
-#endif
-
- if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
- return;
-
- socket->close();
-
- NFD_LOG_DEBUG("Connect to remote endpoint failed: "
- << error.category().message(error.value()));
-
- onConnectFailed("Connect to remote endpoint failed: " +
- error.category().message(error.value()));
- return;
- }
-
- NFD_LOG_DEBUG("[" << m_localEndpoint << "] "
- ">> Connection to " << socket->remote_endpoint());
-
- createFace(socket, onFaceCreated, false);
-}
-
-void
-TcpChannel::handleFailedConnect(const shared_ptr<ip::tcp::socket>& socket,
- const ConnectFailedCallback& onConnectFailed)
-{
- NFD_LOG_DEBUG("Connect to remote endpoint timed out");
- onConnectFailed("Connect to remote endpoint timed out");
- socket->close(); // abort the connection
-}
-
-void
-TcpChannel::handleEndpointResolution(const boost::system::error_code& error,
- ip::tcp::resolver::iterator remoteEndpoint,
- const shared_ptr<boost::asio::ip::tcp::socket>& socket,
- const EventId& connectTimeoutEvent,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed,
- const shared_ptr<ip::tcp::resolver>& resolver)
-{
- if (error ||
- remoteEndpoint == ip::tcp::resolver::iterator())
- {
- if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
- return;
-
- socket->close();
- scheduler::cancel(connectTimeoutEvent);
-
- NFD_LOG_DEBUG("Remote endpoint hostname or port cannot be resolved: "
- << error.category().message(error.value()));
-
- onConnectFailed("Remote endpoint hostname or port cannot be resolved: " +
- error.category().message(error.value()));
- return;
- }
-
- // got endpoint, now trying to connect (only try the first resolution option)
- socket->async_connect(*remoteEndpoint,
- bind(&TcpChannel::handleSuccessfulConnect, this, _1,
- socket, connectTimeoutEvent,
- onFaceCreated, onConnectFailed));
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/tcp-channel.hpp b/NFD/daemon/face/tcp-channel.hpp
deleted file mode 100644
index f126a47..0000000
--- a/NFD/daemon/face/tcp-channel.hpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_TCP_CHANNEL_HPP
-#define NFD_DAEMON_FACE_TCP_CHANNEL_HPP
-
-#include "channel.hpp"
-#include "tcp-face.hpp"
-#include "core/scheduler.hpp"
-
-namespace nfd {
-
-namespace tcp {
-typedef boost::asio::ip::tcp::endpoint Endpoint;
-} // namespace tcp
-
-/**
- * \brief Class implementing TCP-based channel to create faces
- *
- * Channel can create faces as a response to incoming TCP
- * connections (TcpChannel::listen needs to be called for that
- * to work) or explicitly after using TcpChannel::connect method.
- */
-class TcpChannel : public Channel
-{
-public:
- /**
- * \brief Create TCP channel for the local endpoint
- *
- * To enable creation faces upon incoming connections,
- * one needs to explicitly call TcpChannel::listen method.
- */
- explicit
- TcpChannel(const tcp::Endpoint& localEndpoint);
-
- virtual
- ~TcpChannel();
-
- /**
- * \brief Enable listening on the local endpoint, accept connections,
- * and create faces when remote host makes a connection
- * \param onFaceCreated Callback to notify successful creation of the face
- * \param onAcceptFailed Callback to notify when channel fails (accept call
- * returns an error)
- * \param backlog The maximum length of the queue of pending incoming
- * connections
- */
- void
- listen(const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onAcceptFailed,
- int backlog = boost::asio::ip::tcp::acceptor::max_connections);
-
- /**
- * \brief Create a face by establishing connection to remote endpoint
- */
- void
- connect(const tcp::Endpoint& remoteEndpoint,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed,
- const time::seconds& timeout = time::seconds(4));
-
- /**
- * \brief Create a face by establishing connection to the specified
- * remote host and remote port
- *
- * This method will never block and will return immediately. All
- * necessary hostname and port resolution and connection will happen
- * in asynchronous mode.
- *
- * If connection cannot be established within specified timeout, it
- * will be aborted.
- */
- void
- connect(const std::string& remoteHost, const std::string& remotePort,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed,
- const time::seconds& timeout = time::seconds(4));
-
- /**
- * \brief Get number of faces in the channel
- */
- size_t
- size() const;
-
- bool
- isListening() const;
-
-private:
- void
- createFace(const shared_ptr<boost::asio::ip::tcp::socket>& socket,
- const FaceCreatedCallback& onFaceCreated,
- bool isOnDemand);
-
- void
- afterFaceFailed(tcp::Endpoint &endpoint);
-
- void
- handleSuccessfulAccept(const boost::system::error_code& error,
- const shared_ptr<boost::asio::ip::tcp::socket>& socket,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed);
-
- void
- handleSuccessfulConnect(const boost::system::error_code& error,
- const shared_ptr<boost::asio::ip::tcp::socket>& socket,
- const EventId& connectTimeoutEvent,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed);
-
- void
- handleFailedConnect(const shared_ptr<boost::asio::ip::tcp::socket>& socket,
- const ConnectFailedCallback& onConnectFailed);
-
- void
- handleEndpointResolution(const boost::system::error_code& error,
- boost::asio::ip::tcp::resolver::iterator remoteEndpoint,
- const shared_ptr<boost::asio::ip::tcp::socket>& socket,
- const EventId& connectTimeoutEvent,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed,
- const shared_ptr<boost::asio::ip::tcp::resolver>& resolver);
-
-private:
- tcp::Endpoint m_localEndpoint;
-
- typedef std::map< tcp::Endpoint, shared_ptr<Face> > ChannelFaceMap;
- ChannelFaceMap m_channelFaces;
-
- bool m_isListening;
- shared_ptr<boost::asio::ip::tcp::acceptor> m_acceptor;
-};
-
-inline bool
-TcpChannel::isListening() const
-{
- return m_isListening;
-}
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_TCP_CHANNEL_HPP
diff --git a/NFD/daemon/face/tcp-face.cpp b/NFD/daemon/face/tcp-face.cpp
deleted file mode 100644
index 6428b03..0000000
--- a/NFD/daemon/face/tcp-face.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "tcp-face.hpp"
-
-namespace nfd {
-
-NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(StreamFace, TcpFace::protocol, "TcpFace");
-
-NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(StreamFace,
- TcpLocalFace::protocol, LocalFace,
- "TcpLocalFace");
-
-TcpFace::TcpFace(const shared_ptr<TcpFace::protocol::socket>& socket, bool isOnDemand)
- : StreamFace<protocol>(FaceUri(socket->remote_endpoint()),
- FaceUri(socket->local_endpoint()),
- socket, isOnDemand)
-{
-}
-
-TcpLocalFace::TcpLocalFace(const shared_ptr<TcpLocalFace::protocol::socket>& socket,
- bool isOnDemand)
- : StreamFace<protocol, LocalFace>(FaceUri(socket->remote_endpoint()),
- FaceUri(socket->local_endpoint()),
- socket, isOnDemand)
-{
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/tcp-face.hpp b/NFD/daemon/face/tcp-face.hpp
deleted file mode 100644
index 3eddde1..0000000
--- a/NFD/daemon/face/tcp-face.hpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_TCP_FACE_HPP
-#define NFD_DAEMON_FACE_TCP_FACE_HPP
-
-#include "stream-face.hpp"
-
-namespace nfd {
-
-/**
- * \brief Implementation of Face abstraction that uses TCP
- * as underlying transport mechanism
- */
-class TcpFace : public StreamFace<boost::asio::ip::tcp>
-{
-public:
- TcpFace(const shared_ptr<protocol::socket>& socket,
- bool isOnDemand);
-};
-
-//
-
-/**
- * \brief Implementation of Face abstraction that uses TCP
- * as underlying transport mechanism and is used for
- * local communication (can enable LocalControlHeader)
- */
-class TcpLocalFace : public StreamFace<boost::asio::ip::tcp, LocalFace>
-{
-public:
- TcpLocalFace(const shared_ptr<protocol::socket>& socket,
- bool isOnDemand);
-};
-
-
-/** \brief Class validating use of TcpLocalFace
- */
-template<>
-struct StreamFaceValidator<boost::asio::ip::tcp, LocalFace>
-{
- /** Check that local endpoint is loopback
- *
- * @throws Face::Error if validation failed
- */
- static void
- validateSocket(boost::asio::ip::tcp::socket& socket)
- {
- if (!socket.local_endpoint().address().is_loopback() ||
- !socket.remote_endpoint().address().is_loopback())
- {
- throw Face::Error("TcpLocalFace can be created only on loopback interface");
- }
- }
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_TCP_FACE_HPP
diff --git a/NFD/daemon/face/tcp-factory.cpp b/NFD/daemon/face/tcp-factory.cpp
deleted file mode 100644
index 598a2c4..0000000
--- a/NFD/daemon/face/tcp-factory.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "tcp-factory.hpp"
-#include "core/resolver.hpp"
-#include "core/logger.hpp"
-#include "core/network-interface.hpp"
-
-NFD_LOG_INIT("TcpFactory");
-
-namespace nfd {
-
-static const boost::asio::ip::address_v4 ALL_V4_ENDPOINT(
- boost::asio::ip::address_v4::from_string("0.0.0.0"));
-
-static const boost::asio::ip::address_v6 ALL_V6_ENDPOINT(
- boost::asio::ip::address_v6::from_string("::"));
-
-TcpFactory::TcpFactory(const std::string& defaultPort/* = "6363"*/)
- : m_defaultPort(defaultPort)
-{
-}
-
-void
-TcpFactory::prohibitEndpoint(const tcp::Endpoint& endpoint)
-{
- using namespace boost::asio::ip;
-
- const address& address = endpoint.address();
-
- if (address.is_v4() && address == ALL_V4_ENDPOINT)
- {
- prohibitAllIpv4Endpoints(endpoint.port());
- }
- else if (endpoint.address().is_v6() && address == ALL_V6_ENDPOINT)
- {
- prohibitAllIpv6Endpoints(endpoint.port());
- }
-
- NFD_LOG_TRACE("prohibiting TCP " << endpoint);
-
- m_prohibitedEndpoints.insert(endpoint);
-}
-
-void
-TcpFactory::prohibitAllIpv4Endpoints(const uint16_t port)
-{
- using namespace boost::asio::ip;
-
- for (const NetworkInterfaceInfo& nic : listNetworkInterfaces()) {
- for (const address_v4& addr : nic.ipv4Addresses) {
- if (addr != ALL_V4_ENDPOINT) {
- prohibitEndpoint(tcp::Endpoint(addr, port));
- }
- }
- }
-}
-
-void
-TcpFactory::prohibitAllIpv6Endpoints(const uint16_t port)
-{
- using namespace boost::asio::ip;
-
- for (const NetworkInterfaceInfo& nic : listNetworkInterfaces()) {
- for (const address_v6& addr : nic.ipv6Addresses) {
- if (addr != ALL_V6_ENDPOINT) {
- prohibitEndpoint(tcp::Endpoint(addr, port));
- }
- }
- }
-}
-
-shared_ptr<TcpChannel>
-TcpFactory::createChannel(const tcp::Endpoint& endpoint)
-{
- shared_ptr<TcpChannel> channel = findChannel(endpoint);
- if (static_cast<bool>(channel))
- return channel;
-
- channel = make_shared<TcpChannel>(endpoint);
- m_channels[endpoint] = channel;
- prohibitEndpoint(endpoint);
-
- NFD_LOG_DEBUG("Channel [" << endpoint << "] created");
- return channel;
-}
-
-shared_ptr<TcpChannel>
-TcpFactory::createChannel(const std::string& localHost, const std::string& localPort)
-{
- return createChannel(TcpResolver::syncResolve(localHost, localPort));
-}
-
-shared_ptr<TcpChannel>
-TcpFactory::findChannel(const tcp::Endpoint& localEndpoint)
-{
- ChannelMap::iterator i = m_channels.find(localEndpoint);
- if (i != m_channels.end())
- return i->second;
- else
- return shared_ptr<TcpChannel>();
-}
-
-void
-TcpFactory::createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed)
-{
- resolver::AddressSelector addressSelector = resolver::AnyAddress();
- if (uri.getScheme() == "tcp4")
- addressSelector = resolver::Ipv4Address();
- else if (uri.getScheme() == "tcp6")
- addressSelector = resolver::Ipv6Address();
-
- if (!uri.getPath().empty() && uri.getPath() != "/")
- {
- onConnectFailed("Invalid URI");
- }
-
- TcpResolver::asyncResolve(uri.getHost(),
- uri.getPort().empty() ? m_defaultPort : uri.getPort(),
- bind(&TcpFactory::continueCreateFaceAfterResolve, this, _1,
- onCreated, onConnectFailed),
- onConnectFailed,
- addressSelector);
-}
-
-void
-TcpFactory::continueCreateFaceAfterResolve(const tcp::Endpoint& endpoint,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed)
-{
- if (m_prohibitedEndpoints.find(endpoint) != m_prohibitedEndpoints.end())
- {
- onConnectFailed("Requested endpoint is prohibited "
- "(reserved by this NFD or disallowed by face management protocol)");
- return;
- }
-
- // very simple logic for now
-
- for (ChannelMap::iterator channel = m_channels.begin();
- channel != m_channels.end();
- ++channel)
- {
- if ((channel->first.address().is_v4() && endpoint.address().is_v4()) ||
- (channel->first.address().is_v6() && endpoint.address().is_v6()))
- {
- channel->second->connect(endpoint, onCreated, onConnectFailed);
- return;
- }
- }
- onConnectFailed("No channels available to connect to "
- + boost::lexical_cast<std::string>(endpoint));
-}
-
-std::list<shared_ptr<const Channel> >
-TcpFactory::getChannels() const
-{
- std::list<shared_ptr<const Channel> > channels;
- for (ChannelMap::const_iterator i = m_channels.begin(); i != m_channels.end(); ++i)
- {
- channels.push_back(i->second);
- }
-
- return channels;
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/tcp-factory.hpp b/NFD/daemon/face/tcp-factory.hpp
deleted file mode 100644
index e2ebda5..0000000
--- a/NFD/daemon/face/tcp-factory.hpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_TCP_FACTORY_HPP
-#define NFD_DAEMON_FACE_TCP_FACTORY_HPP
-
-#include "protocol-factory.hpp"
-#include "tcp-channel.hpp"
-
-namespace nfd {
-
-class TcpFactory : public ProtocolFactory
-{
-public:
- /**
- * \brief Exception of TcpFactory
- */
- struct Error : public ProtocolFactory::Error
- {
- Error(const std::string& what) : ProtocolFactory::Error(what) {}
- };
-
- explicit
- TcpFactory(const std::string& defaultPort = "6363");
-
- /**
- * \brief Create TCP-based channel using tcp::Endpoint
- *
- * tcp::Endpoint is really an alias for boost::asio::ip::tcp::endpoint.
- *
- * If this method called twice with the same endpoint, only one channel
- * will be created. The second call will just retrieve the existing
- * channel.
- *
- * \returns always a valid pointer to a TcpChannel object, an exception
- * is thrown if it cannot be created.
- *
- * \throws TcpFactory::Error
- *
- * \see http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/ip__tcp/endpoint.html
- * for details on ways to create tcp::Endpoint
- */
- shared_ptr<TcpChannel>
- createChannel(const tcp::Endpoint& localEndpoint);
-
- /**
- * \brief Create TCP-based channel using specified host and port number
- *
- * This method will attempt to resolve the provided host and port numbers
- * and will throw TcpFactory::Error when channel cannot be created.
- *
- * Note that this call will **BLOCK** until resolution is done or failed.
- *
- * \throws TcpFactory::Error or std::runtime_error
- */
- shared_ptr<TcpChannel>
- createChannel(const std::string& localHost, const std::string& localPort);
-
- // from Factory
-
- virtual void
- createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed);
-
- virtual std::list<shared_ptr<const Channel> >
- getChannels() const;
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-
- void
- prohibitEndpoint(const tcp::Endpoint& endpoint);
-
- void
- prohibitAllIpv4Endpoints(const uint16_t port);
-
- void
- prohibitAllIpv6Endpoints(const uint16_t port);
-
- /**
- * \brief Look up TcpChannel using specified local endpoint
- *
- * \returns shared pointer to the existing TcpChannel object
- * or empty shared pointer when such channel does not exist
- *
- * \throws never
- */
- shared_ptr<TcpChannel>
- findChannel(const tcp::Endpoint& localEndpoint);
-
- void
- continueCreateFaceAfterResolve(const tcp::Endpoint& endpoint,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed);
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
- typedef std::map< tcp::Endpoint, shared_ptr<TcpChannel> > ChannelMap;
- ChannelMap m_channels;
-
- std::string m_defaultPort;
-
- std::set<tcp::Endpoint> m_prohibitedEndpoints;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_TCP_FACTORY_HPP
diff --git a/NFD/daemon/face/udp-channel.cpp b/NFD/daemon/face/udp-channel.cpp
deleted file mode 100644
index 2ab4b77..0000000
--- a/NFD/daemon/face/udp-channel.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "udp-channel.hpp"
-#include "core/global-io.hpp"
-
-namespace nfd {
-
-NFD_LOG_INIT("UdpChannel");
-
-using namespace boost::asio;
-
-UdpChannel::UdpChannel(const udp::Endpoint& localEndpoint,
- const time::seconds& timeout)
- : m_localEndpoint(localEndpoint)
- , m_isListening(false)
- , m_idleFaceTimeout(timeout)
-{
- /// \todo the reuse_address works as we want in Linux, but in other system could be different.
- /// We need to check this
- /// (SO_REUSEADDR doesn't behave uniformly in different OS)
-
- m_socket = make_shared<ip::udp::socket>(ref(getGlobalIoService()));
- m_socket->open(m_localEndpoint.protocol());
- m_socket->set_option(boost::asio::ip::udp::socket::reuse_address(true));
- if (m_localEndpoint.address().is_v6())
- {
- m_socket->set_option(ip::v6_only(true));
- }
-
- try {
- m_socket->bind(m_localEndpoint);
- }
- catch (boost::system::system_error& e) {
- //The bind failed, so the socket is useless now
- m_socket->close();
- throw Error("Failed to properly configure the socket. "
- "UdpChannel creation aborted, check the address (" + std::string(e.what()) + ")");
- }
-
- this->setUri(FaceUri(localEndpoint));
-}
-
-void
-UdpChannel::listen(const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onListenFailed)
-{
- if (m_isListening) {
- throw Error("Listen already called on this channel");
- }
- m_isListening = true;
-
- onFaceCreatedNewPeerCallback = onFaceCreated;
- onConnectFailedNewPeerCallback = onListenFailed;
-
- m_socket->async_receive_from(boost::asio::buffer(m_inputBuffer, ndn::MAX_NDN_PACKET_SIZE),
- m_newRemoteEndpoint,
- bind(&UdpChannel::newPeer, this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred));
-}
-
-
-void
-UdpChannel::connect(const udp::Endpoint& remoteEndpoint,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed)
-{
- ChannelFaceMap::iterator i = m_channelFaces.find(remoteEndpoint);
- if (i != m_channelFaces.end()) {
- i->second->setOnDemand(false);
- onFaceCreated(i->second);
- return;
- }
-
- //creating a new socket for the face that will be created soon
- shared_ptr<ip::udp::socket> clientSocket =
- make_shared<ip::udp::socket>(ref(getGlobalIoService()));
-
- clientSocket->open(m_localEndpoint.protocol());
- clientSocket->set_option(ip::udp::socket::reuse_address(true));
-
- try {
- clientSocket->bind(m_localEndpoint);
- clientSocket->connect(remoteEndpoint); //@todo connect or async_connect
- //(since there is no handshake the connect shouldn't block). If we go for
- //async_connect, make sure that if in the meantime we receive a UDP pkt from
- //that endpoint nothing bad happen (it's difficult, but it could happen)
- }
- catch (boost::system::system_error& e) {
- clientSocket->close();
- onConnectFailed("Failed to configure socket (" + std::string(e.what()) + ")");
- return;
- }
- createFace(clientSocket, onFaceCreated, false);
-}
-
-void
-UdpChannel::connect(const std::string& remoteHost,
- const std::string& remotePort,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed)
-{
- ip::udp::resolver::query query(remoteHost, remotePort);
- shared_ptr<ip::udp::resolver> resolver =
- make_shared<ip::udp::resolver>(ref(getGlobalIoService()));
-
- resolver->async_resolve(query,
- bind(&UdpChannel::handleEndpointResolution, this, _1, _2,
- onFaceCreated, onConnectFailed,
- resolver));
-}
-
-void
-UdpChannel::handleEndpointResolution(const boost::system::error_code& error,
- ip::udp::resolver::iterator remoteEndpoint,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed,
- const shared_ptr<ip::udp::resolver>& resolver)
-{
- if (error != 0 ||
- remoteEndpoint == ip::udp::resolver::iterator())
- {
- if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
- return;
-
- NFD_LOG_DEBUG("Remote endpoint hostname or port cannot be resolved: "
- << error.category().message(error.value()));
-
- onConnectFailed("Remote endpoint hostname or port cannot be resolved: " +
- error.category().message(error.value()));
- return;
- }
-
- connect(*remoteEndpoint, onFaceCreated, onConnectFailed);
-}
-
-size_t
-UdpChannel::size() const
-{
- return m_channelFaces.size();
-}
-
-
-shared_ptr<UdpFace>
-UdpChannel::createFace(const shared_ptr<ip::udp::socket>& socket,
- const FaceCreatedCallback& onFaceCreated,
- bool isOnDemand)
-{
- udp::Endpoint remoteEndpoint = socket->remote_endpoint();
-
- shared_ptr<UdpFace> face;
-
- ChannelFaceMap::iterator faceMapPos = m_channelFaces.find(remoteEndpoint);
- if (faceMapPos == m_channelFaces.end())
- {
- face = make_shared<UdpFace>(socket, isOnDemand, m_idleFaceTimeout);
- face->onFail += bind(&UdpChannel::afterFaceFailed, this, remoteEndpoint);
-
- m_channelFaces[remoteEndpoint] = face;
- }
- else
- {
- // we've already created a a face for this endpoint, just reuse it
- face = faceMapPos->second;
-
- boost::system::error_code error;
- socket->shutdown(ip::udp::socket::shutdown_both, error);
- socket->close(error);
- }
-
- // Need to invoke the callback regardless of whether or not we have already created
- // the face so that control responses and such can be sent.
- onFaceCreated(face);
-
- return face;
-}
-
-void
-UdpChannel::newPeer(const boost::system::error_code& error,
- size_t nBytesReceived)
-{
- NFD_LOG_DEBUG("UdpChannel::newPeer from " << m_newRemoteEndpoint);
-
- shared_ptr<UdpFace> face;
-
- ChannelFaceMap::iterator i = m_channelFaces.find(m_newRemoteEndpoint);
- if (i != m_channelFaces.end()) {
- //The face already exists.
- //Usually this shouldn't happen, because the channel creates a Udpface
- //as soon as it receives a pkt from a new endpoint and then the
- //traffic is dispatched by the kernel directly to the face.
- //However, if the node receives multiple packets from the same endpoint
- //"at the same time", while the channel is creating the face the kernel
- //could dispatch the other pkts to the channel because the face is not yet
- //ready. In this case, the channel has to pass the pkt to the face
-
- NFD_LOG_DEBUG("The creation of the face for the remote endpoint "
- << m_newRemoteEndpoint
- << " is in progress");
-
- face = i->second;
- }
- else {
- shared_ptr<ip::udp::socket> clientSocket =
- make_shared<ip::udp::socket>(ref(getGlobalIoService()));
- clientSocket->open(m_localEndpoint.protocol());
- clientSocket->set_option(ip::udp::socket::reuse_address(true));
- clientSocket->bind(m_localEndpoint);
- boost::system::error_code ec;
- clientSocket->connect(m_newRemoteEndpoint, ec);
- if (ec) {
- NFD_LOG_WARN("Error while creating on-demand UDP face from " << m_newRemoteEndpoint << ": "
- << boost::system::system_error(ec).what());
- return;
- }
-
- face = createFace(clientSocket,
- onFaceCreatedNewPeerCallback,
- true);
- }
-
- // dispatch the datagram to the face for processing
- face->receiveDatagram(m_inputBuffer, nBytesReceived, error);
-
- m_socket->async_receive_from(boost::asio::buffer(m_inputBuffer, ndn::MAX_NDN_PACKET_SIZE),
- m_newRemoteEndpoint,
- bind(&UdpChannel::newPeer, this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred));
-}
-
-
-void
-UdpChannel::afterFaceFailed(udp::Endpoint &endpoint)
-{
- NFD_LOG_DEBUG("afterFaceFailed: " << endpoint);
- m_channelFaces.erase(endpoint);
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/udp-channel.hpp b/NFD/daemon/face/udp-channel.hpp
deleted file mode 100644
index bcefd8b..0000000
--- a/NFD/daemon/face/udp-channel.hpp
+++ /dev/null
@@ -1,179 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_UDP_CHANNEL_HPP
-#define NFD_DAEMON_FACE_UDP_CHANNEL_HPP
-
-#include "channel.hpp"
-#include "core/global-io.hpp"
-#include "udp-face.hpp"
-
-namespace nfd {
-
-namespace udp {
-typedef boost::asio::ip::udp::endpoint Endpoint;
-} // namespace udp
-
-/**
- * \brief Class implementing UDP-based channel to create faces
- *
- *
- */
-class UdpChannel : public Channel
-{
-public:
- /**
- * \brief Exception of UdpChannel
- */
- struct Error : public std::runtime_error
- {
- Error(const std::string& what) : runtime_error(what) {}
- };
-
- /**
- * \brief Create UDP channel for the local endpoint
- *
- * To enable creation of faces upon incoming connections,
- * one needs to explicitly call UdpChannel::listen method.
- * The created socket is bound to the localEndpoint.
- * reuse_address option is set
- *
- * \throw UdpChannel::Error if bind on the socket fails
- */
- UdpChannel(const udp::Endpoint& localEndpoint,
- const time::seconds& timeout);
-
- /**
- * \brief Enable listening on the local endpoint, accept connections,
- * and create faces when remote host makes a connection
- * \param onFaceCreated Callback to notify successful creation of the face
- * \param onAcceptFailed Callback to notify when channel fails
- *
- * Once a face is created, if it doesn't send/receive anything for
- * a period of time equal to timeout, it will be destroyed
- * \todo this functionality has to be implemented
- *
- * \throws UdpChannel::Error if called multiple times
- */
- void
- listen(const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onAcceptFailed);
-
- /**
- * \brief Create a face by establishing connection to remote endpoint
- *
- * \throw UdpChannel::Error if bind or connect on the socket fail
- */
- void
- connect(const udp::Endpoint& remoteEndpoint,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed);
- /**
- * \brief Create a face by establishing connection to the specified
- * remote host and remote port
- *
- * This method will never block and will return immediately. All
- * necessary hostname and port resolution and connection will happen
- * in asynchronous mode.
- *
- * If connection cannot be established within specified timeout, it
- * will be aborted.
- */
- void
- connect(const std::string& remoteHost, const std::string& remotePort,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed);
-
- /**
- * \brief Get number of faces in the channel
- */
- size_t
- size() const;
-
-private:
- shared_ptr<UdpFace>
- createFace(const shared_ptr<boost::asio::ip::udp::socket>& socket,
- const FaceCreatedCallback& onFaceCreated,
- bool isOnDemand);
- void
- afterFaceFailed(udp::Endpoint& endpoint);
-
- /**
- * \brief The UdpChannel has received a new pkt from a remote endpoint not yet
- * associated with any UdpFace
- */
- void
- newPeer(const boost::system::error_code& error, size_t nBytesReceived);
-
- void
- handleEndpointResolution(const boost::system::error_code& error,
- boost::asio::ip::udp::resolver::iterator remoteEndpoint,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed,
- const shared_ptr<boost::asio::ip::udp::resolver>& resolver);
-
-private:
- udp::Endpoint m_localEndpoint;
-
- /**
- * \brief Endpoint used to store the information about the last new remote endpoint
- */
- udp::Endpoint m_newRemoteEndpoint;
-
- /**
- * Callbacks for face creation.
- * New communications are detected using async_receive_from.
- * Its handler has a fixed signature. No space for the face callback
- */
- FaceCreatedCallback onFaceCreatedNewPeerCallback;
-
- // @todo remove the onConnectFailedNewPeerCallback if it remains unused
- ConnectFailedCallback onConnectFailedNewPeerCallback;
-
- /**
- * \brief Socket used to "accept" new communication
- **/
- shared_ptr<boost::asio::ip::udp::socket> m_socket;
-
- uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
-
- typedef std::map< udp::Endpoint, shared_ptr<UdpFace> > ChannelFaceMap;
- ChannelFaceMap m_channelFaces;
-
- /**
- * \brief If true, it means the function listen has already been called
- */
- bool m_isListening;
-
- /**
- * \brief every time m_idleFaceTimeout expires all the idle (and on-demand)
- * faces will be removed
- */
- time::seconds m_idleFaceTimeout;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_UDP_CHANNEL_HPP
diff --git a/NFD/daemon/face/udp-face.cpp b/NFD/daemon/face/udp-face.cpp
deleted file mode 100644
index 81e915c..0000000
--- a/NFD/daemon/face/udp-face.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "udp-face.hpp"
-
-#ifdef __linux__
-#include <netinet/in.h> // for IP_MTU_DISCOVER and IP_PMTUDISC_DONT
-#include <sys/socket.h> // for setsockopt()
-#endif
-
-namespace nfd {
-
-NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(DatagramFace, UdpFace::protocol, "UdpFace");
-
-UdpFace::UdpFace(const shared_ptr<UdpFace::protocol::socket>& socket,
- bool isOnDemand,
- const time::seconds& idleTimeout)
- : DatagramFace<protocol>(FaceUri(socket->remote_endpoint()),
- FaceUri(socket->local_endpoint()),
- socket, isOnDemand)
- , m_idleTimeout(idleTimeout)
- , m_lastIdleCheck(time::steady_clock::now())
-{
-#ifdef __linux__
- //
- // By default, Linux does path MTU discovery on IPv4 sockets,
- // and sets the DF (Don't Fragment) flag on datagrams smaller
- // than the interface MTU. However this does not work for us,
- // because we cannot properly respond to ICMP "packet too big"
- // messages by fragmenting the packet at the application level,
- // since we want to rely on IP for fragmentation and reassembly.
- //
- // Therefore, we disable PMTU discovery, which prevents the kernel
- // from setting the DF flag on outgoing datagrams, and thus allows
- // routers along the path to perform fragmentation as needed.
- //
- const int value = IP_PMTUDISC_DONT;
- if (::setsockopt(socket->native_handle(), IPPROTO_IP,
- IP_MTU_DISCOVER, &value, sizeof(value)) < 0)
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Failed to disable path MTU discovery");
- }
-#endif
-
- if (isOnDemand && m_idleTimeout > time::seconds::zero()) {
- m_closeIfIdleEvent = scheduler::schedule(m_idleTimeout,
- bind(&UdpFace::closeIfIdle, this));
- }
-}
-
-UdpFace::~UdpFace()
-{
- scheduler::cancel(m_closeIfIdleEvent);
-}
-
-ndn::nfd::FaceStatus
-UdpFace::getFaceStatus() const
-{
- ndn::nfd::FaceStatus status = Face::getFaceStatus();
- if (isOnDemand()) {
- time::milliseconds left = m_idleTimeout - time::duration_cast<time::milliseconds>(
- time::steady_clock::now() - m_lastIdleCheck);
- if (left < time::milliseconds::zero())
- left = time::milliseconds::zero();
-
- if (hasBeenUsedRecently()) {
- status.setExpirationPeriod(left + m_idleTimeout);
- }
- else {
- status.setExpirationPeriod(left);
- }
- }
- return status;
-}
-
-void
-UdpFace::closeIfIdle()
-{
- // Face can be switched from on-demand to non-on-demand mode
- // (non-on-demand -> on-demand transition is not allowed)
- if (isOnDemand()) {
- if (!hasBeenUsedRecently()) {
- // face has been idle since the last time closeIfIdle
- // has been called. Going to close it
- NFD_LOG_DEBUG("Found idle face id: " << getId());
-
- NFD_LOG_INFO("[id:" << this->getId()
- << ",uri:" << this->getRemoteUri()
- << "] Idle for more than " << m_idleTimeout << ", closing");
- close();
- }
- else {
- resetRecentUsage();
-
- m_lastIdleCheck = time::steady_clock::now();
- m_closeIfIdleEvent = scheduler::schedule(m_idleTimeout,
- bind(&UdpFace::closeIfIdle, this));
- }
- }
- // else do nothing and do not reschedule the event
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/udp-face.hpp b/NFD/daemon/face/udp-face.hpp
deleted file mode 100644
index 49c374b..0000000
--- a/NFD/daemon/face/udp-face.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_UDP_FACE_HPP
-#define NFD_DAEMON_FACE_UDP_FACE_HPP
-
-#include "datagram-face.hpp"
-#include "core/scheduler.hpp"
-
-namespace nfd {
-
-/**
- * \brief Implementation of Face abstraction that uses UDP
- * as underlying transport mechanism
- */
-class UdpFace : public DatagramFace<boost::asio::ip::udp>
-{
-public:
- UdpFace(const shared_ptr<protocol::socket>& socket,
- bool isOnDemand,
- const time::seconds& idleTimeout);
-
- virtual
- ~UdpFace();
-
- virtual ndn::nfd::FaceStatus
- getFaceStatus() const;
-
-private:
- void
- closeIfIdle();
-
-private:
- EventId m_closeIfIdleEvent;
- time::seconds m_idleTimeout;
- time::steady_clock::TimePoint m_lastIdleCheck;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_UDP_FACE_HPP
diff --git a/NFD/daemon/face/udp-factory.cpp b/NFD/daemon/face/udp-factory.cpp
deleted file mode 100644
index 458d4fb..0000000
--- a/NFD/daemon/face/udp-factory.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "udp-factory.hpp"
-#include "core/global-io.hpp"
-#include "core/resolver.hpp"
-#include "core/network-interface.hpp"
-
-#if defined(__linux__)
-#include <sys/socket.h>
-#endif
-
-namespace nfd {
-
-using namespace boost::asio;
-
-NFD_LOG_INIT("UdpFactory");
-
-static const boost::asio::ip::address_v4 ALL_V4_ENDPOINT(
- boost::asio::ip::address_v4::from_string("0.0.0.0"));
-
-static const boost::asio::ip::address_v6 ALL_V6_ENDPOINT(
- boost::asio::ip::address_v6::from_string("::"));
-
-UdpFactory::UdpFactory(const std::string& defaultPort/* = "6363"*/)
- : m_defaultPort(defaultPort)
-{
-}
-
-void
-UdpFactory::prohibitEndpoint(const udp::Endpoint& endpoint)
-{
- using namespace boost::asio::ip;
-
- const address& address = endpoint.address();
-
- if (address.is_v4() && address == ALL_V4_ENDPOINT)
- {
- prohibitAllIpv4Endpoints(endpoint.port());
- }
- else if (endpoint.address().is_v6() && address == ALL_V6_ENDPOINT)
- {
- prohibitAllIpv6Endpoints(endpoint.port());
- }
-
- NFD_LOG_TRACE("prohibiting UDP " << endpoint);
-
- m_prohibitedEndpoints.insert(endpoint);
-}
-
-void
-UdpFactory::prohibitAllIpv4Endpoints(const uint16_t port)
-{
- using namespace boost::asio::ip;
-
- for (const NetworkInterfaceInfo& nic : listNetworkInterfaces()) {
- for (const address_v4& addr : nic.ipv4Addresses) {
- if (addr != ALL_V4_ENDPOINT) {
- prohibitEndpoint(udp::Endpoint(addr, port));
- }
- }
-
- if (nic.isBroadcastCapable() && nic.broadcastAddress != ALL_V4_ENDPOINT)
- {
- NFD_LOG_TRACE("prohibiting broadcast address: " << nic.broadcastAddress.to_string());
- prohibitEndpoint(udp::Endpoint(nic.broadcastAddress, port));
- }
- }
-
- prohibitEndpoint(udp::Endpoint(address::from_string("255.255.255.255"), port));
-}
-
-void
-UdpFactory::prohibitAllIpv6Endpoints(const uint16_t port)
-{
- using namespace boost::asio::ip;
-
- for (const NetworkInterfaceInfo& nic : listNetworkInterfaces()) {
- for (const address_v6& addr : nic.ipv6Addresses) {
- if (addr != ALL_V6_ENDPOINT) {
- prohibitEndpoint(udp::Endpoint(addr, port));
- }
- }
- }
-}
-
-shared_ptr<UdpChannel>
-UdpFactory::createChannel(const udp::Endpoint& endpoint,
- const time::seconds& timeout)
-{
- NFD_LOG_DEBUG("Creating unicast channel " << endpoint);
-
- shared_ptr<UdpChannel> channel = findChannel(endpoint);
- if (static_cast<bool>(channel))
- return channel;
-
- //checking if the endpoint is already in use for multicast face
- shared_ptr<MulticastUdpFace> multicast = findMulticastFace(endpoint);
- if (static_cast<bool>(multicast))
- throw Error("Cannot create the requested UDP unicast channel, local "
- "endpoint is already allocated for a UDP multicast face");
-
- if (endpoint.address().is_multicast()) {
- throw Error("This method is only for unicast channel. The provided "
- "endpoint is multicast. Use createMulticastFace to "
- "create a multicast face");
- }
-
- channel = make_shared<UdpChannel>(endpoint, timeout);
- m_channels[endpoint] = channel;
- prohibitEndpoint(endpoint);
-
- return channel;
-}
-
-shared_ptr<UdpChannel>
-UdpFactory::createChannel(const std::string& localHost,
- const std::string& localPort,
- const time::seconds& timeout)
-{
- return createChannel(UdpResolver::syncResolve(localHost, localPort), timeout);
-}
-
-shared_ptr<MulticastUdpFace>
-UdpFactory::createMulticastFace(const udp::Endpoint& localEndpoint,
- const udp::Endpoint& multicastEndpoint,
- const std::string& networkInterfaceName /* "" */)
-{
- //checking if the local and multicast endpoint are already in use for a multicast face
- shared_ptr<MulticastUdpFace> multicastFace = findMulticastFace(localEndpoint);
- if (static_cast<bool>(multicastFace)) {
- if (multicastFace->getMulticastGroup() == multicastEndpoint)
- return multicastFace;
- else
- throw Error("Cannot create the requested UDP multicast face, local "
- "endpoint is already allocated for a UDP multicast face "
- "on a different multicast group");
- }
-
- //checking if the local endpoint is already in use for an unicast channel
- shared_ptr<UdpChannel> unicast = findChannel(localEndpoint);
- if (static_cast<bool>(unicast)) {
- throw Error("Cannot create the requested UDP multicast face, local "
- "endpoint is already allocated for a UDP unicast channel");
- }
-
- if (m_prohibitedEndpoints.find(multicastEndpoint) != m_prohibitedEndpoints.end()) {
- throw Error("Cannot create the requested UDP multicast face, "
- "remote endpoint is owned by this NFD instance");
- }
-
- if (localEndpoint.address().is_v6() || multicastEndpoint.address().is_v6()) {
- throw Error("IPv6 multicast is not supported yet. Please provide an IPv4 address");
- }
-
- if (localEndpoint.port() != multicastEndpoint.port()) {
- throw Error("Cannot create the requested UDP multicast face, "
- "both endpoints should have the same port number. ");
- }
-
- if (!multicastEndpoint.address().is_multicast()) {
- throw Error("Cannot create the requested UDP multicast face, "
- "the multicast group given as input is not a multicast address");
- }
-
- shared_ptr<ip::udp::socket> receiveSocket =
- make_shared<ip::udp::socket>(ref(getGlobalIoService()));
-
- shared_ptr<ip::udp::socket> sendSocket =
- make_shared<ip::udp::socket>(ref(getGlobalIoService()));
-
- receiveSocket->open(multicastEndpoint.protocol());
- receiveSocket->set_option(ip::udp::socket::reuse_address(true));
-
- sendSocket->open(multicastEndpoint.protocol());
- sendSocket->set_option(ip::udp::socket::reuse_address(true));
- sendSocket->set_option(ip::multicast::enable_loopback(false));
-
- try {
- sendSocket->bind(udp::Endpoint(ip::address_v4::any(), multicastEndpoint.port()));
- receiveSocket->bind(multicastEndpoint);
-
- if (localEndpoint.address() != ip::address::from_string("0.0.0.0")) {
- sendSocket->set_option(ip::multicast::outbound_interface(localEndpoint.address().to_v4()));
- }
- sendSocket->set_option(ip::multicast::join_group(multicastEndpoint.address().to_v4(),
- localEndpoint.address().to_v4()));
-
- receiveSocket->set_option(ip::multicast::join_group(multicastEndpoint.address().to_v4(),
- localEndpoint.address().to_v4()));
- }
- catch (boost::system::system_error& e) {
- std::stringstream msg;
- msg << "Failed to properly configure the socket, check the address (" << e.what() << ")";
- throw Error(msg.str());
- }
-
-#if defined(__linux__)
- //On linux system, if there are more than one MulticastUdpFace for the same multicast group but
- //bound on different network interfaces, the socket has to be bound with the specific interface
- //using SO_BINDTODEVICE, otherwise the face will receive packets also from other interfaces.
- //Without SO_BINDTODEVICE every MulticastUdpFace that have joined the same multicast group
- //on different interfaces will receive the same packet.
- //This applies only on linux, for OS X the ip::multicast::join_group is enough to get
- //the desired behaviour
- if (!networkInterfaceName.empty()) {
- if (::setsockopt(receiveSocket->native_handle(), SOL_SOCKET, SO_BINDTODEVICE,
- networkInterfaceName.c_str(), networkInterfaceName.size()+1) == -1){
- throw Error("Cannot bind multicast face to " + networkInterfaceName
- + " make sure you have CAP_NET_RAW capability" );
- }
- }
-
-#endif
-
- multicastFace = make_shared<MulticastUdpFace>(receiveSocket, sendSocket,
- localEndpoint, multicastEndpoint);
- multicastFace->onFail += bind(&UdpFactory::afterFaceFailed, this, localEndpoint);
-
- m_multicastFaces[localEndpoint] = multicastFace;
-
- return multicastFace;
-}
-
-shared_ptr<MulticastUdpFace>
-UdpFactory::createMulticastFace(const std::string& localIp,
- const std::string& multicastIp,
- const std::string& multicastPort,
- const std::string& networkInterfaceName /* "" */)
-{
-
- return createMulticastFace(UdpResolver::syncResolve(localIp,
- multicastPort),
- UdpResolver::syncResolve(multicastIp,
- multicastPort),
- networkInterfaceName);
-}
-
-void
-UdpFactory::createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed)
-{
- resolver::AddressSelector addressSelector = resolver::AnyAddress();
- if (uri.getScheme() == "udp4")
- addressSelector = resolver::Ipv4Address();
- else if (uri.getScheme() == "udp6")
- addressSelector = resolver::Ipv6Address();
-
- if (!uri.getPath().empty() && uri.getPath() != "/")
- {
- onConnectFailed("Invalid URI");
- }
-
- UdpResolver::asyncResolve(uri.getHost(),
- uri.getPort().empty() ? m_defaultPort : uri.getPort(),
- bind(&UdpFactory::continueCreateFaceAfterResolve, this, _1,
- onCreated, onConnectFailed),
- onConnectFailed,
- addressSelector);
-
-}
-
-void
-UdpFactory::continueCreateFaceAfterResolve(const udp::Endpoint& endpoint,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed)
-{
- if (endpoint.address().is_multicast()) {
- onConnectFailed("The provided address is multicast. Please use createMulticastFace method");
- return;
- }
-
- if (m_prohibitedEndpoints.find(endpoint) != m_prohibitedEndpoints.end())
- {
- onConnectFailed("Requested endpoint is prohibited "
- "(reserved by this NFD or disallowed by face management protocol)");
- return;
- }
-
- // very simple logic for now
-
- for (ChannelMap::iterator channel = m_channels.begin();
- channel != m_channels.end();
- ++channel)
- {
- if ((channel->first.address().is_v4() && endpoint.address().is_v4()) ||
- (channel->first.address().is_v6() && endpoint.address().is_v6()))
- {
- channel->second->connect(endpoint, onCreated, onConnectFailed);
- return;
- }
- }
- onConnectFailed("No channels available to connect to " +
- boost::lexical_cast<std::string>(endpoint));
-}
-
-shared_ptr<UdpChannel>
-UdpFactory::findChannel(const udp::Endpoint& localEndpoint)
-{
- ChannelMap::iterator i = m_channels.find(localEndpoint);
- if (i != m_channels.end())
- return i->second;
- else
- return shared_ptr<UdpChannel>();
-}
-
-shared_ptr<MulticastUdpFace>
-UdpFactory::findMulticastFace(const udp::Endpoint& localEndpoint)
-{
- MulticastFaceMap::iterator i = m_multicastFaces.find(localEndpoint);
- if (i != m_multicastFaces.end())
- return i->second;
- else
- return shared_ptr<MulticastUdpFace>();
-}
-
-void
-UdpFactory::afterFaceFailed(udp::Endpoint& endpoint)
-{
- NFD_LOG_DEBUG("afterFaceFailed: " << endpoint);
- m_multicastFaces.erase(endpoint);
-}
-
-std::list<shared_ptr<const Channel> >
-UdpFactory::getChannels() const
-{
- std::list<shared_ptr<const Channel> > channels;
- for (ChannelMap::const_iterator i = m_channels.begin(); i != m_channels.end(); ++i)
- {
- channels.push_back(i->second);
- }
-
- return channels;
-}
-
-
-
-} // namespace nfd
diff --git a/NFD/daemon/face/udp-factory.hpp b/NFD/daemon/face/udp-factory.hpp
deleted file mode 100644
index 1f7f7de..0000000
--- a/NFD/daemon/face/udp-factory.hpp
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_UDP_FACTORY_HPP
-#define NFD_DAEMON_FACE_UDP_FACTORY_HPP
-
-#include "protocol-factory.hpp"
-#include "udp-channel.hpp"
-#include "multicast-udp-face.hpp"
-
-
-namespace nfd {
-
-// @todo The multicast support for ipv6 must be implemented
-
-class UdpFactory : public ProtocolFactory
-{
-public:
- /**
- * \brief Exception of UdpFactory
- */
- class Error : public ProtocolFactory::Error
- {
- public:
- explicit
- Error(const std::string& what)
- : ProtocolFactory::Error(what)
- {
- }
- };
-
- typedef std::map< udp::Endpoint, shared_ptr<MulticastUdpFace> > MulticastFaceMap;
-
- explicit
- UdpFactory(const std::string& defaultPort = "6363");
-
- /**
- * \brief Create UDP-based channel using udp::Endpoint
- *
- * udp::Endpoint is really an alias for boost::asio::ip::udp::endpoint.
- *
- * If this method called twice with the same endpoint, only one channel
- * will be created. The second call will just retrieve the existing
- * channel.
- *
- * If a multicast face is already active on the same local endpoint,
- * the creation fails and an exception is thrown
- *
- * Once a face is created, if it doesn't send/receive anything for
- * a period of time equal to timeout, it will be destroyed
- * @todo this funcionality has to be implemented
- *
- * \returns always a valid pointer to a UdpChannel object, an exception
- * is thrown if it cannot be created.
- *
- * \throws UdpFactory::Error
- *
- * \see http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/ip__udp/endpoint.html
- * for details on ways to create udp::Endpoint
- */
- shared_ptr<UdpChannel>
- createChannel(const udp::Endpoint& localEndpoint,
- const time::seconds& timeout = time::seconds(600));
-
- /**
- * \brief Create UDP-based channel using specified host and port number
- *
- * This method will attempt to resolve the provided host and port numbers
- * and will throw UdpFactory::Error when channel cannot be created.
- *
- * Note that this call will **BLOCK** until resolution is done or failed.
- *
- * If localHost is a IPv6 address of a specific device, it must be in the form:
- * ip address%interface name
- * Example: fe80::5e96:9dff:fe7d:9c8d%en1
- * Otherwise, you can use ::
- *
- * \throws UdpChannel::Error if the bind on the socket fails
- * \throws UdpFactory::Error
- */
- shared_ptr<UdpChannel>
- createChannel(const std::string& localHost,
- const std::string& localPort,
- const time::seconds& timeout = time::seconds(600));
-
- /**
- * \brief Create MulticastUdpFace using udp::Endpoint
- *
- * udp::Endpoint is really an alias for boost::asio::ip::udp::endpoint.
- *
- * The face will join the multicast group
- *
- * If this method called twice with the same endpoint and group, only one face
- * will be created. The second call will just retrieve the existing
- * channel.
- *
- * If an unicast face is already active on the same local NIC and port, the
- * creation fails and an exception is thrown
- *
- * \param networkInterfaceName name of the network interface on which the face will be bound
- * (Used only on multihomed linux machine with more than one MulticastUdpFace for
- * the same multicast group. If specified, will requires CAP_NET_RAW capability)
- * An empty string can be provided in other system or in linux machine with only one
- * MulticastUdpFace per multicast group
- *
- *
- * \returns always a valid pointer to a MulticastUdpFace object, an exception
- * is thrown if it cannot be created.
- *
- * \throws UdpFactory::Error
- *
- * \see http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/ip__udp/endpoint.html
- * for details on ways to create udp::Endpoint
- */
- shared_ptr<MulticastUdpFace>
- createMulticastFace(const udp::Endpoint& localEndpoint,
- const udp::Endpoint& multicastEndpoint,
- const std::string& networkInterfaceName = "");
-
- shared_ptr<MulticastUdpFace>
- createMulticastFace(const std::string& localIp,
- const std::string& multicastIp,
- const std::string& multicastPort,
- const std::string& networkInterfaceName = "");
-
- // from Factory
- virtual void
- createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed);
-
- virtual std::list<shared_ptr<const Channel> >
- getChannels() const;
-
- /**
- * \brief Get map of configured multicast faces
- */
- const MulticastFaceMap&
- getMulticastFaces() const;
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-
- void
- prohibitEndpoint(const udp::Endpoint& endpoint);
-
- void
- prohibitAllIpv4Endpoints(const uint16_t port);
-
- void
- prohibitAllIpv6Endpoints(const uint16_t port);
-
- void
- afterFaceFailed(udp::Endpoint& endpoint);
-
- /**
- * \brief Look up UdpChannel using specified local endpoint
- *
- * \returns shared pointer to the existing UdpChannel object
- * or empty shared pointer when such channel does not exist
- *
- * \throws never
- */
- shared_ptr<UdpChannel>
- findChannel(const udp::Endpoint& localEndpoint);
-
-
- /**
- * \brief Look up multicast UdpFace using specified local endpoint
- *
- * \returns shared pointer to the existing multicast MulticastUdpFace object
- * or empty shared pointer when such face does not exist
- *
- * \throws never
- */
- shared_ptr<MulticastUdpFace>
- findMulticastFace(const udp::Endpoint& localEndpoint);
-
- void
- continueCreateFaceAfterResolve(const udp::Endpoint& endpoint,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed);
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
- typedef std::map< udp::Endpoint, shared_ptr<UdpChannel> > ChannelMap;
-
- ChannelMap m_channels;
- MulticastFaceMap m_multicastFaces;
-
- std::string m_defaultPort;
- std::set<udp::Endpoint> m_prohibitedEndpoints;
-};
-
-
-inline const UdpFactory::MulticastFaceMap&
-UdpFactory::getMulticastFaces() const
-{
- return m_multicastFaces;
-}
-
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_UDP_FACTORY_HPP
diff --git a/NFD/daemon/face/unix-stream-channel.cpp b/NFD/daemon/face/unix-stream-channel.cpp
deleted file mode 100644
index d64f333..0000000
--- a/NFD/daemon/face/unix-stream-channel.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "unix-stream-channel.hpp"
-#include "core/global-io.hpp"
-
-#include <boost/filesystem.hpp>
-#include <sys/stat.h> // for chmod()
-
-namespace nfd {
-
-NFD_LOG_INIT("UnixStreamChannel");
-
-using namespace boost::asio::local;
-
-UnixStreamChannel::UnixStreamChannel(const unix_stream::Endpoint& endpoint)
- : m_endpoint(endpoint)
- , m_isListening(false)
-{
- setUri(FaceUri(endpoint));
-}
-
-UnixStreamChannel::~UnixStreamChannel()
-{
- if (m_isListening)
- {
- // use the non-throwing variants during destruction
- // and ignore any errors
- boost::system::error_code error;
- m_acceptor->close(error);
- NFD_LOG_TRACE("[" << m_endpoint << "] Removing socket file");
- boost::filesystem::remove(m_endpoint.path(), error);
- }
-}
-
-void
-UnixStreamChannel::listen(const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onAcceptFailed,
- int backlog/* = acceptor::max_connections*/)
-{
- if (m_isListening) {
- NFD_LOG_WARN("[" << m_endpoint << "] Already listening");
- return;
- }
-
- namespace fs = boost::filesystem;
-
- fs::path socketPath(m_endpoint.path());
- fs::file_type type = fs::symlink_status(socketPath).type();
-
- if (type == fs::socket_file)
- {
- boost::system::error_code error;
- stream_protocol::socket socket(getGlobalIoService());
- socket.connect(m_endpoint, error);
- NFD_LOG_TRACE("[" << m_endpoint << "] connect() on existing socket file returned: "
- + error.message());
- if (!error)
- {
- // someone answered, leave the socket alone
- throw Error("Socket file at " + m_endpoint.path()
- + " belongs to another NFD process");
- }
- else if (error == boost::system::errc::connection_refused ||
- error == boost::system::errc::timed_out)
- {
- // no one is listening on the remote side,
- // we can safely remove the socket file
- NFD_LOG_INFO("[" << m_endpoint << "] Removing stale socket file");
- fs::remove(socketPath);
- }
- }
- else if (type != fs::file_not_found)
- {
- throw Error(m_endpoint.path() + " already exists and is not a socket file");
- }
-
- m_acceptor = make_shared<stream_protocol::acceptor>(ref(getGlobalIoService()));
- m_acceptor->open();
- m_acceptor->bind(m_endpoint);
- m_acceptor->listen(backlog);
- m_isListening = true;
-
- if (::chmod(m_endpoint.path().c_str(), 0666) < 0)
- {
- throw Error("Failed to chmod() socket file at " + m_endpoint.path());
- }
-
- shared_ptr<stream_protocol::socket> clientSocket =
- make_shared<stream_protocol::socket>(ref(getGlobalIoService()));
-
- m_acceptor->async_accept(*clientSocket,
- bind(&UnixStreamChannel::handleSuccessfulAccept, this,
- boost::asio::placeholders::error, clientSocket,
- onFaceCreated, onAcceptFailed));
-}
-
-void
-UnixStreamChannel::handleSuccessfulAccept(const boost::system::error_code& error,
- const shared_ptr<stream_protocol::socket>& socket,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onAcceptFailed)
-{
- if (error) {
- if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
- return;
-
- NFD_LOG_DEBUG("[" << m_endpoint << "] Connection failed: " << error.message());
- onAcceptFailed("Connection failed: " + error.message());
- return;
- }
-
- NFD_LOG_DEBUG("[" << m_endpoint << "] << Incoming connection");
-
- shared_ptr<stream_protocol::socket> clientSocket =
- make_shared<stream_protocol::socket>(ref(getGlobalIoService()));
-
- // prepare accepting the next connection
- m_acceptor->async_accept(*clientSocket,
- bind(&UnixStreamChannel::handleSuccessfulAccept, this,
- boost::asio::placeholders::error, clientSocket,
- onFaceCreated, onAcceptFailed));
-
- shared_ptr<UnixStreamFace> face = make_shared<UnixStreamFace>(socket);
- onFaceCreated(face);
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/unix-stream-channel.hpp b/NFD/daemon/face/unix-stream-channel.hpp
deleted file mode 100644
index c923c39..0000000
--- a/NFD/daemon/face/unix-stream-channel.hpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
-#define NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
-
-#include "channel.hpp"
-#include "unix-stream-face.hpp"
-
-namespace nfd {
-
-namespace unix_stream {
-typedef boost::asio::local::stream_protocol::endpoint Endpoint;
-} // namespace unix_stream
-
-/**
- * \brief Class implementing a local channel to create faces
- *
- * Channel can create faces as a response to incoming IPC connections
- * (UnixStreamChannel::listen needs to be called for that to work).
- */
-class UnixStreamChannel : public Channel
-{
-public:
- /**
- * \brief UnixStreamChannel-related error
- */
- struct Error : public std::runtime_error
- {
- Error(const std::string& what) : std::runtime_error(what) {}
- };
-
- /**
- * \brief Create UnixStream channel for the specified endpoint
- *
- * To enable creation of faces upon incoming connections, one
- * needs to explicitly call UnixStreamChannel::listen method.
- */
- explicit
- UnixStreamChannel(const unix_stream::Endpoint& endpoint);
-
- virtual
- ~UnixStreamChannel();
-
- /**
- * \brief Enable listening on the local endpoint, accept connections,
- * and create faces when a connection is made
- * \param onFaceCreated Callback to notify successful creation of the face
- * \param onAcceptFailed Callback to notify when channel fails (accept call
- * returns an error)
- * \param backlog The maximum length of the queue of pending incoming
- * connections
- */
- void
- listen(const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onAcceptFailed,
- int backlog = boost::asio::local::stream_protocol::acceptor::max_connections);
-
-private:
- void
- handleSuccessfulAccept(const boost::system::error_code& error,
- const shared_ptr<boost::asio::local::stream_protocol::socket>& socket,
- const FaceCreatedCallback& onFaceCreated,
- const ConnectFailedCallback& onConnectFailed);
-
-private:
- unix_stream::Endpoint m_endpoint;
- shared_ptr<boost::asio::local::stream_protocol::acceptor> m_acceptor;
- bool m_isListening;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
diff --git a/NFD/daemon/face/unix-stream-face.cpp b/NFD/daemon/face/unix-stream-face.cpp
deleted file mode 100644
index 93ff30e..0000000
--- a/NFD/daemon/face/unix-stream-face.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "unix-stream-face.hpp"
-
-namespace nfd {
-
-// The whole purpose of this file is to specialize the logger,
-// otherwise, everything could be put into the header file.
-
-NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(StreamFace,
- UnixStreamFace::protocol, LocalFace,
- "UnixStreamFace");
-
-BOOST_STATIC_ASSERT((boost::is_same<UnixStreamFace::protocol::socket::native_handle_type,
- int>::value));
-
-UnixStreamFace::UnixStreamFace(const shared_ptr<UnixStreamFace::protocol::socket>& socket)
- : StreamFace<protocol, LocalFace>(FaceUri::fromFd(socket->native_handle()),
- FaceUri(socket->local_endpoint()),
- socket, true)
-{
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/unix-stream-face.hpp b/NFD/daemon/face/unix-stream-face.hpp
deleted file mode 100644
index 51482c4..0000000
--- a/NFD/daemon/face/unix-stream-face.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_UNIX_STREAM_FACE_HPP
-#define NFD_DAEMON_FACE_UNIX_STREAM_FACE_HPP
-
-#include "stream-face.hpp"
-
-#ifndef HAVE_UNIX_SOCKETS
-#error "Cannot include this file when UNIX sockets are not available"
-#endif
-
-namespace nfd {
-
-/**
- * \brief Implementation of Face abstraction that uses stream-oriented
- * Unix domain sockets as underlying transport mechanism
- */
-class UnixStreamFace : public StreamFace<boost::asio::local::stream_protocol, LocalFace>
-{
-public:
- explicit
- UnixStreamFace(const shared_ptr<protocol::socket>& socket);
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_UNIX_STREAM_FACE_HPP
diff --git a/NFD/daemon/face/unix-stream-factory.cpp b/NFD/daemon/face/unix-stream-factory.cpp
deleted file mode 100644
index d7513f6..0000000
--- a/NFD/daemon/face/unix-stream-factory.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "unix-stream-factory.hpp"
-
-#include <boost/filesystem.hpp> // for canonical()
-
-namespace nfd {
-
-shared_ptr<UnixStreamChannel>
-UnixStreamFactory::createChannel(const std::string& unixSocketPath)
-{
- boost::filesystem::path p(unixSocketPath);
- p = boost::filesystem::canonical(p.parent_path()) / p.filename();
- unix_stream::Endpoint endpoint(p.string());
-
- shared_ptr<UnixStreamChannel> channel = findChannel(endpoint);
- if (channel)
- return channel;
-
- channel = make_shared<UnixStreamChannel>(endpoint);
- m_channels[endpoint] = channel;
- return channel;
-}
-
-shared_ptr<UnixStreamChannel>
-UnixStreamFactory::findChannel(const unix_stream::Endpoint& endpoint)
-{
- ChannelMap::iterator i = m_channels.find(endpoint);
- if (i != m_channels.end())
- return i->second;
- else
- return shared_ptr<UnixStreamChannel>();
-}
-
-void
-UnixStreamFactory::createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed)
-{
- throw Error("UnixStreamFactory does not support 'createFace' operation");
-}
-
-std::list<shared_ptr<const Channel> >
-UnixStreamFactory::getChannels() const
-{
- std::list<shared_ptr<const Channel> > channels;
- for (ChannelMap::const_iterator i = m_channels.begin(); i != m_channels.end(); ++i)
- {
- channels.push_back(i->second);
- }
-
- return channels;
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/unix-stream-factory.hpp b/NFD/daemon/face/unix-stream-factory.hpp
deleted file mode 100644
index e2aff30..0000000
--- a/NFD/daemon/face/unix-stream-factory.hpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
-#define NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
-
-#include "protocol-factory.hpp"
-#include "unix-stream-channel.hpp"
-
-namespace nfd {
-
-class UnixStreamFactory : public ProtocolFactory
-{
-public:
- /**
- * \brief Exception of UnixStreamFactory
- */
- struct Error : public ProtocolFactory::Error
- {
- Error(const std::string& what) : ProtocolFactory::Error(what) {}
- };
-
- /**
- * \brief Create stream-oriented Unix channel using specified socket path
- *
- * If this method is called twice with the same path, only one channel
- * will be created. The second call will just retrieve the existing
- * channel.
- *
- * \returns always a valid pointer to a UnixStreamChannel object,
- * an exception will be thrown if the channel cannot be created.
- *
- * \throws UnixStreamFactory::Error
- */
- shared_ptr<UnixStreamChannel>
- createChannel(const std::string& unixSocketPath);
-
- // from Factory
-
- virtual void
- createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed);
-
- virtual std::list<shared_ptr<const Channel> >
- getChannels() const;
-
-private:
- /**
- * \brief Look up UnixStreamChannel using specified endpoint
- *
- * \returns shared pointer to the existing UnixStreamChannel object
- * or empty shared pointer when such channel does not exist
- *
- * \throws never
- */
- shared_ptr<UnixStreamChannel>
- findChannel(const unix_stream::Endpoint& endpoint);
-
-private:
- typedef std::map< unix_stream::Endpoint, shared_ptr<UnixStreamChannel> > ChannelMap;
- ChannelMap m_channels;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
diff --git a/NFD/daemon/face/websocket-channel.cpp b/NFD/daemon/face/websocket-channel.cpp
deleted file mode 100644
index 8abdbac..0000000
--- a/NFD/daemon/face/websocket-channel.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "websocket-channel.hpp"
-
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-namespace nfd {
-
-NFD_LOG_INIT("WebSocketChannel");
-
-using namespace boost::asio;
-
-WebSocketChannel::WebSocketChannel(const websocket::Endpoint& localEndpoint)
- : m_localEndpoint(localEndpoint)
- , m_isListening(false)
- , m_pingInterval(10000)
-{
- // Setup WebSocket server
- m_server.clear_access_channels(websocketpp::log::alevel::all);
- m_server.clear_error_channels(websocketpp::log::alevel::all);
-
- m_server.set_message_handler(bind(&WebSocketChannel::handleMessage, this, _1, _2));
- m_server.set_open_handler(bind(&WebSocketChannel::handleOpen, this, _1));
- m_server.set_close_handler(bind(&WebSocketChannel::handleClose, this, _1));
- m_server.init_asio(&getGlobalIoService());
- // Always set SO_REUSEADDR flag
- m_server.set_reuse_addr(true);
-
- // Detect disconnection using PONG message
- m_server.set_pong_handler(bind(&WebSocketChannel::handlePong, this, _1, _2));
- m_server.set_pong_timeout_handler(bind(&WebSocketChannel::handlePongTimeout,
- this, _1, _2));
-
- this->setUri(FaceUri(localEndpoint, "ws"));
-}
-
-WebSocketChannel::~WebSocketChannel()
-{
-}
-
-void
-WebSocketChannel::setPongTimeout(time::milliseconds timeout)
-{
- m_server.set_pong_timeout(static_cast<long>(timeout.count()));
-}
-
-void
-WebSocketChannel::handlePongTimeout(websocketpp::connection_hdl hdl, std::string msg)
-{
- ChannelFaceMap::iterator it = m_channelFaces.find(hdl);
- if (it != m_channelFaces.end())
- {
- it->second->close();
- NFD_LOG_DEBUG("handlePongTimeout: remove " << it->second->getRemoteUri());
- m_channelFaces.erase(it);
- }
-}
-
-void
-WebSocketChannel::handlePong(websocketpp::connection_hdl hdl, std::string msg)
-{
- ChannelFaceMap::iterator it = m_channelFaces.find(hdl);
- if (it != m_channelFaces.end())
- {
- NFD_LOG_TRACE("handlePong: from " << it->second->getRemoteUri());
- }
-}
-
-void
-WebSocketChannel::handleMessage(websocketpp::connection_hdl hdl,
- websocket::Server::message_ptr msg)
-{
- ChannelFaceMap::iterator it = m_channelFaces.find(hdl);
- if (it != m_channelFaces.end())
- {
- it->second->handleReceive(msg->get_payload());
- }
-}
-
-void
-WebSocketChannel::handleOpen(websocketpp::connection_hdl hdl)
-{
- std::string remote;
- try
- {
- remote = "wsclient://" + m_server.get_con_from_hdl(hdl)->get_remote_endpoint();
- }
- catch (websocketpp::lib::error_code&)
- {
- NFD_LOG_DEBUG("handleOpen: cannot get remote uri");
- websocketpp::lib::error_code ecode;
- m_server.close(hdl, websocketpp::close::status::normal, "closed by channel", ecode);
- }
- shared_ptr<WebSocketFace> face = ndn::make_shared<WebSocketFace>(FaceUri(remote), this->getUri(),
- hdl, ref(m_server));
- m_onFaceCreatedCallback(face);
- m_channelFaces[hdl] = face;
-
- // Schedule PING message
- EventId pingEvent = scheduler::schedule(m_pingInterval,
- bind(&WebSocketChannel::sendPing, this, hdl));
- face->setPingEventId(pingEvent);
-}
-
-void
-WebSocketChannel::sendPing(websocketpp::connection_hdl hdl)
-{
- ChannelFaceMap::iterator it = m_channelFaces.find(hdl);
- if (it != m_channelFaces.end())
- {
- try
- {
- m_server.ping(hdl, "NFD-WebSocket");
- }
- catch (websocketpp::lib::error_code&)
- {
- it->second->close();
- NFD_LOG_DEBUG("sendPing: failed to ping " << it->second->getRemoteUri());
- m_channelFaces.erase(it);
- }
-
- NFD_LOG_TRACE("sendPing: to " << it->second->getRemoteUri());
-
- // Schedule next PING message
- EventId pingEvent = scheduler::schedule(m_pingInterval,
- bind(&WebSocketChannel::sendPing, this, hdl));
- it->second->setPingEventId(pingEvent);
- }
-}
-
-void
-WebSocketChannel::handleClose(websocketpp::connection_hdl hdl)
-{
- ChannelFaceMap::iterator it = m_channelFaces.find(hdl);
- if (it != m_channelFaces.end())
- {
- it->second->close();
- NFD_LOG_DEBUG("handleClose: remove " << it->second->getRemoteUri());
- m_channelFaces.erase(it);
- }
-}
-
-
-void
-WebSocketChannel::listen(const FaceCreatedCallback& onFaceCreated)
-{
- if (m_isListening)
- {
- throw Error("Listen already called on this channel");
- }
- m_isListening = true;
-
- m_onFaceCreatedCallback = onFaceCreated;
-
- try
- {
- m_server.listen(m_localEndpoint);
- }
- catch (websocketpp::lib::error_code ec)
- {
- throw Error("Failed to listen on local endpoint");
- }
-
- m_server.start_accept();
-}
-
-size_t
-WebSocketChannel::size() const
-{
- return m_channelFaces.size();
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/websocket-channel.hpp b/NFD/daemon/face/websocket-channel.hpp
deleted file mode 100644
index f7c6ae2..0000000
--- a/NFD/daemon/face/websocket-channel.hpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
-#define NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
-
-#include "channel.hpp"
-#include "core/global-io.hpp"
-#include "core/scheduler.hpp"
-#include "websocket-face.hpp"
-
-namespace nfd {
-
-/**
- * \brief Class implementing WebSocket-based channel to create faces
- *
- *
- */
-class WebSocketChannel : public Channel
-{
-public:
- /**
- * \brief Exception of WebSocketChannel
- */
- class Error : public std::runtime_error
- {
- public:
- explicit
- Error(const std::string& what)
- : runtime_error(what)
- {
- }
- };
-
- /**
- * \brief Create WebSocket channel for the local endpoint
- *
- * To enable creation of faces upon incoming connections,
- * one needs to explicitly call WebSocketChannel::listen method.
- * The created socket is bound to the localEndpoint.
- *
- * \throw WebSocketChannel::Error if bind on the socket fails
- */
- explicit
- WebSocketChannel(const websocket::Endpoint& localEndpoint);
-
- virtual
- ~WebSocketChannel();
-
- /**
- * \brief Enable listening on the local endpoint, accept connections,
- * and create faces when remote host makes a connection
- * \param onFaceCreated Callback to notify successful creation of the face
- *
- * \throws WebSocketChannel::Error if called multiple times
- */
- void
- listen(const FaceCreatedCallback& onFaceCreated);
-
- /**
- * \brief Get number of faces in the channel
- */
- size_t
- size() const;
-
- bool
- isListening() const;
-
- void
- setPingInterval(time::milliseconds interval)
- {
- m_pingInterval = interval;
- }
-
- void
- setPongTimeout(time::milliseconds timeout);
-
-private:
- void
- sendPing(websocketpp::connection_hdl hdl);
-
- void
- handlePong(websocketpp::connection_hdl hdl, std::string msg);
-
- void
- handlePongTimeout(websocketpp::connection_hdl hdl, std::string msg);
-
- void
- handleMessage(websocketpp::connection_hdl hdl, websocket::Server::message_ptr msg);
-
- void
- handleOpen(websocketpp::connection_hdl hdl);
-
- void
- handleClose(websocketpp::connection_hdl hdl);
-
-private:
- websocket::Endpoint m_localEndpoint;
-
- websocket::Server m_server;
-
- /**
- * Callbacks for face creation.
- * New communications are detected using async_receive_from.
- * Its handler has a fixed signature. No space for the face callback
- */
- FaceCreatedCallback m_onFaceCreatedCallback;
-
- typedef std::map< websocketpp::connection_hdl, shared_ptr<WebSocketFace>,
- std::owner_less<websocketpp::connection_hdl> > ChannelFaceMap;
- ChannelFaceMap m_channelFaces;
-
- /**
- * \brief If true, it means the function listen has already been called
- */
- bool m_isListening;
-
- time::milliseconds m_pingInterval;
-};
-
-inline bool
-WebSocketChannel::isListening() const
-{
- return m_isListening;
-}
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
diff --git a/NFD/daemon/face/websocket-face.cpp b/NFD/daemon/face/websocket-face.cpp
deleted file mode 100644
index abd8b3c..0000000
--- a/NFD/daemon/face/websocket-face.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "websocket-face.hpp"
-#include "core/global-io.hpp"
-
-namespace nfd {
-
-NFD_LOG_INIT("WebSocketFace");
-
-WebSocketFace::WebSocketFace(const FaceUri& remoteUri, const FaceUri& localUri,
- websocketpp::connection_hdl hdl,
- websocket::Server& server)
- : Face(remoteUri, localUri)
- , m_handle(hdl)
- , m_server(server)
- , m_closed(false)
-{
- this->setOnDemand(true);
-}
-
-void
-WebSocketFace::sendInterest(const Interest& interest)
-{
- if (m_closed)
- return;
-
- this->onSendInterest(interest);
- const Block& payload = interest.wireEncode();
- this->getMutableCounters().getNOutBytes() += payload.size();
-
- try {
- m_server.send(m_handle, payload.wire(), payload.size(),
- websocketpp::frame::opcode::binary);
- }
- catch (const websocketpp::lib::error_code& e) {
- NFD_LOG_DEBUG("Failed to send Interest because: " << e
- << "(" << e.message() << ")");
- }
-}
-
-void
-WebSocketFace::sendData(const Data& data)
-{
- if (m_closed)
- return;
-
- this->onSendData(data);
- const Block& payload = data.wireEncode();
- this->getMutableCounters().getNOutBytes() += payload.size();
-
- try {
- m_server.send(m_handle, payload.wire(), payload.size(),
- websocketpp::frame::opcode::binary);
- }
- catch (const websocketpp::lib::error_code& e) {
- NFD_LOG_DEBUG("Failed to send Data because: " << e
- << "(" << e.message() << ")");
- }
-}
-
-void
-WebSocketFace::close()
-{
- if (m_closed == false)
- {
- m_closed = true;
- scheduler::cancel(m_pingEventId);
- websocketpp::lib::error_code ecode;
- m_server.close(m_handle, websocketpp::close::status::normal, "closed by nfd", ecode);
-
- fail("Face closed");
- }
-}
-
-void
-WebSocketFace::handleReceive(const std::string& msg)
-{
- // Copy message into Face internal buffer
- if (msg.size() > ndn::MAX_NDN_PACKET_SIZE)
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << "] Received WebSocket message size ["
- << msg.size() << "] is too big");
- return;
- }
-
- this->getMutableCounters().getNInBytes() += msg.size();
-
- // Try to parse message data
- bool isOk = true;
- Block element;
- isOk = Block::fromBuffer(reinterpret_cast<const uint8_t*>(msg.c_str()), msg.size(), element);
- if (!isOk)
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << "] Received invalid NDN packet of length ["
- << msg.size() << "]");
- return;
- }
-
- if (!this->decodeAndDispatchInput(element))
- {
- NFD_LOG_WARN("[id:" << this->getId()
- << "] Received unrecognized block of type ["
- << element.type() << "]");
- // ignore unknown packet and proceed
- }
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/websocket-face.hpp b/NFD/daemon/face/websocket-face.hpp
deleted file mode 100644
index 81a1111..0000000
--- a/NFD/daemon/face/websocket-face.hpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP
-#define NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP
-
-#include "face.hpp"
-#include "core/logger.hpp"
-#include "core/scheduler.hpp"
-
-#ifndef HAVE_WEBSOCKET
-#error "Cannot include this file when WebSocket support is not enabled"
-#endif // HAVE_WEBSOCKET
-
-#include "websocketpp.hpp"
-
-namespace nfd {
-
-namespace websocket {
-typedef boost::asio::ip::tcp::endpoint Endpoint;
-typedef websocketpp::server<websocketpp::config::asio> Server;
-} // namespace websocket
-
-
-/**
- * \brief Implementation of Face abstraction that uses WebSocket
- * as underlying transport mechanism
- */
-class WebSocketFace : public Face
-{
-public:
- WebSocketFace(const FaceUri& remoteUri, const FaceUri& localUri,
- websocketpp::connection_hdl hdl, websocket::Server& server);
-
- // from Face
- virtual void
- sendInterest(const Interest& interest);
-
- virtual void
- sendData(const Data& data);
-
- virtual void
- close();
-
- void
- setPingEventId(EventId& id)
- {
- m_pingEventId = id;
- }
-
- void
- handleReceive(const std::string& msg);
-
-private:
- websocketpp::connection_hdl m_handle;
- websocket::Server& m_server;
- EventId m_pingEventId;
- bool m_closed;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP
diff --git a/NFD/daemon/face/websocket-factory.cpp b/NFD/daemon/face/websocket-factory.cpp
deleted file mode 100644
index 30f3afd..0000000
--- a/NFD/daemon/face/websocket-factory.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "websocket-factory.hpp"
-#include "core/resolver.hpp"
-
-namespace nfd {
-
-using namespace boost::asio;
-
-NFD_LOG_INIT("WebSocketFactory");
-
-WebSocketFactory::WebSocketFactory(const std::string& defaultPort)
- : m_defaultPort(defaultPort)
-{
-}
-
-shared_ptr<WebSocketChannel>
-WebSocketFactory::createChannel(const websocket::Endpoint& endpoint)
-{
- shared_ptr<WebSocketChannel> channel = findChannel(endpoint);
- if (static_cast<bool>(channel))
- return channel;
-
- channel = make_shared<WebSocketChannel>(endpoint);
- m_channels[endpoint] = channel;
-
- return channel;
-}
-
-shared_ptr<WebSocketChannel>
-WebSocketFactory::createChannel(const std::string& host, const std::string& port)
-{
- ip::tcp::endpoint tcpEndpoint = TcpResolver::syncResolve(host, port);
- websocket::Endpoint endpoint(tcpEndpoint.address(), tcpEndpoint.port());
- return createChannel(endpoint);
-}
-
-shared_ptr<WebSocketChannel>
-WebSocketFactory::findChannel(const websocket::Endpoint& localEndpoint)
-{
- ChannelMap::iterator i = m_channels.find(localEndpoint);
- if (i != m_channels.end())
- return i->second;
- else
- return shared_ptr<WebSocketChannel>();
-}
-
-void
-WebSocketFactory::createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed)
-{
- throw Error("WebSocketFactory does not support 'createFace' operation");
-}
-
-std::list<shared_ptr<const Channel> >
-WebSocketFactory::getChannels() const
-{
- std::list<shared_ptr<const Channel> > channels;
- for (ChannelMap::const_iterator i = m_channels.begin(); i != m_channels.end(); ++i)
- {
- channels.push_back(i->second);
- }
-
- return channels;
-}
-
-} // namespace nfd
diff --git a/NFD/daemon/face/websocket-factory.hpp b/NFD/daemon/face/websocket-factory.hpp
deleted file mode 100644
index d3a6324..0000000
--- a/NFD/daemon/face/websocket-factory.hpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
-#define NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
-
-#include "protocol-factory.hpp"
-#include "websocket-channel.hpp"
-
-
-namespace nfd {
-
-class WebSocketFactory : public ProtocolFactory
-{
-public:
- /**
- * \brief Exception of WebSocketFactory
- */
- class Error : public ProtocolFactory::Error
- {
- public:
- explicit
- Error(const std::string& what)
- : ProtocolFactory::Error(what)
- {
- }
- };
-
- explicit
- WebSocketFactory(const std::string& defaultPort);
-
- /**
- * \brief Create WebSocket-based channel using websocket::Endpoint
- *
- * websocket::Endpoint is really an alias for boost::asio::ip::tcp::endpoint.
- *
- * If this method called twice with the same endpoint, only one channel
- * will be created. The second call will just retrieve the existing
- * channel.
- *
- * \returns always a valid pointer to a WebSocketChannel object, an exception
- * is thrown if it cannot be created.
- *
- * \throws WebSocketFactory::Error, TcpResolver::Error
- *
- */
- shared_ptr<WebSocketChannel>
- createChannel(const websocket::Endpoint& localEndpoint);
-
- /**
- * \brief Create WebSocket-based channel using specified ip address and port number
- *
- * \throws WebSocketFactory::Error
- */
- shared_ptr<WebSocketChannel>
- createChannel(const std::string& ipAddress, const std::string& port);
-
- // from Factory
- virtual void
- createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed);
-
- virtual std::list<shared_ptr<const Channel> >
- getChannels() const;
-
-private:
-
- /**
- * \brief Look up WebSocketChannel using specified local endpoint
- *
- * \returns shared pointer to the existing WebSocketChannel object
- * or empty shared pointer when such channel does not exist
- *
- * \throws never
- */
- shared_ptr<WebSocketChannel>
- findChannel(const websocket::Endpoint& localEndpoint);
-
- typedef std::map< websocket::Endpoint, shared_ptr<WebSocketChannel> > ChannelMap;
- ChannelMap m_channels;
-
- std::string m_defaultPort;
-};
-
-} // namespace nfd
-
-#endif // NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
diff --git a/NFD/daemon/face/websocketpp.hpp b/NFD/daemon/face/websocketpp.hpp
deleted file mode 100644
index f590bd1..0000000
--- a/NFD/daemon/face/websocketpp.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_DAEMON_FACE_WEBSOCKETPP_HPP
-#define NFD_DAEMON_FACE_WEBSOCKETPP_HPP
-
-#ifndef HAVE_WEBSOCKET
-#error "This file must not be included when WebSocket Face support is disabled"
-#endif
-
-// suppress websocketpp warnings
-#pragma GCC system_header
-#pragma clang system_header
-
-#include "websocketpp/config/asio_no_tls.hpp"
-#include "websocketpp/server.hpp"
-
-#endif // NFD_DAEMON_FACE_WEBSOCKETPP_HPP
diff --git a/NFD/daemon/main.cpp b/NFD/daemon/main.cpp
deleted file mode 100644
index e275668..0000000
--- a/NFD/daemon/main.cpp
+++ /dev/null
@@ -1,408 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <getopt.h>
-#include <boost/filesystem.hpp>
-
-#include "version.hpp"
-#include "core/logger.hpp"
-#include "core/global-io.hpp"
-#include "core/privilege-helper.hpp"
-#include "fw/forwarder.hpp"
-#include "face/null-face.hpp"
-#include "mgmt/internal-face.hpp"
-#include "mgmt/fib-manager.hpp"
-#include "mgmt/face-manager.hpp"
-#include "mgmt/strategy-choice-manager.hpp"
-#include "mgmt/status-server.hpp"
-#include "core/config-file.hpp"
-#include "mgmt/general-config-section.hpp"
-#include "mgmt/tables-config-section.hpp"
-
-namespace nfd {
-
-NFD_LOG_INIT("NFD");
-
-struct ProgramOptions
-{
- bool showUsage;
- bool showVersion;
- bool showModules;
- std::string config;
-};
-
-class Nfd : noncopyable
-{
-public:
- explicit
- Nfd(const std::string& configFile)
- : m_configFile(configFile)
- , m_originalStreamBuf(0)
- {
- }
-
- ~Nfd()
- {
- if (static_cast<bool>(m_originalStreamBuf)) {
- std::clog.rdbuf(m_originalStreamBuf);
- }
- }
-
- void
- initialize()
- {
- initializeLogging();
-
- m_forwarder = make_shared<Forwarder>();
-
- initializeManagement();
-
- m_forwarder->getFaceTable().addReserved(make_shared<NullFace>(), FACEID_NULL);
- m_forwarder->getFaceTable().addReserved(
- make_shared<NullFace>(FaceUri("contentstore://")), FACEID_CONTENT_STORE);
-
- PrivilegeHelper::drop();
- }
-
-
- void
- initializeLogging()
- {
- ConfigFile config(&ConfigFile::ignoreUnknownSection);
- LoggerFactory::getInstance().setConfigFile(config);
-
- config.parse(m_configFile, true);
- config.parse(m_configFile, false);
- }
-
- class IgnoreRibAndLogSections
- {
- public:
- void
- operator()(const std::string& filename,
- const std::string& sectionName,
- const ConfigSection& section,
- bool isDryRun)
-
- {
- // Ignore "log" and sections beginning with "rib_" (intended for rib manager),
- // but raise an error if we're missing a handler for an NFD section.
-
- if (sectionName.find("rib") == 0 || sectionName == "log")
- {
- // do nothing
- }
- else
- {
- // missing NFD section
- ConfigFile::throwErrorOnUnknownSection(filename, sectionName, section, isDryRun);
- }
- }
- };
-
- void
- initializeManagement()
- {
- m_internalFace = make_shared<InternalFace>();
-
- m_fibManager = make_shared<FibManager>(ref(m_forwarder->getFib()),
- bind(&Forwarder::getFace, m_forwarder.get(), _1),
- m_internalFace,
- ndn::ref(m_keyChain));
-
- m_faceManager = make_shared<FaceManager>(ref(m_forwarder->getFaceTable()),
- m_internalFace,
- ndn::ref(m_keyChain));
-
- m_strategyChoiceManager =
- make_shared<StrategyChoiceManager>(ref(m_forwarder->getStrategyChoice()),
- m_internalFace,
- ndn::ref(m_keyChain));
-
- m_statusServer = make_shared<StatusServer>(m_internalFace,
- ref(*m_forwarder),
- ndn::ref(m_keyChain));
-
- ConfigFile config((IgnoreRibAndLogSections()));
- general::setConfigFile(config);
-
- TablesConfigSection tablesConfig(m_forwarder->getCs(),
- m_forwarder->getPit(),
- m_forwarder->getFib(),
- m_forwarder->getStrategyChoice(),
- m_forwarder->getMeasurements());
- tablesConfig.setConfigFile(config);
-
- m_internalFace->getValidator().setConfigFile(config);
-
- m_forwarder->getFaceTable().addReserved(m_internalFace, FACEID_INTERNAL_FACE);
-
- m_faceManager->setConfigFile(config);
-
- // parse config file
- config.parse(m_configFile, true);
- config.parse(m_configFile, false);
-
- tablesConfig.ensureTablesAreConfigured();
-
- // add FIB entry for NFD Management Protocol
- shared_ptr<fib::Entry> entry = m_forwarder->getFib().insert("/localhost/nfd").first;
- entry->addNextHop(m_internalFace, 0);
- }
-
- static void
- printUsage(std::ostream& os, const std::string& programName)
- {
- os << "Usage: \n"
- << " " << programName << " [options]\n"
- << "\n"
- << "Run NFD forwarding daemon\n"
- << "\n"
- << "Options:\n"
- << " [--help] - print this help message\n"
- << " [--version] - print version and exit\n"
- << " [--modules] - list available logging modules\n"
- << " [--config /path/to/nfd.conf] - path to configuration file "
- << "(default: " << DEFAULT_CONFIG_FILE << ")\n"
- ;
- }
-
- static void
- printModules(std::ostream& os)
- {
- using namespace std;
-
- os << "Available logging modules: \n";
-
- list<string> modules(LoggerFactory::getInstance().getModules());
- for (list<string>::const_iterator i = modules.begin(); i != modules.end(); ++i)
- {
- os << *i << "\n";
- }
- }
-
- static bool
- parseCommandLine(int argc, char** argv, ProgramOptions& options)
- {
- options.showUsage = false;
- options.showVersion = false;
- options.showModules = false;
- options.config = DEFAULT_CONFIG_FILE;
-
- while (true) {
- int optionIndex = 0;
- static ::option longOptions[] = {
- { "help" , no_argument , 0, 0 },
- { "modules", no_argument , 0, 0 },
- { "config" , required_argument, 0, 0 },
- { "version", no_argument , 0, 0 },
- { 0 , 0 , 0, 0 }
- };
- int c = getopt_long_only(argc, argv, "", longOptions, &optionIndex);
- if (c == -1)
- break;
-
- switch (c) {
- case 0:
- switch (optionIndex) {
- case 0: // help
- options.showUsage = true;
- break;
- case 1: // modules
- options.showModules = true;
- break;
- case 2: // config
- options.config = ::optarg;
- break;
- case 3: // version
- options.showVersion = true;
- break;
- default:
- return false;
- }
- break;
- }
- }
- return true;
- }
-
- void
- terminate(const boost::system::error_code& error,
- int signalNo,
- boost::asio::signal_set& signalSet)
- {
- if (error)
- return;
-
- if (signalNo == SIGINT ||
- signalNo == SIGTERM)
- {
- getGlobalIoService().stop();
- NFD_LOG_INFO("Caught signal '" << strsignal(signalNo) << "', exiting...");
- }
- else
- {
- signalSet.async_wait(bind(&Nfd::terminate, this, _1, _2, ref(signalSet)));
- }
- }
-
- void
- reload(const boost::system::error_code& error,
- int signalNo,
- boost::asio::signal_set& signalSet)
- {
- if (error)
- return;
-
- NFD_LOG_INFO("Caught signal '" << strsignal(signalNo));
-
- ////////////////////////
- // Reload config file //
- ////////////////////////
-
- // Logging
- initializeLogging();
- /// \todo Reopen log file
-
- // Other stuff
- ConfigFile config((IgnoreRibAndLogSections()));
-
- general::setConfigFile(config);
-
- TablesConfigSection tablesConfig(m_forwarder->getCs(),
- m_forwarder->getPit(),
- m_forwarder->getFib(),
- m_forwarder->getStrategyChoice(),
- m_forwarder->getMeasurements());
-
- tablesConfig.setConfigFile(config);
-
- m_internalFace->getValidator().setConfigFile(config);
- m_faceManager->setConfigFile(config);
-
- config.parse(m_configFile, false);
-
- ////////////////////////
-
- signalSet.async_wait(bind(&Nfd::reload, this, _1, _2, ref(signalSet)));
- }
-
-private:
- std::string m_configFile;
-
- shared_ptr<Forwarder> m_forwarder;
-
- shared_ptr<InternalFace> m_internalFace;
- shared_ptr<FibManager> m_fibManager;
- shared_ptr<FaceManager> m_faceManager;
- shared_ptr<StrategyChoiceManager> m_strategyChoiceManager;
- shared_ptr<StatusServer> m_statusServer;
-
- shared_ptr<std::ofstream> m_logFile;
- std::basic_streambuf<char>* m_originalStreamBuf;
- ndn::KeyChain m_keyChain;
-};
-
-} // namespace nfd
-
-int
-main(int argc, char** argv)
-{
- using namespace nfd;
-
- ProgramOptions options;
- bool isCommandLineValid = Nfd::parseCommandLine(argc, argv, options);
- if (!isCommandLineValid) {
- Nfd::printUsage(std::cerr, argv[0]);
- return 1;
- }
-
- if (options.showUsage) {
- Nfd::printUsage(std::cout, argv[0]);
- return 0;
- }
-
- if (options.showVersion) {
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- }
-
- if (options.showModules) {
- Nfd::printModules(std::cout);
- return 0;
- }
-
- Nfd nfdInstance(options.config);
-
- try {
- nfdInstance.initialize();
- }
- catch (boost::filesystem::filesystem_error& e) {
- if (e.code() == boost::system::errc::permission_denied) {
- NFD_LOG_FATAL("Permissions denied for " << e.path1() << ". " <<
- argv[0] << " should be run as superuser");
- }
- else {
- NFD_LOG_FATAL(e.what());
- }
- return 1;
- }
- catch (const std::exception& e) {
- NFD_LOG_FATAL(e.what());
- return 2;
- }
- catch (const PrivilegeHelper::Error& e) {
- // PrivilegeHelper::Errors do not inherit from std::exception
- // and represent seteuid/gid failures
-
- NFD_LOG_FATAL(e.what());
- return 3;
- }
-
- boost::asio::signal_set terminationSignalSet(getGlobalIoService());
- terminationSignalSet.add(SIGINT);
- terminationSignalSet.add(SIGTERM);
- terminationSignalSet.async_wait(bind(&Nfd::terminate, &nfdInstance, _1, _2,
- ref(terminationSignalSet)));
-
- boost::asio::signal_set reloadSignalSet(getGlobalIoService());
- reloadSignalSet.add(SIGHUP);
- reloadSignalSet.async_wait(bind(&Nfd::reload, &nfdInstance, _1, _2,
- ref(reloadSignalSet)));
-
- try {
- getGlobalIoService().run();
- }
- catch (const std::exception& e) {
- NFD_LOG_FATAL(e.what());
- return 4;
- }
- catch (const PrivilegeHelper::Error& e) {
- NFD_LOG_FATAL(e.what());
- return 5;
- }
-
- return 0;
-}
diff --git a/NFD/docs/FAQ.rst b/NFD/docs/FAQ.rst
deleted file mode 100644
index 0709ef8..0000000
--- a/NFD/docs/FAQ.rst
+++ /dev/null
@@ -1,221 +0,0 @@
-FAQ
-===
-
-How to change default paths?
-----------------------------
-
-Paths to where NFD is installed can be configured during ``./waf
-configure``:
-
-- Installation prefix (default ``/usr/local``):
-
- ::
-
- ./waf configure --prefix=/usr
-
-- Location of NFD configuration file (default: ``${prefix}/etc``):
-
- ::
-
- ./waf configure --prefix=/usr --sysconfdir=/etc
-
-- Location of manpages (default: ``${prefix}/share/man``)
-
- ::
-
- ./waf configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man
-
-How to run NFD on Raspberry Pi?
--------------------------------
-
-To run NFD on the Raspberry Pi, you need to either enable IPv6 support
-in Raspberry Pi or disable IPv6 support in NFD.
-
-To enable IPv6 in Raspberry Pi:
-
-::
-
- sudo modprobe ipv6
-
-To disable IPv6 in NFD, replace ``enable_v6 yes`` with ``enable_v6 no``
-in ``tcp`` and ``udp`` sections of ``/usr/local/etc/ndn/nfd.conf``:
-
-::
-
- ...
- tcp
- {
- listen yes
- port 6363
- enable_v4 yes
- enable_v6 no
- }
-
- udp
- {
- port 6363
- enable_v4 yes
- enable_v6 no
- idle_timeout 600
- keep_alive_interval 25
-
- mcast yes
- mcast_port 56363
- mcast_group 224.0.23.170
- }
- ...
-
-
-How to run NFD as non-root user?
---------------------------------
-
-How to configure automatic dropping of privileges?
-++++++++++++++++++++++++++++++++++++++++++++++++++
-
-NFD can be configured to drop privileges whenever possible. You can specify a user and/or
-group for NFD to change its *effective* user/group ID to in the ``general`` section of the
-configuration file. For example:
-
-::
-
- general
- {
- user nobody
- group nogroup
- }
-
-will configure NFD to drop its effective user and group IDs to ``nobody`` and ``nogroup``,
-respectively.
-
-.. note::
-
- **IMPORTANT:** NFD may regain elevated permissions as needed during normal
- execution. Dropping privileges in this manner should not be considered a security
- mechanism (a compromised NFD that was started as root can trivially return to
- root). However, reducing privileges may limit any damaged caused by well intentioned,
- but buggy, code.
-
-
-How to enable Ethernet Face Support?
-++++++++++++++++++++++++++++++++++++
-
-The ``ether`` configuration file section contains settings for Ethernet faces and
-channels. These settings will **NOT** work without root or setting the appropriate
-permissions:
-
-::
-
- sudo setcap cap_net_raw,cap_net_admin=eip /full/path/nfd
-
-You may need to install a package to use setcap:
-
-**Ubuntu:**
-
-::
-
- sudo apt-get install libcap2-bin
-
-**Mac OS X:**
-
-::
-
- curl https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3373 -o ChmodBPF.tar.gz
- tar zxvf ChmodBPF.tar.gz
- open ChmodBPF/Install\ ChmodBPF.app
-
-or manually:
-
-::
-
- sudo chgrp admin /dev/bpf*
- sudo chmod g+rw /dev/bpf*
-
-How to enable UDP multicast support in multi-homed Linux machines
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-The UDP configuration file section contains settings for unicast and multicast UDP
-faces. If the Linux box is equipped with multiple network interfaces with multicast
-capabilities, the settings for multicast faces will **NOT** work without root
-or setting the appropriate permissions:
-
-::
-
- sudo setcap cap_net_raw=eip /full/path/nfd
-
-.. _How to configure NFD security:
-
-How to configure NFD security?
-------------------------------
-
-.. note:: Sample configuration file of NFD allow any user to manage faces, FIB, RIB, and
- StrategyChoice. The following description can be used to restrict certain operations
- to certain users.
-
- More extensive documentation about NFD's security and options to configure trust model
- for NFD is currently in preparation.
-
-Many NFD management protocols require signed commands to be processed
-(e.g. FIB modification, Face creation/destructions, etc.). You will need
-an NDN certificate to use any application that issues signed commands.
-
-If you do not already have NDN certificate, you can generate one with
-the following commands:
-
-**Generate and install a self-signed identity certificate**:
-
-::
-
- ndnsec-keygen /`whoami` | ndnsec-install-cert -
-
-Note that the argument to ndnsec-key will be the identity name of the
-new key (in this case, ``/your-username``). Identity names are
-hierarchical NDN names and may have multiple components (e.g.
-``/ndn/ucla/edu/alice``). You may create additional keys and identities
-as you see fit.
-
-**Dump the NDN certificate to a file**:
-
-The following commands assume that you have not modified ``PREFIX`` or
-``SYSCONFDIR`` If you have, please substitute ``/usr/local/etc`` for the
-appropriate value (the overriden ``SYSCONFDIR`` or ``PREFIX/etc`` if you
-changed ``PREFIX``).
-
-::
-
- sudo mkdir -p /usr/local/etc/ndn/keys
- ndnsec-cert-dump -i /`whoami` > default.ndncert
- sudo mv default.ndncert /usr/local/etc/ndn/keys/default.ndncert
-
-.. _How to start using NDN MacPorts repository on OSX:
-
-How to start using NDN MacPorts repository on OSX?
---------------------------------------------------
-
-Please see :ref:`Install NFD Using the NDN MacPorts Repository on OS X`.
-
-.. _How to start using NDN PPA repository on Ubuntu Linux:
-
-How to start using NDN PPA repository on Ubuntu Linux?
-------------------------------------------------------
-
-Please see :ref:`Install NFD Using the NDN PPA Repository on Ubuntu Linux`.
-
-.. _How to start using NDN Overlay on Gentoo Linux:
-
-How to start using NDN Overlay on Gentoo Linux?
------------------------------------------------
-
-If you want to install NFD and other packages using Portage on Gentoo Linux, you can start
-using NDN Overlay.
-
-Simply checkout `NDN Overlay <https://github.com/Pesa/ndn-overlay>`_ repository to some
-location add the checkout path to ``PORTDIR_OVERLAY`` in ``/etc/portage/make.conf``:
-
-::
-
- cd /some/path
- git clone https://github.com/Pesa/ndn-overlay.git
-
- # and then add /some/path/ndn-overlay to PORTDIR_OVERLAY in /etc/portage/make.conf
-
-Afterwards, you will be able to install ``nfd`` using standard mechanisms.
diff --git a/NFD/docs/INSTALL.rst b/NFD/docs/INSTALL.rst
deleted file mode 100644
index e04ee48..0000000
--- a/NFD/docs/INSTALL.rst
+++ /dev/null
@@ -1,387 +0,0 @@
-Getting Started with NFD
-========================
-
-Installing NFD from Binaries
-----------------------------
-
-We provide NFD binaries for the supported platforms, which are the preferred installation
-method. In addition to simplifying installation, the binary release also includes
-automatic initial configuration and platform-specific tools to automatically start NFD and
-related daemons. In particular, on OS X NFD is controlled using `launchd
-<https://github.com/named-data/NFD/tree/master/contrib/osx-launchd>`__ and on Ubuntu using
-`upstart <https://github.com/named-data/NFD/tree/master/contrib/upstart>`__ mechanisms.
-In both cases, `nfd-start` and `nfd-stop` scripts are convenience wrappers for launchd and
-upstart.
-
-On OS X, NFD can be installed with MacPorts. Refer to :ref:`Install NFD Using the NDN
-MacPorts Repository on OS X` for more details.
-
-On Ubuntu 12.04, 14.04, or 14.10 NFD can be installed from NDN PPA repository. Refer to
-:ref:`Install NFD Using the NDN PPA Repository on Ubuntu Linux`.
-
-Future releases could include support for other platforms. Please send us feedback on the
-platforms you're using, so we can prioritize our goals. We would also appreciate help
-packaging the current NFD release for other platforms.
-
-
-.. _Install NFD Using the NDN MacPorts Repository on OS X:
-
-Install NFD Using the NDN MacPorts Repository on OS X
------------------------------------------------------
-
-OS X users have the opportunity to seamlessly install and run NFD as well as other related
-applications via `MacPorts <https://www.macports.org/>`_. If you are not using MacPorts
-yet, go to the `MacPorts website <https://www.macports.org/install.php>`_ and install the
-MacPorts package.
-
-NFD and related ports are not part of the official MacPorts repository. In order to use
-these ports, you will need to add the NDN MacPorts repository to your local configuration.
-In particular, you will need to modify the list of source URLs for MacPorts. For example,
-if your MacPorts are installed in ``/opt/local``, add the following line to
-`/opt/local/etc/macports/sources.conf` before or after the default port repository:
-
-::
-
- rsync://macports.named-data.net/macports/
-
-After this step, you can use ``sudo port selfupdate`` to fetch updated port definitions.
-
-The following command will install NFD using MacPorts:
-
-::
-
- sudo port install nfd
-
-.. note::
-
- You have to have XCode installed on your machine. This can be installed from the
- AppStore (free) on OS X 10.7 or later. Older editions of OS X can download an
- appropriate version of XCode from http://developer.apple.com.
-
-
-One advantage of using MacPorts is that you can easily upgrade NFD and other packages to
-the latest version. The following commands will do this job:
-
-::
-
- sudo port selfupdate
- sudo port upgrade nfd
-
-.. _Install NFD Using the NDN PPA Repository on Ubuntu Linux:
-
-Install NFD Using the NDN PPA Repository on Ubuntu Linux
---------------------------------------------------------
-
-NFD binaries and related tools for Ubuntu 12.04, 14.04, or 14.10 can be installed using PPA
-packages from named-data repository. First, you will need to add ``named-data/ppa``
-repository to binary package sources and update list of available packages.
-
-Preliminary steps if you haven't used PPA packages before
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To simplify adding new PPA repositories, Ubuntu provides ``add-apt-repository`` tool,
-which is not installed by default on some platforms.
-
-On Ubuntu **12.04**:
-
-::
-
- sudo apt-get install python-software-properties
-
-On Ubuntu **14.04** or **14.10**:
-
-::
-
- sudo apt-get install software-properties-common
-
-
-Adding NDN PPA
-~~~~~~~~~~~~~~
-
-After installing ``add-apt-repository``, run the following command to add `NDN PPA
-repository`_.
-
-::
-
- sudo add-apt-repository ppa:named-data/ppa
- sudo apt-get update
-
-Installing NFD and other NDN packages
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-After you have added `NDN PPA repository`_, NFD and other NDN packages can be easily
-installed in a standard way, i.e., either using ``apt-get`` as shown below or using any
-other package manager, such as Synaptic Package Manager:
-
-::
-
- sudo apt-get install nfd
-
-For the list of available packages, refer to `NDN PPA repository`_ homepage.
-
-.. _NDN PPA repository: https://launchpad.net/~named-data/+archive/ppa
-
-Building from Source
---------------------
-
-Downloading from Git
-~~~~~~~~~~~~~~~~~~~~
-
-The first step is to obtain the source code for ``NFD`` and, its main dependency, the
-``ndn-cxx`` library. If you are not planning to work with the bleeding edge code, make
-sure you checkout the correct release tag (e.g., ``*-0.2.0``) for both repositories:
-
-::
-
- # Download ndn-cxx
- git clone https://github.com/named-data/ndn-cxx
-
- # Download NFD
- git clone --recursive https://github.com/named-data/NFD
-
-Prerequisites
-~~~~~~~~~~~~~
-
-- Install the `ndn-cxx library <http://named-data.net/doc/ndn-cxx/current/INSTALL.html>`_
- and its requirements
-
-- ``pkg-config``
-
- On OS X 10.8, 10.9, and 10.10 with MacPorts:
-
- ::
-
- sudo port install pkgconfig
-
- On Ubuntu >= 12.04:
-
- ::
-
- sudo apt-get install pkg-config
-
-- ``libpcap``
-
- Comes with the base system on OS X 10.8, 10.9, and 10.10.
-
- On Ubuntu >= 12.04:
-
- ::
-
- sudo apt-get install libpcap-dev
-
-To build manpages and API documentation:
-
-- ``doxygen``
-- ``graphviz``
-- ``python-sphinx``
-
- On OS X 10.8, 10.9, and 10.10 with MacPorts:
-
- ::
-
- sudo port install doxygen graphviz py27-sphinx sphinx_select
- sudo port select sphinx py27-sphinx
-
- On Ubuntu >= 12.04:
-
- ::
-
- sudo apt-get install doxygen graphviz python-sphinx
-
-
-Besides officially supported platforms, NFD is known to work on: Fedora 20, CentOS 6/7, Gentoo Linux,
-Raspberry Pi, OpenWRT, FreeBSD 10.0, and several other platforms. We are soliciting help
-with documenting common problems / pitfalls in installing/using NFD on different platforms
-on `NFD Wiki
-<http://redmine.named-data.net/projects/nfd/wiki/Wiki#Installation-experiences-for-selected-platforms>`__.
-
-
-Build
-~~~~~
-
-The following basic commands should be used to build NFD on Ubuntu:
-
-::
-
- ./waf configure
- ./waf
- sudo ./waf install
-
-If you have installed `ndn-cxx` library and/or other dependencies into a non-standard paths, you
-may need to modify ``PKG_CONFIG_PATH`` environment variable before running ``./waf configure``.
-For example,
-
-::
-
- export PKG_CONFIG_PATH=/custom/lib/pkgconfig:$PKG_CONFIG_PATH
- ./waf configure
- ./waf
- sudo ./waf install
-
-
-Refer to ``./waf --help`` for more options that can be used during ``configure`` stage and
-how to properly configure and run NFD.
-
-.. note::
- If you are working on a source repository that has been compiled before, and you have
- upgraded one of the dependencies, please execute ``./waf distclean`` to clear object files
- and start over.
-
-Debug symbols
-~~~~~~~~~~~~~
-
-The default compiler flags enable debug symbols to be included in binaries. This
-potentially allows more meaningful debugging if NFD or other tools happen to crash.
-
-If it is undesirable, default flags can be easily overridden. The following example shows
-how to completely disable debug symbols and configure NFD to be installed into ``/usr``
-with configuration in ``/etc`` folder.
-
-::
-
- CXXFLAGS="-O2" ./waf configure --prefix=/usr --sysconfdir=/etc
- ./waf
- sudo ./waf install
-
-Building documentation
-~~~~~~~~~~~~~~~~~~~~~~
-
-NFD tutorials and API documentation can be built using the following commands:
-
-::
-
- # Full set of documentation (tutorials + API) in build/docs
- ./waf docs
-
- # Only tutorials in `build/docs`
- ./waf sphinx
-
- # Only API docs in `build/docs/doxygen`
- ./waf doxgyen
-
-
-Manpages are automatically created and installed during the normal build process (e.g.,
-during ``./waf`` and ``./waf install``), if ``python-sphinx`` module is detected during
-``./waf configure`` stage. By default, manpages are installed into
-``${PREFIX}/share/man`` (where default value for ``PREFIX`` is ``/usr/local``). This
-location can be changed during ``./waf configure`` stage using ``--prefix``,
-``--datarootdir``, or ``--mandir`` options.
-
-For more details, refer to ``./waf --help``.
-
-
-Initial configuration
----------------------
-
-.. note::
- If you have installed NFD from binary packages, the package manager has already
- installed initial configuration and you can safely skip this section.
-
-General
-~~~~~~~
-
-After installing NFD from source, you need to create a proper config file. If default
-location for ``./waf configure`` was used, this can be accomplished by simply copying the
-sample configuration file:
-
-::
-
- sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
-
-NFD Security
-~~~~~~~~~~~~
-
-NFD provides mechanisms to enable strict authorization for all management commands. In
-particular, one can authorize only specific public keys to create new Faces or change the
-forwarding strategy for specific namespaces. For more information about how to generate
-private/public key pair, generate self-signed certificate, and use this self-signed
-certificate to authorize NFD management commands refer to :ref:`How to configure NFD
-security` FAQ question.
-
-In the sample configuration file, all authorizations are disabled, effectively allowing
-anybody on the local machine to issue NFD management commands. **The sample file is
-intended only for demo purposes and MUST NOT be used in a production environment.**
-
-Running
--------
-
-**You should not run ndnd or ndnd-tlv, otherwise NFD will not work correctly**
-
-Starting
-~~~~~~~~
-
-In order to use NFD, you need to start two separate daemons: ``nfd`` (the forwarder
-itself) and ``nrd`` (RIB manager that will manage all prefix registrations). The
-recommended way is to use `nfd-start` script:
-
-::
-
- nfd-start
-
-On OS X it may ask for your keychain password or ask ``nfd/nrd wants to sign using key in
-your keychain.`` Enter your keychain password and click Always Allow.
-
-Later, you can stop NFD with ``nfd-stop`` or by simply killing the ``nfd`` process.
-
-
-Connecting to remote NFDs
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To create a UDP or TCP tunnel to remote NFD and create route toward it, use the following
-command in terminal:
-
-::
-
- nfdc register /ndn udp://<other host>
-
-where ``<other host>`` is the name or IP address of the other host (e.g.,
-``udp://spurs.cs.ucla.edu``). This outputs:
-
-::
-
- Successful in name registration: ControlParameters(Name: /ndn, FaceId: 260, Origin: 255, Cost: 0, Flags: 1, )
-
-The ``/ndn`` means that NFD will forward all Interests that start with ``/ndn`` through
-the face to the other host. If you only want to forward Interests with a certain prefix,
-use it instead of ``/ndn``. This only forwards Interests to the other host, but there is
-no "back route" for the other host to forward Interests to you. For that, you must go to
-the other host and use ``nfdc`` to add the route.
-
-The "back route" can also be automatically configured with ``nfd-autoreg``. For more
-information refer to :doc:`manpages/nfd-autoreg`.
-
-Playing with NFD
-----------------
-
-After you haved installed, configured, and started NFD, you can try to install and play
-with the following:
-
-Sample applications:
-
-- `Simple examples in ndn-cxx
- library <http://named-data.net/doc/ndn-cxx/current/examples.html>`__.
- If you have installed ndn-cxx from source, you already have compiled
- these:
-
- + examples/producer
- + examples/consumer
- + examples/consumer-with-timer
-
- + tools/ndncatchunks3
- + tools/ndnputchunks3
-
-- `Introductory examples of
- NDN-CCL <http://redmine.named-data.net/projects/nfd/wiki/Getting_Started_-_Common_Client_Libraries#Install-the-Common-Client-Library>`__
-
-Real applications and libraries:
-
- + `ndn-tlv-ping - Reachability Testing Tool for NDN
- <https://github.com/named-data/ndn-tlv-ping>`__
- + `ndn-traffic-generator - Traffic Generator For
- NDN <https://github.com/named-data/ndn-traffic-generator>`__
- + `repo-ng - Next generation of NDN
- repository <https://github.com/named-data/repo-ng>`__
- + `ChronoChat - Multi-user NDN chat
- application <https://github.com/named-data/ChronoChat>`__
- + `ChronoSync - Sync library for multiuser realtime applications for
- NDN <https://github.com/named-data/ChronoSync>`__
diff --git a/NFD/docs/RELEASE_NOTES.rst b/NFD/docs/RELEASE_NOTES.rst
deleted file mode 100644
index bfb47b9..0000000
--- a/NFD/docs/RELEASE_NOTES.rst
+++ /dev/null
@@ -1,263 +0,0 @@
-.. _NFD Release Notes:
-
-NFD Release Notes
-=================
-
-NFD version 0.2.0 (changes since version 0.1.0)
------------------------------------------------
-
-Release date: August 25, 2014
-
-- **Documentation**
-
- + `"NFD Developer's Guide" by NFD authors
- <http://named-data.net/wp-content/uploads/2014/07/NFD-developer-guide.pdf>`_ that
- explains NFD's internals including the overall design, major modules, their
- implementation, and their interactions
-
- + New detailed instructions on how to enable auto-start of NFD using OSX ``launchd``
- and Ubuntu's ``upstart`` (see `contrib/ folder
- <https://github.com/named-data/NFD/tree/master/contrib>`_)
-
-- **Core**
-
- + Add support for temporary privilege drop and elevation (`Issue #1370
- <http://redmine.named-data.net/issues/1370>`_)
-
- + Add support to reinitialize multicast Faces and (partially) reload config file
- (`Issue #1584 <http://redmine.named-data.net/issues/1584>`_)
-
- + Randomization routines are now uniform across all NFD modules
- (`Issue #1369 <http://redmine.named-data.net/issues/1369>`_)
-
- + Enable use of new NDN naming conventions
- (`Issue #1837 <http://redmine.named-data.net/issues/1837>`_ and
- `#1838 <http://redmine.named-data.net/issues/1838>`_)
-
-- **Faces**
-
- + `WebSocket <http://tools.ietf.org/html/rfc6455>`_ Face support
- (`Issue #1468 <http://redmine.named-data.net/issues/1468>`_)
-
- + Fix Ethernet Face support on Linux with ``libpcap`` version >=1.5.0
- (`Issue #1511 <http://redmine.named-data.net/issues/1511>`_)
-
- + Fix to recognize IPv4-mapped IPv6 addresses in ``FaceUri``
- (`Issue #1635 <http://redmine.named-data.net/issues/1635>`_)
-
- + Fix to avoid multiple onFail events
- (`Issue #1497 <http://redmine.named-data.net/issues/1497>`_)
-
- + Fix broken support of multicast UDP Faces on OSX
- (`Issue #1668 <http://redmine.named-data.net/issues/1668>`_)
-
- + On Linux, path MTU discovery on unicast UDPv4 faces is now disabled
- (`Issue #1651 <http://redmine.named-data.net/issues/1651>`_)
-
- + Added link layer byte counts in FaceCounters
- (`Issue #1729 <http://redmine.named-data.net/issues/1729>`_)
-
- + Face IDs 0-255 are now reserved for internal NFD use
- (`Issue #1620 <http://redmine.named-data.net/issues/1620>`_)
-
- + Serialized StreamFace::send(Interest|Data) operations using queue
- (`Issue #1777 <http://redmine.named-data.net/issues/1777>`_)
-
-- **Forwarding**
-
- + Outgoing Interest pipeline now allows strategies to request a fresh ``Nonce``
- (e.g., when the strategy needs to re-express the Interest)
- (`Issue #1596 <http://redmine.named-data.net/issues/1596>`_)
-
- + Fix in the incoming Data pipeline to avoid sending packets to the incoming Face
- (`Issue #1556 <http://redmine.named-data.net/issues/1556>`_)
-
- + New ``RttEstimator`` class that implements the Mean-Deviation RTT estimator to be used
- in forwarding strategies
-
- + Fix memory leak caused by not removing PIT entry when Interest matches CS
- (`Issue #1882 <http://redmine.named-data.net/issues/1882>`_)
-
- + Fix spurious assertion in NCC strategy
- (`Issue #1853 <http://redmine.named-data.net/issues/1853>`_)
-
-- **Tables**
-
- + Fix in ContentStore to properly adjust internal structure when ``Cs::setLimit`` is called
- (`Issue #1646 <http://redmine.named-data.net/issues/1646>`_)
-
- + New option in configuration file to set an upper bound on ContentStore size
- (`Issue #1623 <http://redmine.named-data.net/issues/1623>`_)
-
- + Fix to prevent infinite lifetime of Measurement entries
- (`Issue #1665 <http://redmine.named-data.net/issues/1665>`_)
-
- + Introducing capacity limit in PIT NonceList
- (`Issue #1770 <http://redmine.named-data.net/issues/1770>`_)
-
- + Fix memory leak in NameTree
- (`Issue #1803 <http://redmine.named-data.net/issues/1803>`_)
-
- + Fix segfault during Fib::removeNextHopFromAllEntries
- (`Issue #1816 <http://redmine.named-data.net/issues/1816>`_)
-
-- **Management**
-
- + RibManager now fully support ``CHILD_INHERIT`` and ``CAPTURE`` flags
- (`Issue #1325 <http://redmine.named-data.net/issues/1325>`_)
-
- + Fix in ``FaceManager`` to respond with canonical form of Face URI for Face creation
- command (`Issue #1619 <http://redmine.named-data.net/issues/1619>`_)
-
- + Fix to prevent creation of duplicate TCP/UDP Faces due to async calls
- (`Issue #1680 <http://redmine.named-data.net/issues/1680>`_)
-
- + Fix to properly handle optional ExpirationPeriod in RibRegister command
- (`Issue #1772 <http://redmine.named-data.net/issues/1772>`_)
-
- + Added functionality of publishing RIB status (RIB dataset) by RibManager
- (`Issue #1662 <http://redmine.named-data.net/issues/1662>`_)
-
- + Fix issue of not properly canceling route expiration during processing of
- ``unregister`` command
- (`Issue #1902 <http://redmine.named-data.net/issues/1902>`_)
-
- + Enable periodic clean up of route entries that refer to non-existing faces
- (`Issue #1875 <http://redmine.named-data.net/issues/1875>`_)
-
-- **Tools**
-
- + Extended functionality of ``nfd-status``
-
- * ``-x`` to output in XML format, see :ref:`nfd-status xml schema`
- * ``-c`` to retrieve channel status information (enabled by default)
- * ``-s`` to retrieve configured strategy choice for NDN namespaces (enabled by default)
- * Face status now includes reporting of Face flags (``local`` and ``on-demand``)
- * On-demand UDP Faces now report remaining lifetime (``expirationPeriod``)
- * ``-r`` to retrieve RIB information
-
- + Improved ``nfd-status-http-server``
-
- * HTTP server now presents status as XSL-formatted XML page
- * XML dataset and formatted page now include certificate name of the corresponding NFD
- (`Issue #1807 <http://redmine.named-data.net/issues/1807>`_)
-
- + Several fixes in ``ndn-autoconfig`` tool
- (`Issue #1595 <http://redmine.named-data.net/issues/1595>`_)
-
- + Extended options in ``nfdc``:
-
- * ``-e`` to set expiration time for registered routes
- * ``-o`` to specify origin for registration and unregistration commands
-
- + Enable ``all-faces-prefix'' option in ``nfd-autoreg`` to register prefix for all face
- (on-demand and non-on-demand)
- (`Issue #1861 <http://redmine.named-data.net/issues/1861>`_)
-
- + Enable processing auto-registration in ``nfd-autoreg`` for faces that existed
- prior to start of the tool
- (`Issue #1863 <http://redmine.named-data.net/issues/1863>`_)
-
-- **Build**
-
- + Enable support of precompiled headers for clang and gcc to speed up compilation
-
-- `Other small fixes and extensions
- <https://github.com/named-data/NFD/compare/NFD-0.1.0...master>`_
-
-NFD version 0.1.0
------------------
-
-Release date: May 7, 2014
-
-This is an incomplete list of features that are implemented in NFD version 0.1.0.
-
-- **Packet Format**
-
- + `NDN-TLV <http://named-data.net/doc/ndn-tlv/>`_
- + LocalControlHeader, to allow apps to set outgoing face and learn incoming face.
-
-- **Faces**
-
- + Unix stream socket
- + UDP unicast
- + UDP multicast
- + TCP
- + Ethernet, currently without fragmentation.
-
- .. note::
- Ethernet support will not work properly on Linux kernels with TPACKET_V3 flexible
- buffer implementation (>= 3.2.0) and libpcap >= 1.5.0 (e.g., Ubuntu Linux 14.04).
- Refer to `Issue 1551 <http://redmine.named-data.net/issues/1511>`_ for more
- detail and implementation progress.
-
-- **Management**
-
- + Use of signed Interests as commands, with authentication and authorization.
- + Face management
- + FIB management
- + Per-namespace strategy selection
- + NFD status publishing
- + Notification to authorized apps of internal events, including Face creation and destruction.
-
-- **Tables and forwarding pipelines** support most Interest/Data processing, including
- selectors.
-
-- **RIB Management** that runs as a separate process, ``nrd``. It supports basic prefix
- registration by applications, but no flags yet.
-
-- **Strategies**
-
- + ``broadcast``
- + ``best-route``
- + ``ncc``: based on ccnx 0.7 for experimentation
- + ``client-control``: authorized application can directly control Interest forwarding
-
-- **Name-based scoping**
-
- + ``/localhost``: communication only within localhost using "local" Faces
- (UnixStreamFace, LocalTcpFace). NFD will strictly enforce this scope for Interests
- and Data packets
- + ``/localhop``: one-hop communication (e.g., if at least one incoming or outgoing Face
- in PIT entry is non-local, the Interest cannot be forwarded to any non-local Face)
-
-- **Support configuration file**, which is in the Boost INFO format.
-
-- **Applications**
-
- + Tools to discover hubs on NDN testbed.
- + peek/poke and traffic generators for testing and debugging.
- + ``nfdc``, a command-line tool to configure NFD.
- + ``nfd-status``, a command-line tool to query NFD status.
- + ``nfd-status-http-server``, which reads the NFD status and publishes over HTTP.
-
-
-Planned Functions and Features for Next Releases
-------------------------------------------------
-
-- NACK
- A packet sent back by a producer or a router to signal the unavailability of a requested
- Data packet. The protocol specification for NACK is in progress.
-
-- New strategies
- Additional strategies, including self-learning that populates the FIB by observing
- Interest and Data exchange.
-
-- Hop-by-hop Interest limit mechanism
- For congestion control
-
-- Face enhancements
- Add fragmentation support for Ethernet face, may add support for new types such as
- WiFi direct and WebSockets.
-
-- Tables
- Experiment and evaluate different data structures and algorithms.
-
-- RIB management
- Move to more scalable data structures and support all flags in prefix registrations.
-
-- Tunnel management
- For hub nodes to authenticate incoming tunnel requests and maintain the tunnels.
-
-- Extensible name-based scoping
- Configurable organization-based scoping
diff --git a/NFD/docs/_static/.gitignore b/NFD/docs/_static/.gitignore
deleted file mode 100644
index e69de29..0000000
--- a/NFD/docs/_static/.gitignore
+++ /dev/null
diff --git a/NFD/docs/_static/nfd-status.xsd b/NFD/docs/_static/nfd-status.xsd
deleted file mode 100644
index a34b2f2..0000000
--- a/NFD/docs/_static/nfd-status.xsd
+++ /dev/null
@@ -1,171 +0,0 @@
-<?xml version="1.0"?>
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
-targetNamespace="ndn:/localhost/nfd/status/1" xmlns:nfd="ndn:/localhost/nfd/status/1"
-elementFormDefault="qualified">
-
-<xs:complexType name="unidirectionalPacketCountersType">
- <xs:sequence>
- <xs:element type="xs:nonNegativeInteger" name="nInterests"/>
- <xs:element type="xs:nonNegativeInteger" name="nDatas"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="bidirectionalPacketCountersType">
- <xs:sequence>
- <xs:element type="nfd:unidirectionalPacketCountersType" name="incomingPackets"/>
- <xs:element type="nfd:unidirectionalPacketCountersType" name="outgoingPackets"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="bidirectionalByteCountersType">
- <xs:sequence>
- <xs:element type="xs:nonNegativeInteger" name="incomingBytes"/>
- <xs:element type="xs:nonNegativeInteger" name="outgoingBytes"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="generalStatusType">
- <xs:sequence>
- <xs:element type="xs:anyURI" name="nfdId"/>
- <xs:element type="xs:string" name="version"/>
- <xs:element type="xs:dateTime" name="startTime"/>
- <xs:element type="xs:dateTime" name="currentTime"/>
- <xs:element type="xs:duration" name="uptime"/>
- <xs:element type="xs:nonNegativeInteger" name="nNameTreeEntries"/>
- <xs:element type="xs:nonNegativeInteger" name="nFibEntries"/>
- <xs:element type="xs:nonNegativeInteger" name="nPitEntries"/>
- <xs:element type="xs:nonNegativeInteger" name="nMeasurementsEntries"/>
- <xs:element type="xs:nonNegativeInteger" name="nCsEntries"/>
- <xs:element type="nfd:bidirectionalPacketCountersType" name="packetCounters"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="channelType">
- <xs:sequence>
- <xs:element type="xs:anyURI" name="localUri"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="channelsType">
- <xs:sequence>
- <xs:element type="nfd:channelType" name="channel" maxOccurs="unbounded" minOccurs="0"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="faceType">
- <xs:sequence>
- <xs:element type="xs:nonNegativeInteger" name="faceId"/>
- <xs:element type="xs:anyURI" name="remoteUri"/>
- <xs:element type="xs:anyURI" name="localUri"/>
- <xs:element type="xs:duration" name="expirationPeriod" minOccurs="0"/>
- <xs:element type="xs:string" name="faceScope"/>
- <xs:element type="xs:string" name="facePersistency"/>
- <xs:element type="xs:string" name="linkType"/>
- <xs:element type="nfd:bidirectionalPacketCountersType" name="packetCounters"/>
- <xs:element type="nfd:bidirectionalByteCountersType" name="byteCounters"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="facesType">
- <xs:sequence>
- <xs:element type="nfd:faceType" name="face" maxOccurs="unbounded" minOccurs="0"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="nextHopType">
- <xs:sequence>
- <xs:element type="xs:nonNegativeInteger" name="faceId"/>
- <xs:element type="xs:nonNegativeInteger" name="cost"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="fibEntryType">
- <xs:sequence>
- <xs:element type="xs:anyURI" name="prefix"/>
- <xs:element name="nextHops">
- <xs:complexType>
- <xs:sequence>
- <xs:element type="nfd:nextHopType" name="nextHop" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="fibType">
- <xs:sequence>
- <xs:element type="nfd:fibEntryType" name="fibEntry" maxOccurs="unbounded" minOccurs="0"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="ribFlagsType">
- <xs:sequence>
- <xs:element type="xs:string" name="childInherit" minOccurs="0"/>
- <xs:element type="xs:string" name="ribCapture" minOccurs="0"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="routeType">
- <xs:sequence>
- <xs:element type="xs:nonNegativeInteger" name="faceId"/>
- <xs:element type="xs:nonNegativeInteger" name="origin"/>
- <xs:element type="xs:nonNegativeInteger" name="cost"/>
- <xs:element type="nfd:ribFlagsType" name="flags"/>
- <xs:element type="xs:duration" name="expirationPeriod" minOccurs="0"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="ribEntryType">
- <xs:sequence>
- <xs:element type="xs:anyURI" name="prefix"/>
- <xs:element name="routes">
- <xs:complexType>
- <xs:sequence>
- <xs:element type="nfd:routeType" name="route" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="ribType">
- <xs:sequence>
- <xs:element type="nfd:ribEntryType" name="ribEntry" maxOccurs="unbounded" minOccurs="0"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="strategyType">
- <xs:sequence>
- <xs:element type="xs:anyURI" name="name"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="strategyChoiceType">
- <xs:sequence>
- <xs:element type="xs:anyURI" name="namespace"/>
- <xs:element type="nfd:strategyType" name="strategy"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:complexType name="strategyChoicesType">
- <xs:sequence>
- <xs:element type="nfd:strategyChoiceType" name="strategyChoice"
- maxOccurs="unbounded" minOccurs="0"/>
- </xs:sequence>
-</xs:complexType>
-
-<xs:element name="nfdStatus">
- <xs:complexType>
- <xs:sequence>
- <xs:element type="nfd:generalStatusType" name="generalStatus"/>
- <xs:element type="nfd:channelsType" name="channels"/>
- <xs:element type="nfd:facesType" name="faces"/>
- <xs:element type="nfd:fibType" name="fib"/>
- <xs:element type="nfd:ribType" name="rib"/>
- <xs:element type="nfd:strategyChoicesType" name="strategyChoices"/>
- </xs:sequence>
- </xs:complexType>
-</xs:element>
-
-</xs:schema>
diff --git a/NFD/docs/conf.py b/NFD/docs/conf.py
deleted file mode 100644
index c261a1d..0000000
--- a/NFD/docs/conf.py
+++ /dev/null
@@ -1,268 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# NFD - Named Data Networking Forwarding Daemon documentation build configuration file, created by
-# sphinx-quickstart on Sun Apr 6 19:58:22 2014.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys
-import os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
-
-# -- General configuration ------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
- 'sphinx.ext.todo',
-]
-
-def addExtensionIfExists(extension):
- try:
- __import__(extension)
- extensions.append(extension)
- except ImportError:
- sys.stderr.write("Extension '%s' in not available. "
- "Some documentation may not build correctly.\n" % extension)
- sys.stderr.write("To install, use \n"
- " sudo pip install %s\n" % extension.replace('.', '-'))
-
-addExtensionIfExists('sphinxcontrib.doxylink')
-
-if os.getenv('GOOGLE_ANALYTICS', None):
- addExtensionIfExists('sphinxcontrib.googleanalytics')
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'NFD - Named Data Networking Forwarding Daemon'
-copyright = u'2014, Named Data Networking Project'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = []
-
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
-
-
-# -- Options for HTML output ----------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-# html_theme = 'default'
-html_theme = 'named_data_theme'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = ['./']
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# Add any extra paths that contain custom files (such as robots.txt or
-# .htaccess) here, relative to this directory. These files are copied
-# directly to the root of the documentation.
-#html_extra_path = []
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-html_file_suffix = ".html"
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'nfd-docs'
-
-
-# -- Options for LaTeX output ---------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-# author, documentclass [howto, manual, or own class]).
-latex_documents = [
- ('index', 'nfd-docs.tex', u'NFD - Named Data Networking Forwarding Daemon Documentation',
- u'Named Data Networking Project', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output ---------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- ('manpages/nfd', 'nfd', u'Named Data Networking Forwarding Daemon', None, 1),
- ('manpages/nrd', 'nrd', u'NFD RIB Daemon', None, 1),
- ('manpages/ndn-autoconfig-server', 'ndn-autoconfig-server',
- u'NFD Auto-configuration Server', None, 1),
- ('manpages/ndn-autoconfig', 'ndn-autoconfig',
- u'NFD Auto-configuration Client', None, 1),
- ('manpages/nfdc', 'nfdc',
- u'NFD utility to manipulate the forwarding table (FIB)', None, 1),
- ('manpages/ndn-tlv-peek', 'ndn-tlv-peek', u'NFD consumer', None, 1),
- ('manpages/ndn-tlv-poke', 'ndn-tlv-poke', u'NFD producer', None, 1),
- ('manpages/nfd-autoreg', 'nfd-autoreg', u'NFD Auto-registration Server', None, 1),
- ('manpages/nfd-status-http-server', 'nfd-status-http-server',
- u'NFD status HTTP server', None, 1),
- ('manpages/nfd-status', 'nfd-status', u'Command-line utility to show NFD status', None, 1),
-]
-
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-doxylink = {
- 'NFD' : ('NFD.tag', 'doxygen/'),
-}
-
-if os.getenv('GOOGLE_ANALYTICS', None):
- googleanalytics_id = os.environ['GOOGLE_ANALYTICS']
- googleanalytics_enabled = True
diff --git a/NFD/docs/doxygen.conf.in b/NFD/docs/doxygen.conf.in
deleted file mode 100644
index cc58aa6..0000000
--- a/NFD/docs/doxygen.conf.in
+++ /dev/null
@@ -1,2286 +0,0 @@
-# Doxyfile 1.8.5
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME = "NFD - Named Data Networking Forwarding Daemon"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER = @VERSION@
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF =
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
-# the documentation. The maximum height of the logo should not exceed 55 pixels
-# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
-# to the output directory.
-
-PROJECT_LOGO =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = docs/doxygen
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
-
-CREATE_SUBDIRS = YES
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-
-# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi,
-# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en,
-# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish,
-# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,
-# Turkish, Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB = YES
-
-# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES = NO
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF = YES
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
-# new page for each member. If set to NO, the documentation of a member will be
-# part of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE = 4
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:\n"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
-
-ALIASES =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding "class=itcl::class"
-# will allow you to use the command class in the itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C.
-#
-# Note For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT = YES
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by by putting a % sign in front of the word
-# or globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT = YES
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO these classes will be included in the various overviews. This option has
-# no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO these declarations will be
-# included in the documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-# The default value is: system dependent.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES = YES
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
-# todo list. This list is created by putting \todo commands in the
-# documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
-# test list. This list is created by putting \test commands in the
-# documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES the list
-# will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. Do not use file names with spaces, bibtex cannot handle them. See
-# also \cite for info how to create references.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET = YES
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO doxygen will only warn about wrong or incomplete parameter
-# documentation, but not about the absence of documentation.
-# The default value is: NO.
-
-WARN_NO_PARAMDOC = YES
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr).
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces.
-# Note: If this tag is empty the current directory is searched.
-
-INPUT = core/ daemon/
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
-# possible encodings.
-# The default value is: UTF-8.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank the
-# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
-# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
-# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
-# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
-# *.qsf, *.as and *.js.
-
-FILE_PATTERNS =
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER ) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
-ALPHABETICAL_INDEX = YES
-
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_OUTPUT = ./
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER = ../docs/named_data_theme/named_data_header.html
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER = @HTML_FOOTER@
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-# HTML_STYLESHEET = ../docs/named_data_theme/static/named_data_doxygen.css
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
-# defined cascading style sheet that is included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefor more robust against future updates.
-# Doxygen will copy the style sheet file to the output directory. For an example
-# see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES = ../docs/named_data_theme/static/doxygen.css \
- ../docs/named_data_theme/static/base.css \
- ../docs/named_data_theme/static/foundation.css \
- ../docs/named_data_theme/static/bar-top.png
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the stylesheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_HUE = 0
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_SAT = 0
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_GAMMA = 91
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler ( hhc.exe). If non-empty
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated (
-# YES) or that it should be included in the master .chm file ( NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated (
-# YES) or a normal table of contents ( NO) in the .chm file.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
-# folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS =
-
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW = YES
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using prerendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX = NO
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
-# are two flavours of web server based searching depending on the
-# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
-# searching and an index file used by the script. When EXTERNAL_SEARCH is
-# enabled the indexing and searching needs to be provided by external tools. See
-# the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SERVER_BASED_SEARCH = NO
-
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
-# Searching" for details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
-# The default value is: YES.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PAPER_TYPE = a4
-
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. To get the times font for
-# instance you can specify
-# EXTRA_PACKAGES=times
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
-#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
-# replace them by respectively the title of the page, the current date and time,
-# only the current date, the version number of doxygen, the project name (see
-# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PDF_HYPERLINKS = YES
-
-# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES to get a
-# higher quality PDF documentation.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BATCHMODE = NO
-
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HIDE_INDICES = NO
-
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_SOURCE_CODE = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE = plain
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
-# validating XML parser to check the syntax of the XML files.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
-# validating XML parser to check the syntax of the XML files.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT = docbook
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
-# Definitions (see http://autogen.sf.net) file that captures the structure of
-# the code including all documentation. Note that this feature is still
-# experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
-# in the source code. If set to NO only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES the includes files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-PREDEFINED = NFD_LOG_INIT(x)= \
- NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(x,y)= \
- NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(x,y,z)= \
- BOOST_STATIC_ASSERT(x)=
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all refrences to function-like macros that are alone on a line, have an
-# all uppercase name, and do not end with a semicolon. Such function macros are
-# typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have an unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE = NFD.tag
-
-# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
-# class index. If set to NO only the inherited external classes will be listed.
-# The default value is: NO.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
-# the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
-
-EXTERNAL_GROUPS = YES
-
-# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: NO.
-
-HAVE_DOT = YES
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NUM_THREADS = 0
-
-# When you want a differently looking font n the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTNAME = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LOOK = YES
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LIMIT_NUM_FIELDS = 10
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-TEMPLATE_RELATIONS = YES
-
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDE_GRAPH = YES
-
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot.
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, jpg, gif and svg.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_IMAGE_FORMAT = svg
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT = YES
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
-# files that are used to generate the various graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_CLEANUP = YES
diff --git a/NFD/docs/index.rst b/NFD/docs/index.rst
deleted file mode 100644
index 74f568d..0000000
--- a/NFD/docs/index.rst
+++ /dev/null
@@ -1,60 +0,0 @@
-NFD - Named Data Networking Forwarding Daemon
-=============================================
-
-NFD is a network forwarder that implements and evolves together with the Named Data
-Networking (NDN) `protocol <http://named-data.net/doc/ndn-tlv/>`__. After the initial
-release, NFD will become a core component of the `NDN Platform
-<http://named-data.net/codebase/platform/>`__ and will follow the same release cycle.
-
-NFD Documentation
------------------
-
-.. toctree::
- :hidden:
- :maxdepth: 3
-
- overview
- INSTALL
- FAQ
- manpages
-
-* :doc:`overview`
-
- A brief overview of NFD and its major modules.
-
-* :doc:`INSTALL`
-
- Instructions for obtaining, installing, and running NFD.
-
-* :doc:`FAQ`
-
- Suggestions for configuring and running non-standard NFD setups.
-
-* :doc:`manpages`
-
-**Additional documentation**
-
-* `NFD Developer's Guide <http://named-data.net/wp-content/uploads/2014/07/NFD-developer-guide.pdf>`_
-
- A comprehensive guide to the design and implementation of NFD. The developer's guide also contains
- suggestions and hints for anyone wanting to modify or extend NFD.
-
-* `NFD Wiki <http://redmine.named-data.net/projects/nfd/wiki>`_
-
- + `NFD Management protocol <http://redmine.named-data.net/projects/nfd/wiki/Management>`_
- + `NFD Configuration file format <http://redmine.named-data.net/projects/nfd/wiki/ConfigFileFormat>`_
-
- The NFD Wiki contains detailed protocol specifications and
- information for building on unsupported platforms.
-
-* `API Documentation (doxygen) <doxygen/annotated.html>`_
-
-* `Release Notes <RELEASE_NOTES.html>`_
-
-License
--------
-
-NFD is an open and free software package licensed under GPL 3.0 license and is the
-centerpiece of our committement to making NDN's core technology open and free to all
-Internet users and developers. For more information about the licensing details and
-limitation, refer to `COPYING.md <https://github.com/named-data/NFD/blob/master/COPYING.md>`_.
diff --git a/NFD/docs/manpages.rst b/NFD/docs/manpages.rst
deleted file mode 100644
index 6a52897..0000000
--- a/NFD/docs/manpages.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-.. _Manpages:
-
-Manpages
-========
-
-.. toctree::
- manpages/nfd
- manpages/nrd
- manpages/nfdc
- manpages/nfd-status
- schema
- manpages/nfd-status-http-server
- manpages/ndn-autoconfig
- manpages/ndn-autoconfig-server
- manpages/nfd-autoreg
- manpages/ndn-tlv-peek
- manpages/ndn-tlv-poke
- :maxdepth: 1
diff --git a/NFD/docs/manpages/ndn-autoconfig-server.rst b/NFD/docs/manpages/ndn-autoconfig-server.rst
deleted file mode 100644
index c38b6c1..0000000
--- a/NFD/docs/manpages/ndn-autoconfig-server.rst
+++ /dev/null
@@ -1,50 +0,0 @@
-.. _ndn-autoconfig-server:
-
-ndn-autoconfig-server
-=====================
-
-Usage
------
-
-::
-
- ndn-autoconfig-server [-h] [-p prefix] [-p prefix] ... FaceUri
-
-
-Description
------------
-
-``ndn-autoconfig-server`` is a daemon that implements server part for the stage 1 of
-:ref:`NDN hub discovery procedure`.
-
-This daemon essentially waits for Interests for ``/localhop/ndn-autoconf/hub`` and
-satisfies them with a Data packet that contains TLV-encoded FaceUri block. The value of
-this block is the ``Uri`` for the HUB, preferrably a UDP tunnel.
-
-``-h``
- print usage and exit.
-
-``FaceUri``
- FaceUri for this NDN hub.
-
-``-p prefix``
- A local prefix for which the local hub allow end applications to register prefix
- (See more details in :ref:`local-prefix-discovery`). One can supply more than one
- prefixes. All supplied prefixes will be put into the local prefix discovery data
- as described in :ref:`local-prefix-discovery`. If no prefix is specified,
- auto-config-server will not serve any local prefix discovery data.
-
-Examples
---------
-
-::
-
- ndn-autoconfig-server tcp://spurs.cs.ucla.edu
-
- ndn-autoconfig-server -p /ndn/edu/ucla tcp://spurs.cs.ucla.edu
-
-
-See also
---------
-
-:ref:`ndn-autoconfig`
diff --git a/NFD/docs/manpages/ndn-autoconfig.rst b/NFD/docs/manpages/ndn-autoconfig.rst
deleted file mode 100644
index 8e56435..0000000
--- a/NFD/docs/manpages/ndn-autoconfig.rst
+++ /dev/null
@@ -1,129 +0,0 @@
-.. _ndn-autoconfig:
-
-ndn-autoconfig
-==============
-
-Usage
------
-
-::
-
- ndn-autoconfig
-
-Description
------------
-
-Client tool to run :ref:`NDN hub discovery procedure`.
-
-.. _NDN hub discovery procedure:
-
-NDN hub discovery procedure
----------------------------
-
-When an end host starts up, or detects a change in its network environment, it MAY use
-this procedure to discover a local or home NDN router, in order to gain connectivity to
-`the NDN research testbed <http://named-data.net/ndn-testbed/>`_.
-
-Overview
-^^^^^^^^
-
-This procedure contains three methods to discover a NDN router:
-
-1. Look for a local NDN router by multicast.
- This is useful in a home or small office network.
-
-2. Look for a local NDN router by DNS query with default suffix.
- This allows network administrator to configure a NDN router in a large enterprise network.
-
-3. Connect to the home NDN router according to user certificate.
- This ensures connectivity from anywhere.
-
-Stage 1: multicast discovery
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Request
-+++++++
-
-The end host sends an Interest over a multicast face.
-
-Interest Name is ``/localhop/ndn-autoconf/hub``.
-
-Response
-++++++++
-
-A producer app on the HUB answer this Interest with a Data packet that contains a
-TLV-encoded `Uri` block. The value of this block is the URI for the HUB, preferrably a
-UDP tunnel.
-
-Stage 2: DNS query with default suffix
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Request
-+++++++
-
-The end host sends a DNS query that is equivalent to this command::
-
- dig +search +short +cmd +tries=2 +ndots=10 _ndn._udp srv
-
-Response
-++++++++
-
-The DNS server should answer with an SRV record that contains the hostname and UDP port
-number of the NDN router.
-
-Stage 3: find home router
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-This stage assumes that user has configured default certificate using
-`<http://ndncert.named-data.net/>`_ as described in `Certification Architecture
-<http://redmine.named-data.net/attachments/download/23/CertificationArchitecture.pptx>`_.
-
-Request
-+++++++
-
-The end host loads the default user identity (eg. ``/ndn/edu/ucla/cs/afanasev``), and
-converts it to DNS format.
-
-The end host sends a DNS query for an SRV record of name ``_ndn._udp.`` + user identity in
-DNS format + ``_homehub._autoconf.named-data.net``. For example::
-
- _ndn._udp.afanasev.cs.ucla.edu.ndn._homehub._autoconf.named-data.net
-
-Response
-++++++++
-
-The DNS server should answer with an SRV record that contains the hostname and UDP port
-number of the home NDN router of this user's site.
-
-Client procedure
-----------------
-
-Stage 1
-^^^^^^^
-
-Send a multicast discovery Interest.
-
-If this Interest is answered, connect to the HUB and terminate auto-discovery.
-
-Stage 2
-^^^^^^^
-
-Send a DNS query with default suffix.
-
-If this query is answered, connect to the HUB and terminate auto-discovery.
-
-Stage 3
-^^^^^^^
-
-* Load default user identity, and convert it to DNS format; if either fails, the
- auto-discovery fails.
-
-* Send a DNS query to find home HUB.
- If this query is answered, connect to the home HUB and terminate auto-discovery.
- Otherwise, the auto-discovery fails.
-
-
-See also
---------
-
-:ref:`ndn-autoconfig-server`
diff --git a/NFD/docs/manpages/ndn-tlv-peek.rst b/NFD/docs/manpages/ndn-tlv-peek.rst
deleted file mode 100644
index 9b2a7e4..0000000
--- a/NFD/docs/manpages/ndn-tlv-peek.rst
+++ /dev/null
@@ -1,56 +0,0 @@
-ndn-tlv-peek
-============
-
-Usage
------
-
-::
-
- ndn-tlv-peek [-h] [-f] [-r] [-m min] [-M max] [-l lifetime] [-p] [-w timeout] name
-
-Description
------------
-
-``ndn-tlv-peek`` is a simple consumer program that sends one Interest and expects one Data
-packet in response. The full Data packet (in TLV format) is written to stdout. The
-program terminates with return code 0 if Data arrives, and with return code 1 when timeout
-occurs.
-
-``name`` is interpreted as the Interest name.
-
-Options
--------
-
-``-h``
- Print help and exit
-
-``-f``
- If specified, set ``MustBeFresh`` selector in the Interest packet.
-
-``-r``
- Set ``ChildSelector=1`` (the rightmost child) selector.
-
-``-m``
- Set ``min`` as the ``MinSuffixComponents`` selector.
-
-``-M``
- Set ``max`` as the ``MaxSuffixComponents`` selector.
-
-``-l``
- Set ``lifetime`` (in milliseconds) as the ``InterestLifetime``.
-
-``-p``
- If specified, print the received payload only, not the full packet.
-
-``-w``
- Timeout after ``timeout`` milliseconds.
-
-
-Examples
---------
-
-Send Interest for ``ndn:/app1/video`` and print the received payload only
-
-::
-
- ndn-tlv-peek -p ndn:/app1/video
diff --git a/NFD/docs/manpages/ndn-tlv-poke.rst b/NFD/docs/manpages/ndn-tlv-poke.rst
deleted file mode 100644
index 73acb82..0000000
--- a/NFD/docs/manpages/ndn-tlv-poke.rst
+++ /dev/null
@@ -1,54 +0,0 @@
-ndn-tlv-poke
-============
-
-Usage
------
-
-::
-
- ndn-tlv-poke [-h] [-f] [-D] [-i identity] [-F] [-x freshness] [-w timeout] name
-
-Description
------------
-
-``ndn-tlv-poke`` is a simple producer program that reads payload from stdin and publishes it
-as a single NDN Data packet. The Data packet is published either as a response to the
-incoming Interest for the given ``name``, or forcefully pushed to the local NDN
-forwarder's cache if ``-f`` flag is specified.
-
-The program terminates with return code 0 if Data is sent and with return code 1 when
-timeout occurs.
-
-Options
--------
-
-``-h``
- Print usage and exit.
-
-``-f``
- If specified, send Data without waiting for Interest.
-
-``-D``
- If specified, use ``DigestSha256`` signature instead of default ``SignatureSha256WithRsa``.
-
-``-i``
- Use ``identity`` to sign the created Data packet.
-
-``-F``
- Set ``FinalBlockId`` to the last component of specified name.
-
-``-x``
- Set ``FreshnessPeriod`` in milliseconds.
-
-``-w``
- Wait at most ``timeout`` milliseconds for the incoming Interest. If no Interest arrives
- within the ``timeout``, the Data packet will not be published.
-
-
-Examples
---------
-
-Create Data packet with content ``hello`` with the name ``ndn:/app/video`` and wait at
-most 3 seconds for the incoming Interest for it::
-
- echo "Hello" | build/bin/ndn-tlv-poke -w 3000 ndn:/app/video
diff --git a/NFD/docs/manpages/nfd-autoreg.rst b/NFD/docs/manpages/nfd-autoreg.rst
deleted file mode 100644
index 168528d..0000000
--- a/NFD/docs/manpages/nfd-autoreg.rst
+++ /dev/null
@@ -1,57 +0,0 @@
-ndn-autoreg
-===========
-
-Usage
------
-
-::
-
- nfd-autoreg --prefix=</autoreg/prefix> [--prefix=</another/prefix>] ...
-
-Description
------------
-
-``autoreg-server`` is a deamon application that automatically registers the specified
-prefix(es) when new on-demand Face is created (i.e., when a new UDP face is created
-as a result of an incoming packet or TCP face is created as a result of an incoming
-connection).
-
-Options
--------
-
-``-h`` or ``--help``
- Produce help message.
-
-``-i`` or ``--prefix``
- Prefix that should be automatically registered when a new remote face is created.
- Can be repeated multiple to specify additional prefixes.
-
-``-c`` or ``--cost``
- RIB cost to be assigned to auto-registered prefixes. if not specified, default cost
- is set to 255.
-
-``-w`` or ``--whitelist``
- Whitelisted network, e.g., 192.168.2.0/24 or ::1/128. Can be repeated multiple times
- to specify multiple whitelisted networks.
-
- Prefix(es) will be auto-registered only when remote IP address is within the specified
- range(s), except blacklist ranges.
-
- Default: 0.0.0.0/0 and ::/0
-
-``-b`` or ``--blacklist``
- Blacklisted network, e.g., 192.168.2.32/30 or ::1/128. Can be repeated multiple times
- to specify multiple blacklisted networks.
-
- Prefix(es) will be auto-registered only when remote IP address in **NOT** within the
- specified range(s), but is within the range define by the whitelist(s).
-
- Default: none
-
-Examples
---------
-
-Auto-register two prefixes for any newly created on-demand Face, except those that has
-source IP address in ``10.0.0.0/8`` network::
-
- nfd-autoreg --prefix=/app1/video --prefix=/app2/pictures -b 10.0.0.0/8
diff --git a/NFD/docs/manpages/nfd-status-http-server.rst b/NFD/docs/manpages/nfd-status-http-server.rst
deleted file mode 100644
index a6aa0eb..0000000
--- a/NFD/docs/manpages/nfd-status-http-server.rst
+++ /dev/null
@@ -1,43 +0,0 @@
-nfd-status-http-server
-======================
-
-Usage
------
-
-::
-
- nfd-status-http-server [-h] [-p port number] [-a IP address] [-r] [-v]
-
-Description
------------
-
-``nfd-status-http-server`` is a daemon that enables retrieval of NFD status via HTTP protocol.
-
-Options
--------
-
-``-h``
- Show this help message and exit.
-
-``-p``
- HTTP server port number (default is 8080).
-
-``-a``
- HTTP server IP address (default is 127.0.0.1).
-
-``-r``
- Enable HTTP robots to crawl (disabled by default).
-
-``-v``
- Verbose mode.
-
-Examples
---------
-
-Enable NFD HTTP status server on all IPv4 interfaces::
-
- nfd-status-http-server -p 80 -a 0.0.0.0
-
-Enable NFD HTTP status server on all IPv6 interfaces::
-
- nfd-status-http-server -p 80 -a ::
diff --git a/NFD/docs/manpages/nfd-status.rst b/NFD/docs/manpages/nfd-status.rst
deleted file mode 100644
index 4fabe2e..0000000
--- a/NFD/docs/manpages/nfd-status.rst
+++ /dev/null
@@ -1,99 +0,0 @@
-nfd-status
-==========
-
-Usage
------
-
-::
-
- nfd-status [options]
-
-Description
------------
-
-``nfd-status`` is a tool to retrieve and print out NFD version and status information.
-
-Options:
---------
-
-``-h``
- Print usage information.
-
-``-v``
- Retrieve version information.
-
-``-c``
- Retrieve channel status information.
-
-``-f``
- Retrieve face status information.
-
-``-b``
- Retrieve FIB information.
-
-``-r``
- Retrieve RIB information.
-
-``-s``
- Retrieve configured strategy choice for NDN namespaces.
-
-``-x``
- Output NFD status information in XML format.
-
-``-V``
- Show version information of nfd-status and exit.
-
-If no options are provided, all information is retrieved.
-
-If -x is provided, other options(-v, -c, etc.) are ignored, and all information is printed in XML format.
-
-Examples
---------
-
-Get all status information from NFD::
-
- $ nfd-status
-
- General NFD status:
- nfdId=/chengyu/KEY/ksk-1405136377018/ID-CERT
- version=2000
- startTime=20140725T232341.374000
- currentTime=20140725T233240
- uptime=538 seconds
- nNameTreeEntries=10
- nFibEntries=3
- nPitEntries=2
- nMeasurementsEntries=0
- nCsEntries=56
- nInInterests=55
- nOutInterests=54
- nInDatas=56
- nOutDatas=47
- Channels:
- ws://[::]:9696
- unix:///private/var/run/nfd.sock
- udp6://[::]:6363
- udp4://0.0.0.0:6363
- tcp6://[::]:6363
- tcp4://0.0.0.0:6363
- Faces:
- faceid=1 remote=internal:// local=internal:// counters={in={0i 52d 0B} out={51i 0d 0B}} local
- faceid=254 remote=contentstore:// local=contentstore:// counters={in={0i 0d 0B} out={0i 0d 0B}} local
- faceid=255 remote=null:// local=null:// counters={in={0i 0d 0B} out={0i 0d 0B}} local
- faceid=256 remote=udp4://224.0.23.170:56363 local=udp4://129.82.138.211:56363 counters={in={0i 0d 0B} out={0i 0d 0B}}
- faceid=257 remote=udp4://224.0.23.170:56363 local=udp4://127.0.0.1:56363 counters={in={0i 0d 0B} out={0i 0d 0B}}
- faceid=258 remote=ether://[01:00:5e:00:17:aa] local=dev://bridge0 counters={in={0i 0d 0B} out={0i 0d 0B}}
- faceid=259 remote=ether://[01:00:5e:00:17:aa] local=dev://en0 counters={in={0i 0d 0B} out={0i 0d 0B}}
- faceid=260 remote=ether://[01:00:5e:00:17:aa] local=dev://en1 counters={in={0i 0d 0B} out={0i 0d 0B}}
- faceid=261 remote=ether://[01:00:5e:00:17:aa] local=dev://en2 counters={in={0i 0d 0B} out={0i 0d 0B}}
- faceid=262 remote=fd://30 local=unix:///private/var/run/nfd.sock counters={in={24i 6d 4880B} out={6i 16d 8417B}} local on-demand
- faceid=268 remote=fd://31 local=unix:///private/var/run/nfd.sock counters={in={1i 0d 410B} out={0i 1d 764B}} local on-demand
- faceid=269 remote=fd://32 local=unix:///private/var/run/nfd.sock counters={in={3i 0d 137B} out={0i 2d 925B}} local on-demand
- FIB:
- /localhost/nfd nexthops={faceid=1 (cost=0)}
- /example/testApp nexthops={faceid=268 (cost=0)}
- /localhost/nfd/rib nexthops={faceid=262 (cost=0)}
- RIB:
- /example/testApp route={faceid=268 (origin=0 cost=0 flags=1)}
- Strategy choices:
- / strategy=/localhost/nfd/strategy/best-route
diff --git a/NFD/docs/manpages/nfd.rst b/NFD/docs/manpages/nfd.rst
deleted file mode 100644
index 0fa0ef8..0000000
--- a/NFD/docs/manpages/nfd.rst
+++ /dev/null
@@ -1,38 +0,0 @@
-nfd
-===
-
-Usage
------
-
-::
-
- nfd [options]
-
-
-Description
------------
-
-NFD forwarding daemon.
-
-
-Options:
---------
-
-``--help``
- Print this help message.
-
-``--modules``
- List available logging modules
-
-``--config <path/to/nfd.conf>``
- Specify the path to nfd configuration file (default: ``${SYSCONFDIR}/ndn/nfd.conf``).
-
-Examples
---------
-
-Start NFD forwarding daemon as super user and use a configuration file from the current
-working directory.
-
-::
-
- sudo nfd --config nfd.conf
diff --git a/NFD/docs/manpages/nfdc.rst b/NFD/docs/manpages/nfdc.rst
deleted file mode 100644
index 67d691c..0000000
--- a/NFD/docs/manpages/nfdc.rst
+++ /dev/null
@@ -1,190 +0,0 @@
-nfdc
-====
-
-Usage
------
-
-::
-
- nfdc [-h] COMMAND [<command options>]
-
-
-Description
------------
-
-``nfdc`` is a tool to manipulate routing information base (RIB), forwarding information
-base (FIB), and StrategyChoices table (i.e., which strategy should be used by which
-namespaces).
-
-Options
--------
-
-``-h``
- Print usage information.
-
-``COMMAND``
-
- ``register``
- Register a new or update existing routing entry in Routing Information Base (RIB).
-
- ``register [-I] [-C] [-c <cost>] [-e expiration time] [-o origin] <prefix> <faceId | faceUri>``
-
- ``-I``
- Unset CHILD_INHERIT flag from the routing entry.
-
- ``-C``
- Set CAPTURE flag in the routing entry.
-
- ``-c <cost>``
- Cost for the RIB entry (default is 0).
-
- ``-e <expiration time>``
- Expiration time of the RIB entry in milliseconds. If not specified, the entry remains in FIB
- for the lifetime of the associated face.
-
- ``-o <origin>``
- Origin of the registration request (default is 255).
- 0 for Local producer applications, 128 for NLSR, 255 for static routes.
-
- ``prefix``
- A prefix of an existing or to be created RIB entry, for which routing entry is
- requested to be added or updated.
-
- ``faceId``
- An existing NFD Face ID number, which can be obtained, for example, using
- ``nfd-status`` command.
-
- ``faceUri``
- URI of the existing or to be created Face.
-
- ``unregister``
- Unregister an existing routing entry from Routing Information Base (RIB).
-
- ``unregister [-o origin] <prefix> <faceId>``
-
- ``-o <origin>``
- Origin of the unregistration request (default is 255).
-
- ``prefix``
- A prefix of an existing RIB entry, from which routing entry is requested to be
- removed.
-
- ``faceId``
- An existing NFD Face ID number, which can be obtained, for example, using
- ``nfd-status`` command.
-
- ``create``
- Create a UDP unicast or TCP Face
-
- ``create <faceUri>``
-
- ``faceUri``
- UDP unicast or TCP Face URI::
-
- UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]
- TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
-
- ``destroy``
- Create an existing UDP unicast or TCP Face.
-
- ``destroy <faceId | faceUri>``
-
- ``faceId``
- An existing NFD Face ID number, which can be obtained, for example, using
- ``nfd-status`` command.
-
- ``faceUri``
- UDP unicast or TCP Face URI::
-
- UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]
- TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
-
- ``set-strategy``
- Select strategy to be used for the specified namespace
-
- ``set-strategy <namespace> <strategy-name>``
-
- ``namespace``
- Namespace that will use the specified strategy.
-
- Note that more specific namespace(s) can use different strategy or strategies.
- For example, if namespace ``/A/B/C`` was using strategy
- ``ndn:/localhost/nfd/strategy/best-route`` before running ``set-strategy`` on
- ``/A`` namespace, it will continue using the same strategy no matter which
- namespace was specified for ``/A``.
-
- ``strategy-name``
- Name of one of the available strategies.
-
- Currently, NFD supports the following strategies::
-
- ndn:/localhost/nfd/strategy/best-route
- ndn:/localhost/nfd/strategy/broadcast
- ndn:/localhost/nfd/strategy/client-control
- ndn:/localhost/nfd/strategy/ncc
-
- ``unset-strategy``
- Unset the strategy for a given ``namespace``.
-
- Effectively, this command select parent's namespace strategy to be used for the
- specified ``namespace``.
-
- ``unset-strategy <namespace>``
-
- ``namespace``
- Namespace from which namespace customization should be removed.
-
- ``add-nexthop``
- Directly add nexthop entry info NFD's Forwarding Information Base (FIB). This command
- is intended only for debugging purposes. Normally, prefix-nexhop association should
- be registered in Routing Information Base using ``register`` command.
-
- ``add-nexthop [-c <cost>] <prefix> <faceId | faceUri>``
-
- ``-c <cost>``
- Cost for the nexthop entry to be inserted (default is 0).
-
- ``prefix``
- A prefix of an existing or to be created FIB entry, to which nexthop
- entry is requested to be added.
-
- ``faceId``
- An existing NFD Face ID number, which can be obtained, for example, using
- ``nfd-status`` command
-
- ``faceUri``
- URI of the existing or to be created Face.
-
- ``remove-nexthop``
- Directly remove nexthop entry from NFD'S FIB. This command
- is intended only for debugging purposes. Normally, prefix-nexhop association should
- be unregistered from Routing Information Base using ``unregister`` command.
-
- ``remove-nexthop <prefix> <faceId>``
-
- ``prefix``
- A prefix of an existing FIB entry, from which nexthop entry is requested to be removed.
-
- ``faceId``
- An existing NFD Face ID number, which can be obtained, for example, using
- ``nfd-status`` command.
-
- Note that when ``faceId`` is the last Face associated with ``prefix`` FIB entry,
- the whole FIB entry will be removed.
-
-
-
-Examples
---------
-
-Add a namespace to a face uri:
-
-::
-
- nfdc register ndn:/app1/video udp://192.168.1.2
-
-Set strategy to a name:
-
-::
-
- nfdc set-strategy ndn:/app1/video ndn:/localhost/nfd/strategy/broadcast
diff --git a/NFD/docs/manpages/nrd.rst b/NFD/docs/manpages/nrd.rst
deleted file mode 100644
index 31fb384..0000000
--- a/NFD/docs/manpages/nrd.rst
+++ /dev/null
@@ -1,34 +0,0 @@
-NRD (NFD RIB Daemon)
-====================
-
-Usage
------
-
-::
-
- nrd [options]
-
-
-Description
------------
-
-NRD is a complementary daemon designed to work in parallel with NFD and to provide
-services for Routing Information Base management and constructing NFD's FIB:
-
-* prefix registration from applications;
-* manual prefix registration;
-* prefix registrations from multiple dynamic routing protocols.
-
-NRD's runtime settings may be modified via `rib_*` sections in NFD's configuration file.
-
-Options:
---------
-
-``--help``
- Print this help message.
-
-``--modules``
- List available logging modules
-
-``--config <path/to/nfd.conf>``
- Specify the path to nfd configuration file (default: ``${SYSCONFDIR}/ndn/nfd.conf``).
diff --git a/NFD/docs/misc/local-prefix-discovery.rst b/NFD/docs/misc/local-prefix-discovery.rst
deleted file mode 100644
index f1bca84..0000000
--- a/NFD/docs/misc/local-prefix-discovery.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-.. _local-prefix-discovery:
-
-Discover local hub prefix
-=========================
-
-Some applications need to discover prefix(es) under which they can publish data
-/ which Interests local hub will be able to forward down to the application.
-In order to discover that, applications need to send an interest for
-``/localhop/ndn-autoconf/routable-prefixes`` prefix. Response data to the
-interest contains a list of prefixes and should be encoded as:
-
-::
-
- Response ::= DATA-TYPE TLV-LENGTH
- Name (= /localhop/ndn-autoconf/routable-prefixes/[version])
- MetaInfo (= ResponseMetaInfo)
- Content (= ResponseContent)
- Signature
-
- ResponseMetaInfo ::= META-INFO-TYPE TLV-LENGTH
- ContentType (= DATA)
- FreshnessPeriod (= 5000)
-
- ResponseContent ::= Name+
-
-.. note::
-ResponseContent should contain at least one Name, which should be routable
-towards the face from which the request has been received. The requester may
-process list of the returned names and pick whichever it wants to use.
-
-For now, the ``/localhop/ndn-autoconf/routable-prefixes`` data is served by
-:ref:`ndn-autoconfig-server`.
diff --git a/NFD/docs/named_data_theme/layout.html b/NFD/docs/named_data_theme/layout.html
deleted file mode 100644
index 16ae50f..0000000
--- a/NFD/docs/named_data_theme/layout.html
+++ /dev/null
@@ -1,85 +0,0 @@
-{#
- named_data_theme/layout.html
- ~~~~~~~~~~~~~~~~~
-#}
-{% extends "basic/layout.html" %}
-
-{% block header %}
- <!--headercontainer-->
- <div id="header_container">
-
- <!--header-->
- <div class="row">
- <div class="three columns">
- <div id="logo">
- <a href="http://named-data.net" title="A Future Internet Architecture"><img src="http://named-data.net/wp-content/uploads/cropped-20130722_Logo2.png" alt="" /></a>
- </div><!--logo end-->
- </div>
-
- <!--top menu-->
- <div class="nine columns" id="menu_container" >
- <h1><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a></h1>
- </div>
- </div>
- </div><!--header container end-->
-
-{% endblock %}
-
-{% block content %}
- <div class="content-wrapper">
- <div class="content">
- <div class="document">
- {%- block document %}
- {{ super() }}
- {%- endblock %}
- </div>
- <div class="sidebar">
- {%- block sidebartoc %}
- <h3>{{ _('Table Of Contents') }}</h3>
- {{ toctree(includehidden=True) }}
-
- <h3>{{ _('Additional documenation') }}</h3>
- <ul>
- <li class="toctree-l1"><a class="reference external" href="http://redmine.named-data.net/projects/nfd/wiki">NFD Wiki</a></li>
- <li class="toctree-l1"><a class="reference internal" href="doxygen/annotated.html">API documentation (doxygen)</a></li>
- </ul>
- {%- endblock %}
- {%- block sidebarsearch %}
- <h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
- <form class="search" action="{{ pathto('search') }}" method="get">
- <input type="text" name="q" />
- <input type="submit" value="{{ _('Go') }}" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- {{ _('Enter search terms or a module, class or function name.') }}
- </p>
- {%- endblock %}
- </div>
- <div class="clearer"></div>
- </div>
- </div>
-{% endblock %}
-
-{% block footer %}
- <div id="footer-container">
- <!--footer container-->
- <div class="row">
- </div><!-- footer container-->
- </div>
-
- <div id="footer-info">
- <!--footer container-->
- <div class="row">
- <div class="twelve columns">
-
- <div id="copyright">This research is partially supported by NSF (Award <a href="http://www.nsf.gov/awardsearch/showAward?AWD_ID=1040868" target="_blank>">CNS-1040868</a>)<br/><br/><a rel="license" href="http://creativecommons.org/licenses/by/3.0/deed.en_US" target="_blank">Creative Commons Attribution 3.0 Unported License</a> except where noted.</div>
-
- </div>
- </div>
- </div><!--footer info end-->
-{% endblock %}
-
-{% block relbar1 %}{% endblock %}
-{% block relbar2 %}{% endblock %}
diff --git a/NFD/docs/named_data_theme/named_data_footer-with-analytics.html.in b/NFD/docs/named_data_theme/named_data_footer-with-analytics.html.in
deleted file mode 100644
index 68a4a9d..0000000
--- a/NFD/docs/named_data_theme/named_data_footer-with-analytics.html.in
+++ /dev/null
@@ -1,32 +0,0 @@
-<!-- start footer part -->
-<!--BEGIN GENERATE_TREEVIEW-->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- $navpath
- <li class="footer">$generatedby
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
- </ul>
-</div>
-<!--END GENERATE_TREEVIEW-->
-<!--BEGIN !GENERATE_TREEVIEW-->
-<hr class="footer"/>
-<address class="footer"><small>
-$generatedby  <a href="http://www.doxygen.org/index.html">
-<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/>
-</a> $doxygenversion
-</small></address>
-<!--END !GENERATE_TREEVIEW-->
-
-<script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
- ga('create', '@GOOGLE_ANALYTICS@', 'auto');
- ga('send', 'pageview');
-</script>
-
-</body>
-</html>
diff --git a/NFD/docs/named_data_theme/named_data_footer.html b/NFD/docs/named_data_theme/named_data_footer.html
deleted file mode 100644
index 77fc327..0000000
--- a/NFD/docs/named_data_theme/named_data_footer.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!-- start footer part -->
-<!--BEGIN GENERATE_TREEVIEW-->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- $navpath
- <li class="footer">$generatedby
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
- </ul>
-</div>
-<!--END GENERATE_TREEVIEW-->
-<!--BEGIN !GENERATE_TREEVIEW-->
-<hr class="footer"/>
-<address class="footer"><small>
-$generatedby  <a href="http://www.doxygen.org/index.html">
-<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/>
-</a> $doxygenversion
-</small></address>
-<!--END !GENERATE_TREEVIEW-->
-
-<script type="text/javascript">
-</script>
-</body>
-</html>
diff --git a/NFD/docs/named_data_theme/named_data_header.html b/NFD/docs/named_data_theme/named_data_header.html
deleted file mode 100644
index 97b2932..0000000
--- a/NFD/docs/named_data_theme/named_data_header.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
-<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
-<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="$relpath$jquery.js"></script>
-<script type="text/javascript" src="$relpath$dynsections.js"></script>
-$treeview
-$search
-$mathjax
-<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
-<link href="$relpath$named_data_doxygen.css" rel="stylesheet" type="text/css" />
-<link href="$relpath$favicon.ico" rel="shortcut icon" type="image/ico" />
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-
-<!--BEGIN TITLEAREA-->
-<!--headercontainer-->
-<div id="header_container">
-
- <!--header-->
- <div class="row">
- <div class="three columns">
- <div id="logo">
- <a href="http://named-data.net" title="A Future Internet Architecture"><img src="http://named-data.net/wp-content/uploads/cropped-20130722_Logo2.png" alt="" /></a>
- </div><!--logo end-->
- </div>
-
- <!--top menu-->
- <div class="nine columns" id="menu_container" >
- <h1><a href="http://named-data.net/doc/NFD/$projectnumber/">$projectname $projectnumber documentation</a></h1>
- </div>
- </div>
-</div><!--header container end-->
-<!--END TITLEAREA-->
-
-<!-- end header part -->
diff --git a/NFD/docs/named_data_theme/static/bar-top.png b/NFD/docs/named_data_theme/static/bar-top.png
deleted file mode 100644
index 07cafb6..0000000
--- a/NFD/docs/named_data_theme/static/bar-top.png
+++ /dev/null
Binary files differ
diff --git a/NFD/docs/named_data_theme/static/base.css b/NFD/docs/named_data_theme/static/base.css
deleted file mode 100644
index 164d1c1..0000000
--- a/NFD/docs/named_data_theme/static/base.css
+++ /dev/null
@@ -1,71 +0,0 @@
-* {
- margin: 0px;
- padding: 0px;
-}
-
-html { font-size: 62.5%; }
-
-body {
- font-family: "Verdana", Arial, sans-serif;
- background-color: #eeeeec;
- color: #777;
- border-top: 4px solid #fd7800;
-}
-
-body { background: white; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1; color: #222222; position: relative; -webkit-font-smoothing: antialiased; }
-
-.clearer {
- clear: both;
-}
-
-.left {
- float: left;
-}
-
-.right {
- float: right;
-}
-
-.line-block {
- display: block;
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.line-block .line-block {
- margin-top: 0;
- margin-bottom: 0;
- margin-left: 1.5em;
-}
-
-h1, h2, h3, h4 {
- font-family: "Georgia", "Times New Roman", serif;
- font-weight: normal;
- color: #3465a4;
- margin-bottom: .8em;
-}
-
-h1 {
- color: #204a87;
-}
-
-h2 {
- padding-bottom: .5em;
- border-bottom: 1px solid #3465a4;
-}
-
-a.headerlink {
- visibility: hidden;
- color: #dddddd;
- padding-left: .3em;
-}
-
-h1:hover > a.headerlink,
-h2:hover > a.headerlink,
-h3:hover > a.headerlink,
-h4:hover > a.headerlink,
-h5:hover > a.headerlink,
-h6:hover > a.headerlink,
-dt:hover > a.headerlink {
- visibility: visible;
-}
diff --git a/NFD/docs/named_data_theme/static/base.css_t b/NFD/docs/named_data_theme/static/base.css_t
deleted file mode 100644
index eed3973..0000000
--- a/NFD/docs/named_data_theme/static/base.css_t
+++ /dev/null
@@ -1,459 +0,0 @@
-* {
- margin: 0px;
- padding: 0px;
-}
-
-html { font-size: 62.5%; }
-
-body {
- font-family: {{ theme_bodyfont }};
- background-color: {{ theme_bgcolor }};
- color: #777;
- border-top: 4px solid #fd7800;
-}
-
-body { background: white; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1; color: #222222; position: relative; -webkit-font-smoothing: antialiased; }
-
-/* Page layout */
-
-div.header, div.content, div.footer {
- width: 90%;
- margin-left: auto;
- margin-right: auto;
-}
-
-div.header-wrapper {
- background: {{ theme_headerbg }};
- border-bottom: 3px solid #2e3436;
-}
-
-
-/* Default body styles */
-a {
- color: {{ theme_linkcolor }};
-}
-
-div.bodywrapper a, div.footer a {
- text-decoration: none;
-}
-
-.clearer {
- clear: both;
-}
-
-.left {
- float: left;
-}
-
-.right {
- float: right;
-}
-
-.line-block {
- display: block;
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-.line-block .line-block {
- margin-top: 0;
- margin-bottom: 0;
- margin-left: 1.5em;
-}
-
-h1, h2, h3, h4 {
- font-family: {{ theme_headerfont }};
- font-weight: normal;
- color: {{ theme_headercolor2 }};
- margin-bottom: .8em;
-}
-
-h1 {
- color: {{ theme_headercolor1 }};
-}
-
-h2 {
- padding-bottom: .5em;
- border-bottom: 1px solid {{ theme_headercolor2 }};
-}
-
-a.headerlink {
- visibility: hidden;
- color: #dddddd;
- padding-left: .3em;
-}
-
-h1:hover > a.headerlink,
-h2:hover > a.headerlink,
-h3:hover > a.headerlink,
-h4:hover > a.headerlink,
-h5:hover > a.headerlink,
-h6:hover > a.headerlink,
-dt:hover > a.headerlink {
- visibility: visible;
-}
-
-img {
- border: 0;
-}
-
-div.admonition {
- margin-top: 10px;
- margin-bottom: 10px;
- padding: 2px 7px 1px 7px;
- border-left: 0.2em solid black;
-}
-
-p.admonition-title {
- margin: 0px 10px 5px 0px;
- font-weight: bold;
-}
-
-dt:target, .highlighted {
- background-color: #fbe54e;
-}
-
-/* Header */
-
-div.header {
- padding-top: 10px;
- padding-bottom: 10px;
-}
-
-div.header .headertitle {
- font-family: {{ theme_headerfont }};
- font-weight: normal;
- font-size: 180%;
- letter-spacing: .08em;
- margin-bottom: .8em;
-}
-
-div.header .headertitle a {
- color: white;
-}
-
-div.header div.rel {
- margin-top: 1em;
-}
-
-div.header div.rel a {
- color: {{ theme_headerlinkcolor }};
- letter-spacing: .1em;
- text-transform: uppercase;
-}
-
-p.logo {
- float: right;
-}
-
-img.logo {
- border: 0;
-}
-
-
-/* Content */
-div.content-wrapper {
- background-color: white;
- padding-top: 20px;
- padding-bottom: 20px;
-}
-
-div.document {
- width: 70%;
- float: left;
-}
-
-div.body {
- padding-right: 2em;
- text-align: left;
-}
-
-div.document h1 {
- line-height: 120%;
-}
-
-div.document ul {
- margin-left: 1.5em;
- list-style-type: square;
-}
-
-div.document dd {
- margin-left: 1.2em;
- margin-top: .4em;
- margin-bottom: 1em;
-}
-
-div.document .section {
- margin-top: 1.7em;
-}
-div.document .section:first-child {
- margin-top: 0px;
-}
-
-div.document div.highlight {
- padding: 3px;
- background-color: #eeeeec;
- border-top: 2px solid #dddddd;
- border-bottom: 2px solid #dddddd;
- margin-bottom: .8em;
-}
-
-div.document h2 {
- margin-top: .7em;
-}
-
-div.document p {
- margin-bottom: .5em;
-}
-
-div.document li.toctree-l1 {
- margin-bottom: 1em;
-}
-
-div.document .descname {
- font-weight: bold;
-}
-
-div.document .docutils.literal {
- background-color: #eeeeec;
- padding: 1px;
-}
-
-div.document .docutils.xref.literal {
- background-color: transparent;
- padding: 0px;
-}
-
-div.document ol {
- margin: 1.5em;
-}
-
-
-/* Sidebar */
-
-div.sidebar {
- width: 20%;
- float: right;
- font-size: .9em;
-}
-
-div.sidebar a, div.header a {
- text-decoration: none;
-}
-
-div.sidebar a:hover, div.header a:hover {
- text-decoration: none;
-}
-
-div.sidebar h3 {
- color: #2e3436;
- text-transform: uppercase;
- font-size: 130%;
- letter-spacing: .1em;
-}
-
-div.sidebar ul {
- list-style-type: none;
-}
-
-div.sidebar li.toctree-l1 a {
- display: block;
- padding: 1px;
- border: 1px solid #dddddd;
- background-color: #eeeeec;
- margin-bottom: .4em;
- padding-left: 3px;
- color: #2e3436;
-}
-
-div.sidebar li.toctree-l2 a {
- background-color: transparent;
- border: none;
- margin-left: 1em;
- border-bottom: 1px solid #dddddd;
-}
-
-div.sidebar li.toctree-l3 a {
- background-color: transparent;
- border: none;
- margin-left: 2em;
- border-bottom: 1px solid #dddddd;
-}
-
-div.sidebar li.toctree-l2:last-child a {
- border-bottom: none;
-}
-
-div.sidebar li.toctree-l1.current a {
- border-right: 5px solid {{ theme_headerlinkcolor }};
-}
-
-div.sidebar li.toctree-l1.current li.toctree-l2 a {
- border-right: none;
-}
-
-div.sidebar input[type="text"] {
- width: 170px;
-}
-
-div.sidebar input[type="submit"] {
- width: 30px;
-}
-
-
-/* Footer */
-
-div.footer-wrapper {
- background: {{ theme_footerbg }};
- border-top: 4px solid #babdb6;
- padding-top: 10px;
- padding-bottom: 10px;
- min-height: 80px;
-}
-
-div.footer, div.footer a {
- color: #888a85;
-}
-
-div.footer .right {
- text-align: right;
-}
-
-div.footer .left {
- text-transform: uppercase;
-}
-
-
-/* Styles copied from basic theme */
-
-img.align-left, .figure.align-left, object.align-left {
- clear: left;
- float: left;
- margin-right: 1em;
-}
-
-img.align-right, .figure.align-right, object.align-right {
- clear: right;
- float: right;
- margin-left: 1em;
-}
-
-img.align-center, .figure.align-center, object.align-center {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-
-.align-left {
- text-align: left;
-}
-
-.align-center {
- text-align: center;
-}
-
-.align-right {
- text-align: right;
-}
-
-/* -- search page ----------------------------------------------------------- */
-
-ul.search {
- margin: 10px 0 0 20px;
- padding: 0;
-}
-
-ul.search li {
- padding: 5px 0 5px 20px;
- background-image: url(file.png);
- background-repeat: no-repeat;
- background-position: 0 7px;
-}
-
-ul.search li a {
- font-weight: bold;
-}
-
-ul.search li div.context {
- color: #888;
- margin: 2px 0 0 30px;
- text-align: left;
-}
-
-ul.keywordmatches li.goodmatch a {
- font-weight: bold;
-}
-
-/* -- index page ------------------------------------------------------------ */
-
-table.contentstable {
- width: 90%;
-}
-
-table.contentstable p.biglink {
- line-height: 150%;
-}
-
-a.biglink {
- font-size: 1.3em;
-}
-
-span.linkdescr {
- font-style: italic;
- padding-top: 5px;
- font-size: 90%;
-}
-
-/* -- general index --------------------------------------------------------- */
-
-table.indextable td {
- text-align: left;
- vertical-align: top;
-}
-
-table.indextable dl, table.indextable dd {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-table.indextable tr.pcap {
- height: 10px;
-}
-
-table.indextable tr.cap {
- margin-top: 10px;
- background-color: #f2f2f2;
-}
-
-img.toggler {
- margin-right: 3px;
- margin-top: 3px;
- cursor: pointer;
-}
-
-/* -- viewcode extension ---------------------------------------------------- */
-
-.viewcode-link {
- float: right;
-}
-
-.viewcode-back {
- float: right;
- font-family:: {{ theme_bodyfont }};
-}
-
-div.viewcode-block:target {
- margin: -1px -3px;
- padding: 0 3px;
- background-color: #f4debf;
- border-top: 1px solid #ac9;
- border-bottom: 1px solid #ac9;
-}
-
-td.linenos pre {
- padding: 5px 0px;
- border: 0;
- background-color: transparent;
- color: #aaa;
- margin-top: -10pt;
-}
\ No newline at end of file
diff --git a/NFD/docs/named_data_theme/static/bc_s.png b/NFD/docs/named_data_theme/static/bc_s.png
deleted file mode 100644
index eebf862..0000000
--- a/NFD/docs/named_data_theme/static/bc_s.png
+++ /dev/null
Binary files differ
diff --git a/NFD/docs/named_data_theme/static/default.css_t b/NFD/docs/named_data_theme/static/default.css_t
deleted file mode 100644
index b582768..0000000
--- a/NFD/docs/named_data_theme/static/default.css_t
+++ /dev/null
@@ -1,14 +0,0 @@
-@import url("agogo.css");
-
-pre {
- padding: 10px;
- background-color: #fafafa;
- color: #222;
- line-height: 1.2em;
- border: 2px solid #C6C9CB;
- font-size: 1.1em;
- /* margin: 1.5em 0 1.5em 0; */
- margin: 0;
- border-right-style: none;
- border-left-style: none;
-}
diff --git a/NFD/docs/named_data_theme/static/doxygen.css b/NFD/docs/named_data_theme/static/doxygen.css
deleted file mode 100644
index e5c796e..0000000
--- a/NFD/docs/named_data_theme/static/doxygen.css
+++ /dev/null
@@ -1,1157 +0,0 @@
-/* The standard CSS for doxygen */
-
-body, table, div, p, dl {
- font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
- font-size: 13px;
- line-height: 1.3;
-}
-
-/* @group Heading Levels */
-
-h1 {
- font-size: 150%;
-}
-
-.title {
- font-size: 150%;
- font-weight: bold;
- margin: 10px 2px;
-}
-
-h2 {
- font-size: 120%;
-}
-
-h3 {
- font-size: 100%;
-}
-
-h1, h2, h3, h4, h5, h6 {
- -webkit-transition: text-shadow 0.5s linear;
- -moz-transition: text-shadow 0.5s linear;
- -ms-transition: text-shadow 0.5s linear;
- -o-transition: text-shadow 0.5s linear;
- transition: text-shadow 0.5s linear;
- margin-right: 15px;
-}
-
-h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow {
- text-shadow: 0 0 15px cyan;
-}
-
-dt {
- font-weight: bold;
-}
-
-div.multicol {
- -moz-column-gap: 1em;
- -webkit-column-gap: 1em;
- -moz-column-count: 3;
- -webkit-column-count: 3;
-}
-
-p.startli, p.startdd, p.starttd {
- margin-top: 2px;
-}
-
-p.endli {
- margin-bottom: 0px;
-}
-
-p.enddd {
- margin-bottom: 4px;
-}
-
-p.endtd {
- margin-bottom: 2px;
-}
-
-/* @end */
-
-caption {
- font-weight: bold;
-}
-
-span.legend {
- font-size: 70%;
- text-align: center;
-}
-
-h3.version {
- font-size: 90%;
- text-align: center;
-}
-
-div.qindex, div.navtab{
- background-color: #EFEFEF;
- border: 1px solid #B5B5B5;
- text-align: center;
-}
-
-div.qindex, div.navpath {
- width: 100%;
- line-height: 140%;
-}
-
-div.navtab {
- margin-right: 15px;
-}
-
-/* @group Link Styling */
-
-a {
- color: #585858;
- font-weight: normal;
- text-decoration: none;
-}
-
-/*.contents a:visited {
- color: #686868;
-}*/
-
-a:hover {
- text-decoration: underline;
-}
-
-a.qindex {
- font-weight: bold;
-}
-
-a.qindexHL {
- font-weight: bold;
- background-color: #B0B0B0;
- color: #ffffff;
- border: 1px double #9F9F9F;
-}
-
-.contents a.qindexHL:visited {
- color: #ffffff;
-}
-
-a.el {
- font-weight: bold;
-}
-
-a.elRef {
-}
-
-a.code, a.code:visited {
- color: #4665A2;
-}
-
-a.codeRef, a.codeRef:visited {
- color: #4665A2;
-}
-
-/* @end */
-
-dl.el {
- margin-left: -1cm;
-}
-
-pre.fragment {
- border: 1px solid #C4CFE5;
- background-color: #FBFCFD;
- padding: 4px 6px;
- margin: 4px 8px 4px 2px;
- overflow: auto;
- word-wrap: break-word;
- font-size: 9pt;
- line-height: 125%;
- font-family: monospace, fixed;
- font-size: 105%;
-}
-
-div.fragment {
- padding: 4px;
- margin: 4px;
- background-color: #FCFCFC;
- border: 1px solid #D0D0D0;
-}
-
-div.line {
- font-family: monospace, fixed;
- font-size: 13px;
- min-height: 13px;
- line-height: 1.0;
- text-wrap: unrestricted;
- white-space: -moz-pre-wrap; /* Moz */
- white-space: -pre-wrap; /* Opera 4-6 */
- white-space: -o-pre-wrap; /* Opera 7 */
- white-space: pre-wrap; /* CSS3 */
- word-wrap: break-word; /* IE 5.5+ */
- text-indent: -53px;
- padding-left: 53px;
- padding-bottom: 0px;
- margin: 0px;
- -webkit-transition-property: background-color, box-shadow;
- -webkit-transition-duration: 0.5s;
- -moz-transition-property: background-color, box-shadow;
- -moz-transition-duration: 0.5s;
- -ms-transition-property: background-color, box-shadow;
- -ms-transition-duration: 0.5s;
- -o-transition-property: background-color, box-shadow;
- -o-transition-duration: 0.5s;
- transition-property: background-color, box-shadow;
- transition-duration: 0.5s;
-}
-
-div.line.glow {
- background-color: cyan;
- box-shadow: 0 0 10px cyan;
-}
-
-
-span.lineno {
- padding-right: 4px;
- text-align: right;
- border-right: 2px solid #0F0;
- background-color: #E8E8E8;
- white-space: pre;
-}
-span.lineno a {
- background-color: #D8D8D8;
-}
-
-span.lineno a:hover {
- background-color: #C8C8C8;
-}
-
-div.ah {
- background-color: black;
- font-weight: bold;
- color: #ffffff;
- margin-bottom: 3px;
- margin-top: 3px;
- padding: 0.2em;
- border: solid thin #333;
- border-radius: 0.5em;
- -webkit-border-radius: .5em;
- -moz-border-radius: .5em;
- box-shadow: 2px 2px 3px #999;
- -webkit-box-shadow: 2px 2px 3px #999;
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
- background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
-}
-
-div.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- font-weight: bold;
-}
-
-div.groupText {
- margin-left: 16px;
- font-style: italic;
-}
-
-body {
- background-color: white;
- color: black;
- margin: 0;
-}
-
-div.contents {
- margin-top: 10px;
- margin-left: 12px;
- margin-right: 8px;
-}
-
-td.indexkey {
- background-color: #EFEFEF;
- font-weight: bold;
- border: 1px solid #D0D0D0;
- margin: 2px 0px 2px 0;
- padding: 2px 10px;
- white-space: nowrap;
- vertical-align: top;
-}
-
-td.indexvalue {
- background-color: #EFEFEF;
- border: 1px solid #D0D0D0;
- padding: 2px 10px;
- margin: 2px 0px;
-}
-
-tr.memlist {
- background-color: #F1F1F1;
-}
-
-p.formulaDsp {
- text-align: center;
-}
-
-img.formulaDsp {
-
-}
-
-img.formulaInl {
- vertical-align: middle;
-}
-
-div.center {
- text-align: center;
- margin-top: 0px;
- margin-bottom: 0px;
- padding: 0px;
-}
-
-div.center img {
- border: 0px;
-}
-
-address.footer {
- text-align: right;
- padding-right: 12px;
-}
-
-img.footer {
- border: 0px;
- vertical-align: middle;
-}
-
-/* @group Code Colorization */
-
-span.keyword {
- color: #008000
-}
-
-span.keywordtype {
- color: #604020
-}
-
-span.keywordflow {
- color: #e08000
-}
-
-span.comment {
- color: #800000
-}
-
-span.preprocessor {
- color: #806020
-}
-
-span.stringliteral {
- color: #002080
-}
-
-span.charliteral {
- color: #008080
-}
-
-span.vhdldigit {
- color: #ff00ff
-}
-
-span.vhdlchar {
- color: #000000
-}
-
-span.vhdlkeyword {
- color: #700070
-}
-
-span.vhdllogic {
- color: #ff0000
-}
-
-blockquote {
- background-color: #F8F8F8;
- border-left: 2px solid #B0B0B0;
- margin: 0 24px 0 4px;
- padding: 0 12px 0 16px;
-}
-
-/* @end */
-
-/*
-.search {
- color: #003399;
- font-weight: bold;
-}
-
-form.search {
- margin-bottom: 0px;
- margin-top: 0px;
-}
-
-input.search {
- font-size: 75%;
- color: #000080;
- font-weight: normal;
- background-color: #e8eef2;
-}
-*/
-
-td.tiny {
- font-size: 75%;
-}
-
-.dirtab {
- padding: 4px;
- border-collapse: collapse;
- border: 1px solid #B5B5B5;
-}
-
-th.dirtab {
- background: #EFEFEF;
- font-weight: bold;
-}
-
-hr {
- height: 0px;
- border: none;
- border-top: 1px solid #6E6E6E;
-}
-
-hr.footer {
- height: 1px;
-}
-
-/* @group Member Descriptions */
-
-table.memberdecls {
- border-spacing: 0px;
- padding: 0px;
-}
-
-.memberdecls td {
- -webkit-transition-property: background-color, box-shadow;
- -webkit-transition-duration: 0.5s;
- -moz-transition-property: background-color, box-shadow;
- -moz-transition-duration: 0.5s;
- -ms-transition-property: background-color, box-shadow;
- -ms-transition-duration: 0.5s;
- -o-transition-property: background-color, box-shadow;
- -o-transition-duration: 0.5s;
- transition-property: background-color, box-shadow;
- transition-duration: 0.5s;
-}
-
-.memberdecls td.glow {
- background-color: cyan;
- box-shadow: 0 0 15px cyan;
-}
-
-.mdescLeft, .mdescRight,
-.memItemLeft, .memItemRight,
-.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
- background-color: #FAFAFA;
- border: none;
- margin: 4px;
- padding: 1px 0 0 8px;
-}
-
-.mdescLeft, .mdescRight {
- padding: 0px 8px 4px 8px;
- color: #555;
-}
-
-.memItemLeft, .memItemRight, .memTemplParams {
- border-top: 1px solid #D0D0D0;
-}
-
-.memItemLeft, .memTemplItemLeft {
- white-space: nowrap;
-}
-
-.memItemRight {
- width: 100%;
-}
-
-.memTemplParams {
- color: #686868;
- white-space: nowrap;
-}
-
-/* @end */
-
-/* @group Member Details */
-
-/* Styles for detailed member documentation */
-
-.memtemplate {
- font-size: 80%;
- color: #686868;
- font-weight: normal;
- margin-left: 9px;
-}
-
-.memnav {
- background-color: #EFEFEF;
- border: 1px solid #B5B5B5;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
-}
-
-.mempage {
- width: 100%;
-}
-
-.memitem {
- padding: 0;
- margin-bottom: 10px;
- margin-right: 5px;
- -webkit-transition: box-shadow 0.5s linear;
- -moz-transition: box-shadow 0.5s linear;
- -ms-transition: box-shadow 0.5s linear;
- -o-transition: box-shadow 0.5s linear;
- transition: box-shadow 0.5s linear;
- display: table !important;
- width: 100%;
-}
-
-.memitem.glow {
- box-shadow: 0 0 15px cyan;
-}
-
-.memname {
- font-weight: bold;
- margin-left: 6px;
-}
-
-.memname td {
- vertical-align: bottom;
-}
-
-.memproto, dl.reflist dt {
- border-top: 1px solid #B9B9B9;
- border-left: 1px solid #B9B9B9;
- border-right: 1px solid #B9B9B9;
- padding: 6px 0px 6px 0px;
- color: #323232;
- font-weight: bold;
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
- background-image:url('nav_f.png');
- background-repeat:repeat-x;
- background-color: #E8E8E8;
- /* opera specific markup */
- box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- /* firefox specific markup */
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-topleft: 4px;
- /* webkit specific markup */
- -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- -webkit-border-top-right-radius: 4px;
- -webkit-border-top-left-radius: 4px;
-
-}
-
-.memdoc, dl.reflist dd {
- border-bottom: 1px solid #B9B9B9;
- border-left: 1px solid #B9B9B9;
- border-right: 1px solid #B9B9B9;
- padding: 6px 10px 2px 10px;
- background-color: #FCFCFC;
- border-top-width: 0;
- background-image:url('nav_g.png');
- background-repeat:repeat-x;
- background-color: #FFFFFF;
- /* opera specific markup */
- border-bottom-left-radius: 4px;
- border-bottom-right-radius: 4px;
- box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- /* firefox specific markup */
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-bottomright: 4px;
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
- /* webkit specific markup */
- -webkit-border-bottom-left-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-}
-
-dl.reflist dt {
- padding: 5px;
-}
-
-dl.reflist dd {
- margin: 0px 0px 10px 0px;
- padding: 5px;
-}
-
-.paramkey {
- text-align: right;
-}
-
-.paramtype {
- white-space: nowrap;
-}
-
-.paramname {
- color: #602020;
- white-space: nowrap;
-}
-.paramname em {
- font-style: normal;
-}
-.paramname code {
- line-height: 14px;
-}
-
-.params, .retval, .exception, .tparams {
- margin-left: 0px;
- padding-left: 0px;
-}
-
-.params .paramname, .retval .paramname {
- font-weight: bold;
- vertical-align: top;
-}
-
-.params .paramtype {
- font-style: italic;
- vertical-align: top;
-}
-
-.params .paramdir {
- font-family: "courier new",courier,monospace;
- vertical-align: top;
-}
-
-table.mlabels {
- border-spacing: 0px;
-}
-
-td.mlabels-left {
- width: 100%;
- padding: 0px;
-}
-
-td.mlabels-right {
- vertical-align: bottom;
- padding: 0px;
- white-space: nowrap;
-}
-
-span.mlabels {
- margin-left: 8px;
-}
-
-span.mlabel {
- background-color: #8F8F8F;
- border-top:1px solid #787878;
- border-left:1px solid #787878;
- border-right:1px solid #D0D0D0;
- border-bottom:1px solid #D0D0D0;
- text-shadow: none;
- color: white;
- margin-right: 4px;
- padding: 2px 3px;
- border-radius: 3px;
- font-size: 7pt;
- white-space: nowrap;
-}
-
-
-
-/* @end */
-
-/* these are for tree view when not used as main index */
-
-div.directory {
- margin: 10px 0px;
- border-top: 1px solid #A8B8D9;
- border-bottom: 1px solid #A8B8D9;
- width: 100%;
-}
-
-.directory table {
- border-collapse:collapse;
- width: 100%;
-}
-
-.directory td {
- margin: 0px;
- padding: 0px;
- vertical-align: top;
-}
-
-.directory td.entry {
- width: 20%;
- white-space: nowrap;
- padding-right: 6px;
-}
-
-.directory td.entry a {
- outline:none;
-}
-
-.directory td.entry a img {
- border: none;
-}
-
-.directory td.desc {
- width: 80%;
- padding-left: 6px;
- padding-right: 6px;
- border-left: 1px solid rgba(0,0,0,0.05);
-}
-
-.directory tr.even {
- padding-left: 6px;
- background-color: #F8F8F8;
-}
-
-.directory img {
- vertical-align: -30%;
-}
-
-.directory .levels {
- white-space: nowrap;
- width: 100%;
- text-align: right;
- font-size: 9pt;
-}
-
-.directory .levels span {
- cursor: pointer;
- padding-left: 2px;
- padding-right: 2px;
- color: #585858;
-}
-
-div.dynheader {
- margin-top: 8px;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-address {
- font-style: normal;
- color: #3A3A3A;
-}
-
-table.doxtable {
- border-collapse:collapse;
- margin-top: 4px;
- margin-bottom: 4px;
-}
-
-table.doxtable td, table.doxtable th {
- border: 1px solid #3F3F3F;
- padding: 3px 7px 2px;
-}
-
-table.doxtable th {
- background-color: #4F4F4F;
- color: #FFFFFF;
- font-size: 110%;
- padding-bottom: 4px;
- padding-top: 5px;
-}
-
-table.fieldtable {
- width: 100%;
- margin-bottom: 10px;
- border: 1px solid #B9B9B9;
- border-spacing: 0px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
- -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
- -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
- box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
-}
-
-.fieldtable td, .fieldtable th {
- padding: 3px 7px 2px;
-}
-
-.fieldtable td.fieldtype, .fieldtable td.fieldname {
- white-space: nowrap;
- border-right: 1px solid #B9B9B9;
- border-bottom: 1px solid #B9B9B9;
- vertical-align: top;
-}
-
-.fieldtable td.fielddoc {
- border-bottom: 1px solid #B9B9B9;
- width: 100%;
-}
-
-.fieldtable tr:last-child td {
- border-bottom: none;
-}
-
-.fieldtable th {
- background-image:url('nav_f.png');
- background-repeat:repeat-x;
- background-color: #E8E8E8;
- font-size: 90%;
- color: #323232;
- padding-bottom: 4px;
- padding-top: 5px;
- text-align:left;
- -moz-border-radius-topleft: 4px;
- -moz-border-radius-topright: 4px;
- -webkit-border-top-left-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-bottom: 1px solid #B9B9B9;
-}
-
-
-.tabsearch {
- top: 0px;
- left: 10px;
- height: 36px;
- background-image: url('tab_b.png');
- z-index: 101;
- overflow: hidden;
- font-size: 13px;
-}
-
-.navpath ul
-{
- font-size: 11px;
- background-image:url('tab_b.png');
- background-repeat:repeat-x;
- height:30px;
- line-height:30px;
- color:#A2A2A2;
- border:solid 1px #CECECE;
- overflow:hidden;
- margin:0px;
- padding:0px;
-}
-
-.navpath li
-{
- list-style-type:none;
- float:left;
- padding-left:10px;
- padding-right:15px;
- background-image:url('bc_s.png');
- background-repeat:no-repeat;
- background-position:right;
- color:#4D4D4D;
-}
-
-.navpath li.navelem a
-{
- height:32px;
- display:block;
- text-decoration: none;
- outline: none;
-}
-
-.navpath li.navelem a:hover
-{
- color:#888888;
-}
-
-.navpath li.footer
-{
- list-style-type:none;
- float:right;
- padding-left:10px;
- padding-right:15px;
- background-image:none;
- background-repeat:no-repeat;
- background-position:right;
- color:#4D4D4D;
- font-size: 8pt;
-}
-
-
-div.summary
-{
- float: right;
- font-size: 8pt;
- padding-right: 5px;
- width: 50%;
- text-align: right;
-}
-
-div.summary a
-{
- white-space: nowrap;
-}
-
-div.ingroups
-{
- font-size: 8pt;
- width: 50%;
- text-align: left;
-}
-
-div.ingroups a
-{
- white-space: nowrap;
-}
-
-div.header
-{
- background-image:url('nav_h.png');
- background-repeat:repeat-x;
- background-color: #FAFAFA;
- margin: 0px;
- border-bottom: 1px solid #D0D0D0;
-}
-
-div.headertitle
-{
- padding: 5px 5px 5px 7px;
-}
-
-dl
-{
- padding: 0 0 0 10px;
-}
-
-/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
-dl.section
-{
- margin-left: 0px;
- padding-left: 0px;
-}
-
-dl.note
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #D0C000;
-}
-
-dl.warning, dl.attention
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #FF0000;
-}
-
-dl.pre, dl.post, dl.invariant
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #00D000;
-}
-
-dl.deprecated
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #505050;
-}
-
-dl.todo
-{
- margin-left:-7px;
- padding-left: 3px;
- border:4px solid;
- border-color: #00C0E0;
-}
-
-dl.test
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #3030E0;
-}
-
-dl.bug
-{
- margin-left:-7px;
- padding-left: 3px;
- border-left:4px solid;
- border-color: #C08050;
-}
-
-dl.section dd {
- margin-bottom: 6px;
-}
-
-
-#projectlogo
-{
- text-align: center;
- vertical-align: bottom;
- border-collapse: separate;
-}
-
-#projectlogo img
-{
- border: 0px none;
-}
-
-#projectname
-{
- font: 300% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 2px 0px;
-}
-
-#projectbrief
-{
- font: 120% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 0px;
-}
-
-#projectnumber
-{
- font: 50% Tahoma, Arial,sans-serif;
- margin: 0px;
- padding: 0px;
-}
-
-#titlearea
-{
- padding: 0px;
- margin: 0px;
- width: 100%;
- border-bottom: 1px solid #787878;
-}
-
-.image
-{
- text-align: center;
-}
-
-.dotgraph
-{
- text-align: center;
-}
-
-.mscgraph
-{
- text-align: center;
-}
-
-.caption
-{
- font-weight: bold;
-}
-
-div.zoom
-{
- border: 1px solid #A6A6A6;
-}
-
-dl.citelist {
- margin-bottom:50px;
-}
-
-dl.citelist dt {
- color:#484848;
- float:left;
- font-weight:bold;
- margin-right:10px;
- padding:5px;
-}
-
-dl.citelist dd {
- margin:2px 0;
- padding:5px 0;
-}
-
-div.toc {
- padding: 14px 25px;
- background-color: #F6F6F6;
- border: 1px solid #DFDFDF;
- border-radius: 7px 7px 7px 7px;
- float: right;
- height: auto;
- margin: 0 20px 10px 10px;
- width: 200px;
-}
-
-div.toc li {
- background: url("bdwn.png") no-repeat scroll 0 5px transparent;
- font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
- margin-top: 5px;
- padding-left: 10px;
- padding-top: 2px;
-}
-
-div.toc h3 {
- font: bold 12px/1.2 Arial,FreeSans,sans-serif;
- color: #686868;
- border-bottom: 0 none;
- margin: 0;
-}
-
-div.toc ul {
- list-style: none outside none;
- border: medium none;
- padding: 0px;
-}
-
-div.toc li.level1 {
- margin-left: 0px;
-}
-
-div.toc li.level2 {
- margin-left: 15px;
-}
-
-div.toc li.level3 {
- margin-left: 30px;
-}
-
-div.toc li.level4 {
- margin-left: 45px;
-}
-
-.inherit_header {
- font-weight: bold;
- color: gray;
- cursor: pointer;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.inherit_header td {
- padding: 6px 0px 2px 5px;
-}
-
-.inherit {
- display: none;
-}
-
-tr.heading h2 {
- margin-top: 12px;
- margin-bottom: 4px;
-}
-
-@media print
-{
- #top { display: none; }
- #side-nav { display: none; }
- #nav-path { display: none; }
- body { overflow:visible; }
- h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
- .summary { display: none; }
- .memitem { page-break-inside: avoid; }
- #doc-content
- {
- margin-left:0 !important;
- height:auto !important;
- width:auto !important;
- overflow:inherit;
- display:inline;
- }
-}
diff --git a/NFD/docs/named_data_theme/static/foundation.css b/NFD/docs/named_data_theme/static/foundation.css
deleted file mode 100644
index ff1330e..0000000
--- a/NFD/docs/named_data_theme/static/foundation.css
+++ /dev/null
@@ -1,788 +0,0 @@
-.c-1, .c-2, .c-3, .c-4, .c-5, .c-6, .c-7, .c-8, .c-9, .c-10, .c-11, .c-12 { float: left; }
-
-.c-1, .c-2, .c-3, .c-4, .c-5, .c-6, .c-7, .c-8, .c-9, .c-10, .c-11, .c-12 { position: relative; min-height: 1px; padding: 0 15px; }
-
-.c-1 { width: 8.33333%; }
-
-.c-2 { width: 16.66667%; }
-
-.c-3 { width: 25%; }
-
-.c-4 { width: 33.33333%; }
-
-.c-5 { width: 41.66667%; }
-
-.c-6 { width: 50%; }
-
-.c-7 { width: 58.33333%; }
-
-.c-8 { width: 66.66667%; }
-
-.c-9 { width: 75%; }
-
-.c-10 { width: 83.33333%; }
-
-.c-11 { width: 91.66667%; }
-
-.c-12 { width: 100%; }
-
-/* Requires: normalize.css */
-/* Global Reset & Standards ---------------------- */
-* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
-
-html { font-size: 62.5%; }
-
-body { background: white; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1; color: #222222; position: relative; -webkit-font-smoothing: antialiased; }
-
-/* Links ---------------------- */
-a { color: #fd7800; text-decoration: none; line-height: inherit; }
-
-a:hover { color: #2795b6; }
-
-a:focus { color: #fd7800; outline: none; }
-
-p a, p a:visited { line-height: inherit; }
-
-/* Misc ---------------------- */
-.left { float: left; }
-@media only screen and (max-width: 767px) { .left { float: none; } }
-
-.right { float: right; }
-@media only screen and (max-width: 767px) { .right { float: none; } }
-
-.text-left { text-align: left; }
-
-.text-right { text-align: right; }
-
-.text-center { text-align: center; }
-
-.hide { display: none; }
-
-.highlight { background: #ffff99; }
-
-#googlemap img, object, embed { max-width: none; }
-
-#map_canvas embed { max-width: none; }
-
-#map_canvas img { max-width: none; }
-
-#map_canvas object { max-width: none; }
-
-/* Reset for strange margins by default on <figure> elements */
-figure { margin: 0; }
-
-/* Base Type Styles Using Modular Scale ---------------------- */
-body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, p, blockquote, th, td { margin: 0; padding: 0; font-size: 14px; direction: ltr; }
-
-p { font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-weight: normal; font-size: 14px; line-height: 1.6; margin-bottom: 17px; }
-p.lead { font-size: 17.5px; line-height: 1.6; margin-bottom: 17px; }
-
-aside p { font-size: 13px; line-height: 1.35; font-style: italic; }
-
-h1, h2, h3, h4, h5, h6 { font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-weight: bold; color: #222222; text-rendering: optimizeLegibility; line-height: 1.0; margin-bottom: 14px; margin-top: 14px; }
-h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-size: 60%; color: #6f6f6f; line-height: 0; }
-
-h1 { font-size: 24px; }
-
-h2 { font-size: 18px; }
-
-h3 { font-size: 14px; }
-
-h4 { font-size: 12px; }
-
-h5 { font-weight: bold; font-size: 12px; }
-
-h6 { font-style: italic; font-size: 12px; }
-
-hr { border: solid #c6c6c6; border-width: 1px 0 0; clear: both; margin: 22px 0 21px; height: 0; }
-
-.subheader { line-height: 1.3; color: #6f6f6f; font-weight: 300; margin-bottom: 17px; }
-
-em, i { font-style: italic; line-height: inherit; }
-
-strong, b { font-weight: bold; line-height: inherit; }
-
-small { font-size: 60%; line-height: inherit; }
-
-code { font-weight: bold; background: #ffff99; }
-
-/* Lists ---------------------- */
-ul, ol { font-size: 14px; line-height: 1.6; margin-bottom: 17px; list-style-position: inside; }
-
-ul li ul, ul li ol { margin-left: 20px; margin-bottom: 0; }
-ul.square, ul.circle, ul.disc { margin-left: 17px; }
-ul.square { list-style-type: square; }
-ul.square li ul { list-style: inherit; }
-ul.circle { list-style-type: circle; }
-ul.circle li ul { list-style: inherit; }
-ul.disc { list-style-type: disc; }
-ul.disc li ul { list-style: inherit; }
-ul.no-bullet { list-style: none; }
-ul.large li { line-height: 21px; }
-
-ol li ul, ol li ol { margin-left: 20px; margin-bottom: 0; }
-
-/* Blockquotes ---------------------- */
-blockquote, blockquote p { line-height: 1.5; }
-
-blockquote { margin: 0 0 17px; padding: 9px 20px 0 19px; }
-blockquote cite { display: block; font-size: 13pt; color: #555555; }
-blockquote cite:before { content: "\2014 \0020"; }
-blockquote cite a, blockquote cite a:visited { color: #555555; }
-
-abbr, acronym { text-transform: uppercase; font-size: 90%; color: #222222; border-bottom: 1px solid #ddd; cursor: help; }
-
-abbr { text-transform: none; }
-
-/* Print styles. Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/ Credit to Paul Irish and HTML5 Boilerplate (html5boilerplate.com)
-*/
-.print-only { display: none !important; }
-
-@media print { * { background: transparent !important; color: black !important; box-shadow: none !important; text-shadow: none !important; filter: none !important; -ms-filter: none !important; }
- /* Black prints faster: h5bp.com/s */
- a, a:visited { text-decoration: underline; }
- a[href]:after { content: " (" attr(href) ")"; }
- abbr[title]:after { content: " (" attr(title) ")"; }
- .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
- /* Don't show links for images, or javascript/internal links */
- pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
- thead { display: table-header-group; }
- /* h5bp.com/t */
- tr, img { page-break-inside: avoid; }
- img { max-width: 100% !important; }
- @page { margin: 0.5cm; }
- p, h2, h3 { orphans: 3; widows: 3; }
- h2, h3 { page-break-after: avoid; }
- .hide-on-print { display: none !important; }
- .print-only { display: block !important; } }
-/* Requires globals.css */
-/* Standard Forms ---------------------- */
-form { margin: 0 0 19.41641px; }
-
-.row form .row { margin: 0 -6px; }
-.row form .row .column, .row form .row .columns { padding: 0 6px; }
-.row form .row.collapse { margin: 0; }
-.row form .row.collapse .column, .row form .row.collapse .columns { padding: 0; }
-
-label { font-size: 14px; color: #4d4d4d; cursor: pointer; display: block; font-weight: 500; margin-bottom: 3px; }
-label.right { float: none; text-align: right; }
-label.inline { line-height: 32px; margin: 0 0 12px 0; }
-
-@media only screen and (max-width: 767px) { label.right { text-align: left; } }
-.prefix, .postfix { display: block; position: relative; z-index: 2; text-align: center; width: 100%; padding-top: 0; padding-bottom: 0; height: 32px; line-height: 31px; }
-
-a.button.prefix, a.button.postfix { padding-left: 0; padding-right: 0; text-align: center; }
-
-span.prefix, span.postfix { background: #f2f2f2; border: 1px solid #cccccc; }
-
-.prefix { left: 2px; -moz-border-radius-topleft: 2px; -webkit-border-top-left-radius: 2px; border-top-left-radius: 2px; -moz-border-radius-bottomleft: 2px; -webkit-border-bottom-left-radius: 2px; border-bottom-left-radius: 2px; overflow: hidden; }
-
-.postfix { right: 2px; -moz-border-radius-topright: 2px; -webkit-border-top-right-radius: 2px; border-top-right-radius: 2px; -moz-border-radius-bottomright: 2px; -webkit-border-bottom-right-radius: 2px; border-bottom-right-radius: 2px; }
-
-input[type="text"], input[type="password"], input[type="date"], input[type="datetime"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="time"], input[type="url"], textarea { font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; border: 1px solid #cccccc; -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); color: rgba(0, 0, 0, 0.75); display: block; font-size: 14px; margin: 0 0 12px 0; padding: 6px; height: 32px; width: 100%; -webkit-transition: all 0.15s linear; -moz-transition: all 0.15s linear; -o-transition: all 0.15s linear; transition: all 0.15s linear; }
-input[type="text"].oversize, input[type="password"].oversize, input[type="date"].oversize, input[type="datetime"].oversize, input[type="email"].oversize, input[type="number"].oversize, input[type="search"].oversize, input[type="tel"].oversize, input[type="time"].oversize, input[type="url"].oversize, textarea.oversize { font-size: 17px; padding: 4px 6px; }
-input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="time"]:focus, input[type="url"]:focus, textarea:focus { background: #fafafa; outline: none !important; border-color: #b3b3b3; }
-input[type="text"][disabled], input[type="password"][disabled], input[type="date"][disabled], input[type="datetime"][disabled], input[type="email"][disabled], input[type="number"][disabled], input[type="search"][disabled], input[type="tel"][disabled], input[type="time"][disabled], input[type="url"][disabled], textarea[disabled] { background-color: #ddd; }
-
-textarea { height: auto; }
-
-select { width: 100%; }
-
-/* Fieldsets */
-fieldset { border: solid 1px #ddd; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; padding: 12px 12px 0; margin: 18px 0; }
-fieldset legend { font-weight: bold; background: white; padding: 0 3px; margin: 0; margin-left: -3px; }
-
-/* Errors */
-.error input, input.error, .error textarea, textarea.error { border-color: #c60f13; background-color: rgba(198, 15, 19, 0.1); }
-
-.error label, label.error { color: #c60f13; }
-
-.error small, small.error { display: block; padding: 6px 4px; margin-top: -13px; margin-bottom: 12px; background: #c60f13; color: #fff; font-size: 12px; font-size: 1.2rem; font-weight: bold; -moz-border-radius-bottomleft: 2px; -webkit-border-bottom-left-radius: 2px; border-bottom-left-radius: 2px; -moz-border-radius-bottomright: 2px; -webkit-border-bottom-right-radius: 2px; border-bottom-right-radius: 2px; }
-
-@media only screen and (max-width: 767px) { input[type="text"].one, input[type="password"].one, input[type="date"].one, input[type="datetime"].one, input[type="email"].one, input[type="number"].one, input[type="search"].one, input[type="tel"].one, input[type="time"].one, input[type="url"].one, textarea.one, .row textarea.one { width: 100% !important; }
- input[type="text"].two, .row input[type="text"].two, input[type="password"].two, .row input[type="password"].two, input[type="date"].two, .row input[type="date"].two, input[type="datetime"].two, .row input[type="datetime"].two, input[type="email"].two, .row input[type="email"].two, input[type="number"].two, .row input[type="number"].two, input[type="search"].two, .row input[type="search"].two, input[type="tel"].two, .row input[type="tel"].two, input[type="time"].two, .row input[type="time"].two, input[type="url"].two, .row input[type="url"].two, textarea.two, .row textarea.two { width: 100% !important; }
- input[type="text"].three, .row input[type="text"].three, input[type="password"].three, .row input[type="password"].three, input[type="date"].three, .row input[type="date"].three, input[type="datetime"].three, .row input[type="datetime"].three, input[type="email"].three, .row input[type="email"].three, input[type="number"].three, .row input[type="number"].three, input[type="search"].three, .row input[type="search"].three, input[type="tel"].three, .row input[type="tel"].three, input[type="time"].three, .row input[type="time"].three, input[type="url"].three, .row input[type="url"].three, textarea.three, .row textarea.three { width: 100% !important; }
- input[type="text"].four, .row input[type="text"].four, input[type="password"].four, .row input[type="password"].four, input[type="date"].four, .row input[type="date"].four, input[type="datetime"].four, .row input[type="datetime"].four, input[type="email"].four, .row input[type="email"].four, input[type="number"].four, .row input[type="number"].four, input[type="search"].four, .row input[type="search"].four, input[type="tel"].four, .row input[type="tel"].four, input[type="time"].four, .row input[type="time"].four, input[type="url"].four, .row input[type="url"].four, textarea.four, .row textarea.four { width: 100% !important; }
- input[type="text"].five, .row input[type="text"].five, input[type="password"].five, .row input[type="password"].five, input[type="date"].five, .row input[type="date"].five, input[type="datetime"].five, .row input[type="datetime"].five, input[type="email"].five, .row input[type="email"].five, input[type="number"].five, .row input[type="number"].five, input[type="search"].five, .row input[type="search"].five, input[type="tel"].five, .row input[type="tel"].five, input[type="time"].five, .row input[type="time"].five, input[type="url"].five, .row input[type="url"].five, textarea.five, .row textarea.five { width: 100% !important; }
- input[type="text"].six, .row input[type="text"].six, input[type="password"].six, .row input[type="password"].six, input[type="date"].six, .row input[type="date"].six, input[type="datetime"].six, .row input[type="datetime"].six, input[type="email"].six, .row input[type="email"].six, input[type="number"].six, .row input[type="number"].six, input[type="search"].six, .row input[type="search"].six, input[type="tel"].six, .row input[type="tel"].six, input[type="time"].six, .row input[type="time"].six, input[type="url"].six, .row input[type="url"].six, textarea.six, .row textarea.six { width: 100% !important; }
- input[type="text"].seven, .row input[type="text"].seven, input[type="password"].seven, .row input[type="password"].seven, input[type="date"].seven, .row input[type="date"].seven, input[type="datetime"].seven, .row input[type="datetime"].seven, input[type="email"].seven, .row input[type="email"].seven, input[type="number"].seven, .row input[type="number"].seven, input[type="search"].seven, .row input[type="search"].seven, input[type="tel"].seven, .row input[type="tel"].seven, input[type="time"].seven, .row input[type="time"].seven, input[type="url"].seven, .row input[type="url"].seven, textarea.seven, .row textarea.seven { width: 100% !important; }
- input[type="text"].eight, .row input[type="text"].eight, input[type="password"].eight, .row input[type="password"].eight, input[type="date"].eight, .row input[type="date"].eight, input[type="datetime"].eight, .row input[type="datetime"].eight, input[type="email"].eight, .row input[type="email"].eight, input[type="number"].eight, .row input[type="number"].eight, input[type="search"].eight, .row input[type="search"].eight, input[type="tel"].eight, .row input[type="tel"].eight, input[type="time"].eight, .row input[type="time"].eight, input[type="url"].eight, .row input[type="url"].eight, textarea.eight, .row textarea.eight { width: 100% !important; }
- input[type="text"].nine, .row input[type="text"].nine, input[type="password"].nine, .row input[type="password"].nine, input[type="date"].nine, .row input[type="date"].nine, input[type="datetime"].nine, .row input[type="datetime"].nine, input[type="email"].nine, .row input[type="email"].nine, input[type="number"].nine, .row input[type="number"].nine, input[type="search"].nine, .row input[type="search"].nine, input[type="tel"].nine, .row input[type="tel"].nine, input[type="time"].nine, .row input[type="time"].nine, input[type="url"].nine, .row input[type="url"].nine, textarea.nine, .row textarea.nine { width: 100% !important; }
- input[type="text"].ten, .row input[type="text"].ten, input[type="password"].ten, .row input[type="password"].ten, input[type="date"].ten, .row input[type="date"].ten, input[type="datetime"].ten, .row input[type="datetime"].ten, input[type="email"].ten, .row input[type="email"].ten, input[type="number"].ten, .row input[type="number"].ten, input[type="search"].ten, .row input[type="search"].ten, input[type="tel"].ten, .row input[type="tel"].ten, input[type="time"].ten, .row input[type="time"].ten, input[type="url"].ten, .row input[type="url"].ten, textarea.ten, .row textarea.ten { width: 100% !important; }
- input[type="text"].eleven, .row input[type="text"].eleven, input[type="password"].eleven, .row input[type="password"].eleven, input[type="date"].eleven, .row input[type="date"].eleven, input[type="datetime"].eleven, .row input[type="datetime"].eleven, input[type="email"].eleven, .row input[type="email"].eleven, input[type="number"].eleven, .row input[type="number"].eleven, input[type="search"].eleven, .row input[type="search"].eleven, input[type="tel"].eleven, .row input[type="tel"].eleven, input[type="time"].eleven, .row input[type="time"].eleven, input[type="url"].eleven, .row input[type="url"].eleven, textarea.eleven, .row textarea.eleven { width: 100% !important; }
- input[type="text"].twelve, .row input[type="text"].twelve, input[type="password"].twelve, .row input[type="password"].twelve, input[type="date"].twelve, .row input[type="date"].twelve, input[type="datetime"].twelve, .row input[type="datetime"].twelve, input[type="email"].twelve, .row input[type="email"].twelve, input[type="number"].twelve, .row input[type="number"].twelve, input[type="search"].twelve, .row input[type="search"].twelve, input[type="tel"].twelve, .row input[type="tel"].twelve, input[type="time"].twelve, .row input[type="time"].twelve, input[type="url"].twelve, .row input[type="url"].twelve, textarea.twelve, .row textarea.twelve { width: 100% !important; } }
-/* Custom Forms ---------------------- */
-form.custom { /* Custom input, disabled */ }
-form.custom span.custom { display: inline-block; width: 16px; height: 16px; position: relative; top: 2px; border: solid 1px #ccc; background: #fff; }
-form.custom span.custom.radio { -webkit-border-radius: 100px; -moz-border-radius: 100px; -ms-border-radius: 100px; -o-border-radius: 100px; border-radius: 100px; }
-form.custom span.custom.checkbox:before { content: ""; display: block; line-height: 0.8; height: 14px; width: 14px; text-align: center; position: absolute; top: 0; left: 0; font-size: 14px; color: #fff; }
-form.custom span.custom.radio.checked:before { content: ""; display: block; width: 8px; height: 8px; -webkit-border-radius: 100px; -moz-border-radius: 100px; -ms-border-radius: 100px; -o-border-radius: 100px; border-radius: 100px; background: #222; position: relative; top: 3px; left: 3px; }
-form.custom span.custom.checkbox.checked:before { content: "\00d7"; color: #222; }
-form.custom div.custom.dropdown { display: block; position: relative; width: auto; height: 28px; margin-bottom: 9px; margin-top: 2px; }
-form.custom div.custom.dropdown a.current { display: block; width: auto; line-height: 26px; min-height: 28px; padding: 0; padding-left: 6px; padding-right: 38px; border: solid 1px #ddd; color: #141414; background-color: #fff; white-space: nowrap; }
-form.custom div.custom.dropdown a.selector { position: absolute; width: 27px; height: 28px; display: block; right: 0; top: 0; border: solid 1px #ddd; }
-form.custom div.custom.dropdown a.selector:after { content: ""; display: block; content: ""; display: block; width: 0; height: 0; border: solid 5px; border-color: #aaaaaa transparent transparent transparent; position: absolute; left: 50%; top: 50%; margin-top: -2px; margin-left: -5px; }
-form.custom div.custom.dropdown:hover a.selector:after, form.custom div.custom.dropdown.open a.selector:after { content: ""; display: block; width: 0; height: 0; border: solid 5px; border-color: #222222 transparent transparent transparent; }
-form.custom div.custom.dropdown.open ul { display: block; z-index: 10; }
-form.custom div.custom.dropdown.small { width: 134px !important; }
-form.custom div.custom.dropdown.medium { width: 254px !important; }
-form.custom div.custom.dropdown.large { width: 434px !important; }
-form.custom div.custom.dropdown.expand { width: 100% !important; }
-form.custom div.custom.dropdown.open.small ul { width: 134px !important; }
-form.custom div.custom.dropdown.open.medium ul { width: 254px !important; }
-form.custom div.custom.dropdown.open.large ul { width: 434px !important; }
-form.custom div.custom.dropdown.open.expand ul { width: 100% !important; }
-form.custom div.custom.dropdown ul { position: absolute; width: auto; display: none; margin: 0; left: 0; top: 27px; margin: 0; padding: 0; background: #fff; background: rgba(255, 255, 255, 0.95); border: solid 1px #cccccc; }
-form.custom div.custom.dropdown ul li { color: #555; font-size: 13px; cursor: pointer; padding: 3px; padding-left: 6px; padding-right: 38px; min-height: 18px; line-height: 18px; margin: 0; white-space: nowrap; list-style: none; }
-form.custom div.custom.dropdown ul li.selected { background: #cdebf5; color: #000; }
-form.custom div.custom.dropdown ul li.selected:after { content: "\2013"; position: absolute; right: 10px; }
-form.custom div.custom.dropdown ul li:hover { background-color: #e3f4f9; color: #222; }
-form.custom div.custom.dropdown ul li:hover:after { content: "\2013"; position: absolute; right: 10px; color: #8ed3e7; }
-form.custom div.custom.dropdown ul li.selected:hover { background: #cdebf5; cursor: default; color: #000; }
-form.custom div.custom.dropdown ul li.selected:hover:after { color: #000; }
-form.custom div.custom.dropdown ul.show { display: block; }
-form.custom .custom.disabled { background-color: #ddd; }
-
-/* Correct FF custom dropdown height */
-@-moz-document url-prefix() { form.custom div.custom.dropdown a.selector { height: 30px; } }
-
-.lt-ie9 form.custom div.custom.dropdown a.selector { height: 30px; }
-
-/* The Grid ---------------------- */
-.row { width: 1000px; max-width: 100%; min-width: 768px; margin: 0 auto; }
-.row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
-.row.collapse .column, .row.collapse .columns { padding: 0; }
-.row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
-.row .row.collapse { margin: 0; }
-
-.column, .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
-.column.centered, .columns.centered { float: none; margin: 0 auto; }
-
-[class*="column"] + [class*="column"]:last-child { float: right; }
-
-[class*="column"] + [class*="column"].end { float: left; }
-
-.one, .row .one { width: 8.33333%; }
-
-.two, .row .two { width: 16.66667%; }
-
-.three, .row .three { width: 25%; }
-
-.four, .row .four { width: 33.33333%; }
-
-.five, .row .five { width: 41.66667%; }
-
-.six, .row .six { width: 50%; }
-
-.seven, .row .seven { width: 58.33333%; }
-
-.eight, .row .eight { width: 66.66667%; }
-
-.nine, .row .nine { width: 75%; }
-
-.ten, .row .ten { width: 83.33333%; }
-
-.eleven, .row .eleven { width: 91.66667%; }
-
-.twelve, .row .twelve { width: 100%; }
-
-.row .offset-by-one { margin-left: 8.33333%; }
-
-.row .offset-by-two { margin-left: 16.66667%; }
-
-.row .offset-by-three { margin-left: 25%; }
-
-.row .offset-by-four { margin-left: 33.33333%; }
-
-.row .offset-by-five { margin-left: 41.66667%; }
-
-.row .offset-by-six { margin-left: 50%; }
-
-.row .offset-by-seven { margin-left: 58.33333%; }
-
-.row .offset-by-eight { margin-left: 66.66667%; }
-
-.row .offset-by-nine { margin-left: 75%; }
-
-.row .offset-by-ten { margin-left: 83.33333%; }
-
-.push-two { left: 16.66667%; }
-
-.pull-two { right: 16.66667%; }
-
-.push-three { left: 25%; }
-
-.pull-three { right: 25%; }
-
-.push-four { left: 33.33333%; }
-
-.pull-four { right: 33.33333%; }
-
-.push-five { left: 41.66667%; }
-
-.pull-five { right: 41.66667%; }
-
-.push-six { left: 50%; }
-
-.pull-six { right: 50%; }
-
-.push-seven { left: 58.33333%; }
-
-.pull-seven { right: 58.33333%; }
-
-.push-eight { left: 66.66667%; }
-
-.pull-eight { right: 66.66667%; }
-
-.push-nine { left: 75%; }
-
-.pull-nine { right: 75%; }
-
-.push-ten { left: 83.33333%; }
-
-.pull-ten { right: 83.33333%; }
-
-img, object, embed { max-width: 100%; height: auto; }
-
-object, embed { height: 100%; }
-
-img { -ms-interpolation-mode: bicubic; }
-
-#map_canvas img, .map_canvas img { max-width: none!important; }
-
-/* Nicolas Gallagher's micro clearfix */
-.row { *zoom: 1; }
-.row:before, .row:after { content: ""; display: table; }
-.row:after { clear: both; }
-
-/* Mobile Grid and Overrides ---------------------- */
-@media only screen and (max-width: 767px) { body { -webkit-text-size-adjust: none; -ms-text-size-adjust: none; width: 100%; min-width: 0; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
- .row { width: auto; min-width: 0; margin-left: 0; margin-right: 0; }
- .column, .columns { width: auto !important; float: none; }
- .column:last-child, .columns:last-child { float: none; }
- [class*="column"] + [class*="column"]:last-child { float: none; }
- .column:before, .columns:before, .column:after, .columns:after { content: ""; display: table; }
- .column:after, .columns:after { clear: both; }
- .offset-by-one, .offset-by-two, .offset-by-three, .offset-by-four, .offset-by-five, .offset-by-six, .offset-by-seven, .offset-by-eight, .offset-by-nine, .offset-by-ten { margin-left: 0 !important; }
- .push-two, .push-three, .push-four, .push-five, .push-six, .push-seven, .push-eight, .push-nine, .push-ten { left: auto; }
- .pull-two, .pull-three, .pull-four, .pull-five, .pull-six, .pull-seven, .pull-eight, .pull-nine, .pull-ten { right: auto; }
- /* Mobile 4-column Grid */
- .row .mobile-one { width: 25% !important; float: left; padding: 0 15px; }
- .row .mobile-one:last-child { float: right; }
- .row.collapse .mobile-one { padding: 0; }
- .row .mobile-two { width: 50% !important; float: left; padding: 0 15px; }
- .row .mobile-two:last-child { float: right; }
- .row.collapse .mobile-two { padding: 0; }
- .row .mobile-three { width: 75% !important; float: left; padding: 0 15px; }
- .row .mobile-three:last-child { float: right; }
- .row.collapse .mobile-three { padding: 0; }
- .row .mobile-four { width: 100% !important; float: left; padding: 0 15px; }
- .row .mobile-four:last-child { float: right; }
- .row.collapse .mobile-four { padding: 0; }
- .push-one-mobile { left: 25%; }
- .pull-one-mobile { right: 25%; }
- .push-two-mobile { left: 50%; }
- .pull-two-mobile { right: 50%; }
- .push-three-mobile { left: 75%; }
- .pull-three-mobile { right: 75%; } }
-/* Block Grids ---------------------- */
-/* These are 2-up, 3-up, 4-up and 5-up ULs, suited
-for repeating blocks of content. Add 'mobile' to
-them to switch them just like the layout grid
-(one item per line) on phones
-
-For IE7/8 compatibility block-grid items need to be
-the same height. You can optionally uncomment the
-lines below to support arbitrary height, but know
-that IE7/8 do not support :nth-child.
--------------------------------------------------- */
-.block-grid { display: block; overflow: hidden; padding: 0; }
-.block-grid > li { display: block; height: auto; float: left; }
-.block-grid.one-up { margin: 0; }
-.block-grid.one-up > li { width: 100%; padding: 0 0 15px; }
-.block-grid.two-up { margin: 0 -15px; }
-.block-grid.two-up > li { width: 50%; padding: 0 15px 15px; }
-.block-grid.two-up > li:nth-child(2n+1) { clear: both; }
-.block-grid.three-up { margin: 0 -12px; }
-.block-grid.three-up > li { width: 33.33%; padding: 0 12px 12px; }
-.block-grid.three-up > li:nth-child(3n+1) { clear: both; }
-.block-grid.four-up { margin: 0 -10px; }
-.block-grid.four-up > li { width: 25%; padding: 0 10px 10px; }
-.block-grid.four-up > li:nth-child(4n+1) { clear: both; }
-.block-grid.five-up { margin: 0 -8px; }
-.block-grid.five-up > li { width: 20%; padding: 0 8px 8px; }
-.block-grid.five-up > li:nth-child(5n+1) { clear: both; }
-
-/* Mobile Block Grids */
-@media only screen and (max-width: 767px) { .block-grid.mobile > li { float: none; width: 100%; margin-left: 0; }
- .block-grid > li { clear: none !important; }
- .block-grid.mobile-two-up > li { width: 50%; }
- .block-grid.mobile-two-up > li:nth-child(2n+1) { clear: both; }
- .block-grid.mobile-three-up > li { width: 33.33%; }
- .block-grid.mobile-three-up > li:nth-child(3n+1) { clear: both !important; }
- .block-grid.mobile-four-up > li { width: 25%; }
- .block-grid.mobile-four-up > li:nth-child(4n+1) { clear: both; }
- .block-grid.mobile-five-up > li:nth-child(5n+1) { clear: both; } }
-/* Requires globals.css */
-/* Normal Buttons ---------------------- */
-.button { width: auto; background: #fd7800; border: 1px solid #ce6200; -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; color: white; cursor: pointer; display: inline-block; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 14px; font-weight: bold; line-height: 1; margin: 0; outline: none; padding: 10px 20px 11px; position: relative; text-align: center; text-decoration: none; -webkit-transition: background-color 0.15s ease-in-out; -moz-transition: background-color 0.15s ease-in-out; -o-transition: background-color 0.15s ease-in-out; transition: background-color 0.15s ease-in-out; /* Hovers */ /* Sizes */ /* Colors */ /* Radii */ /* Layout */ /* Disabled ---------- */ }
-.button:hover { color: white; background-color: #ce6200; }
-.button:active { -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset; -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset; }
-.button:focus { -webkit-box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; color: white; }
-.button.large { font-size: 17px; padding: 15px 30px 16px; }
-.button.medium { font-size: 14px; }
-.button.small { font-size: 11px; padding: 7px 14px 8px; }
-.button.tiny { font-size: 10px; padding: 5px 10px 6px; }
-.button.expand { width: 100%; text-align: center; }
-.button.primary { background-color: #fd7800; border: 1px solid #1e728c; }
-.button.primary:hover { background-color: #2284a1; }
-.button.primary:focus { -webkit-box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 4px #fd7800, 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
-.button.success { background-color: #5da423; border: 1px solid #396516; }
-.button.success:hover { background-color: #457a1a; }
-.button.success:focus { -webkit-box-shadow: 0 0 5px #5da423, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 5px #5da423, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 5px #5da423, 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
-.button.alert { background-color: #c60f13; border: 1px solid #7f0a0c; }
-.button.alert:hover { background-color: #970b0e; }
-.button.alert:focus { -webkit-box-shadow: 0 0 4px #c60f13, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 4px #c60f13, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 4px #c60f13, 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
-.button.secondary { background-color: #e9e9e9; color: #1d1d1d; border: 1px solid #c3c3c3; }
-.button.secondary:hover { background-color: #d0d0d0; }
-.button.secondary:focus { -webkit-box-shadow: 0 0 5px #e9e9e9, 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 0 5px #e9e9e9, 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 0 5px #e9e9e9, 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
-.button.radius { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
-.button.round { -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; }
-.button.full-width { width: 100%; text-align: center; padding-left: 0px !important; padding-right: 0px !important; }
-.button.left-align { text-align: left; text-indent: 12px; }
-.button.disabled, .button[disabled] { opacity: 0.6; cursor: default; background: #fd7800; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; }
-.button.disabled :hover, .button[disabled] :hover { background: #fd7800; }
-.button.disabled.success, .button[disabled].success { background-color: #5da423; }
-.button.disabled.success:hover, .button[disabled].success:hover { background-color: #5da423; }
-.button.disabled.alert, .button[disabled].alert { background-color: #c60f13; }
-.button.disabled.alert:hover, .button[disabled].alert:hover { background-color: #c60f13; }
-.button.disabled.secondary, .button[disabled].secondary { background-color: #e9e9e9; }
-.button.disabled.secondary:hover, .button[disabled].secondary:hover { background-color: #e9e9e9; }
-
-/* Don't use native buttons on iOS */
-input[type=submit].button, button.button { -webkit-appearance: none; }
-
-@media only screen and (max-width: 767px) { .button { display: block; }
- button.button, input[type="submit"].button { width: 100%; padding-left: 0; padding-right: 0; } }
-/* Correct FF button padding */
-@-moz-document url-prefix() { button::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner, input[type="file"] > input[type="button"]::-moz-focus-inner { border: none; padding: 0; }
- input[type="submit"].tiny.button { padding: 3px 10px 4px; }
- input[type="submit"].small.button { padding: 5px 14px 6px; }
- input[type="submit"].button, input[type=submit].medium.button { padding: 8px 20px 9px; }
- input[type="submit"].large.button { padding: 13px 30px 14px; } }
-
-/* Buttons with Dropdowns ---------------------- */
-.button.dropdown { position: relative; padding-right: 44px; /* Sizes */ /* Triangles */ /* Flyout List */ /* Split Dropdown Buttons */ }
-.button.dropdown.large { padding-right: 60px; }
-.button.dropdown.small { padding-right: 28px; }
-.button.dropdown.tiny { padding-right: 20px; }
-.button.dropdown:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: white transparent transparent transparent; position: absolute; top: 50%; right: 20px; margin-top: -2px; }
-.button.dropdown.large:after { content: ""; display: block; width: 0; height: 0; border: solid 7px; border-color: white transparent transparent transparent; margin-top: -3px; right: 30px; }
-.button.dropdown.small:after { content: ""; display: block; width: 0; height: 0; border: solid 5px; border-color: white transparent transparent transparent; margin-top: -2px; right: 14px; }
-.button.dropdown.tiny:after { content: ""; display: block; width: 0; height: 0; border: solid 4px; border-color: white transparent transparent transparent; margin-top: -1px; right: 10px; }
-.button.dropdown > ul { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; display: none; position: absolute; left: -1px; background: #fff; background: rgba(255, 255, 255, 0.95); list-style: none; margin: 0; padding: 0; border: 1px solid #cccccc; border-top: none; min-width: 100%; z-index: 40; }
-.button.dropdown > ul li { width: 100%; cursor: pointer; padding: 0; min-height: 18px; line-height: 18px; margin: 0; white-space: nowrap; list-style: none; }
-.button.dropdown > ul li a { display: block; color: #555; font-size: 13px; font-weight: normal; padding: 6px 14px; text-align: left; }
-.button.dropdown > ul li:hover { background-color: #e3f4f9; color: #222; }
-.button.dropdown > ul li.divider { min-height: 0; padding: 0; height: 1px; margin: 4px 0; background: #ededed; }
-.button.dropdown.up > ul { border-top: 1px solid #cccccc; border-bottom: none; }
-.button.dropdown ul.no-hover.show-dropdown { display: block !important; }
-.button.dropdown:hover > ul.no-hover { display: none; }
-.button.dropdown.split { padding: 0; position: relative; /* Sizes */ /* Triangle Spans */ /* Colors */ }
-.button.dropdown.split:after { display: none; }
-.button.dropdown.split:hover { background-color: #fd7800; }
-.button.dropdown.split.alert:hover { background-color: #c60f13; }
-.button.dropdown.split.success:hover { background-color: #5da423; }
-.button.dropdown.split.secondary:hover { background-color: #e9e9e9; }
-.button.dropdown.split > a { color: white; display: block; padding: 10px 50px 11px 20px; padding-left: 20px; padding-right: 50px; -webkit-transition: background-color 0.15s ease-in-out; -moz-transition: background-color 0.15s ease-in-out; -o-transition: background-color 0.15s ease-in-out; transition: background-color 0.15s ease-in-out; }
-.button.dropdown.split > a:hover { background-color: #2284a1; }
-.button.dropdown.split.large > a { padding: 15px 75px 16px 30px; padding-left: 30px; padding-right: 75px; }
-.button.dropdown.split.small > a { padding: 7px 35px 8px 14px; padding-left: 14px; padding-right: 35px; }
-.button.dropdown.split.tiny > a { padding: 5px 25px 6px 10px; padding-left: 10px; padding-right: 25px; }
-.button.dropdown.split > span { background-color: #fd7800; position: absolute; right: 0; top: 0; height: 100%; width: 30px; border-left: 1px solid #1e728c; -webkit-box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5) inset; -webkit-transition: background-color 0.15s ease-in-out; -moz-transition: background-color 0.15s ease-in-out; -o-transition: background-color 0.15s ease-in-out; transition: background-color 0.15s ease-in-out; }
-.button.dropdown.split > span:hover { background-color: #2284a1; }
-.button.dropdown.split > span:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: white transparent transparent transparent; position: absolute; top: 50%; left: 50%; margin-left: -6px; margin-top: -2px; }
-.button.dropdown.split.secondary > span:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: #1d1d1d transparent transparent transparent; }
-.button.dropdown.split.large span { width: 45px; }
-.button.dropdown.split.small span { width: 21px; }
-.button.dropdown.split.tiny span { width: 15px; }
-.button.dropdown.split.large span:after { content: ""; display: block; width: 0; height: 0; border: solid 7px; border-color: white transparent transparent transparent; margin-top: -3px; margin-left: -7px; }
-.button.dropdown.split.small span:after { content: ""; display: block; width: 0; height: 0; border: solid 4px; border-color: white transparent transparent transparent; margin-top: -1px; margin-left: -4px; }
-.button.dropdown.split.tiny span:after { content: ""; display: block; width: 0; height: 0; border: solid 3px; border-color: white transparent transparent transparent; margin-top: -1px; margin-left: -3px; }
-.button.dropdown.split.alert > span { background-color: #c60f13; border-left-color: #7f0a0c; }
-.button.dropdown.split.success > span { background-color: #5da423; border-left-color: #396516; }
-.button.dropdown.split.secondary > span { background-color: #e9e9e9; border-left-color: #c3c3c3; }
-.button.dropdown.split.secondary > a { color: #1d1d1d; }
-.button.dropdown.split.alert > a:hover, .button.dropdown.split.alert > span:hover { background-color: #970b0e; }
-.button.dropdown.split.success > a:hover, .button.dropdown.split.success > span:hover { background-color: #457a1a; }
-.button.dropdown.split.secondary > a:hover, .button.dropdown.split.secondary > span:hover { background-color: #d0d0d0; }
-
-/* Button Groups ---------------------- */
-ul.button-group { list-style: none; padding: 0; margin: 0 0 12px; *zoom: 1; }
-ul.button-group:before, ul.button-group:after { content: ""; display: table; }
-ul.button-group:after { clear: both; }
-ul.button-group li { padding: 0; margin: 0 0 0 -1px; float: left; }
-ul.button-group li:first-child { margin-left: 0; }
-ul.button-group.radius li a.button, ul.button-group.radius li a.button.radius, ul.button-group.radius li a.button-rounded { -webkit-border-radius: 0px; -moz-border-radius: 0px; -ms-border-radius: 0px; -o-border-radius: 0px; border-radius: 0px; }
-ul.button-group.radius li:first-child a.button, ul.button-group.radius li:first-child a.button.radius { -moz-border-radius-left3px: 5px; -webkit-border-left-3px-radius: 5px; border-left-3px-radius: 5px; }
-ul.button-group.radius li:first-child a.button.rounded { -moz-border-radius-left1000px: 5px; -webkit-border-left-1000px-radius: 5px; border-left-1000px-radius: 5px; }
-ul.button-group.radius li:last-child a.button, ul.button-group.radius li:last-child a.button.radius { -moz-border-radius-right3px: 5px; -webkit-border-right-3px-radius: 5px; border-right-3px-radius: 5px; }
-ul.button-group.radius li:last-child a.button.rounded { -moz-border-radius-right1000px: 5px; -webkit-border-right-1000px-radius: 5px; border-right-1000px-radius: 5px; }
-ul.button-group.even a.button { width: 100%; }
-ul.button-group.even.two-up li { width: 50%; }
-ul.button-group.even.three-up li { width: 33.3%; }
-ul.button-group.even.three-up li:first-child { width: 33.4%; }
-ul.button-group.even.four-up li { width: 25%; }
-ul.button-group.even.five-up li { width: 20%; }
-
-@media only screen and (max-width: 767px) { .button-group button.button, .button-group input[type="submit"].button { width: auto; padding: 10px 20px 11px; }
- .button-group button.button.large, .button-group input[type="submit"].button.large { padding: 15px 30px 16px; }
- .button-group button.button.medium, .button-group input[type="submit"].button.medium { padding: 10px 20px 11px; }
- .button-group button.button.small, .button-group input[type="submit"].button.small { padding: 7px 14px 8px; }
- .button-group button.button.tiny, .button-group input[type="submit"].button.tiny { padding: 5px 10px 6px; }
- .button-group.even button.button, .button-group.even input[type="submit"].button { width: 100%; padding-left: 0; padding-right: 0; } }
-div.button-bar { overflow: hidden; }
-div.button-bar ul.button-group { float: left; margin-right: 8px; }
-div.button-bar ul.button-group:last-child { margin-left: 0; }
-
-/* CSS for jQuery Reveal Plugin Maintained for Foundation. foundation.zurb.com Free to use under the MIT license. http://www.opensource.org/licenses/mit-license.php */
-/* Reveal Modals ---------------------- */
-.reveal-modal-bg { position: fixed; height: 100%; width: 100%; background: #000; background: rgba(0, 0, 0, 0.45); z-index: 40; display: none; top: 0; left: 0; }
-
-.reveal-modal { background: white; visibility: hidden; display: none; top: 100px; left: 50%; margin-left: -260px; width: 520px; position: absolute; z-index: 41; padding: 30px; -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); }
-.reveal-modal *:first-child { margin-top: 0; }
-.reveal-modal *:last-child { margin-bottom: 0; }
-.reveal-modal .close-reveal-modal { font-size: 22px; font-size: 2.2rem; line-height: .5; position: absolute; top: 8px; right: 11px; color: #aaa; text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.6); font-weight: bold; cursor: pointer; }
-.reveal-modal.small { width: 30%; margin-left: -15%; }
-.reveal-modal.medium { width: 40%; margin-left: -20%; }
-.reveal-modal.large { width: 60%; margin-left: -30%; }
-.reveal-modal.xlarge { width: 70%; margin-left: -35%; }
-.reveal-modal.expand { width: 90%; margin-left: -45%; }
-.reveal-modal .row { min-width: 0; margin-bottom: 10px; }
-
-/* Mobile */
-@media only screen and (max-width: 767px) { .reveal-modal-bg { position: absolute; }
- .reveal-modal, .reveal-modal.small, .reveal-modal.medium, .reveal-modal.large, .reveal-modal.xlarge { width: 80%; top: 15px; left: 50%; margin-left: -40%; padding: 20px; height: auto; } }
- /* NOTES Close button entity is ×
- Example markup <div id="myModal" class="reveal-modal"> <h2>Awesome. I have it.</h2> <p class="lead">Your couch. I it's mine.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ultrices aliquet placerat. Duis pulvinar orci et nisi euismod vitae tempus lorem consectetur. Duis at magna quis turpis mattis venenatis eget id diam. </p> <a class="close-reveal-modal">×</a> </div> */
-/* Requires -globals.css -app.js */
-/* Tabs ---------------------- */
-dl.tabs { border-bottom: solid 1px #e6e6e6; display: block; height: 40px; padding: 0; margin-bottom: 20px; }
-dl.tabs.contained { margin-bottom: 0; }
-dl.tabs dt { color: #b3b3b3; cursor: default; display: block; float: left; font-size: 12px; height: 40px; line-height: 40px; padding: 0; padding-right: 9px; padding-left: 20px; width: auto; text-transform: uppercase; }
-dl.tabs dt:first-child { padding: 0; padding-right: 9px; }
-dl.tabs dd { display: block; float: left; padding: 0; margin: 0; }
-dl.tabs dd a { color: #6f6f6f; display: block; font-size: 14px; height: 40px; line-height: 40px; padding: 0px 23.8px; }
-dl.tabs dd a:focus { font-weight: bold; color: #fd7800; }
-dl.tabs dd.active { border-top: 3px solid #fd7800; margin-top: -3px; }
-dl.tabs dd.active a { cursor: default; color: #3c3c3c; background: #fff; border-left: 1px solid #e6e6e6; border-right: 1px solid #e6e6e6; font-weight: bold; }
-dl.tabs dd:first-child { margin-left: 0; }
-dl.tabs.vertical { height: auto; border-bottom: 1px solid #e6e6e6; }
-dl.tabs.vertical dt, dl.tabs.vertical dd { float: none; height: auto; }
-dl.tabs.vertical dd { border-left: 3px solid #cccccc; }
-dl.tabs.vertical dd a { background: #f2f2f2; border: none; border: 1px solid #e6e6e6; border-width: 1px 1px 0 0; color: #555; display: block; font-size: 14px; height: auto; line-height: 1; padding: 15px 20px; -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
-dl.tabs.vertical dd.active { margin-top: 0; border-top: 1px solid #4d4d4d; border-left: 4px solid #1a1a1a; }
-dl.tabs.vertical dd.active a { background: #4d4d4d; border: none; color: #fff; height: auto; margin: 0; position: static; top: 0; -webkit-box-shadow: 0 0 0; -moz-box-shadow: 0 0 0; box-shadow: 0 0 0; }
-dl.tabs.vertical dd:first-child a.active { margin: 0; }
-dl.tabs.pill { border-bottom: none; margin-bottom: 10px; }
-dl.tabs.pill dd { margin-right: 10px; }
-dl.tabs.pill dd:last-child { margin-right: 0; }
-dl.tabs.pill dd a { -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; background: #e6e6e6; height: 26px; line-height: 26px; color: #666; }
-dl.tabs.pill dd.active { border: none; margin-top: 0; }
-dl.tabs.pill dd.active a { background-color: #fd7800; border: none; color: #fff; }
-dl.tabs.pill.contained { border-bottom: solid 1px #eee; margin-bottom: 0; }
-dl.tabs.pill.two-up dd, dl.tabs.pill.three-up dd, dl.tabs.pill.four-up dd, dl.tabs.pill.five-up dd { margin-right: 0; }
-dl.tabs.two-up dt a, dl.tabs.two-up dd a, dl.tabs.three-up dt a, dl.tabs.three-up dd a, dl.tabs.four-up dt a, dl.tabs.four-up dd a, dl.tabs.five-up dt a, dl.tabs.five-up dd a { padding: 0 17px; text-align: center; overflow: hidden; }
-dl.tabs.two-up dt, dl.tabs.two-up dd { width: 50%; }
-dl.tabs.three-up dt, dl.tabs.three-up dd { width: 33.33%; }
-dl.tabs.four-up dt, dl.tabs.four-up dd { width: 25%; }
-dl.tabs.five-up dt, dl.tabs.five-up dd { width: 20%; }
-
-ul.tabs-content { display: block; margin: 0 0 20px; padding: 0; }
-ul.tabs-content > li { display: none; }
-ul.tabs-content > li.active { display: block; }
-ul.tabs-content.contained { padding: 0; }
-ul.tabs-content.contained > li { border: solid 0 #e6e6e6; border-width: 0 1px 1px 1px; padding: 20px; }
-ul.tabs-content.contained.vertical > li { border-width: 1px 1px 1px 1px; }
-
-.no-js ul.tabs-content > li { display: block; }
-
-@media only screen and (max-width: 767px) { dl.tabs.mobile { width: auto; margin: 20px -20px 40px; height: auto; }
- dl.tabs.mobile dt, dl.tabs.mobile dd { float: none; height: auto; }
- dl.tabs.mobile dd a { display: block; width: auto; height: auto; padding: 18px 20px; line-height: 1; border: solid 0 #ccc; border-width: 1px 0 0; margin: 0; color: #555; background: #eee; font-size: 15px; font-size: 1.5rem; }
- dl.tabs.mobile dd a.active { height: auto; margin: 0; border-width: 1px 0 0; }
- .tabs.mobile { border-bottom: solid 1px #ccc; height: auto; }
- .tabs.mobile dd a { padding: 18px 20px; border: none; border-left: none; border-right: none; border-top: 1px solid #ccc; background: #fff; }
- .tabs.mobile dd a.active { border: none; background: #fd7800; color: #fff; margin: 0; position: static; top: 0; height: auto; }
- .tabs.mobile dd:first-child a.active { margin: 0; }
- dl.contained.mobile { margin-bottom: 0; }
- dl.contained.tabs.mobile dd a { padding: 18px 20px; }
- dl.tabs.mobile + ul.contained { margin-left: -20px; margin-right: -20px; border-width: 0 0 1px 0; } }
-/* Requires: globals.css */
-/* Table of Contents
-
-:: Visibility
-:: Alerts
-:: Labels
-:: Tooltips
-:: Panels
-:: Accordion
-:: Side Nav
-:: Sub Nav
-:: Pagination
-:: Breadcrumbs
-:: Lists
-:: Link Lists
-:: Keystroke Chars
-:: Image Thumbnails
-:: Video
-:: Tables
-:: Microformats
-:: Progress Bars
-
-*/
-/* Visibility Classes ---------------------- */
-/* Standard (large) display targeting */
-.show-for-small, .show-for-medium, .show-for-medium-down, .hide-for-large, .hide-for-large-up, .show-for-xlarge { display: none !important; }
-
-.hide-for-xlarge, .show-for-large, .show-for-large-up, .hide-for-small, .hide-for-medium, .hide-for-medium-down { display: block !important; }
-
-/* Very large display targeting */
-@media only screen and (min-width: 1441px) { .hide-for-small, .hide-for-medium, .hide-for-medium-down, .hide-for-large, .show-for-large-up, .show-for-xlarge { display: block !important; }
- .show-for-small, .show-for-medium, .show-for-medium-down, .show-for-large, .hide-for-large-up, .hide-for-xlarge { display: none !important; } }
-/* Medium display targeting */
-@media only screen and (max-width: 1279px) and (min-width: 768px) { .hide-for-small, .show-for-medium, .show-for-medium-down, .hide-for-large, .hide-for-large-up, .hide-for-xlarge { display: block !important; }
- .show-for-small, .hide-for-medium, .hide-for-medium-down, .show-for-large, .show-for-large-up, .show-for-xlarge { display: none !important; } }
-/* Small display targeting */
-@media only screen and (max-width: 767px) { .show-for-small, .hide-for-medium, .show-for-medium-down, .hide-for-large, .hide-for-large-up, .hide-for-xlarge { display: block !important; }
- .hide-for-small, .show-for-medium, .hide-for-medium-down, .show-for-large, .show-for-large-up, .show-for-xlarge { display: none !important; } }
-/* Orientation targeting */
-.show-for-landscape, .hide-for-portrait { display: block !important; }
-
-.hide-for-landscape, .show-for-portrait { display: none !important; }
-
-@media screen and (orientation: landscape) { .show-for-landscape, .hide-for-portrait { display: block !important; }
- .hide-for-landscape, .show-for-portrait { display: none !important; } }
-@media screen and (orientation: portrait) { .show-for-portrait, .hide-for-landscape { display: block !important; }
- .hide-for-portrait, .show-for-landscape { display: none !important; } }
-/* Touch-enabled device targeting */
-.show-for-touch { display: none !important; }
-
-.hide-for-touch { display: block !important; }
-
-.touch .show-for-touch { display: block !important; }
-
-.touch .hide-for-touch { display: none !important; }
-
-/* Specific overrides for elements that require something other than display: block */
-table.show-for-xlarge, table.show-for-large, table.hide-for-small, table.hide-for-medium { display: table !important; }
-
-@media only screen and (max-width: 1279px) and (min-width: 768px) { .touch table.hide-for-xlarge, .touch table.hide-for-large, .touch table.hide-for-small, .touch table.show-for-medium { display: table !important; } }
-@media only screen and (max-width: 767px) { table.hide-for-xlarge, table.hide-for-large, table.hide-for-medium, table.show-for-small { display: table !important; } }
-/* Alerts ---------------------- */
-div.alert-box { display: block; padding: 6px 7px 7px; font-weight: bold; font-size: 14px; color: white; background-color: #fd7800; border: 1px solid rgba(0, 0, 0, 0.1); margin-bottom: 12px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; text-shadow: 0 -1px rgba(0, 0, 0, 0.3); position: relative; }
-div.alert-box.success { background-color: #5da423; color: #fff; text-shadow: 0 -1px rgba(0, 0, 0, 0.3); }
-div.alert-box.alert { background-color: #c60f13; color: #fff; text-shadow: 0 -1px rgba(0, 0, 0, 0.3); }
-div.alert-box.secondary { background-color: #e9e9e9; color: #505050; text-shadow: 0 1px rgba(255, 255, 255, 0.3); }
-div.alert-box a.close { color: #333; position: absolute; right: 4px; top: -1px; font-size: 17px; opacity: 0.2; padding: 4px; }
-div.alert-box a.close:hover, div.alert-box a.close:focus { opacity: 0.4; }
-
-/* Labels ---------------------- */
-
-
-/* Tooltips ---------------------- */
-.has-tip { border-bottom: dotted 1px #cccccc; cursor: help; font-weight: bold; color: #333333; }
-.has-tip:hover { border-bottom: dotted 1px #196177; color: #fd7800; }
-.has-tip.tip-left, .has-tip.tip-right { float: none !important; }
-
-.tooltip { display: none; background: black; background: rgba(0, 0, 0, 0.85); position: absolute; color: white; font-weight: bold; font-size: 12px; font-size: 1.2rem; padding: 5px; z-index: 999; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; line-height: normal; }
-.tooltip > .nub { display: block; width: 0; height: 0; border: solid 5px; border-color: transparent transparent black transparent; border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent; position: absolute; top: -10px; left: 10px; }
-.tooltip.tip-override > .nub { border-color: transparent transparent black transparent !important; border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent !important; top: -10px !important; }
-.tooltip.tip-top > .nub { border-color: black transparent transparent transparent; border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent; top: auto; bottom: -10px; }
-.tooltip.tip-left, .tooltip.tip-right { float: none !important; }
-.tooltip.tip-left > .nub { border-color: transparent transparent transparent black; border-color: transparent transparent transparent rgba(0, 0, 0, 0.85); right: -10px; left: auto; }
-.tooltip.tip-right > .nub { border-color: transparent black transparent transparent; border-color: transparent rgba(0, 0, 0, 0.85) transparent transparent; right: auto; left: -10px; }
-.tooltip.noradius { -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; }
-.tooltip.opened { color: #fd7800 !important; border-bottom: dotted 1px #196177 !important; }
-
-.tap-to-close { display: block; font-size: 10px; font-size: 1rem; color: #888888; font-weight: normal; }
-
-@media only screen and (max-width: 767px) { .tooltip { font-size: 14px; font-size: 1.4rem; line-height: 1.4; padding: 7px 10px 9px 10px; }
- .tooltip > .nub, .tooltip.top > .nub, .tooltip.left > .nub, .tooltip.right > .nub { border-color: transparent transparent black transparent; border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent; top: -12px; left: 10px; } }
-/* Panels ---------------------- */
-.panel { background: #f2f2f2; border: solid 1px #e6e6e6; margin: 0 0 22px 0; padding: 20px; }
-.panel > :first-child { margin-top: 0; }
-.panel > :last-child { margin-bottom: 0; }
-.panel.callout { background: #fd7800; color: #fff; border-color: #2284a1; -webkit-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5); -moz-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5); box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5); }
-.panel.callout a { color: #fff; }
-.panel.callout .button { background: white; border: none; color: #fd7800; text-shadow: none; }
-.panel.callout .button:hover { background: rgba(255, 255, 255, 0.8); }
-.panel.radius { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
-
-/* Accordion ---------------------- */
-ul.accordion { margin: 0 0 22px 0; border-bottom: 1px solid #e9e9e9; }
-ul.accordion > li { list-style: none; margin: 0; padding: 0; border-top: 1px solid #e9e9e9; }
-ul.accordion > li .title { cursor: pointer; background: #f6f6f6; padding: 15px; margin: 0; position: relative; border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; -webkit-transition: 0.15s background linear; -moz-transition: 0.15s background linear; -o-transition: 0.15s background linear; transition: 0.15s background linear; }
-ul.accordion > li .title h1, ul.accordion > li .title h2, ul.accordion > li .title h3, ul.accordion > li .title h4, ul.accordion > li .title h5 { margin: 0; }
-ul.accordion > li .title:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: transparent #9d9d9d transparent transparent; position: absolute; right: 15px; top: 21px; }
-ul.accordion > li .content { display: none; padding: 15px; }
-ul.accordion > li.active { border-top: 3px solid #fd7800; }
-ul.accordion > li.active .title { background: white; padding-top: 13px; }
-ul.accordion > li.active .title:after { content: ""; display: block; width: 0; height: 0; border: solid 6px; border-color: #9d9d9d transparent transparent transparent; }
-ul.accordion > li.active .content { background: white; display: block; border-left: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; }
-
-/* Side Nav ---------------------- */
-ul.side-nav { display: block; list-style: none; margin: 0; padding: 17px 0; }
-ul.side-nav li { display: block; list-style: none; margin: 0 0 7px 0; }
-ul.side-nav li a { display: block; }
-ul.side-nav li.active a { color: #4d4d4d; font-weight: bold; }
-ul.side-nav li.divider { border-top: 1px solid #e6e6e6; height: 0; padding: 0; }
-
-/* Sub Navs http://www.zurb.com/article/292/how-to-create-simple-and-effective-sub-na ---------------------- */
-dl.sub-nav { display: block; width: auto; overflow: hidden; margin: -4px 0 18px; margin-right: 0; margin-left: -9px; padding-top: 4px; }
-dl.sub-nav dt, dl.sub-nav dd { float: left; display: inline; margin-left: 9px; margin-bottom: 10px; }
-dl.sub-nav dt { color: #999; font-weight: normal; }
-dl.sub-nav dd a { text-decoration: none; -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; }
-dl.sub-nav dd.active a { font-weight: bold; background: #fd7800; color: #fff; padding: 3px 9px; cursor: default; }
-
-/* Pagination ---------------------- */
-ul.pagination { display: block; height: 24px; margin-left: -5px; }
-ul.pagination li { float: left; display: block; height: 24px; color: #999; font-size: 14px; margin-left: 5px; }
-ul.pagination li a { display: block; padding: 1px 7px 1px; color: #555; }
-ul.pagination li:hover a, ul.pagination li a:focus { background: #e6e6e6; }
-ul.pagination li.unavailable a { cursor: default; color: #999; }
-ul.pagination li.unavailable:hover a, ul.pagination li.unavailable a:focus { background: transparent; }
-ul.pagination li.current a { background: #fd7800; color: white; font-weight: bold; cursor: default; }
-ul.pagination li.current a:hover { background: #fd7800; }
-
-/* Breadcrums ---------------------- */
-ul.breadcrumbs { display: block; background: #f6f6f6; padding: 6px 10px 7px; border: 1px solid #e9e9e9; -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; overflow: hidden; }
-ul.breadcrumbs li { margin: 0; padding: 0 12px 0 0; float: left; list-style: none; }
-ul.breadcrumbs li a, ul.breadcrumbs li span { text-transform: uppercase; font-size: 11px; font-size: 1.1rem; padding-left: 12px; }
-ul.breadcrumbs li:first-child a, ul.breadcrumbs li:first-child span { padding-left: 0; }
-ul.breadcrumbs li:before { content: "/"; color: #aaa; }
-ul.breadcrumbs li:first-child:before { content: " "; }
-ul.breadcrumbs li.current a { cursor: default; color: #333; }
-ul.breadcrumbs li:hover a, ul.breadcrumbs li a:focus { text-decoration: underline; }
-ul.breadcrumbs li.current:hover a, ul.breadcrumbs li.current a:focus { text-decoration: none; }
-ul.breadcrumbs li.unavailable a { color: #999; }
-ul.breadcrumbs li.unavailable:hover a, ul.breadcrumbs li.unavailable a:focus { text-decoration: none; color: #999; cursor: default; }
-
-/* Link List */
-ul.link-list { margin: 0 0 17px -22px; padding: 0; list-style: none; overflow: hidden; }
-ul.link-list li { list-style: none; float: left; margin-left: 22px; display: block; }
-ul.link-list li a { display: block; }
-
-/* Keytroke Characters ---------------------- */
-.keystroke, kbd { font-family: "Consolas", "Menlo", "Courier", monospace; font-size: 13px; padding: 2px 4px 0px; margin: 0; background: #ededed; border: solid 1px #dbdbdb; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
-
-/* Image Thumbnails ---------------------- */
-.th { display: block; }
-.th img { display: block; border: solid 4px #fff; -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; -webkit-transition-property: border, box-shadow; -moz-transition-property: border, box-shadow; -o-transition-property: border, box-shadow; transition-property: border, box-shadow; -webkit-transition-duration: 300ms; -moz-transition-duration: 300ms; -o-transition-duration: 300ms; transition-duration: 300ms; }
-.th:hover img { -webkit-box-shadow: 0 0 6px 1px rgba(43, 166, 203, 0.5); -moz-box-shadow: 0 0 6px 1px rgba(43, 166, 203, 0.5); box-shadow: 0 0 6px 1px rgba(43, 166, 203, 0.5); }
-
-/* Video - Mad props to http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ ---------------------- */
-.flex-video { position: relative; padding-top: 25px; padding-bottom: 67.5%; height: 0; margin-bottom: 16px; overflow: hidden; }
-.flex-video.widescreen { padding-bottom: 57.25%; }
-.flex-video.vimeo { padding-top: 0; }
-.flex-video iframe, .flex-video object, .flex-video embed, .flex-video video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
diff --git a/NFD/docs/named_data_theme/static/named_data_doxygen.css b/NFD/docs/named_data_theme/static/named_data_doxygen.css
deleted file mode 100644
index 02bcbf6..0000000
--- a/NFD/docs/named_data_theme/static/named_data_doxygen.css
+++ /dev/null
@@ -1,776 +0,0 @@
-@import url("base.css");
-
-@import url("foundation.css");
-
-table {
- border: 0;
-}
-
-pre {
- padding: 10px;
- background-color: #fafafa;
- color: #222;
- line-height: 1.0em;
- border: 2px solid #C6C9CB;
- font-size: 0.9em;
- /* margin: 1.5em 0 1.5em 0; */
- margin: 0;
- border-right-style: none;
- border-left-style: none;
-}
-
-/* General */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-a:link {
- text-decoration: none;
-}
-a:visited {
- text-decoration: none;
-}
-a:active,
-a:hover {
- text-decoration: none;
-}
-
-h1,h2,h3,h4,h5,h6 {
- color: #000;
- margin-bottom: 18px;
-}
-
-h1 { font-weight: normal; font-size: 24px; line-height: 24px; }
-h2 { font-weight: normal; font-size: 18px; line-height: 18px; }
-h3 { font-weight: bold; font-size: 18px; line-height: 18px; }
-h4 { font-weight: normal; font-size: 18px; line-height: 178px; }
-
-hr {
- background-color: #c6c6c6;
- border:0;
- height: 1px;
- margin-bottom: 18px;
- clear:both;
-}
-
-div.hr {
- height: 1px;
- background: #c6c6c6;
-}
-
-div.hr2 {
- height: 1px;
- background: #c6c6c6;
-}
-
-div.hr hr, div.hr2 hr {
- display: none;
-}
-
-p {
- padding: 0 0 0.5em;
- line-height:1.6em;
-}
-ul {
- list-style: square;
- margin: 0 0 18px 0;
-}
-ol {
- list-style: decimal;
- margin: 0 0 18px 1.5em;
-}
-ol ol {
- list-style:upper-alpha;
-}
-ol ol ol {
- list-style:lower-roman;
-}
-ol ol ol ol {
- list-style:lower-alpha;
-}
-ul ul,
-ol ol,
-ul ol,
-ol ul {
- margin-bottom:0;
-}
-dl {
- margin:0 0 24px 0;
-}
-dt {
- font-weight: bold;
-}
-dd {
- margin-bottom: 18px;
-}
-strong {
- font-weight: bold;
- color: #000;
-}
-cite,
-em,
-i {
- font-style: italic;
- border: none;
-}
-big {
- font-size: 131.25%;
-}
-ins {
- background: #FFFFCC;
- border: none;
- color: #333;
-}
-del {
- text-decoration: line-through;
- color: #555;
-}
-blockquote {
- font-style: italic;
- padding: 0 3em;
-}
-blockquote cite,
-blockquote em,
-blockquote i {
- font-style: normal;
-}
-pre {
- background: #f7f7f7;
- color: #222;
- padding: 1.5em;
-}
-abbr,
-acronym {
- border-bottom: 1px solid #666;
- cursor: help;
-}
-ins {
- text-decoration: none;
-}
-sup,
-sub {
- height: 0;
- line-height: 1;
- vertical-align: baseline;
- position: relative;
- font-size: 10px;
-}
-sup {
- bottom: 1ex;
-}
-sub {
- top: .5ex;
-}
-
-p,
-ul,
-ol,
-dd,
-hr {
- margin-bottom:10px;
-}
-ul ul,
-ol ol,
-ul ol,
-ol ul {
- margin-bottom:0;
-}
-pre,
-kbd,
-tt,
-var {
-}
-code {
- font-size: 13px;
-}
-strong,
-b,
-dt,
-th {
- color: #000;
-}
-
-
-/* main_container */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#wrapper {
- padding: 0px 0px;
- margin-top: 20px;
-}
-
-/* header*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#search-header{
- margin-top:15px;
- padding-bottom:13px;
-}
-
-#search-header #search{
- background: #222;
-
-}
-
-#search-header #search #s{
- background: #222;
- font-size:12px;
- color: #aaa;
-}
-
-#header_container{
- padding-bottom: 25px;
- padding-top: 0px;
- background: #fff;
-}
-
-#header {
-
-}
-
-#header2 {
-
-}
-
-#content_container{
- padding-top: 15px;
-}
-
-#left-col {
- padding: 10px 20px;
- padding-left: 0px;
- background: #fff;
-
-}
-
-
-/*footer*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-
-#footer {
- padding: 5px 20px;
- background: #ddd;
-}
-
-#footer-container{
- padding: 5px 20px;
- background: #303030;
- border-top: 8px solid #000;
- font-size:11px;
-}
-
-#footer-info {
- color:#ccc;
- text-align:left;
- background: #1b1b1b;
- padding: 20px 0;
-}
-
-
-#footer-info a{
- text-decoration:none;
- color: #fff;
-}
-
-#footer-info a:hover{
- color: #ebebeb;
-}
-
-#copyright{float: left;}
-
-.scroll-top {
- text-align:right;
-}
-
-#footer-widget{
- padding: 8px 0px 8px 0px;
- color:#6f6f6f;
-}
-
-#footer-widget #search {
- width:120px;
- height:28px;
- background: #222;
- margin-left: 0px;
- position: relative;
- border: 1px solid #666;
-}
-
-#footer-widget #search #s {
- width:110px;
- height:23px;
- border:0px;
- margin-left:7px;
- margin-right:10px;
- margin-top:3px;
- color:#fff;
- display: inline;
- background: #222;
- float: left;
-}
-
-#footer-widget #calendar_wrap {
- padding: 8px 0px;
-}
-
-#footer-widget #wp-calendar td{
- padding:2px;
-}
-
-
-#footer-widget .textwidget {
- padding: 5px 0px;
- line-height: 23px;
-}
-
-
-#footer-widget .widget_tag_cloud a{
- text-decoration: none;
- margin: 5px;
- line-height: 24px;
- margin-left: 0px;
- color: #6f6f6f;
-}
-
-#footer-widget .widget_tag_cloud a:hover{
- color: #fff;
-}
-
-#footer-widget .widget-container ul li a {
- color:#fd7800;
-}
-
-#footer-widget .widget-container ul li a:hover {
- color: #ccc;
-}
-
-#footer-widget .widget-container h3 {
- color: #a5a5a5;
- text-transform: uppercase;
- margin-bottom: 0px;
- padding-top: 10px;
- padding-left: 0px;
- font-size: 25px;
- padding-bottom: 8px;
- font-weight: bold;
-}
-
-#footer-widget .widget-container ul li {
- padding: 5px 0px;
- background: none;
- }
-
-#footer-widget ul {
- margin-left: 0px;
- }
-
-#footer-bar1 {
- padding-right: 40px;
-}
-#footer-bar2 {
- padding-right: 40px;
-}
-#footer-bar3 {
-}
-#footer-bar4 {
-}
-
-span#follow-box{
- position: absolute;
- right: 100px;
-}
-
-span#follow-box img{
- margin: 0 2px;
-}
-
-/*logo*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#logo {
- margin: 0px 0px 0px 0px;
-}
-
-#logo2 {
- margin: 0px 0px 0px 0px;
-}
-
-#logo img{
- border: none;
-}
-
-#logo2{
- text-decoration: none;
- font-size: 42px;
- letter-spacing: -1pt;
- font-weight: bold;
- font-family:arial, "Times New Roman", Times, serif;
- text-align: left;
- line-height: 57px;
- padding-left: 0px;
-}
-
-#logo2 a, #slogan{
- color: #fd7800;
-}
-
-#slogan{
- text-align: left;
- padding-left: 0px;
-}
-
-/*search*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#search {
- width:180px;
- height:28px;
- border: 1px solid #ccc;
- margin-left: 10px;
- position: relative;
-}
-
-#sidebar #search {
- margin-top: 20px;
-}
-
-#search #searchsubmit {
- background:url(images/go-btn.png) no-repeat top right;
- width:28px;
- height:28px;
- border:0px;
- position:absolute;
- right: -35px;
-}
-
-#search #s {
- width:170px;
- height:23px;
- border:0px;
- margin-left:7px;
- margin-right:10px;
- margin-top:3px;
- color:#000;
- display: inline;
- float: left;
-}
-
-/*menu bar*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#menu_container{
- padding-top: 0px;
-}
-
-
-/*responsive menu*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-/* default style */
-.selectnav { display: none; }
-
-/* small screen */
-@media screen and (max-width: 600px) {
- .js #nav { display: none; }
- .js #nav2 { display: none; }
- .js .selectnav { display: block; }
-}
-
-
-/*welcome*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-#welcome_container h1{
- margin-top: 0px;
-}
-
-/*homepage boxes*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#box_container{
- padding-top: 35px;
- padding-bottom: 15px;
-}
-
-.box-head {
- float: left;
- padding-bottom: 20px;
-}
-
-.box-head img{
-
-}
-
-.title-head{
- padding-top:2px;
-}
-
-.title-box{
- color: #333;
- line-height: 15px;
- text-transform: uppercase;
-}
-
-.title-box h1 {
- font-size: 18px;
- margin-bottom: 3px;
-}
-
-.box-content {
- float: left;
- padding-top: 10px;
- line-height: 20px;
-}
-
-
-/* POST */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-
-.post {
- overflow: hidden;
-
-}
-
-.post-shadow{
- background: url("images/post_shadow.png") no-repeat bottom;
- height: 9px;
- margin-bottom: 25px;
-}
-
-.post ol{
- margin-left: 20px;
-}
-
-.post ul {
- margin-left: 15px;
-}
-.post-entry ul { margin: 0 0 10px 10px; }
-.post-entry ul li {
- display: block;
- margin: 5px 0;
- padding: 0 0 0 20px;
- /*background: url(images/bullet.png) no-repeat 0 7px;*/
-}
-
-.post-entry ol {
- list-style: decimal;
- margin: 0 0 18px 1.6em;
-}
-.post-entry ol li {
- list-style: decimal;
- }
-
-.post-entry {
- padding-bottom: 10px;
- padding-top: 10px;
- overflow: hidden;
-
-}
-
-.post-head {
- margin-bottom: 5px;
- padding-top: 15px;
-}
-
-.post-head h1 a, .post-head h1 {
- text-decoration:none;
- color:#000;
- margin: 0px;
- font-size: 27px;
-}
-
-.post-head h1 a:hover {
- color:#777;
-}
-
-
-.post-head-notfound h1, .post-head-404 h1, .post-head-archive h1, .post-head-search h1 {
- margin-bottom: 10px;
- font-weight:normal;
- text-decoration:none;
- color:#000;
- font-size: 27px;
-}
-
-.post-thumb img {
- border: 0px solid #ebebeb;
-}
-
-.post-entry img{
- margin-bottom: 10px;
- height:auto;
- max-width:100% !important;
-}
-
-.meta-data{
- line-height: 16px;
- padding: 6px 3px;
- margin-bottom: 3px;
- font-size: 11px;
- border-bottom: 1px solid #e9e9e9;
-}
-
-.meta-data a{
- color: #fd7800;
-}
-
-.meta-data a:hover{
- color: #777;
-}
-
-.read-more {
-color: #000;
- background: #fff;
- padding: 4px 8px;
- border-radius: 3px;
- display: inline-block;
- font-size: 11px;
- font-weight: bold;
- text-decoration: none;
- text-transform: capitalize;
- cursor: pointer;
- margin-top: 20px;
-}
-
-.read-more:hover{
- background: #fff;
- color: #666;
-}
-
-.clear {
- clear:both;
-}
-
-.sticky {
-
-}
-
-/* content */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-#content_container table {
- border: 1px solid #e7e7e7;
- margin: 0 -1px 24px 0;
- text-align: left;
- width: 100%;
-
-}
-#content_container tr th,
-#content_container thead th {
- color: #888;
- font-size: 12px;
- font-weight: bold;
- line-height: 18px;
- padding: 9px 10px;
-}
-#content_container tr td {
-
- padding: 6px 10px;
-}
-#content_container tr.odd td {
- background: #f2f7fc;
-}
-
-/*--navigation--*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-.navigation {
- float: left;
- width: 100%;
- margin: 20px 0;
-}
-
-
-.navigation .alignleft a {
- float: left;
-}
-
-.navigation .alignright a {
- float: right;
-}
-
-#nav-single {
- overflow:hidden;
- margin-top:20px;
- margin-bottom:10px;
-}
-.nav-previous {
- float: left;
- width: 50%;
-}
-.nav-next {
- float: right;
- text-align: right;
- width: 50%;
-}
-
-/*--sub head and breadcrumbs--*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#subhead_container{
- padding: 7px 0px;
-}
-
-#subhead h1{
- color: #000;
- padding-top: 10px;
- padding-left: 0px;
- font-size: 30px;
-}
-
-#breadcrumbs {
- padding-left: 25px;
- margin-bottom: 15px;
- color: #9e9e9e;
- margin:0 auto;
- width: 964px;
- font-size: 10px;
-}
-
-#breadcrumbs a{
- text-decoration: none;
- color: #9e9e9e;
-}
-
-/*Alignments */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-.alignleft,
-img.alignleft {
- display: inline;
- float: left;
- margin-right: 22px;
- margin-top: 9px;
-}
-
-.alignright,
-img.alignright {
- display: inline;
- float: right;
- margin-left: 22px;
- margin-top: 8px;
-}
-.aligncenter,
-img.aligncenter {
- clear: both;
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-
-.alignleft,
-.alignright,
-.aligncenter,
-img.alignleft,
-img.alignright,
-img.aligncenter
-{
- margin-bottom: 10px;
-}
-
-
-a img.aligncenter {
- display:block;
- margin-left:auto;
- margin-right:auto;
-}
-
-img { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; }
diff --git a/NFD/docs/named_data_theme/static/named_data_style.css_t b/NFD/docs/named_data_theme/static/named_data_style.css_t
deleted file mode 100644
index 3edfb72..0000000
--- a/NFD/docs/named_data_theme/static/named_data_style.css_t
+++ /dev/null
@@ -1,813 +0,0 @@
-@import url("base.css");
-
-@import url("foundation.css");
-
-table {
- border: 0;
-}
-
-pre {
- padding: 10px;
- background-color: #fafafa;
- color: #222;
- /* line-height: 1.0em; */
- border: 2px solid #C6C9CB;
- font-size: 0.9em;
- /* margin: 1.5em 0 1.5em 0; */
- margin: 0;
- border-right-style: none;
- border-left-style: none;
-}
-
-/* General */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-a:link {
- text-decoration: none;
-}
-a:visited {
- text-decoration: none;
-}
-a:active,
-a:hover {
- text-decoration: none;
-}
-
-h1,h2,h3,h4,h5,h6 {
- color: #000;
- margin-bottom: 18px;
-}
-
-h1 { font-weight: bold; font-size: 24px; }
-h2 { font-weight: bold; font-size: 18px; }
-h3 { font-weight: bold; font-size: 16px; }
-h4 { font-weight: bold; font-size: 14px; }
-
-hr {
- background-color: #c6c6c6;
- border:0;
- height: 1px;
- margin-bottom: 18px;
- clear:both;
-}
-
-div.hr {
- height: 1px;
- background: #c6c6c6;
-}
-
-div.hr2 {
- height: 1px;
- background: #c6c6c6;
-}
-
-div.hr hr, div.hr2 hr {
- display: none;
-}
-
-p {
- padding: 0;
- line-height:1.6em;
-}
-ul {
- list-style: square;
- margin: 0 0 18px 0;
-}
-ol {
- list-style: decimal;
- margin: 0 0 18px 1.5em;
-}
-ol ol {
- list-style:upper-alpha;
-}
-ol ol ol {
- list-style:lower-roman;
-}
-ol ol ol ol {
- list-style:lower-alpha;
-}
-ul ul,
-ol ol,
-ul ol,
-ol ul {
- margin-bottom:0;
-}
-dl {
- margin:0 0 24px 0;
-}
-dt {
- font-weight: bold;
-}
-dd {
- margin-bottom: 18px;
-}
-strong {
- font-weight: bold;
- color: #000;
-}
-cite,
-em,
-i {
- font-style: italic;
- border: none;
-}
-big {
- font-size: 131.25%;
-}
-ins {
- background: #FFFFCC;
- border: none;
- color: #333;
-}
-del {
- text-decoration: line-through;
- color: #555;
-}
-blockquote {
- padding: 0 3em;
-}
-blockquote cite,
-blockquote em,
-blockquote i {
- font-style: normal;
-}
-pre {
- background: #f7f7f7;
- color: #222;
- padding: 1.5em;
-}
-abbr,
-acronym {
- border-bottom: 1px solid #666;
- cursor: help;
-}
-ins {
- text-decoration: none;
-}
-sup,
-sub {
- height: 0;
- line-height: 1;
- vertical-align: baseline;
- position: relative;
- font-size: 10px;
-}
-sup {
- bottom: 1ex;
-}
-sub {
- top: .5ex;
-}
-
-p,
-ul,
-ol,
-dd,
-hr {
- margin-bottom:10px;
-}
-ul ul,
-ol ol,
-ul ol,
-ol ul {
- margin-bottom:0;
-}
-pre,
-kbd,
-tt,
-var {
-}
-code {
- font-size: 13px;
-}
-strong,
-b,
-dt,
-th {
- color: #000;
-}
-
-
-/* main_container */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#wrapper {
- padding: 0px 0px;
- margin-top: 20px;
-}
-
-/* header*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#search-header{
- margin-top:15px;
- padding-bottom:13px;
-}
-
-#search-header #search{
- background: #222;
-
-}
-
-#search-header #search #s{
- background: #222;
- font-size:12px;
- color: #aaa;
-}
-
-#header_container{
- padding-bottom: 25px;
- padding-top: 0px;
- background: #fff;
-}
-
-#header {
-
-}
-
-#header2 {
-
-}
-
-#content_container{
- padding-top: 15px;
-}
-
-#left-col {
- padding: 10px 20px;
- padding-left: 0px;
- background: #fff;
-
-}
-
-
-/*footer*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-
-#footer {
- padding: 5px 20px;
- background: #ddd;
-}
-
-#footer-container{
- padding: 5px 20px;
- background: #303030;
- border-top: 8px solid #000;
- font-size:11px;
-}
-
-#footer-info {
- color:#ccc;
- text-align:left;
- background: #1b1b1b;
- padding: 20px 0;
-}
-
-
-#footer-info a{
- text-decoration:none;
- color: #fff;
-}
-
-#footer-info a:hover{
- color: #ebebeb;
-}
-
-#copyright{float: left;}
-
-.scroll-top {
- text-align:right;
-}
-
-#footer-widget{
- padding: 8px 0px 8px 0px;
- color:#6f6f6f;
-}
-
-#footer-widget #search {
- width:120px;
- height:28px;
- background: #222;
- margin-left: 0px;
- position: relative;
- border: 1px solid #666;
-}
-
-#footer-widget #search #s {
- width:110px;
- height:23px;
- border:0px;
- margin-left:7px;
- margin-right:10px;
- margin-top:3px;
- color:#fff;
- display: inline;
- background: #222;
- float: left;
-}
-
-#footer-widget #calendar_wrap {
- padding: 8px 0px;
-}
-
-#footer-widget #wp-calendar td{
- padding:2px;
-}
-
-
-#footer-widget .textwidget {
- padding: 5px 0px;
- line-height: 23px;
-}
-
-
-#footer-widget .widget_tag_cloud a{
- text-decoration: none;
- margin: 5px;
- line-height: 24px;
- margin-left: 0px;
- color: #6f6f6f;
-}
-
-#footer-widget .widget_tag_cloud a:hover{
- color: #fff;
-}
-
-#footer-widget .widget-container ul li a {
- color:#fd7800;
-}
-
-#footer-widget .widget-container ul li a:hover {
- color: #ccc;
-}
-
-#footer-widget .widget-container h3 {
- color: #a5a5a5;
- text-transform: uppercase;
- margin-bottom: 0px;
- padding-top: 10px;
- padding-left: 0px;
- font-size: 25px;
- padding-bottom: 8px;
- font-weight: bold;
-}
-
-#footer-widget .widget-container ul li {
- padding: 5px 0px;
- background: none;
- }
-
-#footer-widget ul {
- margin-left: 0px;
- }
-
-#footer-bar1 {
- padding-right: 40px;
-}
-#footer-bar2 {
- padding-right: 40px;
-}
-#footer-bar3 {
-}
-#footer-bar4 {
-}
-
-span#follow-box{
- position: absolute;
- right: 100px;
-}
-
-span#follow-box img{
- margin: 0 2px;
-}
-
-/*logo*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#logo {
- margin: 0px 0px 0px 0px;
-}
-
-#logo2 {
- margin: 0px 0px 0px 0px;
-}
-
-#logo img{
- border: none;
-}
-
-#logo2{
- text-decoration: none;
- font-size: 42px;
- letter-spacing: -1pt;
- font-weight: bold;
- font-family:arial, "Times New Roman", Times, serif;
- text-align: left;
- line-height: 57px;
- padding-left: 0px;
-}
-
-#logo2 a, #slogan{
- color: #fd7800;
-}
-
-#slogan{
- text-align: left;
- padding-left: 0px;
-}
-
-/*search*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#search {
- width:180px;
- height:28px;
- border: 1px solid #ccc;
- margin-left: 10px;
- position: relative;
-}
-
-#sidebar #search {
- margin-top: 20px;
-}
-
-#search #searchsubmit {
- background:url(images/go-btn.png) no-repeat top right;
- width:28px;
- height:28px;
- border:0px;
- position:absolute;
- right: -35px;
-}
-
-#search #s {
- width:170px;
- height:23px;
- border:0px;
- margin-left:7px;
- margin-right:10px;
- margin-top:3px;
- color:#000;
- display: inline;
- float: left;
-}
-
-/*menu bar*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#menu_container{
- padding-top: 0px;
-}
-
-
-/*responsive menu*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-/* default style */
-.selectnav { display: none; }
-
-/* small screen */
-@media screen and (max-width: 600px) {
- .js #nav { display: none; }
- .js #nav2 { display: none; }
- .js .selectnav { display: block; }
-}
-
-
-/*welcome*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-#welcome_container h1{
- margin-top: 0px;
-}
-
-/*homepage boxes*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#box_container{
- padding-top: 35px;
- padding-bottom: 15px;
-}
-
-.box-head {
- float: left;
- padding-bottom: 20px;
-}
-
-.box-head img{
-
-}
-
-.title-head{
- padding-top:2px;
-}
-
-.title-box{
- color: #333;
- line-height: 15px;
- text-transform: uppercase;
-}
-
-.title-box h1 {
- font-size: 18px;
- margin-bottom: 3px;
-}
-
-.box-content {
- float: left;
- padding-top: 10px;
- line-height: 20px;
-}
-
-
-/* POST */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-
-.post {
- overflow: hidden;
-
-}
-
-.post-shadow{
- background: url("images/post_shadow.png") no-repeat bottom;
- height: 9px;
- margin-bottom: 25px;
-}
-
-.post ol{
- margin-left: 20px;
-}
-
-.post ul {
- margin-left: 15px;
-}
-.post-entry ul { margin: 0 0 10px 10px; }
-.post-entry ul li {
- display: block;
- margin: 5px 0;
- padding: 0 0 0 20px;
- /*background: url(images/bullet.png) no-repeat 0 7px;*/
-}
-
-.post-entry ol {
- list-style: decimal;
- margin: 0 0 18px 1.6em;
-}
-.post-entry ol li {
- list-style: decimal;
- }
-
-.post-entry {
- padding-bottom: 10px;
- padding-top: 10px;
- overflow: hidden;
-
-}
-
-.post-head {
- margin-bottom: 5px;
- padding-top: 15px;
-}
-
-.post-head h1 a, .post-head h1 {
- text-decoration:none;
- color:#000;
- margin: 0px;
- font-size: 27px;
-}
-
-.post-head h1 a:hover {
- color:#777;
-}
-
-
-.post-head-notfound h1, .post-head-404 h1, .post-head-archive h1, .post-head-search h1 {
- margin-bottom: 10px;
- font-weight:normal;
- text-decoration:none;
- color:#000;
- font-size: 27px;
-}
-
-.post-thumb img {
- border: 0px solid #ebebeb;
-}
-
-.post-entry img{
- margin-bottom: 10px;
- height:auto;
- max-width:100% !important;
-}
-
-.meta-data{
- line-height: 16px;
- padding: 6px 3px;
- margin-bottom: 3px;
- font-size: 11px;
- border-bottom: 1px solid #e9e9e9;
-}
-
-.meta-data a{
- color: #fd7800;
-}
-
-.meta-data a:hover{
- color: #777;
-}
-
-.read-more {
-color: #000;
- background: #fff;
- padding: 4px 8px;
- border-radius: 3px;
- display: inline-block;
- font-size: 11px;
- font-weight: bold;
- text-decoration: none;
- text-transform: capitalize;
- cursor: pointer;
- margin-top: 20px;
-}
-
-.read-more:hover{
- background: #fff;
- color: #666;
-}
-
-.clear {
- clear:both;
-}
-
-.sticky {
-
-}
-
-/* content */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-#content_container table {
- border: 1px solid #e7e7e7;
- margin: 0 -1px 24px 0;
- text-align: left;
- width: 100%;
-
-}
-#content_container tr th,
-#content_container thead th {
- color: #888;
- font-size: 12px;
- font-weight: bold;
- line-height: 18px;
- padding: 9px 10px;
-}
-#content_container tr td {
-
- padding: 6px 10px;
-}
-#content_container tr.odd td {
- background: #f2f7fc;
-}
-
-/* sidebar*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#sidebar {
- padding:0px 20px 20px 0px;
-}
-
-#sidebar ul {
- list-style: none;
-}
-
-#sidebar { word-wrap: break-word;}
-
-
-/*--navigation--*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-.navigation {
- float: left;
- width: 100%;
- margin: 20px 0;
-}
-
-
-.navigation .alignleft a {
- float: left;
-}
-
-.navigation .alignright a {
- float: right;
-}
-
-#nav-single {
- overflow:hidden;
- margin-top:20px;
- margin-bottom:10px;
-}
-.nav-previous {
- float: left;
- width: 50%;
-}
-.nav-next {
- float: right;
- text-align: right;
- width: 50%;
-}
-
-/*--slider--*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#slider_container {
- background: #fff;
-}
-
-.flex-caption{
-background: #232323;
-color: #fff;
-padding: 7px;
-}
-
-.flexslider p{
- margin: 0px;
-}
-
-/*--sub head and breadcrumbs--*/
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-#subhead_container{
- padding: 7px 0px;
-}
-
-#subhead h1{
- color: #000;
- padding-top: 10px;
- padding-left: 0px;
- font-size: 30px;
-}
-
-#breadcrumbs {
- padding-left: 25px;
- margin-bottom: 15px;
- color: #9e9e9e;
- margin:0 auto;
- width: 964px;
- font-size: 10px;
-}
-
-#breadcrumbs a{
- text-decoration: none;
- color: #9e9e9e;
-}
-
-/*Alignments */
-/*////////////////////////////////////////////////////////////////////////////////////////////*/
-
-.alignleft,
-img.alignleft {
- display: inline;
- float: left;
- margin-right: 22px;
- margin-top: 9px;
-}
-
-.alignright,
-img.alignright {
- display: inline;
- float: right;
- margin-left: 22px;
- margin-top: 8px;
-}
-.aligncenter,
-img.aligncenter {
- clear: both;
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-
-.alignleft,
-.alignright,
-.aligncenter,
-img.alignleft,
-img.alignright,
-img.aligncenter
-{
- margin-bottom: 10px;
-}
-
-
-a img.aligncenter {
- display:block;
- margin-left:auto;
- margin-right:auto;
-}
-
-
-table {
- border-collapse:collapse;
-}
-table, th, td {
- border: 1px solid black;
- padding: 5px;
-}
\ No newline at end of file
diff --git a/NFD/docs/named_data_theme/static/nav_f.png b/NFD/docs/named_data_theme/static/nav_f.png
deleted file mode 100644
index f09ac2f..0000000
--- a/NFD/docs/named_data_theme/static/nav_f.png
+++ /dev/null
Binary files differ
diff --git a/NFD/docs/named_data_theme/static/tab_b.png b/NFD/docs/named_data_theme/static/tab_b.png
deleted file mode 100644
index 801fb4e..0000000
--- a/NFD/docs/named_data_theme/static/tab_b.png
+++ /dev/null
Binary files differ
diff --git a/NFD/docs/named_data_theme/theme.conf b/NFD/docs/named_data_theme/theme.conf
deleted file mode 100644
index aa5a7ff..0000000
--- a/NFD/docs/named_data_theme/theme.conf
+++ /dev/null
@@ -1,15 +0,0 @@
-[theme]
-inherit = agogo
-stylesheet = named_data_style.css
-# pygments_style = sphinx
-
-theme_bodyfont = "normal 12px Verdana, sans-serif"
-theme_bgcolor = "#ccc"
-
-theme_documentwidth = "100%"
-theme_textalign = "left"
-
-[options]
-
-stickysidebar = true
-collapsiblesidebar = true
diff --git a/NFD/docs/overview.rst b/NFD/docs/overview.rst
deleted file mode 100644
index 437649d..0000000
--- a/NFD/docs/overview.rst
+++ /dev/null
@@ -1,90 +0,0 @@
-NFD Overview
-============
-
-.. toctree::
- :maxdepth: 2
-
- RELEASE_NOTES
-
-NDN Forwarding Daemon (NFD) is a network forwarder that implements and evolves together
-with the Named Data Networking (NDN) `protocol
-<http://named-data.net/doc/ndn-tlv/>`__. After the initial release, NFD will become a core
-component of the `NDN Platform <http://named-data.net/codebase/platform/>`__ and will
-follow the same release cycle.
-
-NFD is developed by a community effort. Although the first release was mostly done by the
-members of `NSF-sponsored NDN project team
-<http://named-data.net/project/participants/>`__, it already contains significant
-contributions from people outside the project team (for more details, refer to `AUTHORS.md
-<https://github.com/named-data/NFD/blob/master/AUTHORS.md>`__). We strongly encourage
-participation from all interested parties, since broader community support is key for NDN
-to succeed as a new Internet architecture. Bug reports and feedback are highly
-appreciated and can be made through `Redmine site
-<http://redmine.named-data.net/projects/nfd>`__ and the `ndn-interest mailing list
-<http://www.lists.cs.ucla.edu/mailman/listinfo/ndn-interest>`__.
-
-The main design goal of NFD is to support diverse experimentation of NDN technology. The
-design emphasizes *modularity* and *extensibility* to allow easy experiments with new
-protocol features, algorithms, and applications. We have not fully optimized the code for
-performance. The intention is that performance optimizations are one type of experiments
-that developers can conduct by trying out different data structures and different
-algorithms; over time, better implementations may emerge within the same design framework.
-To facilitate such experimentation with the forwarder, the NFD team has also written a
-`developer's guide <http://named-data.net/wp-content/uploads/2014/07/NFD-developer-guide.pdf>`_,
-which details the current implementation and provides tips for extending all aspects of
-NFD.
-
-NFD will keep evolving in three aspects: improvement of the modularity framework, keeping
-up with the NDN protocol spec, and addition of other new features. We hope to keep the
-modular framework stable and lean, allowing researchers to implement and experiment
-with various features, some of which may eventually work into the protocol spec.
-
-The design and development of NFD benefited from our earlier experience with `CCNx
-<http://www.ccnx.org>`__ software package. However, NFD is not in any part derived from
-CCNx codebase and does not maintain compatibility with CCNx.
-
-
-Major Modules of NFD
---------------------
-
-NFD has the following major modules:
-
-- Core
- Provides various common services shared between different NFD modules. These include
- hash computation routines, DNS resolver, config file, face monitoring, and
- several other modules.
-
-- Faces
- Implements the NDN face abstraction on top of different lower level transport
- mechanisms.
-
-- Tables
- Implements the Content Store (CS), the Pending Interest Table (PIT), the Forwarding
- Information Base (FIB), and other data structures to support forwarding of NDN Data
- and Interest packets.
-
-- Forwarding
- Implements basic packet processing pathways, which interact with Faces, Tables,
- and Strategies.
-
- + **Strategy Support**, a major part of the forwarding module
- Implements a framework to support different forwarding strategies. It includes
- StrategyChoice, Measurements, Strategies, and hooks in the forwarding pipelines. The
- StrategyChoice records the choice of the strategy for a namespace, and Measurement
- records are used by strategies to store past performance results for namespaces.
-
-- Management
- Implements the `NFD Management Protocol
- <http://redmine.named-data.net/projects/nfd/wiki/Management>`_, which allows
- applications to configure NFD and set/query NFD's internal states. Protocol interaction
- is done via NDN's Interest/Data exchange between applications and NFD.
-
-- RIB Management
- Manages the routing information base (RIB). The RIB may be updated by different parties
- in different ways, including various routing protocols, application's prefix
- registrations, and command-line manipulation by sysadmins. The RIB management module
- processes all these requests to generate a consistent forwarding table, and then syncs
- it up with the NFD's FIB, which contains only the minimal information needed for
- forwarding decisions. Strictly speaking RIB management is part of the NFD management
- module. However, due to its importance to the overall operations and its more complex
- processing, we make it a separate module.
diff --git a/NFD/docs/schema.rst b/NFD/docs/schema.rst
deleted file mode 100644
index f4c7611..0000000
--- a/NFD/docs/schema.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-.. _nfd-status xml schema:
-
-NFD Status XML Schema
-=====================
-
-The NFD status XML schema describes the structure of the NFD status XML
-document generated by command ``nfd-status``.
-
-Users can use this schema to validate the generated XML document.
-
-.. literalinclude:: _static/nfd-status.xsd
- :language: xml
diff --git a/NFD/nfd.conf.sample.in b/NFD/nfd.conf.sample.in
deleted file mode 100644
index 2f1e31f..0000000
--- a/NFD/nfd.conf.sample.in
+++ /dev/null
@@ -1,316 +0,0 @@
-; The general section contains settings of nfd process.
-general
-{
- ; Specify a user and/or group for NFD to drop privileges to
- ; when not performing privileged tasks. NFD does not drop
- ; privileges by default.
-
- ; user ndn-user
- ; group ndn-user
-}
-
-log
-{
- ; default_level specifies the logging level for modules
- ; that are not explicitly named. All debugging levels
- ; listed above the selected value are enabled.
- ;
- ; Valid values:
- ;
- ; NONE ; no messages
- ; ERROR ; error messages
- ; WARN ; warning messages
- ; INFO ; informational messages (default)
- ; DEBUG ; debugging messages
- ; TRACE ; trace messages (most verbose)
- ; ALL ; all messages
-
- default_level INFO
-
- ; You may override default_level by assigning a logging level
- ; to the desired module name. Module names can be found in two ways:
- ;
- ; Run:
- ; nfd --modules
- ; nrd --modules
- ;
- ; Or look for NFD_LOG_INIT(<module name>) statements in .cpp files
- ;
- ; Example module-level settings:
- ;
- ; FibManager DEBUG
- ; Forwarder INFO
-}
-
-; The tables section configures the CS, PIT, FIB, Strategy Choice, and Measurements
-tables
-{
-
- ; ContentStore size limit in number of packets
- ; default is 65536, about 500MB with 8KB packet size
- cs_max_packets 65536
-
- ; Set the forwarding strategy for the specified prefixes:
- ; <prefix> <strategy>
- strategy_choice
- {
- / /localhost/nfd/strategy/best-route
- /localhost /localhost/nfd/strategy/broadcast
- /localhost/nfd /localhost/nfd/strategy/best-route
- /ndn/broadcast /localhost/nfd/strategy/broadcast
- }
-}
-
-; The face_system section defines what faces and channels are created.
-face_system
-{
- ; The unix section contains settings of Unix stream faces and channels.
- ; Unix channel is always listening; delete unix section to disable
- ; Unix stream faces and channels.
- ;
- ; The ndn-cxx library expects unix:///var/run/nfd.sock
- ; to be used as the default transport option. Please change
- ; the "transport" field in client.conf to an appropriate tcp4 FaceUri
- ; if you need to disable unix sockets.
- unix
- {
- path /var/run/nfd.sock ; Unix stream listener path
- }
-
- ; The tcp section contains settings of TCP faces and channels.
- tcp
- {
- listen yes ; set to 'no' to disable TCP listener, default 'yes'
- port 6363 ; TCP listener port number
- enable_v4 yes ; set to 'no' to disable IPv4 channels, default 'yes'
- enable_v6 yes ; set to 'no' to disable IPv6 channels, default 'yes'
- }
-
- ; The udp section contains settings of UDP faces and channels.
- ; UDP channel is always listening; delete udp section to disable UDP
- udp
- {
- port 6363 ; UDP unicast port number
- enable_v4 yes ; set to 'no' to disable IPv4 channels, default 'yes'
- enable_v6 yes ; set to 'no' to disable IPv6 channels, default 'yes'
- idle_timeout 600 ; idle time (seconds) before closing a UDP unicast face
- keep_alive_interval 25; interval (seconds) between keep-alive refreshes
-
- ; UDP multicast settings
- ; NFD creates one UDP multicast face per NIC
- ;
- ; In multi-homed Linux machines these settings will NOT work without
- ; root or settings the appropriate permissions:
- ;
- ; sudo setcap cap_net_raw=eip /full/path/nfd
- ;
- mcast yes ; set to 'no' to disable UDP multicast, default 'yes'
- mcast_port 56363 ; UDP multicast port number
- mcast_group 224.0.23.170 ; UDP multicast group (IPv4 only)
- }
-
- ; The ether section contains settings of Ethernet faces and channels.
- ; These settings will NOT work without root or setting the appropriate
- ; permissions:
- ;
- ; sudo setcap cap_net_raw,cap_net_admin=eip /full/path/nfd
- ;
- ; You may need to install a package to use setcap:
- ;
- ; **Ubuntu:**
- ;
- ; sudo apt-get install libcap2-bin
- ;
- ; **Mac OS X:**
- ;
- ; curl https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3373 -o ChmodBPF.tar.gz
- ; tar zxvf ChmodBPF.tar.gz
- ; open ChmodBPF/Install\ ChmodBPF.app
- ;
- ; or manually:
- ;
- ; sudo chgrp admin /dev/bpf*
- ; sudo chmod g+rw /dev/bpf*
-
- @IF_HAVE_LIBPCAP@ether
- @IF_HAVE_LIBPCAP@{
- @IF_HAVE_LIBPCAP@ ; Ethernet multicast settings
- @IF_HAVE_LIBPCAP@ ; NFD creates one Ethernet multicast face per NIC
- @IF_HAVE_LIBPCAP@
- @IF_HAVE_LIBPCAP@ mcast yes ; set to 'no' to disable Ethernet multicast, default 'yes'
- @IF_HAVE_LIBPCAP@ mcast_group 01:00:5E:00:17:AA ; Ethernet multicast group
- @IF_HAVE_LIBPCAP@}
-
- ; The websocket section contains settings of WebSocket faces and channels.
-
- @IF_HAVE_WEBSOCKET@websocket
- @IF_HAVE_WEBSOCKET@{
- @IF_HAVE_WEBSOCKET@ listen yes ; set to 'no' to disable WebSocket listener, default 'yes'
- @IF_HAVE_WEBSOCKET@ port 9696 ; WebSocket listener port number
- @IF_HAVE_WEBSOCKET@ enable_v4 yes ; set to 'no' to disable listening on IPv4 socket, default 'yes'
- @IF_HAVE_WEBSOCKET@ enable_v6 yes ; set to 'no' to disable listening on IPv6 socket, default 'yes'
- @IF_HAVE_WEBSOCKET@}
-}
-
-; The authorizations section grants privileges to authorized keys.
-authorizations
-{
- ; An authorize section grants privileges to a NDN certificate.
- authorize
- {
- ; If you do not already have NDN certificate, you can generate
- ; one with the following commands.
- ;
- ; 1. Generate and install a self-signed identity certificate:
- ;
- ; ndnsec-keygen /`whoami` | ndnsec-install-cert -
- ;
- ; Note that the argument to ndnsec-key will be the identity name of the
- ; new key (in this case, /your-username). Identities are hierarchical NDN
- ; names and may have multiple components (e.g. `/ndn/ucla/edu/alice`).
- ; You may create additional keys and identities as you see fit.
- ;
- ; 2. Dump the NDN certificate to a file:
- ;
- ; sudo mkdir -p @SYSCONFDIR@/ndn/keys/
- ; ndnsec-cert-dump -i /`whoami` > default.ndncert
- ; sudo mv default.ndncert @SYSCONFDIR@/ndn/keys/default.ndncert
- ;
- ; The "certfile" field below specifies the default key directory for
- ; your machine. You may move your newly created key to the location it
- ; specifies or path.
-
- ; certfile keys/default.ndncert ; NDN identity certificate file
- certfile any ; "any" authorizes command interests signed under any certificate,
- ; i.e., no actual validation.
- privileges ; set of privileges granted to this identity
- {
- faces
- fib
- strategy-choice
- }
- }
-
- ; You may have multiple authorize sections that specify additional
- ; certificates and their privileges.
-
- ; authorize
- ; {
- ; certfile keys/this_cert_does_not_exist.ndncert
- ; authorize
- ; privileges
- ; {
- ; faces
- ; }
- ; }
-}
-
-rib
-{
- ; The following localhost_security allows anyone to register routing entries in local RIB
- localhost_security
- {
- trust-anchor
- {
- type any
- }
- }
-
- ; localhop_security should be enabled when NFD runs on a hub.
- ; "/localhop/nfd/fib" command prefix will be disabled when localhop_security section is missing.
- ; localhop_security
- ; {
- ; ; This section defines the trust model for NFD RIB Management. It consists of rules and
- ; ; trust-anchors, which are briefly defined in this file. For more information refer to
- ; ; manpage of ndn-validator.conf:
- ; ;
- ; ; man ndn-validator.conf
- ; ;
- ; ; A trust-anchor is a pre-trusted certificate. This can be any certificate that is the
- ; ; root of certification chain (e.g., NDN testbed root certificate) or an existing
- ; ; default system certificate `default.ndncert`.
- ; ;
- ; ; A rule defines conditions a valid packet MUST have. A packet must satisfy one of the
- ; ; rules defined here. A rule can be broken into two parts: matching & checking. A packet
- ; ; will be matched against rules from the first to the last until a matched rule is
- ; ; encountered. The matched rule will be used to check the packet. If a packet does not
- ; ; match any rule, it will be treated as invalid. The matching part of a rule consists
- ; ; of `for` and `filter` sections. They collectively define which packets can be checked
- ; ; with this rule. `for` defines packet type (data or interest) and `filter` defines
- ; ; conditions on other properties of a packet. Right now, you can only define conditions
- ; ; on packet name, and you can only specify ONLY ONE filter for packet name. The
- ; ; checking part of a rule consists of `checker`, which defines the conditions that a
- ; ; VALID packet MUST have. See comments in checker section for more details.
- ;
- ; rule
- ; {
- ; id "NRD Prefix Registration Command Rule"
- ; for interest ; rule for Interests (to validate CommandInterests)
- ; filter
- ; {
- ; type name ; condition on interest name (w/o signature)
- ; regex ^[<localhop><localhost>]<nfd><rib>[<register><unregister>]<>$ ; prefix before
- ; ; timestamp
- ; }
- ; checker
- ; {
- ; type customized
- ; sig-type rsa-sha256 ; interest must have a rsa-sha256 signature
- ; key-locator
- ; {
- ; type name ; key locator must be the certificate name of the
- ; ; signing key
- ; regex ^[^<KEY>]*<KEY><>*<ksk-.*><ID-CERT>$
- ; }
- ; }
- ; }
- ; rule
- ; {
- ; id "NDN Testbed Hierarchy Rule"
- ; for data ; rule for Data (to validate NDN certificates)
- ; filter
- ; {
- ; type name ; condition on data name
- ; regex ^[^<KEY>]*<KEY><>*<ksk-.*><ID-CERT><>$
- ; }
- ; checker
- ; {
- ; type hierarchical ; the certificate name of the signing key and
- ; ; the data name must follow the hierarchical model
- ; sig-type rsa-sha256 ; data must have a rsa-sha256 signature
- ; }
- ; }
- ; trust-anchor
- ; {
- ; type file
- ; file-name keys/default.ndncert ; the file name, by default this file should be placed in the
- ; ; same folder as this config file.
- ; }
- ; ; trust-anchor ; Can be repeated multiple times to specify multiple trust anchors
- ; ; {
- ; ; type file
- ; ; file-name keys/ndn-testbed.ndncert
- ; ; }
- ; }
-
- ; The following localhop_security should be enabled when NFD runs on a hub,
- ; which accepts all remote registrations and is a short-term solution.
- ; localhop_security
- ; {
- ; trust-anchor
- ; {
- ; type any
- ; }
- ; }
-
- remote_register
- {
- cost 15 ; forwarding cost of prefix registered on remote router
- timeout 10000 ; timeout (in milliseconds) of remote prefix registration command
- retry 0 ; maximum number of retries for each remote prefix registration command
-
- refresh_interval 300 ; interval (in seconds) before refreshing the registration
- ; This setting should be less than face_system.udp.idle_time,
- ; so that the face is kept alive on the remote router.
- }
-}
diff --git a/NFD/rib/face-entry.hpp b/NFD/rib/face-entry.hpp
deleted file mode 100644
index c9eeb33..0000000
--- a/NFD/rib/face-entry.hpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_RIB_FACE_ENTRY_HPP
-#define NFD_RIB_FACE_ENTRY_HPP
-
-#include "common.hpp"
-#include "core/scheduler.hpp"
-
-namespace nfd {
-namespace rib {
-
-/** \class FaceEntry
- * \brief represents a route for a name prefix
- */
-class FaceEntry
-{
-public:
- FaceEntry()
- : faceId(0)
- , origin(0)
- , flags(0)
- , cost(0)
- , expires(time::steady_clock::TimePoint::min())
- , m_expirationEvent()
- {
- }
-
-public:
- void
- setExpirationEvent(const EventId eid)
- {
- m_expirationEvent = eid;
- }
-
- const EventId&
- getExpirationEvent() const
- {
- return m_expirationEvent;
- }
-
-public:
- uint64_t faceId;
- uint64_t origin;
- uint64_t flags;
- uint64_t cost;
- time::steady_clock::TimePoint expires;
-
-private:
- EventId m_expirationEvent;
-};
-
-inline bool
-compareFaceIdAndOrigin(const FaceEntry& entry1, const FaceEntry& entry2)
-{
- return (entry1.faceId == entry2.faceId && entry1.origin == entry2.origin);
-}
-
-inline bool
-compareFaceId(const FaceEntry& entry, const uint64_t faceId)
-{
- return (entry.faceId == faceId);
-}
-
-// Method definition in rib-entry.cpp
-std::ostream&
-operator<<(std::ostream& os, const FaceEntry& entry);
-
-} // namespace rib
-} // namespace nfd
-
-#endif // NFD_RIB_RIB_ENTRY_HPP
diff --git a/NFD/rib/fib-update.cpp b/NFD/rib/fib-update.cpp
deleted file mode 100644
index cda4f14..0000000
--- a/NFD/rib/fib-update.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "fib-update.hpp"
-
-namespace nfd {
-namespace rib {
-
-shared_ptr<FibUpdate>
-FibUpdate::createAddUpdate(const Name& name, const uint64_t faceId, const uint64_t cost)
-{
- shared_ptr<FibUpdate> update = make_shared<FibUpdate>();
-
- update->name = name;
- update->faceId = faceId;
- update->cost = cost;
- update->action = ADD_NEXTHOP;
-
- return update;
-}
-
-shared_ptr<FibUpdate>
-FibUpdate::createRemoveUpdate(const Name& name, const uint64_t faceId)
-{
- shared_ptr<FibUpdate> update = make_shared<FibUpdate>();
-
- update->name = name;
- update->faceId = faceId;
- update->action = REMOVE_NEXTHOP;
-
- return update;
-}
-
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/rib/fib-update.hpp b/NFD/rib/fib-update.hpp
deleted file mode 100644
index 02713ab..0000000
--- a/NFD/rib/fib-update.hpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_RIB_FIB_UPDATE_HPP
-#define NFD_RIB_FIB_UPDATE_HPP
-
-#include "common.hpp"
-
-namespace nfd {
-namespace rib {
-
-/** \class FibUpdate
- * \brief represents a FIB update
- */
-class FibUpdate
-{
-public:
- FibUpdate()
- : faceId(0)
- , cost(0)
- {
- }
-
- static shared_ptr<FibUpdate>
- createAddUpdate(const Name& name, const uint64_t faceId, const uint64_t cost);
-
- static shared_ptr<FibUpdate>
- createRemoveUpdate(const Name& name, const uint64_t faceId);
-
- enum Action
- {
- ADD_NEXTHOP = 0,
- REMOVE_NEXTHOP = 1
- };
-
-public:
- Name name;
- uint64_t faceId;
- uint64_t cost;
- Action action;
-};
-
-inline std::ostream&
-operator<<(std::ostream& os, const FibUpdate& update)
-{
- os << "FibUpdate("
- << " Name: " << update.name << ", "
- << "faceId: " << update.faceId << ", ";
-
- if (update.action == FibUpdate::ADD_NEXTHOP)
- {
- os << "cost: " << update.cost << ", "
- << "action: ADD_NEXTHOP";
- }
- else
- {
- os << "action: REMOVE_NEXTHOP";
- }
-
- os << ")";
-
- return os;
-}
-
-} // namespace rib
-} // namespace nfd
-
-#endif // NFD_RIB_FIB_UPDATE_HPP
diff --git a/NFD/rib/main.cpp b/NFD/rib/main.cpp
deleted file mode 100644
index bfea4f7..0000000
--- a/NFD/rib/main.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <getopt.h>
-
-#include "version.hpp"
-#include "common.hpp"
-#include "rib-manager.hpp"
-#include "core/config-file.hpp"
-#include "core/global-io.hpp"
-#include "core/logger.hpp"
-
-namespace nfd {
-namespace rib {
-
-NFD_LOG_INIT("NRD");
-
-struct ProgramOptions
-{
- bool showUsage;
- bool showVersion;
- bool showModules;
- std::string config;
-};
-
-class Nrd : noncopyable
-{
-public:
- class IgnoreNfdAndLogSections
- {
- public:
- void
- operator()(const std::string& filename,
- const std::string& sectionName,
- const ConfigSection& section,
- bool isDryRun)
- {
- // Ignore "log" and sections belonging to NFD,
- // but raise an error if we're missing a handler for an "rib_" section.
-
- if (sectionName.find("rib_") != 0 || sectionName == "log")
- {
- // do nothing
- }
- else
- {
- // missing NRD section
- ConfigFile::throwErrorOnUnknownSection(filename, sectionName, section, isDryRun);
- }
- }
- };
-
- Nrd()
- : m_face(getGlobalIoService())
- {
- }
-
- void
- initialize(const std::string& configFile)
- {
- initializeLogging(configFile);
-
- m_ribManager = make_shared<RibManager>(ndn::ref(m_face));
-
- ConfigFile config((IgnoreNfdAndLogSections()));
- m_ribManager->setConfigFile(config);
-
- // parse config file
- config.parse(configFile, true);
- config.parse(configFile, false);
-
- m_ribManager->registerWithNfd();
- m_ribManager->enableLocalControlHeader();
- }
-
- void
- initializeLogging(const std::string& configFile)
- {
- ConfigFile config(&ConfigFile::ignoreUnknownSection);
- LoggerFactory::getInstance().setConfigFile(config);
-
- config.parse(configFile, true);
- config.parse(configFile, false);
- }
-
- static void
- printUsage(std::ostream& os, const std::string& programName)
- {
- os << "Usage: \n"
- << " " << programName << " [options]\n"
- << "\n"
- << "Run NRD daemon\n"
- << "\n"
- << "Options:\n"
- << " [--help] - print this help message\n"
- << " [--version] - print version and exit\n"
- << " [--modules] - list available logging modules\n"
- << " [--config /path/to/nfd.conf] - path to configuration file "
- << "(default: " << DEFAULT_CONFIG_FILE << ")\n"
- ;
- }
-
- static void
- printModules(std::ostream& os)
- {
- using namespace std;
-
- os << "Available logging modules: \n";
-
- list<string> modules(LoggerFactory::getInstance().getModules());
- for (list<string>::const_iterator i = modules.begin(); i != modules.end(); ++i)
- {
- os << *i << "\n";
- }
- }
-
- static bool
- parseCommandLine(int argc, char** argv, ProgramOptions& options)
- {
- options.showUsage = false;
- options.showVersion = false;
- options.showModules = false;
- options.config = DEFAULT_CONFIG_FILE;
-
- while (true) {
- int optionIndex = 0;
- static ::option longOptions[] = {
- { "help" , no_argument , 0, 0 },
- { "modules", no_argument , 0, 0 },
- { "config" , required_argument, 0, 0 },
- { "version", no_argument , 0, 0 },
- { 0 , 0 , 0, 0 }
- };
- int c = getopt_long_only(argc, argv, "", longOptions, &optionIndex);
- if (c == -1)
- break;
-
- switch (c) {
- case 0:
- switch (optionIndex) {
- case 0: // help
- options.showUsage = true;
- break;
- case 1: // modules
- options.showModules = true;
- break;
- case 2: // config
- options.config = ::optarg;
- break;
- case 3: // version
- options.showVersion = true;
- break;
- default:
- return false;
- }
- break;
- }
- }
- return true;
- }
-
-
- void
- terminate(const boost::system::error_code& error,
- int signalNo,
- boost::asio::signal_set& signalSet)
- {
- if (error)
- return;
-
- if (signalNo == SIGINT ||
- signalNo == SIGTERM)
- {
- getGlobalIoService().stop();
- NFD_LOG_INFO("Caught signal '" << strsignal(signalNo) << "', exiting...");
- }
- else
- {
- /// \todo May be try to reload config file
- signalSet.async_wait(bind(&Nrd::terminate, this, _1, _2,
- ref(signalSet)));
- }
- }
-
-private:
- shared_ptr<RibManager> m_ribManager;
- ndn::Face m_face;
-};
-
-} // namespace rib
-} // namespace nfd
-
-int
-main(int argc, char** argv)
-{
- using namespace nfd::rib;
-
- ProgramOptions options;
- bool isCommandLineValid = Nrd::parseCommandLine(argc, argv, options);
- if (!isCommandLineValid) {
- Nrd::printUsage(std::cerr, argv[0]);
- return 1;
- }
- if (options.showUsage) {
- Nrd::printUsage(std::cout, argv[0]);
- return 0;
- }
-
- if (options.showModules) {
- Nrd::printModules(std::cout);
- return 0;
- }
-
- if (options.showVersion) {
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- }
-
- Nrd nrdInstance;
-
- try {
- nrdInstance.initialize(options.config);
- }
- catch (boost::filesystem::filesystem_error& e) {
- if (e.code() == boost::system::errc::permission_denied) {
- NFD_LOG_FATAL("Permissions denied for " << e.path1() << ". " <<
- argv[0] << " should be run as superuser");
- }
- else {
- NFD_LOG_FATAL(e.what());
- }
- return 1;
- }
- catch (const std::exception& e) {
- NFD_LOG_FATAL(e.what());
- return 2;
- }
-
- boost::asio::signal_set signalSet(nfd::getGlobalIoService());
- signalSet.add(SIGINT);
- signalSet.add(SIGTERM);
- signalSet.add(SIGHUP);
- signalSet.add(SIGUSR1);
- signalSet.add(SIGUSR2);
- signalSet.async_wait(bind(&Nrd::terminate, &nrdInstance, _1, _2,
- ndn::ref(signalSet)));
-
- try {
- nfd::getGlobalIoService().run();
- }
- catch (std::exception& e) {
- NFD_LOG_FATAL(e.what());
- return 3;
- }
-
- return 0;
-}
diff --git a/NFD/rib/remote-registrator.cpp b/NFD/rib/remote-registrator.cpp
deleted file mode 100644
index a587653..0000000
--- a/NFD/rib/remote-registrator.cpp
+++ /dev/null
@@ -1,451 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "remote-registrator.hpp"
-#include "core/logger.hpp"
-#include "core/scheduler.hpp"
-
-namespace nfd {
-namespace rib {
-
-NFD_LOG_INIT("RemoteRegistrator");
-
-using ndn::nfd::ControlParameters;
-using ndn::nfd::CommandOptions;
-
-const Name RemoteRegistrator::LOCAL_REGISTRATION_PREFIX = "/localhost";
-const Name RemoteRegistrator::REMOTE_HUB_PREFIX = "/localhop/nfd/rib";
-const name::Component RemoteRegistrator::IGNORE_COMMPONENT("rib");
-
-RemoteRegistrator::RemoteRegistrator(ndn::nfd::Controller& controller,
- ndn::KeyChain& keyChain,
- Rib& rib)
- : m_nfdController(controller)
- , m_keyChain(keyChain)
- , m_rib(rib)
- , m_refreshInterval(time::seconds(25))
- , m_hasConnectedHub(false)
- , m_nRetries(0)
-{
-}
-
-RemoteRegistrator::~RemoteRegistrator()
-{
- // cancel all periodically refresh events.
- for (auto&& entry : m_regEntries)
- {
- scheduler::cancel(entry.second);
- }
-}
-
-void
-RemoteRegistrator::loadConfig(const ConfigSection& configSection)
-{
- size_t cost = 15, timeout = 10000;
- size_t retry = 0;
- size_t interval = 0;
- const size_t intervalDef = 25, intervalMax = 600;
-
- NFD_LOG_INFO("Load remote_register section in rib section");
- for (auto&& i : configSection)
- {
- if (i.first == "cost")
- {
- cost = i.second.get_value<size_t>();
- }
- else if (i.first == "timeout")
- {
- timeout = i.second.get_value<size_t>();
- }
- else if (i.first == "retry")
- {
- retry = i.second.get_value<size_t>();
- }
- else if (i.first == "refresh_interval")
- {
- interval = i.second.get_value<size_t>();
- }
- else
- {
- throw ConfigFile::Error("Unrecognized option \"" + i.first +
- "\" in \"remote-registrator\" section");
- }
- }
-
- m_controlParameters
- .setCost(cost)
- .setOrigin(ndn::nfd::ROUTE_ORIGIN_CLIENT)// set origin to client.
- .setFaceId(0);// the remote hub will take the input face as the faceId.
-
- Name commandPrefix = REMOTE_HUB_PREFIX;
- if (IGNORE_COMMPONENT == commandPrefix.at(-1))
- {
- commandPrefix = commandPrefix.getPrefix(-1);
- }
-
- m_commandOptions
- .setPrefix(commandPrefix)
- .setTimeout(time::milliseconds(timeout));
-
- m_nRetries = retry;
-
- if (interval == 0)
- {
- interval = intervalDef;
- }
-
- interval = std::min(interval, intervalMax);
-
- m_refreshInterval = time::seconds(interval);
-}
-
-void
-RemoteRegistrator::enable()
-{
- // do remote registration after an entry is inserted into the RIB.
- m_afterInsertConnection =
- m_rib.afterInsertEntry.connect([this] (const Name& prefix) {
- registerPrefix(prefix);
- });
-
- // do remote unregistration after an entry is erased from the RIB.
- m_afterEraseConnection =
- m_rib.afterEraseEntry.connect([this] (const Name& prefix) {
- unregisterPrefix(prefix);
- });
-}
-
-void
-RemoteRegistrator::disable()
-{
- m_afterInsertConnection.disconnect();
- m_afterEraseConnection.disconnect();
-}
-
-void
-RemoteRegistrator::registerPrefix(const Name& prefix)
-{
- if (LOCAL_REGISTRATION_PREFIX.isPrefixOf(prefix))
- {
- NFD_LOG_INFO("local registration only for " << prefix);
- return;
- }
-
- bool isHubPrefix = prefix == REMOTE_HUB_PREFIX;
-
- if (isHubPrefix)
- {
- NFD_LOG_INFO("this is a prefix registered by some hub: " << prefix);
-
- m_hasConnectedHub = true;
-
- redoRegistration();
- return;
- }
-
- if (!m_hasConnectedHub)
- {
- NFD_LOG_INFO("no hub connected when registering " << prefix);
- return;
- }
-
- std::pair<Name, size_t> identity = findIdentityForRegistration(prefix);
-
- if (0 == identity.second)
- {
- NFD_LOG_INFO("no proper identity found for registering " << prefix);
- return;
- }
-
- Name prefixForRegistration;
- if (identity.first.size() == identity.second)
- {
- prefixForRegistration = identity.first;
- }
- else
- {
- prefixForRegistration = identity.first.getPrefix(-1);
- }
-
- if (m_regEntries.find(prefixForRegistration) != m_regEntries.end())
- {
- NFD_LOG_INFO("registration already in process for " << prefix);
- return;
- }
-
- // make copies of m_controlParameters and m_commandOptions to
- // avoid unreasonable overwriting during concurrent registration
- // and unregistration.
- ControlParameters parameters = m_controlParameters;
- CommandOptions options = m_commandOptions;
-
- startRegistration(parameters.setName(prefixForRegistration),
- options.setSigningIdentity(identity.first),
- m_nRetries);
-}
-
-void
-RemoteRegistrator::unregisterPrefix(const Name& prefix)
-{
- if (prefix == REMOTE_HUB_PREFIX)
- {
- NFD_LOG_INFO("disconnected to hub with prefix: " << prefix);
-
- // for phase 1: suppose there is at most one hub connected.
- // if the hub prefix has been unregistered locally, there may
- // be no connected hub.
- m_hasConnectedHub = false;
-
- clearRefreshEvents();
- return;
- }
-
- if (!m_hasConnectedHub)
- {
- NFD_LOG_INFO("no hub connected when unregistering " << prefix);
- return;
- }
-
- std::pair<Name, size_t> identity = findIdentityForRegistration(prefix);
-
- if (0 == identity.second)
- {
- NFD_LOG_INFO("no proper identity found for unregistering " << prefix);
- return;
- }
-
- Name prefixForRegistration;
- if (identity.first.size() == identity.second)
- {
- prefixForRegistration = identity.first;
- }
- else
- {
- prefixForRegistration = identity.first.getPrefix(-1);
- }
-
- RegisteredEntryIt iRegEntry = m_regEntries.find(prefixForRegistration);
- if (m_regEntries.end() == iRegEntry)
- {
- NFD_LOG_INFO("no existing entry found when unregistering " << prefix);
- return;
- }
-
- for (auto&& entry : m_rib)
- {
- if (prefixForRegistration.isPrefixOf(entry.first) &&
- findIdentityForRegistration(entry.first) == identity)
- {
- NFD_LOG_INFO("this identity should be kept for other rib entry: "
- << entry.first);
- return;
- }
- }
-
- scheduler::cancel(iRegEntry->second);
- m_regEntries.erase(iRegEntry);
-
- // make copies of m_controlParameters and m_commandOptions to
- // avoid unreasonable overwriting during concurrent registration
- // and unregistration.
- ControlParameters parameters = m_controlParameters;
- CommandOptions options = m_commandOptions;
-
- startUnregistration(parameters.setName(prefixForRegistration).unsetCost(),
- options.setSigningIdentity(identity.first),
- m_nRetries);
-}
-
-std::pair<Name, size_t>
-RemoteRegistrator::findIdentityForRegistration(const Name& prefix)
-{
- std::pair<Name, size_t> candidateIdentity;
- std::vector<Name> identities;
- bool isPrefix = false;
- size_t maxLength = 0, curLength = 0;
-
- // get all identies from the key-cahin except the default one.
- m_keyChain.getAllIdentities(identities, false);
-
- // get the default identity.
- identities.push_back(m_keyChain.getDefaultIdentity());
-
- // longest prefix matching to all indenties.
- for (auto&& i : identities)
- {
- if (!i.empty() && IGNORE_COMMPONENT == i.at(-1))
- {
- isPrefix = i.getPrefix(-1).isPrefixOf(prefix);
- curLength = i.size() - 1;
- }
- else
- {
- isPrefix = i.isPrefixOf(prefix);
- curLength = i.size();
- }
-
- if (isPrefix && curLength > maxLength)
- {
- candidateIdentity.first = i;
- maxLength = curLength;
- }
- }
-
- candidateIdentity.second = maxLength;
-
- return candidateIdentity;
-}
-
-void
-RemoteRegistrator::startRegistration(const ControlParameters& parameters,
- const CommandOptions& options,
- int nRetries)
-{
- NFD_LOG_INFO("start register " << parameters.getName());
-
- m_nfdController.start<ndn::nfd::RibRegisterCommand>(
- parameters,
- bind(&RemoteRegistrator::onRegSuccess,
- this, parameters, options),
- bind(&RemoteRegistrator::onRegFailure,
- this, _1, _2, parameters, options, nRetries),
- options);
-}
-
-void
-RemoteRegistrator::startUnregistration(const ControlParameters& parameters,
- const CommandOptions& options,
- int nRetries)
-{
- NFD_LOG_INFO("start unregister " << parameters.getName());
-
- m_nfdController.start<ndn::nfd::RibUnregisterCommand>(
- parameters,
- bind(&RemoteRegistrator::onUnregSuccess,
- this, parameters, options),
- bind(&RemoteRegistrator::onUnregFailure,
- this, _1, _2, parameters, options, nRetries),
- options);
-}
-
-void
-RemoteRegistrator::onRegSuccess(const ControlParameters& parameters,
- const CommandOptions& options)
-{
- NFD_LOG_INFO("success to register " << parameters.getName());
-
- RegisteredEntryIt iRegEntry = m_regEntries.find(parameters.getName());
-
- if (m_regEntries.end() != iRegEntry)
- {
- NFD_LOG_DEBUG("Existing Entry: (" << iRegEntry->first
- << ", " << iRegEntry->second
- << ")");
-
- scheduler::cancel(iRegEntry->second);
- iRegEntry->second = scheduler::schedule(
- m_refreshInterval,
- bind(&RemoteRegistrator::startRegistration,
- this, parameters, options, m_nRetries));
- }
- else
- {
- NFD_LOG_DEBUG("New Entry");
- m_regEntries.insert(RegisteredEntry(
- parameters.getName(),
- scheduler::schedule(
- m_refreshInterval,
- bind(&RemoteRegistrator::startRegistration,
- this, parameters, options, m_nRetries))));
- }
-}
-
-void
-RemoteRegistrator::onRegFailure(uint32_t code, const std::string& reason,
- const ControlParameters& parameters,
- const CommandOptions& options,
- int nRetries)
-{
- NFD_LOG_INFO("fail to register " << parameters.getName()
- << "\n\t reason:" << reason
- << "\n\t remain retries:" << nRetries);
-
- if (nRetries > 0)
- {
- startRegistration(parameters, options, nRetries - 1);
- }
-}
-
-void
-RemoteRegistrator::onUnregSuccess(const ControlParameters& parameters,
- const CommandOptions& options)
-{
- NFD_LOG_INFO("success to unregister " << parameters.getName());
-}
-
-void
-RemoteRegistrator::onUnregFailure(uint32_t code, const std::string& reason,
- const ControlParameters& parameters,
- const CommandOptions& options,
- int nRetries)
-{
- NFD_LOG_INFO("fail to unregister " << parameters.getName()
- << "\n\t reason:" << reason
- << "\n\t remain retries:" << nRetries);
-
- if (nRetries > 0)
- {
- startUnregistration(parameters, options, nRetries - 1);
- }
-}
-
-void
-RemoteRegistrator::redoRegistration()
-{
- NFD_LOG_INFO("redo " << m_regEntries.size()
- << " registration when new Hub connection is built.");
-
- for (auto&& entry : m_regEntries)
- {
- // make copies to avoid unreasonable overwrite.
- ControlParameters parameters = m_controlParameters;
- CommandOptions options = m_commandOptions;
- startRegistration(parameters.setName(entry.first),
- options.setSigningIdentity(entry.first),
- m_nRetries);
- }
-}
-
-void
-RemoteRegistrator::clearRefreshEvents()
-{
- for (auto&& entry : m_regEntries)
- {
- scheduler::cancel(entry.second);
- }
-}
-
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/rib/remote-registrator.hpp b/NFD/rib/remote-registrator.hpp
deleted file mode 100644
index 0d9eea3..0000000
--- a/NFD/rib/remote-registrator.hpp
+++ /dev/null
@@ -1,250 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_RIB_REMOTE_REGISTRATOR_HPP
-#define NFD_RIB_REMOTE_REGISTRATOR_HPP
-
-#include "rib.hpp"
-#include "core/config-file.hpp"
-#include "rib-status-publisher.hpp"
-
-#include <unordered_map>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/management/nfd-controller.hpp>
-#include <ndn-cxx/management/nfd-control-command.hpp>
-#include <ndn-cxx/management/nfd-control-parameters.hpp>
-#include <ndn-cxx/management/nfd-command-options.hpp>
-#include <ndn-cxx/util/signal.hpp>
-
-namespace nfd {
-namespace rib {
-
-/**
- * @brief define the RemoteRegistrator class, which handles
- * the registration/unregistration to remote hub(s).
- */
-class RemoteRegistrator : noncopyable
-{
-public:
- class Error : public std::runtime_error
- {
- public:
- explicit
- Error(const std::string& what)
- : std::runtime_error(what)
- {
- }
- };
-
- RemoteRegistrator(ndn::nfd::Controller& controller,
- ndn::KeyChain& keyChain,
- Rib& rib);
-
- ~RemoteRegistrator();
-
- /**
- * @brief load the "remote_register" section from config file
- *
- * @param configSection the sub section in "rib" section.
- */
- void
- loadConfig(const ConfigSection& configSection);
-
- /**
- * @brief enable remote registration/unregistration.
- *
- */
- void
- enable();
-
- /**
- * @brief disable remote registration/unregistration.
- *
- */
- void
- disable();
-
- /**
- * @brief register a prefix to remote hub(s).
- *
- * For the input prefix, we find the longest identity
- * in the key-chain that can sign it, and then
- * register this identity to remote hub(s).
- *
- * @param prefix the prefix being registered in local RIB.
- */
- void
- registerPrefix(const Name& prefix);
-
- /**
- * @brief unregister a prefix from remote hub(s).
- *
- * For the input prefix, if the longest identity can sign it
- * is already registered remotely, that identity should be
- * unregistered from remote hub(s).
- *
- * @param prefix the prefix being unregistered in local RIB.
- */
- void
- unregisterPrefix(const Name& prefix);
-
-private:
- /**
- * @brief find the most proper identity that can sign the
- * registration/unregistration command for the input prefix.
- *
- * @return the identity and the length of the longest match to the
- * input prefix.
- *
- * @retval { ignored, 0 } no matching identity
- */
- std::pair<Name, size_t>
- findIdentityForRegistration(const Name& prefix);
-
- /**
- * @brief make and send the remote registration command.
- *
- * @param nRetries remaining number of retries.
- */
- void
- startRegistration(const ndn::nfd::ControlParameters& parameters,
- const ndn::nfd::CommandOptions& options,
- int nRetries);
-
- /**
- * @brief make and send the remote unregistration command.
- *
- * @param nRetries remaining number of retries.
- */
- void
- startUnregistration(const ndn::nfd::ControlParameters& parameters,
- const ndn::nfd::CommandOptions& options,
- int nRetries);
- /**
- * @brief refresh the remotely registered entry if registration
- * successes by re-sending the registration command.
- *
- * The interval of sending refresh command is defined in the
- * "remote_register" section of the config file.
- *
- * @param parameters the same paremeters from startRegistration.
- * @param options the same options as in startRegistration.
- */
- void
- onRegSuccess(const ndn::nfd::ControlParameters& parameters,
- const ndn::nfd::CommandOptions& options);
-
- /**
- * @brief retry to send registration command if registration fails.
- *
- * the number of retries is defined in the "remote_register"
- * section of the config file.
- *
- * @param code error code.
- * @param reason error reason in string.
- * @param parameters the same paremeters from startRegistration.
- * @param options the same options from startRegistration.
- * @param nRetries remaining number of retries.
- */
- void
- onRegFailure(uint32_t code, const std::string& reason,
- const ndn::nfd::ControlParameters& parameters,
- const ndn::nfd::CommandOptions& options,
- int nRetries);
-
- void
- onUnregSuccess(const ndn::nfd::ControlParameters& parameters,
- const ndn::nfd::CommandOptions& options);
-
- /**
- * @brief retry to send unregistration command if registration fails.
- *
- * the number of retries is defined in the "remote_register"
- * section of the config file.
- *
- * @param code error code.
- * @param reason error reason in string.
- * @param parameters the same paremeters as in startRegistration.
- * @param options the same options as in startRegistration.
- * @param nRetries remaining number of retries.
- */
- void
- onUnregFailure(uint32_t code, const std::string& reason,
- const ndn::nfd::ControlParameters& parameters,
- const ndn::nfd::CommandOptions& options,
- int nRetries);
-
- /**
- * @brief re-register all prefixes
- *
- * This is called when a HUB connection is established.
- */
- void
- redoRegistration();
-
- /**
- * @brief clear all refresh events
- *
- * This is called when all HUB connections are lost.
- */
- void
- clearRefreshEvents();
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
- /**
- * When a locally registered prefix triggles remote
- * registration, we actually register the longest
- * identity that can sign this prefix to remote hub(s).
- *
- * Thus, the remotely reigstered prefix does not equal
- * to Route Name. So it needs seperate sotrage instead
- * of storing within the RIB.
- */
- typedef std::unordered_map<Name, EventId> RegisteredList;
- typedef RegisteredList::iterator RegisteredEntryIt;
- typedef RegisteredList::value_type RegisteredEntry;
- RegisteredList m_regEntries;
-
-private:
- ndn::nfd::Controller& m_nfdController;
- ndn::KeyChain& m_keyChain;
- Rib& m_rib;
- ndn::util::signal::ScopedConnection m_afterInsertConnection;
- ndn::util::signal::ScopedConnection m_afterEraseConnection;
- ndn::nfd::ControlParameters m_controlParameters;
- ndn::nfd::CommandOptions m_commandOptions;
- time::seconds m_refreshInterval;
- bool m_hasConnectedHub;
- int m_nRetries;
-
- static const Name LOCAL_REGISTRATION_PREFIX; // /localhost
- static const Name REMOTE_HUB_PREFIX; // /localhop/nfd/rib
- static const name::Component IGNORE_COMMPONENT; // rib
-};
-
-} // namespace rib
-} // namespace nfd
-
-#endif // NFD_RIB_REMOTE_REGISTRATOR_HPP
diff --git a/NFD/rib/rib-entry.cpp b/NFD/rib/rib-entry.cpp
deleted file mode 100644
index 3e24275..0000000
--- a/NFD/rib/rib-entry.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib-entry.hpp"
-
-#include "core/logger.hpp"
-
-#include <ndn-cxx/management/nfd-control-command.hpp>
-
-NFD_LOG_INIT("RibEntry");
-
-namespace nfd {
-namespace rib {
-
-RibEntry::FaceList::iterator
-RibEntry::findFace(const FaceEntry& face)
-{
- return std::find_if(begin(), end(), bind(&compareFaceIdAndOrigin, _1, face));
-}
-
-bool
-RibEntry::insertFace(const FaceEntry& entry)
-{
- iterator it = findFace(entry);
-
- if (it == end())
- {
- if (entry.flags & ndn::nfd::ROUTE_FLAG_CAPTURE)
- {
- m_nFacesWithCaptureSet++;
- }
-
- m_faces.push_back(entry);
- return true;
- }
- else
- {
- return false;
- }
-}
-
-void
-RibEntry::eraseFace(const FaceEntry& face)
-{
- RibEntry::iterator it = std::find_if(begin(), end(), bind(&compareFaceIdAndOrigin, _1, face));
- eraseFace(it);
-}
-
-bool
-RibEntry::hasFace(const FaceEntry& face)
-{
- RibEntry::const_iterator it = std::find_if(cbegin(), cend(),
- bind(&compareFaceIdAndOrigin, _1, face));
-
- return it != cend();
-}
-
-bool
-RibEntry::hasFaceId(const uint64_t faceId) const
-{
- RibEntry::const_iterator it = std::find_if(cbegin(), cend(), bind(&compareFaceId, _1, faceId));
-
- return it != cend();
-}
-
-void
-RibEntry::addChild(shared_ptr<RibEntry> child)
-{
- BOOST_ASSERT(!static_cast<bool>(child->getParent()));
- child->setParent(this->shared_from_this());
- m_children.push_back(child);
-}
-
-void
-RibEntry::removeChild(shared_ptr<RibEntry> child)
-{
- BOOST_ASSERT(child->getParent().get() == this);
- child->setParent(shared_ptr<RibEntry>());
- m_children.remove(child);
-}
-
-RibEntry::FaceList::iterator
-RibEntry::eraseFace(FaceList::iterator face)
-{
- if (face != m_faces.end())
- {
- if (face->flags & ndn::nfd::ROUTE_FLAG_CAPTURE)
- {
- m_nFacesWithCaptureSet--;
- }
-
- //cancel any scheduled event
- NFD_LOG_TRACE("Cancelling expiration eventId: " << face->getExpirationEvent());
- scheduler::cancel(face->getExpirationEvent());
-
- return m_faces.erase(face);
- }
-
- return m_faces.end();
-}
-
-void
-RibEntry::addInheritedFace(const FaceEntry& face)
-{
- m_inheritedFaces.push_back(face);
-}
-
-void
-RibEntry::removeInheritedFace(const FaceEntry& face)
-{
- FaceList::iterator it = findInheritedFace(face);
- m_inheritedFaces.erase(it);
-}
-
-RibEntry::FaceList::iterator
-RibEntry::findInheritedFace(const FaceEntry& face)
-{
- return std::find_if(m_inheritedFaces.begin(), m_inheritedFaces.end(),
- bind(&compareFaceId, _1, face.faceId));
-}
-
-bool
-RibEntry::hasInheritedFace(const FaceEntry& face)
-{
- FaceList::const_iterator it = findInheritedFace(face);
-
- return (it != m_inheritedFaces.end());
-}
-
-bool
-RibEntry::hasCapture() const
-{
- return m_nFacesWithCaptureSet > 0;
-}
-
-bool
-RibEntry::hasChildInheritOnFaceId(uint64_t faceId) const
-{
- for (RibEntry::const_iterator it = m_faces.begin(); it != m_faces.end(); ++it)
- {
- if (it->faceId == faceId && (it->flags & ndn::nfd::ROUTE_FLAG_CHILD_INHERIT))
- {
- return true;
- }
- }
-
- return false;
-}
-
-shared_ptr<FaceEntry>
-RibEntry::getFaceWithLowestCostByFaceId(uint64_t faceId)
-{
- shared_ptr<FaceEntry> face;
-
- for (FaceList::iterator it = begin(); it != end(); ++it)
- {
- // Correct face ID
- if (it->faceId == faceId)
- {
- // If this is the first face with this ID found
- if (!static_cast<bool>(face))
- {
- face = make_shared<FaceEntry>(*it);
- }
- else if (it->cost < face->cost) // Found a face with a lower cost
- {
- face = make_shared<FaceEntry>(*it);
- }
- }
- }
-
- return face;
-}
-
-shared_ptr<FaceEntry>
-RibEntry::getFaceWithLowestCostAndChildInheritByFaceId(uint64_t faceId)
-{
- shared_ptr<FaceEntry> face;
-
- for (FaceList::iterator it = begin(); it != end(); ++it)
- {
- // Correct face ID and Child Inherit flag set
- if (it->faceId == faceId && it->flags & ndn::nfd::ROUTE_FLAG_CHILD_INHERIT)
- {
- // If this is the first face with this ID found
- if (!static_cast<bool>(face))
- {
- face = make_shared<FaceEntry>(*it);
- }
- else if (it->cost < face->cost) // Found a face with a lower cost
- {
- face = make_shared<FaceEntry>(*it);
- }
- }
- }
-
- return face;
-}
-
-std::ostream&
-operator<<(std::ostream& os, const FaceEntry& entry)
-{
- os << "FaceEntry("
- << "faceid: " << entry.faceId
- << ", origin: " << entry.origin
- << ", cost: " << entry.cost
- << ", flags: " << entry.flags;
- if (entry.expires != time::steady_clock::TimePoint::max()) {
- os << ", expires in: " << (entry.expires - time::steady_clock::now());
- }
- else {
- os << ", never expires";
- }
- os << ")";
-
- return os;
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RibEntry& entry)
-{
- os << "RibEntry {\n";
- os << "\tName: " << entry.getName() << "\n";
-
- for (RibEntry::FaceList::const_iterator faceIt = entry.cbegin(); faceIt != entry.cend(); ++faceIt)
- {
- os << "\t" << (*faceIt) << "\n";
- }
-
- os << "}";
-
- return os;
-}
-
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/rib/rib-entry.hpp b/NFD/rib/rib-entry.hpp
deleted file mode 100644
index b17085a..0000000
--- a/NFD/rib/rib-entry.hpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_RIB_RIB_ENTRY_HPP
-#define NFD_RIB_RIB_ENTRY_HPP
-
-#include "face-entry.hpp"
-
-namespace nfd {
-namespace rib {
-
-/** \class RibEntry
- * \brief represents a namespace
- */
-class RibEntry : public enable_shared_from_this<RibEntry>
-{
-public:
- typedef std::list<FaceEntry> FaceList;
- typedef FaceList::iterator iterator;
- typedef FaceList::const_iterator const_iterator;
-
- RibEntry()
- : m_nFacesWithCaptureSet(0)
- {
- }
-
- void
- setName(const Name& prefix);
-
- const Name&
- getName() const;
-
- shared_ptr<RibEntry>
- getParent() const;
-
- bool
- hasParent() const;
-
- void
- addChild(shared_ptr<RibEntry> child);
-
- void
- removeChild(shared_ptr<RibEntry> child);
-
- std::list<shared_ptr<RibEntry> >&
- getChildren();
-
- bool
- hasChildren() const;
-
- /** \brief inserts a new face into the entry's face list
- * If another entry already exists with the same faceId and origin,
- * the new face is not inserted.
- * \return{ true if the face is inserted, false otherwise }
- */
- bool
- insertFace(const FaceEntry& face);
-
- /** \brief erases a FaceEntry with the same faceId and origin
- */
- void
- eraseFace(const FaceEntry& face);
-
- /** \brief erases a FaceEntry with the passed iterator
- * \return{ an iterator to the element that followed the erased iterator }
- */
- iterator
- eraseFace(FaceList::iterator face);
-
- bool
- hasFaceId(const uint64_t faceId) const;
-
- FaceList&
- getFaces();
-
- iterator
- findFace(const FaceEntry& face);
-
- bool
- hasFace(const FaceEntry& face);
-
- void
- addInheritedFace(const FaceEntry& face);
-
- void
- removeInheritedFace(const FaceEntry& face);
-
- /** \brief Returns the faces this namespace has inherited.
- * The inherited faces returned represent inherited entries this namespace has in the FIB.
- * \return{ faces inherited by this namespace }
- */
- FaceList&
- getInheritedFaces();
-
- /** \brief Finds an inherited face with a matching face ID.
- * \return{ An iterator to the matching face if one is found;
- * otherwise, an iterator to the end of the entry's
- * inherited face list }
- */
- FaceList::iterator
- findInheritedFace(const FaceEntry& face);
-
- /** \brief Determines if the entry has an inherited face with a matching face ID.
- * \return{ True, if a matching inherited face is found; otherwise, false. }
- */
- bool
- hasInheritedFace(const FaceEntry& face);
-
- bool
- hasCapture() const;
-
- /** \brief Determines if the entry has an inherited face with the passed
- * face ID and its child inherit flag set.
- * \return{ True, if a matching inherited face is found; otherwise, false. }
- */
- bool
- hasChildInheritOnFaceId(uint64_t faceId) const;
-
- /** \brief Returns the face with the lowest cost that has the passed face ID.
- * \return{ The face with with the lowest cost that has the passed face ID}
- */
- shared_ptr<FaceEntry>
- getFaceWithLowestCostByFaceId(uint64_t faceId);
-
- /** \brief Returns the face with the lowest cost that has the passed face ID
- * and its child inherit flag set.
- * \return{ The face with with the lowest cost that has the passed face ID
- * and its child inherit flag set }
- */
- shared_ptr<FaceEntry>
- getFaceWithLowestCostAndChildInheritByFaceId(uint64_t faceId);
-
- const_iterator
- cbegin() const;
-
- const_iterator
- cend() const;
-
- iterator
- begin();
-
- iterator
- end();
-
-private:
- void
- setParent(shared_ptr<RibEntry> parent);
-
-private:
- Name m_name;
- std::list<shared_ptr<RibEntry> > m_children;
- shared_ptr<RibEntry> m_parent;
- FaceList m_faces;
- FaceList m_inheritedFaces;
-
- /** \brief The number of faces on this namespace with the capture flag set.
- *
- * This count is used to check if the namespace will block inherited faces.
- * If the number is greater than zero, a route on the namespace has it's capture
- * flag set which means the namespace should not inherit any faces.
- */
- uint64_t m_nFacesWithCaptureSet;
-};
-
-inline void
-RibEntry::setName(const Name& prefix)
-{
- m_name = prefix;
-}
-
-inline const Name&
-RibEntry::getName() const
-{
- return m_name;
-}
-
-inline void
-RibEntry::setParent(shared_ptr<RibEntry> parent)
-{
- m_parent = parent;
-}
-
-inline shared_ptr<RibEntry>
-RibEntry::getParent() const
-{
- return m_parent;
-}
-
-inline std::list<shared_ptr<RibEntry> >&
-RibEntry::getChildren()
-{
- return m_children;
-}
-
-inline RibEntry::FaceList&
-RibEntry::getFaces()
-{
- return m_faces;
-}
-
-inline RibEntry::FaceList&
-RibEntry::getInheritedFaces()
-{
- return m_inheritedFaces;
-}
-
-inline RibEntry::const_iterator
-RibEntry::cbegin() const
-{
- return m_faces.begin();
-}
-
-inline RibEntry::const_iterator
-RibEntry::cend() const
-{
- return m_faces.end();
-}
-
-inline RibEntry::iterator
-RibEntry::begin()
-{
- return m_faces.begin();
-}
-
-inline RibEntry::iterator
-RibEntry::end()
-{
- return m_faces.end();
-}
-
-std::ostream&
-operator<<(std::ostream& os, const RibEntry& entry);
-
-} // namespace rib
-} // namespace nfd
-
-#endif // NFD_RIB_RIB_ENTRY_HPP
diff --git a/NFD/rib/rib-manager.cpp b/NFD/rib/rib-manager.cpp
deleted file mode 100644
index 7d0f5b3..0000000
--- a/NFD/rib/rib-manager.cpp
+++ /dev/null
@@ -1,880 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib-manager.hpp"
-#include "core/global-io.hpp"
-#include "core/logger.hpp"
-#include "core/scheduler.hpp"
-#include <ndn-cxx/management/nfd-face-status.hpp>
-
-namespace nfd {
-namespace rib {
-
-NFD_LOG_INIT("RibManager");
-
-const Name RibManager::COMMAND_PREFIX = "/localhost/nfd/rib";
-const Name RibManager::REMOTE_COMMAND_PREFIX = "/localhop/nfd/rib";
-const Name RibManager::FACES_LIST_DATASET_PREFIX = "/localhost/nfd/faces/list";
-
-const size_t RibManager::COMMAND_UNSIGNED_NCOMPS =
- RibManager::COMMAND_PREFIX.size() +
- 1 + // verb
- 1; // verb options
-
-const size_t RibManager::COMMAND_SIGNED_NCOMPS =
- RibManager::COMMAND_UNSIGNED_NCOMPS +
- 4; // (timestamp, nonce, signed info tlv, signature tlv)
-
-const RibManager::SignedVerbAndProcessor RibManager::SIGNED_COMMAND_VERBS[] =
- {
- SignedVerbAndProcessor(
- Name::Component("register"),
- &RibManager::registerEntry
- ),
-
- SignedVerbAndProcessor(
- Name::Component("unregister"),
- &RibManager::unregisterEntry
- ),
- };
-
-const RibManager::UnsignedVerbAndProcessor RibManager::UNSIGNED_COMMAND_VERBS[] =
- {
- UnsignedVerbAndProcessor(
- Name::Component("list"),
- &RibManager::listEntries
- ),
- };
-
-const Name RibManager::LIST_COMMAND_PREFIX("/localhost/nfd/rib/list");
-const size_t RibManager::LIST_COMMAND_NCOMPS = LIST_COMMAND_PREFIX.size();
-
-const time::seconds RibManager::ACTIVE_FACE_FETCH_INTERVAL = time::seconds(300);
-
-RibManager::RibManager(ndn::Face& face)
- : m_face(face)
- , m_nfdController(m_face, m_keyChain)
- , m_localhostValidator(m_face)
- , m_localhopValidator(m_face)
- , m_faceMonitor(m_face)
- , m_isLocalhopEnabled(false)
- , m_remoteRegistrator(m_nfdController, m_keyChain, m_managedRib)
- , m_ribStatusPublisher(m_managedRib, face, LIST_COMMAND_PREFIX, m_keyChain)
- , m_lastTransactionId(0)
- , m_signedVerbDispatch(SIGNED_COMMAND_VERBS,
- SIGNED_COMMAND_VERBS +
- (sizeof(SIGNED_COMMAND_VERBS) / sizeof(SignedVerbAndProcessor)))
- , m_unsignedVerbDispatch(UNSIGNED_COMMAND_VERBS,
- UNSIGNED_COMMAND_VERBS +
- (sizeof(UNSIGNED_COMMAND_VERBS) / sizeof(UnsignedVerbAndProcessor)))
-{
-}
-
-RibManager::~RibManager()
-{
- scheduler::cancel(m_activeFaceFetchEvent);
-}
-
-void
-RibManager::startListening(const Name& commandPrefix, const ndn::OnInterest& onRequest)
-{
- NFD_LOG_INFO("Listening on: " << commandPrefix);
-
- m_nfdController.start<ndn::nfd::FibAddNextHopCommand>(
- ControlParameters()
- .setName(commandPrefix)
- .setFaceId(0),
- bind(&RibManager::onNrdCommandPrefixAddNextHopSuccess, this, cref(commandPrefix)),
- bind(&RibManager::onNrdCommandPrefixAddNextHopError, this, cref(commandPrefix), _2));
-
- m_face.setInterestFilter(commandPrefix, onRequest);
-}
-
-void
-RibManager::registerWithNfd()
-{
- //check whether the components of localhop and localhost prefixes are same
- BOOST_ASSERT(COMMAND_PREFIX.size() == REMOTE_COMMAND_PREFIX.size());
-
- this->startListening(COMMAND_PREFIX, bind(&RibManager::onLocalhostRequest, this, _2));
-
- if (m_isLocalhopEnabled) {
- this->startListening(REMOTE_COMMAND_PREFIX,
- bind(&RibManager::onLocalhopRequest, this, _2));
- }
-
- NFD_LOG_INFO("Start monitoring face create/destroy events");
- m_faceMonitor.onNotification += bind(&RibManager::onNotification, this, _1);
- m_faceMonitor.start();
-
- scheduleActiveFaceFetch(ACTIVE_FACE_FETCH_INTERVAL);
-}
-
-void
-RibManager::setConfigFile(ConfigFile& configFile)
-{
- configFile.addSectionHandler("rib",
- bind(&RibManager::onConfig, this, _1, _2, _3));
-}
-
-void
-RibManager::onConfig(const ConfigSection& configSection,
- bool isDryRun,
- const std::string& filename)
-{
- bool isRemoteRegisterEnabled = false;
-
- for (ConfigSection::const_iterator i = configSection.begin();
- i != configSection.end(); ++i)
- {
- if (i->first == "localhost_security")
- m_localhostValidator.load(i->second, filename);
- else if (i->first == "localhop_security")
- {
- m_localhopValidator.load(i->second, filename);
- m_isLocalhopEnabled = true;
- }
- else if (i->first == "remote_register")
- {
- m_remoteRegistrator.loadConfig(i->second);
- isRemoteRegisterEnabled = true;
- // avoid other actions when isDryRun == true
- if (isDryRun)
- {
- continue;
- }
-
- m_remoteRegistrator.enable();
- }
- else
- throw Error("Unrecognized rib property: " + i->first);
- }
-
- if (!isRemoteRegisterEnabled)
- {
- m_remoteRegistrator.disable();
- }
-}
-
-void
-RibManager::sendResponse(const Name& name,
- const ControlResponse& response)
-{
- const Block& encodedControl = response.wireEncode();
-
- shared_ptr<Data> responseData = make_shared<Data>(name);
- responseData->setContent(encodedControl);
-
- m_keyChain.sign(*responseData);
- m_face.put(*responseData);
-}
-
-void
-RibManager::sendResponse(const Name& name,
- uint32_t code,
- const std::string& text)
-{
- ControlResponse response(code, text);
- sendResponse(name, response);
-}
-
-void
-RibManager::onLocalhostRequest(const Interest& request)
-{
- const Name& command = request.getName();
- const Name::Component& verb = command.get(COMMAND_PREFIX.size());
-
- UnsignedVerbDispatchTable::const_iterator unsignedVerbProcessor = m_unsignedVerbDispatch.find(verb);
-
- if (unsignedVerbProcessor != m_unsignedVerbDispatch.end())
- {
- NFD_LOG_DEBUG("command result: processing unsigned verb: " << verb);
- (unsignedVerbProcessor->second)(this, request);
- }
- else
- {
- m_localhostValidator.validate(request,
- bind(&RibManager::onCommandValidated, this, _1),
- bind(&RibManager::onCommandValidationFailed, this, _1, _2));
- }
-}
-
-void
-RibManager::onLocalhopRequest(const Interest& request)
-{
- m_localhopValidator.validate(request,
- bind(&RibManager::onCommandValidated, this, _1),
- bind(&RibManager::onCommandValidationFailed, this, _1, _2));
-}
-
-void
-RibManager::onCommandValidated(const shared_ptr<const Interest>& request)
-{
- // REMOTE_COMMAND_PREFIX number of componenets are same as
- // NRD_COMMAND_PREFIX's so no extra checks are required.
-
- const Name& command = request->getName();
- const Name::Component& verb = command[COMMAND_PREFIX.size()];
- const Name::Component& parameterComponent = command[COMMAND_PREFIX.size() + 1];
-
- SignedVerbDispatchTable::const_iterator verbProcessor = m_signedVerbDispatch.find(verb);
- if (verbProcessor != m_signedVerbDispatch.end())
- {
- ControlParameters parameters;
- if (!extractParameters(parameterComponent, parameters))
- {
- NFD_LOG_DEBUG("command result: malformed verb: " << verb);
- if (static_cast<bool>(request))
- sendResponse(command, 400, "Malformed command");
- return;
- }
-
- NFD_LOG_DEBUG("command result: processing verb: " << verb);
- (verbProcessor->second)(this, request, parameters);
- }
- else
- {
- NFD_LOG_DEBUG("Unsupported command: " << verb);
- if (static_cast<bool>(request))
- sendResponse(request->getName(), 501, "Unsupported command");
- }
-}
-
-void
-RibManager::registerEntry(const shared_ptr<const Interest>& request,
- ControlParameters& parameters)
-{
- ndn::nfd::RibRegisterCommand command;
-
- if (!validateParameters(command, parameters))
- {
- NFD_LOG_DEBUG("register result: FAIL reason: malformed");
-
- if (static_cast<bool>(request))
- {
- sendResponse(request->getName(), 400, "Malformed command");
- }
-
- return;
- }
-
- bool isSelfRegistration = (!parameters.hasFaceId() || parameters.getFaceId() == 0);
- if (isSelfRegistration)
- {
- parameters.setFaceId(request->getIncomingFaceId());
- }
-
- FaceEntry faceEntry;
- faceEntry.faceId = parameters.getFaceId();
- faceEntry.origin = parameters.getOrigin();
- faceEntry.cost = parameters.getCost();
- faceEntry.flags = parameters.getFlags();
-
- if (parameters.hasExpirationPeriod() &&
- parameters.getExpirationPeriod() != time::milliseconds::max())
- {
- faceEntry.expires = time::steady_clock::now() + parameters.getExpirationPeriod();
-
- // Schedule a new event, the old one will be cancelled during rib insertion.
- EventId eventId;
- eventId = scheduler::schedule(parameters.getExpirationPeriod(),
- bind(&RibManager::expireEntry,
- this, shared_ptr<Interest>(), parameters));
- NFD_LOG_TRACE("Scheduled unregistration at: " << faceEntry.expires <<
- " with EventId: " << eventId);
-
- //set the NewEventId of this entry
- faceEntry.setExpirationEvent(eventId);
- }
- else
- {
- faceEntry.expires = time::steady_clock::TimePoint::max();
- }
-
- NFD_LOG_TRACE("register prefix: " << faceEntry);
-
- m_managedRib.insert(parameters.getName(), faceEntry);
- m_registeredFaces.insert(faceEntry.faceId);
-
- sendUpdatesToFib(request, parameters);
-}
-
-void
-RibManager::expireEntry(const shared_ptr<const Interest>& request, ControlParameters& params)
-{
- FaceEntry face;
- face.faceId = params.getFaceId();
- face.origin = params.getOrigin();
- face.cost = params.getCost();
- face.flags = params.getFlags();
-
- NFD_LOG_DEBUG(face << " for " << params.getName() << " has expired");
- unregisterEntry(request, params);
-}
-
-void
-RibManager::unregisterEntry(const shared_ptr<const Interest>& request,
- ControlParameters& params)
-{
- ndn::nfd::RibUnregisterCommand command;
-
- //passing all parameters gives error in validation.
- //so passing only the required arguments.
- ControlParameters parameters;
- parameters.setName(params.getName());
- if (params.hasFaceId())
- parameters.setFaceId(params.getFaceId());
- if (params.hasOrigin())
- parameters.setOrigin(params.getOrigin());
-
- if (!validateParameters(command, parameters))
- {
- NFD_LOG_DEBUG("unregister result: FAIL reason: malformed");
- if (static_cast<bool>(request))
- sendResponse(request->getName(), 400, "Malformed command");
- return;
- }
-
- bool isSelfRegistration = (!parameters.hasFaceId() || parameters.getFaceId() == 0);
- if (isSelfRegistration)
- {
- parameters.setFaceId(request->getIncomingFaceId());
- }
-
- FaceEntry faceEntry;
- faceEntry.faceId = parameters.getFaceId();
- faceEntry.origin = parameters.getOrigin();
-
- NFD_LOG_TRACE("unregister prefix: " << faceEntry);
-
- m_managedRib.erase(parameters.getName(), faceEntry);
-
- sendUpdatesToFib(request, parameters);
-}
-
-void
-RibManager::onCommandValidationFailed(const shared_ptr<const Interest>& request,
- const std::string& failureInfo)
-{
- NFD_LOG_DEBUG("RibRequestValidationFailed: " << failureInfo);
- if (static_cast<bool>(request))
- sendResponse(request->getName(), 403, failureInfo);
-}
-
-
-bool
-RibManager::extractParameters(const Name::Component& parameterComponent,
- ControlParameters& extractedParameters)
-{
- try
- {
- Block rawParameters = parameterComponent.blockFromValue();
- extractedParameters.wireDecode(rawParameters);
- }
- catch (const tlv::Error&)
- {
- return false;
- }
-
- NFD_LOG_DEBUG("Parameters parsed OK");
- return true;
-}
-
-bool
-RibManager::validateParameters(const ControlCommand& command,
- ControlParameters& parameters)
-{
- try
- {
- command.validateRequest(parameters);
- }
- catch (const ControlCommand::ArgumentError&)
- {
- return false;
- }
-
- command.applyDefaultsToRequest(parameters);
-
- return true;
-}
-
-void
-RibManager::onCommandError(uint32_t code, const std::string& error,
- const shared_ptr<const Interest>& request,
- const FaceEntry& faceEntry)
-{
- NFD_LOG_ERROR("NFD returned an error: " << error << " (code: " << code << ")");
-
- ControlResponse response;
-
- if (code == 404)
- {
- response.setCode(code);
- response.setText(error);
- }
- else
- {
- response.setCode(533);
- std::ostringstream os;
- os << "Failure to update NFD " << "(NFD Error: " << code << " " << error << ")";
- response.setText(os.str());
- }
-
- if (static_cast<bool>(request))
- sendResponse(request->getName(), response);
-}
-
-void
-RibManager::onRegSuccess(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters,
- const FaceEntry& faceEntry)
-{
- ControlResponse response;
-
- response.setCode(200);
- response.setText("Success");
- response.setBody(parameters.wireEncode());
-
- NFD_LOG_TRACE("onRegSuccess: registered " << faceEntry);
-
- if (static_cast<bool>(request))
- sendResponse(request->getName(), response);
-}
-
-
-void
-RibManager::onUnRegSuccess(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters,
- const FaceEntry& faceEntry)
-{
- ControlResponse response;
-
- response.setCode(200);
- response.setText("Success");
- response.setBody(parameters.wireEncode());
-
- NFD_LOG_TRACE("onUnRegSuccess: unregistered " << faceEntry);
-
- if (static_cast<bool>(request))
- sendResponse(request->getName(), response);
-}
-
-void
-RibManager::sendSuccessResponse(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters)
-{
- if (!static_cast<bool>(request))
- {
- return;
- }
-
- ControlResponse response;
-
- response.setCode(200);
- response.setText("Success");
- response.setBody(parameters.wireEncode());
-
- if (static_cast<bool>(request))
- sendResponse(request->getName(), response);
-}
-
-void
-RibManager::sendErrorResponse(uint32_t code, const std::string& error,
- const shared_ptr<const Interest>& request)
-{
- NFD_LOG_ERROR("NFD returned an error: " << error << " (code: " << code << ")");
-
- if (!static_cast<bool>(request))
- {
- return;
- }
-
- ControlResponse response;
-
- if (code == 404)
- {
- response.setCode(code);
- response.setText(error);
- }
- else
- {
- response.setCode(533);
- std::ostringstream os;
- os << "Failure to update NFD " << "(NFD Error: " << code << " " << error << ")";
- response.setText(os.str());
- }
-
- if (static_cast<bool>(request))
- sendResponse(request->getName(), response);
-}
-
-void
-RibManager::onNrdCommandPrefixAddNextHopSuccess(const Name& prefix)
-{
- NFD_LOG_DEBUG("Successfully registered " + prefix.toUri() + " with NFD");
-}
-
-void
-RibManager::onNrdCommandPrefixAddNextHopError(const Name& name, const std::string& msg)
-{
- throw Error("Error in setting interest filter (" + name.toUri() + "): " + msg);
-}
-
-bool
-RibManager::isTransactionComplete(const TransactionId transactionId)
-{
- FibTransactionTable::iterator it = m_pendingFibTransactions.find(transactionId);
-
- if (it != m_pendingFibTransactions.end())
- {
- int& updatesLeft = it->second;
-
- updatesLeft--;
-
- // All of the updates have been applied successfully
- if (updatesLeft == 0)
- {
- m_pendingFibTransactions.erase(it);
- return true;
- }
- }
-
- return false;
-}
-
-void
-RibManager::invalidateTransaction(const TransactionId transactionId)
-{
- FibTransactionTable::iterator it = m_pendingFibTransactions.find(transactionId);
-
- if (it != m_pendingFibTransactions.end())
- {
- m_pendingFibTransactions.erase(it);
- }
-}
-
-void
-RibManager::onAddNextHopSuccess(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters,
- const TransactionId transactionId,
- const bool shouldSendResponse)
-{
- if (isTransactionComplete(transactionId) && shouldSendResponse)
- {
- sendSuccessResponse(request, parameters);
- }
-}
-
-void
-RibManager::onAddNextHopError(uint32_t code, const std::string& error,
- const shared_ptr<const Interest>& request,
- const TransactionId transactionId, const bool shouldSendResponse)
-{
- invalidateTransaction(transactionId);
-
- if (shouldSendResponse)
- {
- sendErrorResponse(code, error, request);
- }
-
- // Since the FIB rejected the update, clean up the invalid face
- scheduleActiveFaceFetch(time::seconds(1));
-}
-
-void
-RibManager::onRemoveNextHopSuccess(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters,
- const TransactionId transactionId,
- const bool shouldSendResponse)
-{
- if (isTransactionComplete(transactionId) && shouldSendResponse)
- {
- sendSuccessResponse(request, parameters);
- }
-}
-
-void
-RibManager::onRemoveNextHopError(uint32_t code, const std::string& error,
- const shared_ptr<const Interest>& request,
- const TransactionId transactionId, const bool shouldSendResponse)
-{
- invalidateTransaction(transactionId);
-
- if (shouldSendResponse)
- {
- sendErrorResponse(code, error, request);
- }
-}
-
-void
-RibManager::onControlHeaderSuccess()
-{
- NFD_LOG_DEBUG("Local control header enabled");
-}
-
-void
-RibManager::onControlHeaderError(uint32_t code, const std::string& reason)
-{
- std::ostringstream os;
- os << "Couldn't enable local control header "
- << "(code: " << code << ", info: " << reason << ")";
- throw Error(os.str());
-}
-
-void
-RibManager::enableLocalControlHeader()
-{
- m_nfdController.start<ndn::nfd::FaceEnableLocalControlCommand>(
- ControlParameters()
- .setLocalControlFeature(ndn::nfd::LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID),
- bind(&RibManager::onControlHeaderSuccess, this),
- bind(&RibManager::onControlHeaderError, this, _1, _2));
-}
-
-void
-RibManager::onNotification(const FaceEventNotification& notification)
-{
- NFD_LOG_TRACE("onNotification: " << notification);
-
- if (notification.getKind() == ndn::nfd::FACE_EVENT_DESTROYED)
- {
- NFD_LOG_DEBUG("Received notification for destroyed faceId: " << notification.getFaceId());
-
- scheduler::schedule(time::seconds(0),
- bind(&RibManager::processErasureAfterNotification, this,
- notification.getFaceId()));
- }
-}
-
-void
-RibManager::processErasureAfterNotification(uint64_t faceId)
-{
- m_managedRib.erase(faceId);
- m_registeredFaces.erase(faceId);
-
- sendUpdatesToFibAfterFaceDestroyEvent();
-}
-
-void
-RibManager::sendUpdatesToFib(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters)
-{
- const Rib::FibUpdateList& updates = m_managedRib.getFibUpdates();
-
- // If no updates were generated, consider the operation a success
- if (updates.empty())
- {
- sendSuccessResponse(request, parameters);
- return;
- }
-
- bool shouldWaitToRespond = false;
-
- // An application request should wait for all FIB updates to be applied
- // successfully before sending a response
- if (parameters.getOrigin() == ndn::nfd::ROUTE_ORIGIN_APP)
- {
- shouldWaitToRespond = true;
- }
- else // Respond immediately
- {
- sendSuccessResponse(request, parameters);
- }
-
- std::string updateString = (updates.size() == 1) ? " update" : " updates";
- NFD_LOG_DEBUG("Applying " << updates.size() << updateString << " to FIB");
-
- // Assign an ID to this FIB transaction
- TransactionId currentTransactionId = ++m_lastTransactionId;
-
- // Add this transaction to the transaction table
- m_pendingFibTransactions[currentTransactionId] = updates.size();
-
- for (Rib::FibUpdateList::const_iterator it = updates.begin(); it != updates.end(); ++it)
- {
- shared_ptr<const FibUpdate> update(*it);
- NFD_LOG_DEBUG("Sending FIB update: " << *update);
-
- if (update->action == FibUpdate::ADD_NEXTHOP)
- {
- FaceEntry faceEntry;
- faceEntry.faceId = update->faceId;
- faceEntry.cost = update->cost;
-
- m_nfdController.start<ndn::nfd::FibAddNextHopCommand>(
- ControlParameters()
- .setName(update->name)
- .setFaceId(faceEntry.faceId)
- .setCost(faceEntry.cost),
- bind(&RibManager::onAddNextHopSuccess, this, request,
- parameters,
- currentTransactionId,
- shouldWaitToRespond),
- bind(&RibManager::onAddNextHopError, this, _1, _2, request, currentTransactionId,
- shouldWaitToRespond));
- }
- else if (update->action == FibUpdate::REMOVE_NEXTHOP)
- {
- FaceEntry faceEntry;
- faceEntry.faceId = update->faceId;
-
- m_nfdController.start<ndn::nfd::FibRemoveNextHopCommand>(
- ControlParameters()
- .setName(update->name)
- .setFaceId(faceEntry.faceId),
- bind(&RibManager::onRemoveNextHopSuccess, this, request,
- parameters,
- currentTransactionId,
- shouldWaitToRespond),
- bind(&RibManager::onRemoveNextHopError, this, _1, _2, request, currentTransactionId,
- shouldWaitToRespond));
- }
- }
-
- m_managedRib.clearFibUpdates();
-}
-
-void
-RibManager::sendUpdatesToFibAfterFaceDestroyEvent()
-{
- ControlParameters parameters;
- parameters.setOrigin(ndn::nfd::ROUTE_ORIGIN_STATIC);
-
- sendUpdatesToFib(shared_ptr<const Interest>(), parameters);
-}
-
-void
-RibManager::listEntries(const Interest& request)
-{
- const Name& command = request.getName();
- const size_t commandNComps = command.size();
-
- if (commandNComps < LIST_COMMAND_NCOMPS ||
- !LIST_COMMAND_PREFIX.isPrefixOf(command))
- {
- NFD_LOG_DEBUG("command result: malformed");
- sendResponse(command, 400, "Malformed command");
- return;
- }
-
- m_ribStatusPublisher.publish();
-}
-
-void
-RibManager::scheduleActiveFaceFetch(const time::seconds& timeToWait)
-{
- scheduler::cancel(m_activeFaceFetchEvent);
-
- m_activeFaceFetchEvent = scheduler::schedule(timeToWait,
- bind(&RibManager::fetchActiveFaces, this));
-}
-
-void
-RibManager::fetchActiveFaces()
-{
- NFD_LOG_DEBUG("Fetching active faces");
-
- Interest interest(FACES_LIST_DATASET_PREFIX);
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
-
- shared_ptr<ndn::OBufferStream> buffer = make_shared<ndn::OBufferStream>();
-
- m_face.expressInterest(interest,
- bind(&RibManager::fetchSegments, this, _2, buffer),
- bind(&RibManager::onFetchFaceStatusTimeout, this));
-}
-
-void
-RibManager::fetchSegments(const Data& data, shared_ptr<ndn::OBufferStream> buffer)
-{
- buffer->write(reinterpret_cast<const char*>(data.getContent().value()),
- data.getContent().value_size());
-
- uint64_t currentSegment = data.getName().get(-1).toSegment();
-
- const name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
- if (finalBlockId.empty() || finalBlockId.toSegment() > currentSegment)
- {
- m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment+1),
- bind(&RibManager::fetchSegments, this, _2, buffer),
- bind(&RibManager::onFetchFaceStatusTimeout, this));
- }
- else
- {
- removeInvalidFaces(buffer);
- }
-}
-
-void
-RibManager::removeInvalidFaces(shared_ptr<ndn::OBufferStream> buffer)
-{
- NFD_LOG_DEBUG("Checking for invalid face registrations");
-
- ndn::ConstBufferPtr buf = buffer->buf();
-
- Block block;
- size_t offset = 0;
- FaceIdSet activeFaces;
-
- while (offset < buf->size())
- {
- if (!Block::fromBuffer(buf, offset, block))
- {
- std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- ndn::nfd::FaceStatus status(block);
- activeFaces.insert(status.getFaceId());
- }
-
- // Look for face IDs that were registered but not active to find missed
- // face destroyed events
- for (FaceIdSet::iterator it = m_registeredFaces.begin(); it != m_registeredFaces.end(); ++it)
- {
- if (activeFaces.find(*it) == activeFaces.end())
- {
- NFD_LOG_DEBUG("Removing invalid face ID: " << *it);
- scheduler::schedule(time::seconds(0),
- bind(&RibManager::processErasureAfterNotification, this, *it));
- }
- }
-
- // Reschedule the check for future clean up
- scheduleActiveFaceFetch(ACTIVE_FACE_FETCH_INTERVAL);
-}
-
-void
-RibManager::onFetchFaceStatusTimeout()
-{
- std::cerr << "Face Status Dataset request timed out" << std::endl;
- scheduleActiveFaceFetch(ACTIVE_FACE_FETCH_INTERVAL);
-}
-
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/rib/rib-manager.hpp b/NFD/rib/rib-manager.hpp
deleted file mode 100644
index 181d210..0000000
--- a/NFD/rib/rib-manager.hpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_RIB_RIB_MANAGER_HPP
-#define NFD_RIB_RIB_MANAGER_HPP
-
-#include "rib.hpp"
-#include "core/config-file.hpp"
-#include "rib-status-publisher.hpp"
-#include "remote-registrator.hpp"
-
-#include <ndn-cxx/security/validator-config.hpp>
-#include <ndn-cxx/management/nfd-face-monitor.hpp>
-#include <ndn-cxx/management/nfd-controller.hpp>
-#include <ndn-cxx/management/nfd-control-command.hpp>
-#include <ndn-cxx/management/nfd-control-response.hpp>
-#include <ndn-cxx/management/nfd-control-parameters.hpp>
-
-namespace nfd {
-namespace rib {
-
-using ndn::nfd::ControlCommand;
-using ndn::nfd::ControlResponse;
-using ndn::nfd::ControlParameters;
-
-using ndn::nfd::FaceEventNotification;
-
-class RibManager : noncopyable
-{
-public:
- class Error : public std::runtime_error
- {
- public:
- explicit
- Error(const std::string& what)
- : std::runtime_error(what)
- {
- }
- };
-
- explicit
- RibManager(ndn::Face& face);
-
- ~RibManager();
-
- void
- registerWithNfd();
-
- void
- enableLocalControlHeader();
-
- void
- setConfigFile(ConfigFile& configFile);
-
-private:
- typedef uint32_t TransactionId;
-
- void
- onConfig(const ConfigSection& configSection,
- bool isDryRun,
- const std::string& filename);
-
- void
- startListening(const Name& commandPrefix, const ndn::OnInterest& onRequest);
-
- void
- onLocalhopRequest(const Interest& request);
-
- void
- onLocalhostRequest(const Interest& request);
-
- void
- sendResponse(const Name& name,
- const ControlResponse& response);
-
- void
- sendResponse(const Name& name,
- uint32_t code,
- const std::string& text);
-
- void
- sendSuccessResponse(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters);
-
- void
- sendErrorResponse(uint32_t code, const std::string& error,
- const shared_ptr<const Interest>& request);
-
- void
- registerEntry(const shared_ptr<const Interest>& request,
- ControlParameters& parameters);
-
- void
- unregisterEntry(const shared_ptr<const Interest>& request,
- ControlParameters& parameters);
-
- void
- expireEntry(const shared_ptr<const Interest>& request, ControlParameters& params);
-
- void
- onCommandValidated(const shared_ptr<const Interest>& request);
-
- void
- onCommandValidationFailed(const shared_ptr<const Interest>& request,
- const std::string& failureInfo);
-
-
- void
- onCommandError(uint32_t code, const std::string& error,
- const shared_ptr<const Interest>& request,
- const FaceEntry& faceEntry);
-
- void
- onRegSuccess(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters,
- const FaceEntry& faceEntry);
-
- void
- onUnRegSuccess(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters,
- const FaceEntry& faceEntry);
-
- void
- onNrdCommandPrefixAddNextHopSuccess(const Name& prefix);
-
- void
- onNrdCommandPrefixAddNextHopError(const Name& name, const std::string& msg);
-
- void
- onAddNextHopSuccess(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters,
- const TransactionId transactionId,
- const bool shouldSendResponse);
-
- void
- onAddNextHopError(uint32_t code, const std::string& error,
- const shared_ptr<const Interest>& request,
- const TransactionId transactionId, const bool shouldSendResponse);
-
- void
- onRemoveNextHopSuccess(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters,
- const TransactionId transactionId,
- const bool shouldSendResponse);
-
- void
- onRemoveNextHopError(uint32_t code, const std::string& error,
- const shared_ptr<const Interest>& request,
- const TransactionId transactionId, const bool shouldSendResponse);
-
- void
- onControlHeaderSuccess();
-
- void
- onControlHeaderError(uint32_t code, const std::string& reason);
-
- static bool
- extractParameters(const Name::Component& parameterComponent,
- ControlParameters& extractedParameters);
-
- bool
- validateParameters(const ControlCommand& command,
- ControlParameters& parameters);
-
- void
- onNotification(const FaceEventNotification& notification);
-
- void
- processErasureAfterNotification(uint64_t faceId);
-
- void
- sendUpdatesToFib(const shared_ptr<const Interest>& request,
- const ControlParameters& parameters);
-
- void
- sendUpdatesToFibAfterFaceDestroyEvent();
-
- /** \brief Checks if the transaction has received all of the expected responses
- * from the FIB.
- * \return{ True if the transaction with the passed transactionId has applied
- * all of its FIB updates successfully; otherwise, false }
- */
- bool
- isTransactionComplete(const TransactionId transactionId);
-
- void
- invalidateTransaction(const TransactionId transactionId);
-
- void
- listEntries(const Interest& request);
-
- void
- scheduleActiveFaceFetch(const time::seconds& timeToWait);
-
- void
- fetchActiveFaces();
-
- void
- fetchSegments(const Data& data, shared_ptr<ndn::OBufferStream> buffer);
-
- void
- onFetchFaceStatusTimeout();
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
- /** \param buffer Face dataset contents
- */
- void
- removeInvalidFaces(shared_ptr<ndn::OBufferStream> buffer);
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
- Rib m_managedRib;
-
-private:
- ndn::Face& m_face;
- ndn::nfd::Controller m_nfdController;
- ndn::KeyChain m_keyChain;
- ndn::ValidatorConfig m_localhostValidator;
- ndn::ValidatorConfig m_localhopValidator;
- ndn::nfd::FaceMonitor m_faceMonitor;
- bool m_isLocalhopEnabled;
- RemoteRegistrator m_remoteRegistrator;
-
- RibStatusPublisher m_ribStatusPublisher;
-
- /** \brief The last transaction ID for FIB update response messages.
- * Each group of FIB updates applied to the FIB is assigned an incrementing
- * ID that is used to track the number of successfully applied updates.
- */
- TransactionId m_lastTransactionId;
-
- /// table of FIB update transactions => count of pending FIB updates
- typedef std::map<TransactionId, int> FibTransactionTable;
-
- /** \brief Table used to track the number of FIB updates that have not yet received
- * a response from the FIB.
- * The table maps a transaction ID to the number of updates remaining for that
- * specific transaction.
- */
- FibTransactionTable m_pendingFibTransactions;
-
- typedef function<void(RibManager*,
- const shared_ptr<const Interest>& request,
- ControlParameters& parameters)> SignedVerbProcessor;
-
- typedef std::map<name::Component, SignedVerbProcessor> SignedVerbDispatchTable;
-
- typedef std::pair<name::Component, SignedVerbProcessor> SignedVerbAndProcessor;
-
-
- const SignedVerbDispatchTable m_signedVerbDispatch;
-
- static const Name COMMAND_PREFIX; // /localhost/nrd
- static const Name REMOTE_COMMAND_PREFIX; // /localhop/nrd
-
- // number of components in an invalid, but not malformed, unsigned command.
- // (/localhost/nrd + verb + options) = 4
- static const size_t COMMAND_UNSIGNED_NCOMPS;
-
- // number of components in a valid signed Interest.
- // 8 with signed Interest support.
- static const size_t COMMAND_SIGNED_NCOMPS;
-
- static const SignedVerbAndProcessor SIGNED_COMMAND_VERBS[];
-
- typedef function<void(RibManager*, const Interest&)> UnsignedVerbProcessor;
- typedef std::map<Name::Component, UnsignedVerbProcessor> UnsignedVerbDispatchTable;
- typedef std::pair<Name::Component, UnsignedVerbProcessor> UnsignedVerbAndProcessor;
-
- const UnsignedVerbDispatchTable m_unsignedVerbDispatch;
- static const UnsignedVerbAndProcessor UNSIGNED_COMMAND_VERBS[];
-
- static const Name LIST_COMMAND_PREFIX;
- static const size_t LIST_COMMAND_NCOMPS;
-
- static const Name FACES_LIST_DATASET_PREFIX;
-
- static const time::seconds ACTIVE_FACE_FETCH_INTERVAL;
- EventId m_activeFaceFetchEvent;
-
- typedef std::set<uint64_t> FaceIdSet;
- /** \brief contains FaceIds with one or more Routes in the RIB
- */
- FaceIdSet m_registeredFaces;
-};
-
-} // namespace rib
-} // namespace nfd
-
-#endif // NFD_RIB_RIB_MANAGER_HPP
diff --git a/NFD/rib/rib-status-publisher.cpp b/NFD/rib/rib-status-publisher.cpp
deleted file mode 100644
index 76a164c..0000000
--- a/NFD/rib/rib-status-publisher.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib-status-publisher.hpp"
-#include "rib/rib.hpp"
-#include "core/logger.hpp"
-
-#include <ndn-cxx/management/nfd-rib-entry.hpp>
-#include <ndn-cxx/face.hpp>
-
-namespace nfd {
-namespace rib {
-
-NFD_LOG_INIT("RibStatusPublisher");
-
-RibStatusPublisher::RibStatusPublisher(const Rib& rib,
- ndn::Face& face,
- const Name& prefix,
- ndn::KeyChain& keyChain)
- : SegmentPublisher<ndn::Face>(face, prefix, keyChain)
- , m_rib(rib)
-{
-}
-
-RibStatusPublisher::~RibStatusPublisher()
-{
-}
-
-size_t
-RibStatusPublisher::generate(ndn::EncodingBuffer& outBuffer)
-{
- size_t totalLength = 0;
-
- for (Rib::const_iterator ribIt = m_rib.begin(); ribIt != m_rib.end(); ++ribIt)
- {
- RibEntry& entry = *ribIt->second;
-
- const Name& prefix = entry.getName();
- size_t ribEntryLength = 0;
-
- ndn::nfd::RibEntry tlvEntry;
- const RibEntry::FaceList& faces = entry.getFaces();
-
- for (RibEntry::FaceList::const_iterator faceIt = faces.begin();
- faceIt != faces.end(); ++faceIt)
- {
- const FaceEntry& face = *faceIt;
-
- ndn::nfd::Route route;
- route
- .setFaceId(face.faceId)
- .setOrigin(face.origin)
- .setCost(face.cost)
- .setFlags(face.flags);
- if (face.expires < time::steady_clock::TimePoint::max()) {
- route.setExpirationPeriod(time::duration_cast<time::milliseconds>
- (face.expires - time::steady_clock::now()));
- }
- tlvEntry.addRoute(route);
- }
-
- tlvEntry.setName(prefix);
- ribEntryLength += tlvEntry.wireEncode(outBuffer);
-
- NFD_LOG_DEBUG("generate: rib entry length = " << ribEntryLength);
-
- totalLength += ribEntryLength;
- }
- NFD_LOG_DEBUG("generate: Total length = " << totalLength);
- return totalLength;
-}
-
-
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/rib/rib-status-publisher.hpp b/NFD/rib/rib-status-publisher.hpp
deleted file mode 100644
index 8673983..0000000
--- a/NFD/rib/rib-status-publisher.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_RIB_RIB_STATUS_PUBLISHER_HPP
-#define NFD_RIB_RIB_STATUS_PUBLISHER_HPP
-
-#include "core/segment-publisher.hpp"
-#include <ndn-cxx/face.hpp>
-
-namespace nfd {
-namespace rib {
-
-class Rib;
-
-class RibStatusPublisher : public SegmentPublisher<ndn::Face>
-{
-public:
- RibStatusPublisher(const Rib& rib,
- ndn::Face& face,
- const Name& prefix,
- ndn::KeyChain& keyChain);
-
- virtual
- ~RibStatusPublisher();
-
-protected:
- virtual size_t
- generate(ndn::EncodingBuffer& outBuffer);
-
-private:
- const Rib& m_rib;
-};
-
-
-} // namespace rib
-} // namespace nfd
-
-#endif
diff --git a/NFD/rib/rib.cpp b/NFD/rib/rib.cpp
deleted file mode 100644
index 02df45e..0000000
--- a/NFD/rib/rib.cpp
+++ /dev/null
@@ -1,866 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib.hpp"
-
-#include "core/logger.hpp"
-
-NFD_LOG_INIT("Rib");
-
-namespace nfd {
-namespace rib {
-
-static inline bool
-sortFace(const FaceEntry& entry1, const FaceEntry& entry2)
-{
- return entry1.faceId < entry2.faceId;
-}
-
-static inline bool
-isChildInheritFlagSet(uint64_t flags)
-{
- return flags & ndn::nfd::ROUTE_FLAG_CHILD_INHERIT;
-}
-
-static inline bool
-isCaptureFlagSet(uint64_t flags)
-{
- return flags & ndn::nfd::ROUTE_FLAG_CAPTURE;
-}
-
-static inline bool
-isAnyFlagSet(uint64_t flags)
-{
- return isChildInheritFlagSet(flags) || isCaptureFlagSet(flags);
-}
-
-static inline bool
-areBothFlagsSet(uint64_t flags)
-{
- return isChildInheritFlagSet(flags) && isCaptureFlagSet(flags);
-}
-
-Rib::Rib()
- : m_nItems(0)
-{
-}
-
-Rib::const_iterator
-Rib::find(const Name& prefix) const
-{
- return m_rib.find(prefix);
-}
-
-FaceEntry*
-Rib::find(const Name& prefix, const FaceEntry& face) const
-{
- RibTable::const_iterator ribIt = m_rib.find(prefix);
-
- // Name prefix exists
- if (ribIt != m_rib.end())
- {
- shared_ptr<RibEntry> entry(ribIt->second);
-
- RibEntry::iterator faceIt = std::find_if(entry->begin(), entry->end(),
- bind(&compareFaceIdAndOrigin, _1, face));
-
- if (faceIt != entry->end())
- {
- return &((*faceIt));
- }
- }
- return 0;
-}
-
-void
-Rib::insert(const Name& prefix, const FaceEntry& face)
-{
- RibTable::iterator ribIt = m_rib.find(prefix);
-
- // Name prefix exists
- if (ribIt != m_rib.end())
- {
- shared_ptr<RibEntry> entry(ribIt->second);
-
- RibEntry::iterator faceIt = std::find_if(entry->getFaces().begin(),
- entry->getFaces().end(),
- bind(&compareFaceIdAndOrigin, _1, face));
-
- if (faceIt == entry->end())
- {
- // Will the new face change the namespace's capture flag?
- bool captureWasTurnedOn = (entry->hasCapture() == false && isCaptureFlagSet(face.flags));
-
- // New face
- entry->insertFace(face);
- m_nItems++;
-
- // Register with face lookup table
- m_faceMap[face.faceId].push_back(entry);
-
- createFibUpdatesForNewFaceEntry(*entry, face, captureWasTurnedOn);
- }
- else // Entry exists, update fields
- {
- // First cancel old scheduled event, if any, then set the EventId to new one
- if (static_cast<bool>(faceIt->getExpirationEvent()))
- {
- NFD_LOG_TRACE("Cancelling expiration event for " << entry->getName() << " "
- << *faceIt);
- scheduler::cancel(faceIt->getExpirationEvent());
- }
-
- // No checks are required here as the iterator needs to be updated in all cases.
- faceIt->setExpirationEvent(face.getExpirationEvent());
-
- // Save flags for update processing
- uint64_t previousFlags = faceIt->flags;
-
- // If the entry's cost didn't change and child inherit is not set,
- // no need to traverse subtree.
- uint64_t previousCost = faceIt->cost;
-
- faceIt->flags = face.flags;
- faceIt->cost = face.cost;
- faceIt->expires = face.expires;
-
- createFibUpdatesForUpdatedEntry(*entry, face, previousFlags, previousCost);
- }
- }
- else // New name prefix
- {
- shared_ptr<RibEntry> entry(make_shared<RibEntry>(RibEntry()));
-
- m_rib[prefix] = entry;
- m_nItems++;
-
- entry->setName(prefix);
- entry->insertFace(face);
-
- // Find prefix's parent
- shared_ptr<RibEntry> parent = findParent(prefix);
-
- // Add self to parent's children
- if (static_cast<bool>(parent))
- {
- parent->addChild(entry);
- }
-
- RibEntryList children = findDescendants(prefix);
-
- for (std::list<shared_ptr<RibEntry> >::iterator child = children.begin();
- child != children.end(); ++child)
- {
- if ((*child)->getParent() == parent)
- {
- // Remove child from parent and inherit parent's child
- if (static_cast<bool>(parent))
- {
- parent->removeChild((*child));
- }
- entry->addChild((*child));
- }
- }
-
- // Register with face lookup table
- m_faceMap[face.faceId].push_back(entry);
-
- createFibUpdatesForNewRibEntry(*entry, face);
-
- // do something after inserting an entry
- afterInsertEntry(prefix);
- }
-}
-
-void
-Rib::erase(const Name& prefix, const FaceEntry& face)
-{
- RibTable::iterator ribIt = m_rib.find(prefix);
-
- // Name prefix exists
- if (ribIt != m_rib.end())
- {
- shared_ptr<RibEntry> entry(ribIt->second);
-
- const bool hadCapture = entry->hasCapture();
-
- // Need to copy face to do FIB updates with correct cost and flags since nfdc does not
- // pass flags or cost
- RibEntry::iterator faceIt = entry->findFace(face);
-
- if (faceIt != entry->end())
- {
- FaceEntry faceToErase = *faceIt;
- faceToErase.flags = faceIt->flags;
- faceToErase.cost = faceIt->cost;
-
- entry->eraseFace(faceIt);
-
- m_nItems--;
-
- const bool captureWasTurnedOff = (hadCapture && !entry->hasCapture());
-
- createFibUpdatesForErasedFaceEntry(*entry, faceToErase, captureWasTurnedOff);
-
- // If this RibEntry no longer has this faceId, unregister from face lookup table
- if (!entry->hasFaceId(face.faceId))
- {
- m_faceMap[face.faceId].remove(entry);
- }
- else
- {
- // The RibEntry still has the face ID; need to update FIB
- // with lowest cost for the same face instead of removing the face from the FIB
- shared_ptr<FaceEntry> lowCostFace = entry->getFaceWithLowestCostByFaceId(face.faceId);
-
- BOOST_ASSERT(static_cast<bool>(lowCostFace));
-
- createFibUpdatesForNewFaceEntry(*entry, *lowCostFace, false);
- }
-
- // If a RibEntry's facelist is empty, remove it from the tree
- if (entry->getFaces().size() == 0)
- {
- eraseEntry(ribIt);
- }
- }
- }
-}
-
-void
-Rib::erase(const uint64_t faceId)
-{
- FaceLookupTable::iterator lookupIt = m_faceMap.find(faceId);
-
- // No RIB entries have this face
- if (lookupIt == m_faceMap.end())
- {
- return;
- }
-
- RibEntryList& ribEntries = lookupIt->second;
-
- // For each RIB entry that has faceId, remove the face from the entry
- for (RibEntryList::iterator entryIt = ribEntries.begin(); entryIt != ribEntries.end(); ++entryIt)
- {
- shared_ptr<RibEntry> entry = *entryIt;
-
- const bool hadCapture = entry->hasCapture();
-
- // Find the faces in the entry
- for (RibEntry::iterator faceIt = entry->begin(); faceIt != entry->end(); ++faceIt)
- {
- if (faceIt->faceId == faceId)
- {
- FaceEntry copy = *faceIt;
-
- faceIt = entry->eraseFace(faceIt);
- m_nItems--;
-
- const bool captureWasTurnedOff = (hadCapture && !entry->hasCapture());
- createFibUpdatesForErasedFaceEntry(*entry, copy, captureWasTurnedOff);
- }
- }
-
- // If a RibEntry's facelist is empty, remove it from the tree
- if (entry->getFaces().size() == 0)
- {
- eraseEntry(m_rib.find(entry->getName()));
- }
- }
-
- // Face no longer exists, remove from face lookup table
- FaceLookupTable::iterator entryToDelete = m_faceMap.find(faceId);
-
- if (entryToDelete != m_faceMap.end())
- {
- m_faceMap.erase(entryToDelete);
- }
-}
-
-shared_ptr<RibEntry>
-Rib::findParent(const Name& prefix) const
-{
- for (int i = prefix.size() - 1; i >= 0; i--)
- {
- RibTable::const_iterator it = m_rib.find(prefix.getPrefix(i));
- if (it != m_rib.end())
- {
- return (it->second);
- }
- }
-
- return shared_ptr<RibEntry>();
-}
-
-std::list<shared_ptr<RibEntry> >
-Rib::findDescendants(const Name& prefix) const
-{
- std::list<shared_ptr<RibEntry> > children;
-
- RibTable::const_iterator it = m_rib.find(prefix);
-
- if (it != m_rib.end())
- {
- ++it;
- for (; it != m_rib.end(); ++it)
- {
- if (prefix.isPrefixOf(it->first))
- {
- children.push_back((it->second));
- }
- else
- {
- break;
- }
- }
- }
-
- return children;
-}
-
-Rib::RibTable::iterator
-Rib::eraseEntry(RibTable::iterator it)
-{
- // Entry does not exist
- if (it == m_rib.end())
- {
- return m_rib.end();
- }
-
- shared_ptr<RibEntry> entry(it->second);
-
- // Remove inherited routes from namespace
- createFibUpdatesForErasedRibEntry(*entry);
-
- shared_ptr<RibEntry> parent = entry->getParent();
-
- // Remove self from parent's children
- if (static_cast<bool>(parent))
- {
- parent->removeChild(entry);
- }
-
- std::list<shared_ptr<RibEntry> > children = entry->getChildren();
-
- for (RibEntryList::iterator child = children.begin(); child != children.end(); ++child)
- {
- // Remove children from self
- entry->removeChild(*child);
-
- // Update parent's children
- if (static_cast<bool>(parent))
- {
- parent->addChild(*child);
- }
- }
-
- // Must save and advance iterator to return a valid iterator
- RibTable::iterator nextIt = it;
- nextIt++;
-
- m_rib.erase(it);
-
- // do something after erasing an entry.
- afterEraseEntry(entry->getName());
-
- return nextIt;
-}
-
-bool
-compareFibUpdates(const shared_ptr<const FibUpdate> lhs, const shared_ptr<const FibUpdate> rhs)
-{
- return ((lhs->name == rhs->name) &&
- (lhs->faceId == rhs->faceId));
-}
-
-void
-Rib::insertFibUpdate(shared_ptr<FibUpdate> update)
-{
- // If an update with the same name and face already exists,
- // replace it
- FibUpdateList::iterator it = std::find_if(m_fibUpdateList.begin(), m_fibUpdateList.end(),
- bind(&compareFibUpdates, _1, update));
-
- if (it != m_fibUpdateList.end())
- {
- // Get rid of the const to alter the action, prevents copying or removal and
- // insertion
- FibUpdate& entry = const_cast<FibUpdate&>(*(*it));
- entry.action = update->action;
- entry.cost = update->cost;
- }
- else
- {
- m_fibUpdateList.push_back(update);
- }
-}
-
-void
-Rib::createFibUpdatesForNewRibEntry(RibEntry& entry, const FaceEntry& face)
-{
- // Create FIB update for new entry
- insertFibUpdate(FibUpdate::createAddUpdate(entry.getName(), face.faceId, face.cost));
-
- // No flags are set
- if (!isAnyFlagSet(face.flags))
- {
- // Add ancestor faces to self
- addInheritedFacesToEntry(entry, getAncestorFaces(entry));
- }
- else if (areBothFlagsSet(face.flags))
- {
- // Add face to children
- FaceSet facesToAdd;
- facesToAdd.insert(face);
-
- // Remove faces blocked by capture and add self to children
- modifyChildrensInheritedFaces(entry, facesToAdd, getAncestorFaces(entry));
- }
- else if (isChildInheritFlagSet(face.flags))
- {
- FaceSet ancestorFaces = getAncestorFaces(entry);
-
- // Add ancestor faces to self
- addInheritedFacesToEntry(entry, ancestorFaces);
-
- // If there is an ancestor face which is the same as the new face, replace it
- // with the new face
- FaceSet::iterator it = ancestorFaces.find(face);
-
- // There is a face that needs to be overwritten, erase and then replace
- if (it != ancestorFaces.end())
- {
- ancestorFaces.erase(it);
- }
-
- // Add new face to ancestor list so it can be added to children
- ancestorFaces.insert(face);
-
- // Add ancestor faces to children
- modifyChildrensInheritedFaces(entry, ancestorFaces, FaceSet());
- }
- else if (isCaptureFlagSet(face.flags))
- {
- // Remove faces blocked by capture
- modifyChildrensInheritedFaces(entry, FaceSet(), getAncestorFaces(entry));
- }
-}
-
-void
-Rib::createFibUpdatesForNewFaceEntry(RibEntry& entry, const FaceEntry& face,
- bool captureWasTurnedOn)
-{
- // Only update if the new face has a lower cost than a previously installed face
- shared_ptr<FaceEntry> prevFace = entry.getFaceWithLowestCostAndChildInheritByFaceId(face.faceId);
-
- FaceSet facesToAdd;
- if (isChildInheritFlagSet(face.flags))
- {
- // Add to children if this new face doesn't override a previous lower cost, or
- // add to children if this new is lower cost than a previous face.
- // Less than equal, since entry may find this face
- if (!static_cast<bool>(prevFace) || face.cost <= prevFace->cost)
- {
- // Add self to children
- facesToAdd.insert(face);
- }
- }
-
- FaceSet facesToRemove;
- if (captureWasTurnedOn)
- {
- // Capture flag on
- facesToRemove = getAncestorFaces(entry);
-
- // Remove ancestor faces from self
- removeInheritedFacesFromEntry(entry, facesToRemove);
- }
-
- modifyChildrensInheritedFaces(entry, facesToAdd, facesToRemove);
-
- // If another face with same faceId and lower cost, don't update.
- // Must be done last so that add updates replace removal updates
- // Create FIB update for new entry
- if (face.cost <= entry.getFaceWithLowestCostByFaceId(face.faceId)->cost)
- {
- insertFibUpdate(FibUpdate::createAddUpdate(entry.getName(), face.faceId, face.cost));
- }
-}
-
-void
-Rib::createFibUpdatesForUpdatedEntry(RibEntry& entry, const FaceEntry& face,
- const uint64_t previousFlags, const uint64_t previousCost)
-{
- const bool costDidChange = (face.cost != previousCost);
-
- // Look for an installed face with the lowest cost and child inherit set
- shared_ptr<FaceEntry> prevFace = entry.getFaceWithLowestCostAndChildInheritByFaceId(face.faceId);
-
- // No flags changed and cost didn't change, no change in FIB
- if (face.flags == previousFlags && !costDidChange)
- {
- return;
- }
-
- // Cost changed so create update for the entry itself
- if (costDidChange)
- {
- // Create update if this face's cost is lower than other faces
- if (face.cost <= entry.getFaceWithLowestCostByFaceId(face.faceId)->cost)
- {
- // Create FIB update for the updated entry
- insertFibUpdate(FibUpdate::createAddUpdate(entry.getName(), face.faceId, face.cost));
- }
- else if (previousCost < entry.getFaceWithLowestCostByFaceId(face.faceId)->cost)
- {
- // Create update if this face used to be the lowest face but is no longer
- // the lowest cost face.
- insertFibUpdate(FibUpdate::createAddUpdate(entry.getName(), prevFace->faceId,
- prevFace->cost));
- }
-
- // If another face with same faceId and lower cost and ChildInherit exists,
- // don't update children.
- if (!static_cast<bool>(prevFace) || face.cost <= prevFace->cost)
- {
- // If no flags changed but child inheritance is set, need to update children
- // with new cost
- if ((face.flags == previousFlags) && isChildInheritFlagSet(face.flags))
- {
- // Add self to children
- FaceSet facesToAdd;
- facesToAdd.insert(face);
- modifyChildrensInheritedFaces(entry, facesToAdd, FaceSet());
-
- return;
- }
- }
- }
-
- // Child inherit was turned on
- if (!isChildInheritFlagSet(previousFlags) && isChildInheritFlagSet(face.flags))
- {
- // If another face with same faceId and lower cost and ChildInherit exists,
- // don't update children.
- if (!static_cast<bool>(prevFace) || face.cost <= prevFace->cost)
- {
- // Add self to children
- FaceSet facesToAdd;
- facesToAdd.insert(face);
- modifyChildrensInheritedFaces(entry, facesToAdd, FaceSet());
- }
-
- } // Child inherit was turned off
- else if (isChildInheritFlagSet(previousFlags) && !isChildInheritFlagSet(face.flags))
- {
- // Remove self from children
- FaceSet facesToRemove;
- facesToRemove.insert(face);
-
- FaceSet facesToAdd;
- // If another face with same faceId and ChildInherit exists, update children with this face.
- if (static_cast<bool>(prevFace))
- {
- facesToAdd.insert(*prevFace);
- }
- else
- {
- // Look for an ancestor that was blocked previously
- const FaceSet ancestorFaces = getAncestorFaces(entry);
- FaceSet::iterator it = ancestorFaces.find(face);
-
- // If an ancestor is found, add it to children
- if (it != ancestorFaces.end())
- {
- facesToAdd.insert(*it);
- }
- }
-
- modifyChildrensInheritedFaces(entry, facesToAdd, facesToRemove);
- }
-
- // Capture was turned on
- if (!isCaptureFlagSet(previousFlags) && isCaptureFlagSet(face.flags))
- {
- FaceSet ancestorFaces = getAncestorFaces(entry);
-
- // Remove ancestor faces from self
- removeInheritedFacesFromEntry(entry, ancestorFaces);
-
- // Remove ancestor faces from children
- modifyChildrensInheritedFaces(entry, FaceSet(), ancestorFaces);
- } // Capture was turned off
- else if (isCaptureFlagSet(previousFlags) && !isCaptureFlagSet(face.flags))
- {
- FaceSet ancestorFaces = getAncestorFaces(entry);
-
- // Add ancestor faces to self
- addInheritedFacesToEntry(entry, ancestorFaces);
-
- // Add ancestor faces to children
- modifyChildrensInheritedFaces(entry, ancestorFaces, FaceSet());
- }
-}
-
-void
-Rib::createFibUpdatesForErasedFaceEntry(RibEntry& entry, const FaceEntry& face,
- const bool captureWasTurnedOff)
-{
- insertFibUpdate(FibUpdate::createRemoveUpdate(entry.getName(), face.faceId));
-
- if (areBothFlagsSet(face.flags))
- {
- // Remove self from children
- FaceSet facesToRemove;
- facesToRemove.insert(face);
-
- // If capture is turned off for the route, need to add ancestors
- // to self and children
- FaceSet facesToAdd;
- if (captureWasTurnedOff)
- {
- // Look for an ancestors that were blocked previously
- facesToAdd = getAncestorFaces(entry);
-
- // Add ancestor faces to self
- addInheritedFacesToEntry(entry, facesToAdd);
- }
-
- modifyChildrensInheritedFaces(entry, facesToAdd, facesToRemove);
- }
- else if (isChildInheritFlagSet(face.flags))
- {
- // If not blocked by capture, add inherited routes to children
- FaceSet facesToAdd;
- if (!entry.hasCapture())
- {
- facesToAdd = getAncestorFaces(entry);
- }
-
- FaceSet facesToRemove;
- facesToRemove.insert(face);
-
- // Add ancestor faces to children
- modifyChildrensInheritedFaces(entry, facesToAdd, facesToRemove);
- }
- else if (isCaptureFlagSet(face.flags))
- {
- // If capture is turned off for the route, need to add ancestors
- // to self and children
- FaceSet facesToAdd;
- if (captureWasTurnedOff)
- {
- // Look for an ancestors that were blocked previously
- facesToAdd = getAncestorFaces(entry);
-
- // Add ancestor faces to self
- addInheritedFacesToEntry(entry, facesToAdd);
- }
-
- modifyChildrensInheritedFaces(entry, facesToAdd, FaceSet());
- }
-
- // Need to check if the removed face was blocking an inherited route
- FaceSet ancestorFaces = getAncestorFaces(entry);
-
- if (!entry.hasCapture())
- {
- // If there is an ancestor face which is the same as the erased face, add that face
- // to the current entry
- FaceSet::iterator it = ancestorFaces.find(face);
-
- if (it != ancestorFaces.end())
- {
- entry.addInheritedFace(*it);
- insertFibUpdate(FibUpdate::createAddUpdate(entry.getName(), it->faceId, it->cost));
- }
- }
-}
-
-void
-Rib::createFibUpdatesForErasedRibEntry(RibEntry& entry)
-{
- for (RibEntry::FaceList::iterator it = entry.getInheritedFaces().begin();
- it != entry.getInheritedFaces().end(); ++it)
- {
- insertFibUpdate(FibUpdate::createRemoveUpdate(entry.getName(), it->faceId));
- }
-}
-
-Rib::FaceSet
-Rib::getAncestorFaces(const RibEntry& entry) const
-{
- FaceSet ancestorFaces(&sortFace);
-
- shared_ptr<RibEntry> parent = entry.getParent();
-
- while (static_cast<bool>(parent))
- {
- for (RibEntry::iterator it = parent->getFaces().begin();
- it != parent->getFaces().end(); ++it)
- {
- if (isChildInheritFlagSet(it->flags))
- {
- ancestorFaces.insert(*it);
- }
- }
-
- if (parent->hasCapture())
- {
- break;
- }
-
- parent = parent->getParent();
- }
-
- return ancestorFaces;
-}
-
-void
-Rib::addInheritedFacesToEntry(RibEntry& entry, const Rib::FaceSet& facesToAdd)
-{
- for (FaceSet::const_iterator it = facesToAdd.begin(); it != facesToAdd.end(); ++it)
- {
- // Don't add an ancestor faceId if the namespace has an entry for that faceId
- if (!entry.hasFaceId(it->faceId))
- {
- entry.addInheritedFace(*it);
- insertFibUpdate(FibUpdate::createAddUpdate(entry.getName(), it->faceId, it->cost));
- }
- }
-}
-
-void
-Rib::removeInheritedFacesFromEntry(RibEntry& entry, const Rib::FaceSet& facesToRemove)
-{
- for (FaceSet::const_iterator it = facesToRemove.begin(); it != facesToRemove.end(); ++it)
- {
- // Only remove if the face has been inherited
- if (entry.hasInheritedFace(*it))
- {
- entry.removeInheritedFace(*it);
- insertFibUpdate(FibUpdate::createRemoveUpdate(entry.getName(), it->faceId));
- }
- }
-}
-
-void
-Rib::modifyChildrensInheritedFaces(RibEntry& entry, const Rib::FaceSet& facesToAdd,
- const Rib::FaceSet& facesToRemove)
-{
- RibEntryList children = entry.getChildren();
-
- for (RibEntryList::iterator child = children.begin(); child != children.end(); ++child)
- {
- traverseSubTree(*(*child), facesToAdd, facesToRemove);
- }
-}
-
-void
-Rib::traverseSubTree(RibEntry& entry, Rib::FaceSet facesToAdd,
- Rib::FaceSet facesToRemove)
-{
- // If a route on the namespace has the capture flag set, ignore self and children
- if (entry.hasCapture())
- {
- return;
- }
-
- // Remove inherited faces from current namespace
- for (Rib::FaceSet::const_iterator removeIt = facesToRemove.begin();
- removeIt != facesToRemove.end(); )
- {
- // If a route on the namespace has the same face and child inheritance set, ignore this face
- if (entry.hasChildInheritOnFaceId(removeIt->faceId))
- {
- facesToRemove.erase(removeIt++);
- continue;
- }
-
- // Only remove face if it removes an existing inherited route
- if (entry.hasInheritedFace(*removeIt))
- {
- entry.removeInheritedFace(*removeIt);
- insertFibUpdate(FibUpdate::createRemoveUpdate(entry.getName(), removeIt->faceId));
- }
-
- ++removeIt;
- }
-
- // Add inherited faces to current namespace
- for (Rib::FaceSet::const_iterator addIt = facesToAdd.begin();
- addIt != facesToAdd.end(); )
- {
- // If a route on the namespace has the same face and child inherit set, ignore this face
- if (entry.hasChildInheritOnFaceId(addIt->faceId))
- {
- facesToAdd.erase(addIt++);
- continue;
- }
-
- // Only add face if it does not override an existing route
- if (!entry.hasFaceId(addIt->faceId))
- {
- RibEntry::FaceList::iterator faceIt = entry.findInheritedFace(*addIt);
-
- // If the entry already has the inherited face, just update the face
- if (faceIt != entry.getInheritedFaces().end())
- {
- faceIt->cost = addIt->cost;
- }
- else // Otherwise, this is a newly inherited face
- {
- entry.addInheritedFace(*addIt);
- }
-
- insertFibUpdate(FibUpdate::createAddUpdate(entry.getName(), addIt->faceId, addIt->cost));
- }
-
- ++addIt;
- }
-
- Rib::RibEntryList children = entry.getChildren();
-
- // Apply face operations to current namespace's children
- for (Rib::RibEntryList::iterator child = children.begin(); child != children.end(); ++child)
- {
- traverseSubTree(*(*child), facesToAdd, facesToRemove);
- }
-}
-
-std::ostream&
-operator<<(std::ostream& os, const Rib& rib)
-{
- for (Rib::RibTable::const_iterator it = rib.begin(); it != rib.end(); ++it)
- {
- os << *(it->second) << "\n";
- }
-
- return os;
-}
-
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/rib/rib.hpp b/NFD/rib/rib.hpp
deleted file mode 100644
index 2568b1a..0000000
--- a/NFD/rib/rib.hpp
+++ /dev/null
@@ -1,194 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_RIB_RIB_HPP
-#define NFD_RIB_RIB_HPP
-
-#include "rib-entry.hpp"
-#include "fib-update.hpp"
-#include "common.hpp"
-#include <ndn-cxx/management/nfd-control-command.hpp>
-#include <ndn-cxx/util/signal.hpp>
-
-namespace nfd {
-namespace rib {
-
-/** \brief represents the RIB
- */
-class Rib : noncopyable
-{
-public:
- typedef std::list<shared_ptr<RibEntry> > RibEntryList;
- typedef std::map<Name, shared_ptr<RibEntry> > RibTable;
- typedef RibTable::const_iterator const_iterator;
- typedef std::map<uint64_t, std::list<shared_ptr<RibEntry> > > FaceLookupTable;
- typedef bool (*FaceComparePredicate)(const FaceEntry&, const FaceEntry&);
- typedef std::set<FaceEntry, FaceComparePredicate> FaceSet;
- typedef std::list<shared_ptr<const FibUpdate> > FibUpdateList;
-
- Rib();
-
- const_iterator
- find(const Name& prefix) const;
-
- FaceEntry*
- find(const Name& prefix, const FaceEntry& face) const;
-
- void
- insert(const Name& prefix, const FaceEntry& face);
-
- void
- erase(const Name& prefix, const FaceEntry& face);
-
- void
- erase(const uint64_t faceId);
-
- const_iterator
- begin() const;
-
- const_iterator
- end() const;
-
- size_t
- size() const;
-
- bool
- empty() const;
-
- shared_ptr<RibEntry>
- findParent(const Name& prefix) const;
-
- /** \brief finds namespaces under the passed prefix
- * \return{ a list of entries which are under the passed prefix }
- */
- std::list<shared_ptr<RibEntry> >
- findDescendants(const Name& prefix) const;
-
- const std::list<shared_ptr<const FibUpdate> >&
- getFibUpdates() const;
-
- void
- clearFibUpdates();
-
-private:
- RibTable::iterator
- eraseEntry(RibTable::iterator it);
-
- void
- insertFibUpdate(shared_ptr<FibUpdate> update);
-
- void
- createFibUpdatesForNewRibEntry(RibEntry& entry, const FaceEntry& face);
-
- void
- createFibUpdatesForNewFaceEntry(RibEntry& entry, const FaceEntry& face,
- const bool captureWasTurnedOn);
-
- void
- createFibUpdatesForUpdatedEntry(RibEntry& entry, const FaceEntry& face,
- const uint64_t previousFlags, const uint64_t previousCost);
- void
- createFibUpdatesForErasedFaceEntry(RibEntry& entry, const FaceEntry& face,
- const bool captureWasTurnedOff);
-
- void
- createFibUpdatesForErasedRibEntry(RibEntry& entry);
-
- FaceSet
- getAncestorFaces(const RibEntry& entry) const;
-
- void
- modifyChildrensInheritedFaces(RibEntry& entry, const Rib::FaceSet& facesToAdd,
- const Rib::FaceSet& facesToRemove);
-
- void
- traverseSubTree(RibEntry& entry, Rib::FaceSet facesToAdd,
- Rib::FaceSet facesToRemove);
-
- /** \brief Adds passed faces to the entry's inherited faces list
- */
- void
- addInheritedFacesToEntry(RibEntry& entry, const Rib::FaceSet& facesToAdd);
-
- /** \brief Removes passed faces from the entry's inherited faces list
- */
- void
- removeInheritedFacesFromEntry(RibEntry& entry, const Rib::FaceSet& facesToRemove);
-
-public:
- ndn::util::signal::Signal<Rib, Name> afterInsertEntry;
- ndn::util::signal::Signal<Rib, Name> afterEraseEntry;
-
-private:
- RibTable m_rib;
- FaceLookupTable m_faceMap;
- FibUpdateList m_fibUpdateList;
-
- size_t m_nItems;
-};
-
-inline Rib::const_iterator
-Rib::begin() const
-{
- return m_rib.begin();
-}
-
-inline Rib::const_iterator
-Rib::end() const
-{
- return m_rib.end();
-}
-
-inline size_t
-Rib::size() const
-{
- return m_nItems;
-}
-
-inline bool
-Rib::empty() const
-{
- return m_rib.empty();
-}
-
-inline const Rib::FibUpdateList&
-Rib::getFibUpdates() const
-{
- return m_fibUpdateList;
-}
-
-inline void
-Rib::clearFibUpdates()
-{
- m_fibUpdateList.clear();
-}
-
-std::ostream&
-operator<<(std::ostream& os, const Rib& rib);
-
-} // namespace rib
-} // namespace nfd
-
-#endif // NFD_RIB_RIB_HPP
diff --git a/NFD/tests/boost-test.hpp b/NFD/tests/boost-test.hpp
deleted file mode 100644
index a3b8579..0000000
--- a/NFD/tests/boost-test.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_BOOST_TEST_HPP
-#define NFD_TESTS_BOOST_TEST_HPP
-
-// suppress warnings from Boost.Test
-#pragma GCC system_header
-#pragma clang system_header
-
-#include <boost/test/unit_test.hpp>
-#include <boost/concept_check.hpp>
-#include <boost/test/output_test_stream.hpp>
-
-#endif // NFD_TESTS_BOOST_TEST_HPP
diff --git a/NFD/tests/core/config-file.cpp b/NFD/tests/core/config-file.cpp
deleted file mode 100644
index 29689dd..0000000
--- a/NFD/tests/core/config-file.cpp
+++ /dev/null
@@ -1,399 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "core/config-file.hpp"
-
-#include "tests/test-common.hpp"
-
-#include <fstream>
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("ConfigFileTest");
-
-BOOST_FIXTURE_TEST_SUITE(MgmtConfigFile, BaseFixture)
-
-// a
-// {
-// akey "avalue"
-// }
-// b
-// {
-// bkey "bvalue"
-// }
-
-const std::string CONFIG =
-"a\n"
-"{\n"
-" akey \"avalue\"\n"
-"}\n"
-"b\n"
-"{\n"
-" bkey \"bvalue\"\n"
-"}\n";
-
-
-// a
-// {
-// akey "avalue"
-// }
-// b
-//
-// bkey "bvalue"
-// }
-
-const std::string MALFORMED_CONFIG =
-"a\n"
-"{\n"
-" akey \"avalue\"\n"
-"}\n"
-"b\n"
-"\n"
-" bkey \"bvalue\"\n"
-"}\n";
-
-// counts of the respective section counts in config_example.info
-
-const int CONFIG_N_A_SECTIONS = 1;
-const int CONFIG_N_B_SECTIONS = 1;
-
-class DummySubscriber
-{
-public:
-
- DummySubscriber(ConfigFile& config,
- int nASections,
- int nBSections,
- bool expectDryRun)
- : m_nASections(nASections),
- m_nBSections(nBSections),
- m_nRemainingACallbacks(nASections),
- m_nRemainingBCallbacks(nBSections),
- m_expectDryRun(expectDryRun)
- {
-
- }
-
- void
- onA(const ConfigSection& section, bool isDryRun)
- {
- // NFD_LOG_DEBUG("a");
- BOOST_CHECK_EQUAL(isDryRun, m_expectDryRun);
- --m_nRemainingACallbacks;
- }
-
-
- void
- onB(const ConfigSection& section, bool isDryRun)
- {
- // NFD_LOG_DEBUG("b");
- BOOST_CHECK_EQUAL(isDryRun, m_expectDryRun);
- --m_nRemainingBCallbacks;
- }
-
- bool
- allCallbacksFired() const
- {
- return m_nRemainingACallbacks == 0 &&
- m_nRemainingBCallbacks == 0;
- }
-
- bool
- noCallbacksFired() const
- {
- return m_nRemainingACallbacks == m_nASections &&
- m_nRemainingBCallbacks == m_nBSections;
- }
-
- virtual
- ~DummySubscriber()
- {
-
- }
-
-private:
- int m_nASections;
- int m_nBSections;
- int m_nRemainingACallbacks;
- int m_nRemainingBCallbacks;
- bool m_expectDryRun;
-};
-
-class DummyAllSubscriber : public DummySubscriber
-{
-public:
- DummyAllSubscriber(ConfigFile& config, bool expectDryRun=false)
- : DummySubscriber(config,
- CONFIG_N_A_SECTIONS,
- CONFIG_N_B_SECTIONS,
- expectDryRun)
- {
- config.addSectionHandler("a", bind(&DummySubscriber::onA, this, _1, _2));
- config.addSectionHandler("b", bind(&DummySubscriber::onB, this, _1, _2));
- }
-
- virtual
- ~DummyAllSubscriber()
- {
-
- }
-};
-
-class DummyOneSubscriber : public DummySubscriber
-{
-public:
- DummyOneSubscriber(ConfigFile& config,
- const std::string& sectionName,
- bool expectDryRun=false)
- : DummySubscriber(config,
- (sectionName == "a"),
- (sectionName == "b"),
- expectDryRun)
- {
- if (sectionName == "a")
- {
- config.addSectionHandler(sectionName, bind(&DummySubscriber::onA, this, _1, _2));
- }
- else if (sectionName == "b")
- {
- config.addSectionHandler(sectionName, bind(&DummySubscriber::onB, this, _1, _2));
- }
- else
- {
- BOOST_FAIL("Test setup error: "
- << "Unexpected section name "
- <<"\"" << sectionName << "\"");
- }
-
- }
-
- virtual
- ~DummyOneSubscriber()
- {
-
- }
-};
-
-class DummyNoSubscriber : public DummySubscriber
-{
-public:
- DummyNoSubscriber(ConfigFile& config, bool expectDryRun)
- : DummySubscriber(config, 0, 0, expectDryRun)
- {
-
- }
-
- virtual
- ~DummyNoSubscriber()
- {
-
- }
-};
-
-BOOST_AUTO_TEST_CASE(OnConfigStream)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file);
- std::ifstream input;
-
- input.open("tests/core/config_example.info");
- BOOST_REQUIRE(input.is_open());
-
- file.parse(input, false, "config_example.info");
- BOOST_CHECK(sub.allCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigStreamEmptyStream)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file);
-
- std::ifstream input;
-
- BOOST_CHECK_THROW(file.parse(input, false, "unknown"), ConfigFile::Error);
- BOOST_CHECK(sub.noCallbacksFired());
-}
-
-
-BOOST_AUTO_TEST_CASE(OnConfigString)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file);
-
- file.parse(CONFIG, false, "dummy-config");
-
- BOOST_CHECK(sub.allCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigStringEmpty)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file);
-
- BOOST_CHECK_THROW(file.parse(std::string(), false, "dummy-config"), ConfigFile::Error);
- BOOST_CHECK(sub.noCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigStringMalformed)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file);
-
- BOOST_CHECK_THROW(file.parse(MALFORMED_CONFIG, false, "dummy-config"), ConfigFile::Error);
- BOOST_CHECK(sub.noCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigStringDryRun)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file, true);
-
- file.parse(CONFIG, true, "dummy-config");
-
- BOOST_CHECK(sub.allCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigFilename)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file);
-
- file.parse("tests/core/config_example.info", false);
-
- BOOST_CHECK(sub.allCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigFilenameNoFile)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file);
-
- BOOST_CHECK_THROW(file.parse("i_made_this_up.info", false), ConfigFile::Error);
-
- BOOST_CHECK(sub.noCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigFilenameMalformed)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file);
-
- BOOST_CHECK_THROW(file.parse("tests/core/config_malformed.info", false), ConfigFile::Error);
-
- BOOST_CHECK(sub.noCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigStreamDryRun)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file, true);
- std::ifstream input;
-
- input.open("tests/core/config_example.info");
- BOOST_REQUIRE(input.is_open());
-
- file.parse(input, true, "tests/core/config_example.info");
-
- BOOST_CHECK(sub.allCallbacksFired());
-
- input.close();
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigFilenameDryRun)
-{
- ConfigFile file;
- DummyAllSubscriber sub(file, true);
-
- file.parse("tests/core/config_example.info", true);
- BOOST_CHECK(sub.allCallbacksFired());
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigReplaceSubscriber)
-{
- ConfigFile file;
- DummyAllSubscriber sub1(file);
- DummyAllSubscriber sub2(file);
-
- file.parse(CONFIG, false, "dummy-config");
-
- BOOST_CHECK(sub1.noCallbacksFired());
- BOOST_CHECK(sub2.allCallbacksFired());
-}
-
-class MissingCallbackFixture : public BaseFixture
-{
-public:
- MissingCallbackFixture()
- : m_missingFired(false)
- {
- }
-
- void
- checkMissingHandler(const std::string& filename,
- const std::string& sectionName,
- const ConfigSection& section,
- bool isDryRun)
- {
- m_missingFired = true;
- }
-
-protected:
- bool m_missingFired;
-};
-
-
-
-BOOST_FIXTURE_TEST_CASE(OnConfigUncoveredSections, MissingCallbackFixture)
-{
- ConfigFile file;
-
- BOOST_REQUIRE_THROW(file.parse(CONFIG, false, "dummy-config"), ConfigFile::Error);
-
- ConfigFile permissiveFile(bind(&MissingCallbackFixture::checkMissingHandler,
- this, _1, _2, _3, _4));
-
- DummyOneSubscriber subA(permissiveFile, "a");
-
- BOOST_REQUIRE_NO_THROW(permissiveFile.parse(CONFIG, false, "dummy-config"));
- BOOST_CHECK(subA.allCallbacksFired());
- BOOST_CHECK(m_missingFired);
-}
-
-BOOST_AUTO_TEST_CASE(OnConfigCoveredByPartialSubscribers)
-{
- ConfigFile file;
- DummyOneSubscriber subA(file, "a");
- DummyOneSubscriber subB(file, "b");
-
- file.parse(CONFIG, false, "dummy-config");
-
- BOOST_CHECK(subA.allCallbacksFired());
- BOOST_CHECK(subB.allCallbacksFired());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/core/config_example.info b/NFD/tests/core/config_example.info
deleted file mode 100644
index d61691f..0000000
--- a/NFD/tests/core/config_example.info
+++ /dev/null
@@ -1,9 +0,0 @@
-a
-{
- akey "avalue"
-}
-
-b
-{
- bkey "bvalue"
-}
\ No newline at end of file
diff --git a/NFD/tests/core/config_malformed.info b/NFD/tests/core/config_malformed.info
deleted file mode 100644
index d3a1f9e..0000000
--- a/NFD/tests/core/config_malformed.info
+++ /dev/null
@@ -1,9 +0,0 @@
-a
-{
- akey "avalue"
-}
-
-b
-
- bkey "bvalue"
-}
\ No newline at end of file
diff --git a/NFD/tests/core/logger.cpp b/NFD/tests/core/logger.cpp
deleted file mode 100644
index 9ae7fa4..0000000
--- a/NFD/tests/core/logger.cpp
+++ /dev/null
@@ -1,870 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "core/logger.hpp"
-
-#include "tests/test-common.hpp"
-
-#include <boost/algorithm/string.hpp>
-#include <boost/algorithm/string/classification.hpp>
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(CoreLogger, BaseFixture)
-
-class LoggerFixture : protected BaseFixture
-{
-public:
- LoggerFixture()
- : m_savedBuf(std::clog.rdbuf())
- , m_savedLevel(LoggerFactory::getInstance().getDefaultLevel())
- {
- std::clog.rdbuf(m_buffer.rdbuf());
- }
-
- ~LoggerFixture()
- {
- std::clog.rdbuf(m_savedBuf);
- LoggerFactory::getInstance().setDefaultLevel(m_savedLevel);
- }
-
- std::stringstream m_buffer;
- std::streambuf* m_savedBuf;
- LogLevel m_savedLevel;
-
-};
-
-BOOST_FIXTURE_TEST_CASE(Basic, LoggerFixture)
-{
- using namespace ndn::time;
- using std::string;
-
- const ndn::time::microseconds::rep ONE_SECOND = 1000000;
-
- NFD_LOG_INIT("BasicTests");
- g_logger.setLogLevel(LOG_ALL);
-
- const string EXPECTED[] =
- {
- "TRACE:", "[BasicTests]", "trace-message-JHGFDSR^1\n",
- "DEBUG:", "[BasicTests]", "debug-message-IGg2474fdksd-fo-151617\n",
- "WARNING:", "[BasicTests]", "warning-message-XXXhdhd111x\n",
- "INFO:", "[BasicTests]", "info-message-Jjxjshj13\n",
- "ERROR:", "[BasicTests]", "error-message-!#$&^%$#@\n",
- "FATAL:", "[BasicTests]", "fatal-message-JJSjaamcng\n",
- };
-
- const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(string);
-
- microseconds::rep before =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- NFD_LOG_TRACE("trace-message-JHGFDSR^1");
- NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
- NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 <<"x");
- NFD_LOG_INFO("info-message-Jjxjshj13");
- NFD_LOG_ERROR("error-message-!#$&^%$#@");
- NFD_LOG_FATAL("fatal-message-JJSjaamcng");
-
- microseconds::rep after =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- const string buffer = m_buffer.str();
-
- std::vector<string> components;
- boost::split(components, buffer, boost::is_any_of(" ,\n"));
-
- // std::cout << components.size() << " for " << moduleName << std::endl;
- // for (size_t i = 0; i < components.size(); ++i)
- // {
- // std::cout << "-> " << components[i] << std::endl;
- // }
-
- // expected + number of timestamps (one per log statement) + trailing newline of last statement
- BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 6 + 1);
-
- std::vector<std::string>::const_iterator componentIter = components.begin();
- for (size_t i = 0; i < N_EXPECTED; ++i)
- {
- // timestamp LOG_LEVEL: [ModuleName] message\n
-
- const string& timestamp = *componentIter;
- // std::cout << "timestamp = " << timestamp << std::endl;
- ++componentIter;
-
- size_t timeDelimiterPosition = timestamp.find(".");
-
- BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
-
- string secondsString = timestamp.substr(0, timeDelimiterPosition);
- string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
-
- microseconds::rep extractedTime =
- ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
- boost::lexical_cast<microseconds::rep>(usecondsString);
-
- // std::cout << "before=" << before
- // << " extracted=" << extractedTime
- // << " after=" << after << std::endl;
-
-
- BOOST_CHECK_LE(before, extractedTime);
- BOOST_CHECK_LE(extractedTime, after);
-
- // LOG_LEVEL:
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- // [ModuleName]
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- const string& message = *componentIter;
-
- // std::cout << "message = " << message << std::endl;
-
- // add back the newline that we split on
- BOOST_CHECK_EQUAL(message + "\n", EXPECTED[i]);
- ++componentIter;
- }
-
-}
-
-
-BOOST_FIXTURE_TEST_CASE(ConfigureFactory, LoggerFixture)
-{
- using namespace ndn::time;
- using std::string;
-
- const ndn::time::microseconds::rep ONE_SECOND = 1000000;
-
- NFD_LOG_INIT("ConfigureFactoryTests");
-
- const string LOG_CONFIG =
- "log\n"
- "{\n"
- " default_level INFO\n"
- "}\n";
-
- LoggerFactory::getInstance().setDefaultLevel(LOG_ALL);
-
- ConfigFile config;
- LoggerFactory::getInstance().setConfigFile(config);
-
- config.parse(LOG_CONFIG, false, "LOG_CONFIG");
-
- BOOST_REQUIRE_EQUAL(LoggerFactory::getInstance().getDefaultLevel(), LOG_INFO);
-
- const std::string EXPECTED[] =
- {
- "WARNING:", "[ConfigureFactoryTests]", "warning-message-XXXhdhd111x\n",
- "INFO:", "[ConfigureFactoryTests]", "info-message-Jjxjshj13\n",
- "ERROR:", "[ConfigureFactoryTests]", "error-message-!#$&^%$#@\n",
- "FATAL:", "[ConfigureFactoryTests]", "fatal-message-JJSjaamcng\n",
- };
-
- const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(std::string);
-
- microseconds::rep before =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- NFD_LOG_TRACE("trace-message-JHGFDSR^1");
- NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
- NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 <<"x");
- NFD_LOG_INFO("info-message-Jjxjshj13");
- NFD_LOG_ERROR("error-message-!#$&^%$#@");
- NFD_LOG_FATAL("fatal-message-JJSjaamcng");
-
- microseconds::rep after =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- const string buffer = m_buffer.str();
-
- std::vector<string> components;
- boost::split(components, buffer, boost::is_any_of(" ,\n"));
-
- // std::cout << components.size() << " for " << moduleName << std::endl;
- // for (size_t i = 0; i < components.size(); ++i)
- // {
- // std::cout << "-> " << components[i] << std::endl;
- // }
-
- // expected + number of timestamps (one per log statement) + trailing newline of last statement
- BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 4 + 1);
-
- std::vector<std::string>::const_iterator componentIter = components.begin();
- for (size_t i = 0; i < N_EXPECTED; ++i)
- {
- // timestamp LOG_LEVEL: [ModuleName] message\n
-
- const string& timestamp = *componentIter;
- // std::cout << "timestamp = " << timestamp << std::endl;
- ++componentIter;
-
- size_t timeDelimiterPosition = timestamp.find(".");
-
- BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
-
- string secondsString = timestamp.substr(0, timeDelimiterPosition);
- string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
-
- microseconds::rep extractedTime =
- ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
- boost::lexical_cast<microseconds::rep>(usecondsString);
-
- // std::cout << "before=" << before
- // << " extracted=" << extractedTime
- // << " after=" << after << std::endl;
-
- BOOST_CHECK_LE(before, extractedTime);
- BOOST_CHECK_LE(extractedTime, after);
-
- // LOG_LEVEL:
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- // [ModuleName]
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- const string& message = *componentIter;
-
- // std::cout << "message = " << message << std::endl;
-
- // add back the newline that we split on
- BOOST_CHECK_EQUAL(message + "\n", EXPECTED[i]);
- ++componentIter;
- }
-}
-
-BOOST_FIXTURE_TEST_CASE(TestNumberLevel, LoggerFixture)
-{
- const std::string LOG_CONFIG =
- "log\n"
- "{\n"
- " default_level 2\n" // equivalent of WARN
- "}\n";
-
- LoggerFactory::getInstance().setDefaultLevel(LOG_ALL);
-
- ConfigFile config;
- LoggerFactory::getInstance().setConfigFile(config);
-
- config.parse(LOG_CONFIG, false, "LOG_CONFIG");
-
- BOOST_REQUIRE_EQUAL(LoggerFactory::getInstance().getDefaultLevel(), LOG_WARN);
-}
-
-static void
-testModuleBPrint()
-{
- NFD_LOG_INIT("TestModuleB");
- NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
-}
-
-BOOST_FIXTURE_TEST_CASE(LimitModules, LoggerFixture)
-{
- using namespace ndn::time;
- using std::string;
-
- NFD_LOG_INIT("TestModuleA");
-
- const ndn::time::microseconds::rep ONE_SECOND = 1000000;
-
- const std::string EXPECTED[] =
- {
- "WARNING:", "[TestModuleA]", "warning-message-XXXhdhd111x\n",
- };
-
- const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(std::string);
-
- const std::string LOG_CONFIG =
- "log\n"
- "{\n"
- " default_level WARN\n"
- "}\n";
-
- ConfigFile config;
- LoggerFactory::getInstance().setConfigFile(config);
-
- config.parse(LOG_CONFIG, false, "LOG_CONFIG");
-
- microseconds::rep before =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- // this should print
- NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 << "x");
-
- // this should not because it's level is < WARN
- testModuleBPrint();
-
- microseconds::rep after =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- const string buffer = m_buffer.str();
-
- std::vector<string> components;
- boost::split(components, buffer, boost::is_any_of(" ,\n"));
-
- // expected + number of timestamps (one per log statement) + trailing newline of last statement
- BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 1 + 1);
-
- std::vector<std::string>::const_iterator componentIter = components.begin();
- for (size_t i = 0; i < N_EXPECTED; ++i)
- {
- // timestamp LOG_LEVEL: [ModuleName] message\n
-
- const string& timestamp = *componentIter;
- // std::cout << "timestamp = " << timestamp << std::endl;
- ++componentIter;
-
- size_t timeDelimiterPosition = timestamp.find(".");
-
- BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
-
- string secondsString = timestamp.substr(0, timeDelimiterPosition);
- string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
-
- microseconds::rep extractedTime =
- ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
- boost::lexical_cast<microseconds::rep>(usecondsString);
-
- // std::cout << "before=" << before
- // << " extracted=" << extractedTime
- // << " after=" << after << std::endl;
-
- BOOST_CHECK_LE(before, extractedTime);
- BOOST_CHECK_LE(extractedTime, after);
-
- // LOG_LEVEL:
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- // [ModuleName]
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- const string& message = *componentIter;
-
- // std::cout << "message = " << message << std::endl;
-
- // add back the newline that we split on
- BOOST_CHECK_EQUAL(message + "\n", EXPECTED[i]);
- ++componentIter;
- }
-}
-
-BOOST_FIXTURE_TEST_CASE(ExplicitlySetModule, LoggerFixture)
-{
- using namespace ndn::time;
- using std::string;
-
- NFD_LOG_INIT("TestModuleA");
-
- const ndn::time::microseconds::rep ONE_SECOND = 1000000;
-
- const std::string LOG_CONFIG =
- "log\n"
- "{\n"
- " default_level WARN\n"
- " TestModuleB DEBUG\n"
- "}\n";
-
- ConfigFile config;
- LoggerFactory::getInstance().setConfigFile(config);
-
- config.parse(LOG_CONFIG, false, "LOG_CONFIG");
-
- microseconds::rep before =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- // this should print
- NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 << "x");
-
- // this too because its level is explicitly set to DEBUG
- testModuleBPrint();
-
- microseconds::rep after =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- const std::string EXPECTED[] =
- {
- "WARNING:", "[TestModuleA]", "warning-message-XXXhdhd111x\n",
- "DEBUG:", "[TestModuleB]", "debug-message-IGg2474fdksd-fo-151617\n",
- };
-
- const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(std::string);
-
- const string buffer = m_buffer.str();
-
- std::vector<string> components;
- boost::split(components, buffer, boost::is_any_of(" ,\n"));
-
- // for (size_t i = 0; i < components.size(); ++i)
- // {
- // std::cout << "-> " << components[i] << std::endl;
- // }
-
- // expected + number of timestamps (one per log statement) + trailing newline of last statement
- BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 2 + 1);
-
- std::vector<std::string>::const_iterator componentIter = components.begin();
- for (size_t i = 0; i < N_EXPECTED; ++i)
- {
- // timestamp LOG_LEVEL: [ModuleName] message\n
-
- const string& timestamp = *componentIter;
- // std::cout << "timestamp = " << timestamp << std::endl;
- ++componentIter;
-
- size_t timeDelimiterPosition = timestamp.find(".");
-
- BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
-
- string secondsString = timestamp.substr(0, timeDelimiterPosition);
- string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
-
- microseconds::rep extractedTime =
- ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
- boost::lexical_cast<microseconds::rep>(usecondsString);
-
- // std::cout << "before=" << before
- // << " extracted=" << extractedTime
- // << " after=" << after << std::endl;
-
- BOOST_CHECK_LE(before, extractedTime);
- BOOST_CHECK_LE(extractedTime, after);
-
- // LOG_LEVEL:
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- // [ModuleName]
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- const string& message = *componentIter;
-
- // std::cout << "message = " << message << std::endl;
-
- // add back the newline that we split on
- BOOST_CHECK_EQUAL(message + "\n", EXPECTED[i]);
- ++componentIter;
- }
-}
-
-BOOST_FIXTURE_TEST_CASE(UnknownModule, LoggerFixture)
-{
- using namespace ndn::time;
- using std::string;
-
- const ndn::time::microseconds::rep ONE_SECOND = 1000000;
-
- const std::string LOG_CONFIG =
- "log\n"
- "{\n"
- " default_level DEBUG\n"
- " TestMadeUpModule INFO\n"
- "}\n";
-
- ConfigFile config;
- LoggerFactory::getInstance().setDefaultLevel(LOG_ALL);
- LoggerFactory::getInstance().setConfigFile(config);
-
- const std::string EXPECTED = "DEBUG: [LoggerFactory] "
- "Failed to configure logging level for module \"TestMadeUpModule\" (module not found)\n";
-
- microseconds::rep before =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- config.parse(LOG_CONFIG, false, "LOG_CONFIG");
-
- microseconds::rep after =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- const string buffer = m_buffer.str();
-
- const size_t firstSpace = buffer.find(" ");
- BOOST_REQUIRE(firstSpace != string::npos);
-
- const string timestamp = buffer.substr(0, firstSpace);
- const string message = buffer.substr(firstSpace + 1);
-
- size_t timeDelimiterPosition = timestamp.find(".");
-
- BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
-
- string secondsString = timestamp.substr(0, timeDelimiterPosition);
- string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
-
- microseconds::rep extractedTime =
- ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
- boost::lexical_cast<microseconds::rep>(usecondsString);
-
- // std::cout << "before=" << before
- // << " extracted=" << extractedTime
- // << " after=" << after << std::endl;
-
- BOOST_CHECK_LE(before, extractedTime);
- BOOST_CHECK_LE(extractedTime, after);
-
- BOOST_CHECK_EQUAL(message, EXPECTED);
-}
-
-static bool
-checkError(const LoggerFactory::Error& error, const std::string& expected)
-{
- return error.what() == expected;
-}
-
-BOOST_FIXTURE_TEST_CASE(UnknownLevelString, LoggerFixture)
-{
- const std::string LOG_CONFIG =
- "log\n"
- "{\n"
- " default_level TestMadeUpLevel\n"
- "}\n";
-
- ConfigFile config;
- LoggerFactory::getInstance().setConfigFile(config);
-
- BOOST_REQUIRE_EXCEPTION(config.parse(LOG_CONFIG, false, "LOG_CONFIG"),
- LoggerFactory::Error,
- bind(&checkError,
- _1,
- "Unsupported logging level \"TestMadeUpLevel\""));
-}
-
-class InClassLogger : public LoggerFixture
-{
-public:
-
- InClassLogger()
- {
- g_logger.setLogLevel(LOG_ALL);
- }
-
- void
- writeLogs()
- {
- NFD_LOG_TRACE("trace-message-JHGFDSR^1");
- NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
- NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 <<"x");
- NFD_LOG_INFO("info-message-Jjxjshj13");
- NFD_LOG_ERROR("error-message-!#$&^%$#@");
- NFD_LOG_FATAL("fatal-message-JJSjaamcng");
- }
-
-private:
- NFD_LOG_INCLASS_DECLARE();
-};
-
-NFD_LOG_INCLASS_DEFINE(InClassLogger, "InClassLogger");
-
-BOOST_FIXTURE_TEST_CASE(InClass, InClassLogger)
-{
- using namespace ndn::time;
- using std::string;
-
- const ndn::time::microseconds::rep ONE_SECOND = 1000000;
-
- microseconds::rep before =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- writeLogs();
-
- microseconds::rep after =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- const string EXPECTED[] =
- {
- "TRACE:", "[InClassLogger]", "trace-message-JHGFDSR^1\n",
- "DEBUG:", "[InClassLogger]", "debug-message-IGg2474fdksd-fo-151617\n",
- "WARNING:", "[InClassLogger]", "warning-message-XXXhdhd111x\n",
- "INFO:", "[InClassLogger]", "info-message-Jjxjshj13\n",
- "ERROR:", "[InClassLogger]", "error-message-!#$&^%$#@\n",
- "FATAL:", "[InClassLogger]", "fatal-message-JJSjaamcng\n",
- };
-
- const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(string);
-
- const string buffer = m_buffer.str();
-
- std::vector<string> components;
- boost::split(components, buffer, boost::is_any_of(" ,\n"));
-
- // expected + number of timestamps (one per log statement) + trailing newline of last statement
- BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 6 + 1);
-
- std::vector<std::string>::const_iterator componentIter = components.begin();
- for (size_t i = 0; i < N_EXPECTED; ++i)
- {
- // timestamp LOG_LEVEL: [ModuleName] message\n
-
- const string& timestamp = *componentIter;
- // std::cout << "timestamp = " << timestamp << std::endl;
- ++componentIter;
-
- size_t timeDelimiterPosition = timestamp.find(".");
-
- BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
-
- string secondsString = timestamp.substr(0, timeDelimiterPosition);
- string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
-
- microseconds::rep extractedTime =
- ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
- boost::lexical_cast<microseconds::rep>(usecondsString);
-
- // std::cout << "before=" << before
- // << " extracted=" << extractedTime
- // << " after=" << after << std::endl;
-
- BOOST_CHECK_LE(before, extractedTime);
- BOOST_CHECK_LE(extractedTime, after);
-
- // LOG_LEVEL:
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- // [ModuleName]
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- const string& message = *componentIter;
-
- // std::cout << "message = " << message << std::endl;
-
- // add back the newline that we split on
- BOOST_CHECK_EQUAL(message + "\n", EXPECTED[i]);
- ++componentIter;
- }
-}
-
-
-template<class T>
-class InClassTemplateLogger : public LoggerFixture
-{
-public:
- InClassTemplateLogger()
- {
- g_logger.setLogLevel(LOG_ALL);
- }
-
- void
- writeLogs()
- {
- NFD_LOG_TRACE("trace-message-JHGFDSR^1");
- NFD_LOG_DEBUG("debug-message-IGg2474fdksd-fo-" << 15 << 16 << 17);
- NFD_LOG_WARN("warning-message-XXXhdhd11" << 1 <<"x");
- NFD_LOG_INFO("info-message-Jjxjshj13");
- NFD_LOG_ERROR("error-message-!#$&^%$#@");
- NFD_LOG_FATAL("fatal-message-JJSjaamcng");
- }
-
-private:
- NFD_LOG_INCLASS_DECLARE();
-};
-
-NFD_LOG_INCLASS_TEMPLATE_DEFINE(InClassTemplateLogger, "GenericInClassTemplateLogger");
-NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(InClassTemplateLogger, int, "IntInClassLogger");
-
-BOOST_FIXTURE_TEST_CASE(GenericInTemplatedClass, InClassTemplateLogger<bool>)
-{
- using namespace ndn::time;
- using std::string;
-
- const ndn::time::microseconds::rep ONE_SECOND = 1000000;
-
- microseconds::rep before =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- writeLogs();
-
- microseconds::rep after =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- const string EXPECTED[] =
- {
- "TRACE:", "[GenericInClassTemplateLogger]", "trace-message-JHGFDSR^1\n",
- "DEBUG:", "[GenericInClassTemplateLogger]", "debug-message-IGg2474fdksd-fo-151617\n",
- "WARNING:", "[GenericInClassTemplateLogger]", "warning-message-XXXhdhd111x\n",
- "INFO:", "[GenericInClassTemplateLogger]", "info-message-Jjxjshj13\n",
- "ERROR:", "[GenericInClassTemplateLogger]", "error-message-!#$&^%$#@\n",
- "FATAL:", "[GenericInClassTemplateLogger]", "fatal-message-JJSjaamcng\n",
- };
-
- const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(string);
-
- const string buffer = m_buffer.str();
-
- std::vector<string> components;
- boost::split(components, buffer, boost::is_any_of(" ,\n"));
-
- // expected + number of timestamps (one per log statement) + trailing newline of last statement
- BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 6 + 1);
-
- std::vector<std::string>::const_iterator componentIter = components.begin();
- for (size_t i = 0; i < N_EXPECTED; ++i)
- {
- // timestamp LOG_LEVEL: [ModuleName] message\n
-
- const string& timestamp = *componentIter;
- // std::cout << "timestamp = " << timestamp << std::endl;
- ++componentIter;
-
- size_t timeDelimiterPosition = timestamp.find(".");
-
- BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
-
- string secondsString = timestamp.substr(0, timeDelimiterPosition);
- string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
-
- microseconds::rep extractedTime =
- ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
- boost::lexical_cast<microseconds::rep>(usecondsString);
-
- // std::cout << "before=" << before
- // << " extracted=" << extractedTime
- // << " after=" << after << std::endl;
-
- BOOST_CHECK_LE(before, extractedTime);
- BOOST_CHECK_LE(extractedTime, after);
-
- // LOG_LEVEL:
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- // [ModuleName]
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- const string& message = *componentIter;
-
- // std::cout << "message = " << message << std::endl;
-
- // add back the newline that we split on
- BOOST_CHECK_EQUAL(message + "\n", EXPECTED[i]);
- ++componentIter;
- }
-}
-
-
-BOOST_FIXTURE_TEST_CASE(SpecializedInTemplatedClass, InClassTemplateLogger<int>)
-{
- using namespace ndn::time;
- using std::string;
-
- const ndn::time::microseconds::rep ONE_SECOND = 1000000;
-
- microseconds::rep before =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- writeLogs();
-
- microseconds::rep after =
- duration_cast<microseconds>(system_clock::now().time_since_epoch()).count();
-
- const string EXPECTED[] =
- {
- "TRACE:", "[IntInClassLogger]", "trace-message-JHGFDSR^1\n",
- "DEBUG:", "[IntInClassLogger]", "debug-message-IGg2474fdksd-fo-151617\n",
- "WARNING:", "[IntInClassLogger]", "warning-message-XXXhdhd111x\n",
- "INFO:", "[IntInClassLogger]", "info-message-Jjxjshj13\n",
- "ERROR:", "[IntInClassLogger]", "error-message-!#$&^%$#@\n",
- "FATAL:", "[IntInClassLogger]", "fatal-message-JJSjaamcng\n",
- };
-
- const size_t N_EXPECTED = sizeof(EXPECTED) / sizeof(string);
-
- const string buffer = m_buffer.str();
-
- std::vector<string> components;
- boost::split(components, buffer, boost::is_any_of(" ,\n"));
-
- // expected + number of timestamps (one per log statement) + trailing newline of last statement
- BOOST_REQUIRE_EQUAL(components.size(), N_EXPECTED + 6 + 1);
-
- std::vector<std::string>::const_iterator componentIter = components.begin();
- for (size_t i = 0; i < N_EXPECTED; ++i)
- {
- // timestamp LOG_LEVEL: [ModuleName] message\n
-
- const string& timestamp = *componentIter;
- // std::cout << "timestamp = " << timestamp << std::endl;
- ++componentIter;
-
- size_t timeDelimiterPosition = timestamp.find(".");
-
- BOOST_REQUIRE_NE(string::npos, timeDelimiterPosition);
-
- string secondsString = timestamp.substr(0, timeDelimiterPosition);
- string usecondsString = timestamp.substr(timeDelimiterPosition + 1);
-
- microseconds::rep extractedTime =
- ONE_SECOND * boost::lexical_cast<microseconds::rep>(secondsString) +
- boost::lexical_cast<microseconds::rep>(usecondsString);
-
- // std::cout << "before=" << before << " extracted=" << extractedTime << " after=" << after << std::endl;
-
- BOOST_CHECK_LE(before, extractedTime);
- BOOST_CHECK_LE(extractedTime, after);
-
- // LOG_LEVEL:
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- // [ModuleName]
- BOOST_CHECK_EQUAL(*componentIter, EXPECTED[i]);
- ++componentIter;
- ++i;
-
- const string& message = *componentIter;
-
- // std::cout << "message = " << message << std::endl;
-
- // add back the newline that we split on
- BOOST_CHECK_EQUAL(message + "\n", EXPECTED[i]);
- ++componentIter;
- }
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/core/ndebug.cpp b/NFD/tests/core/ndebug.cpp
deleted file mode 100644
index 75f69c9..0000000
--- a/NFD/tests/core/ndebug.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "common.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace ndn {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(CoreNdebug)
-
-BOOST_AUTO_TEST_CASE(AssertFalse)
-{
-#ifndef _DEBUG
- // in release builds, assertion shouldn't execute
- BOOST_ASSERT(false);
-#endif
-}
-
-BOOST_AUTO_TEST_CASE(SideEffect)
-{
- int a = 1;
- BOOST_ASSERT((a = 2) > 0);
-#ifdef _DEBUG
- BOOST_CHECK_EQUAL(a, 2);
-#else
- BOOST_CHECK_EQUAL(a, 1);
-#endif
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace ndn
diff --git a/NFD/tests/core/network-interface.cpp b/NFD/tests/core/network-interface.cpp
deleted file mode 100644
index c26d46a..0000000
--- a/NFD/tests/core/network-interface.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "core/network-interface.hpp"
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(CoreNetworkInterface, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(ListRealNetworkInterfaces)
-{
- std::vector<NetworkInterfaceInfo> netifs;
- BOOST_CHECK_NO_THROW(netifs = listNetworkInterfaces());
-
- for (const auto& netif : netifs) {
- BOOST_TEST_MESSAGE(netif.index << ": " << netif.name);
- BOOST_TEST_MESSAGE("\tether " << netif.etherAddress);
- for (const auto& address : netif.ipv4Addresses)
- BOOST_TEST_MESSAGE("\tinet " << address);
- for (const auto& address : netif.ipv6Addresses)
- BOOST_TEST_MESSAGE("\tinet6 " << address);
- BOOST_TEST_MESSAGE("\tloopback : " << netif.isLoopback());
- BOOST_TEST_MESSAGE("\tmulticast : " << netif.isMulticastCapable());
- BOOST_TEST_MESSAGE("\tup : " << netif.isUp());
- }
-}
-
-class FakeNetworkInterfaceFixture : public BaseFixture
-{
-public:
- FakeNetworkInterfaceFixture()
- {
- using namespace boost::asio::ip;
-
- auto fakeInterfaces = make_shared<std::vector<NetworkInterfaceInfo>>();
-
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {0, "lo0",
- ethernet::Address(),
- {address_v4::from_string("127.0.0.1")},
- {address_v6::from_string("fe80::1")},
- address_v4::from_string("127.255.255.255"),
- IFF_LOOPBACK | IFF_UP});
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {1, "eth0",
- ethernet::Address::fromString("3e:15:c2:8b:65:00"),
- {address_v4::from_string("192.168.2.1")},
- {},
- address_v4::from_string("192.168.2.255"),
- 0});
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {2, "eth1",
- ethernet::Address::fromString("3e:15:c2:8b:65:00"),
- {address_v4::from_string("198.51.100.1")},
- {address_v6::from_string("2001:db8::1")},
- address_v4::from_string("198.51.100.255"),
- IFF_MULTICAST | IFF_BROADCAST | IFF_UP});
-
- setDebugNetworkInterfaces(fakeInterfaces);
- }
-
- ~FakeNetworkInterfaceFixture()
- {
- setDebugNetworkInterfaces(nullptr);
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(ListFakeNetworkInterfaces, FakeNetworkInterfaceFixture)
-{
- std::vector<NetworkInterfaceInfo> netifs;
- BOOST_CHECK_NO_THROW(netifs = listNetworkInterfaces());
-
- BOOST_REQUIRE_EQUAL(netifs.size(), 3);
-
- BOOST_CHECK_EQUAL(netifs[0].index, 0);
- BOOST_CHECK_EQUAL(netifs[1].index, 1);
- BOOST_CHECK_EQUAL(netifs[2].index, 2);
-
- BOOST_CHECK_EQUAL(netifs[0].name, "lo0");
- BOOST_CHECK_EQUAL(netifs[1].name, "eth0");
- BOOST_CHECK_EQUAL(netifs[2].name, "eth1");
-
- // no real value of testing other parameters
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/core/network.cpp b/NFD/tests/core/network.cpp
deleted file mode 100644
index 866d0b7..0000000
--- a/NFD/tests/core/network.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "core/network.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(CoreNetwork, BaseFixture)
-
-using boost::asio::ip::address;
-
-BOOST_AUTO_TEST_CASE(Empty)
-{
- Network n;
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("192.0.2.1")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:0:3025:ccc5:eeeb:86d3")),
- false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("0.0.0.1")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("255.255.255.255")), false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("::")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")),
- false);
-}
-
-BOOST_AUTO_TEST_CASE(MaxRangeV4)
-{
- Network n = Network::getMaxRangeV4();
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("192.0.2.1")), true);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:1:3025:ccc5:eeeb:86d3")),
- false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("0.0.0.1")), true);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("255.255.255.255")), true);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("::")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")),
- false);
-}
-
-BOOST_AUTO_TEST_CASE(RangeV4)
-{
- Network n = boost::lexical_cast<Network>("192.0.2.0/24");
- BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(n), "192.0.2.0 <-> 192.0.2.255");
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("192.0.2.1")), true);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("192.0.2.254")), true);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("192.0.1.255")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("192.0.3.0")), false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:1:3025:ccc5:eeeb:86d3")),
- false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("0.0.0.1")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("255.255.255.255")), false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("::")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")),
- false);
-}
-
-BOOST_AUTO_TEST_CASE(MaxRangeV6)
-{
- Network n = Network::getMaxRangeV6();
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("192.0.2.1")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:1:3025:ccc5:eeeb:86d3")),
- true);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("0.0.0.1")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("255.255.255.255")), false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("::")), true);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")),
- true);
-}
-
-BOOST_AUTO_TEST_CASE(RangeV6)
-{
- Network n = boost::lexical_cast<Network>("2001:db8:3f9:1::/64");
- BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(n),
- "2001:db8:3f9:1:: <-> 2001:db8:3f9:1:ffff:ffff:ffff:ffff");
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("192.0.2.1")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:1:3025:ccc5:eeeb:86d3")),
- true);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:1::")),
- true);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:1:ffff:ffff:ffff:ffff")),
- true);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:0:ffff:ffff:ffff:ffff")),
- false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("2001:db8:3f9:2::")),
- false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("0.0.0.1")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("255.255.255.255")), false);
-
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("::")), false);
- BOOST_CHECK_EQUAL(n.doesContain(address::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")),
- false);
-}
-
-BOOST_AUTO_TEST_CASE(Comparisons)
-{
- BOOST_CHECK_EQUAL(boost::lexical_cast<Network>("192.0.2.0/24"),
- boost::lexical_cast<Network>("192.0.2.127/24"));
-
- BOOST_CHECK_EQUAL(boost::lexical_cast<Network>("2001:db8:3f9:0::/64"),
- boost::lexical_cast<Network>("2001:db8:3f9:0:ffff::/64"));
-
- BOOST_CHECK_NE(boost::lexical_cast<Network>("192.0.2.0/24"),
- boost::lexical_cast<Network>("192.0.3.127/24"));
-
- BOOST_CHECK_NE(boost::lexical_cast<Network>("2001:db8:3f9:0::/64"),
- boost::lexical_cast<Network>("2001:db8:3f9:1::/64"));
-
- BOOST_CHECK_NE(boost::lexical_cast<Network>("192.0.2.0/24"),
- boost::lexical_cast<Network>("2001:db8:3f9:0::/64"));
-}
-
-BOOST_AUTO_TEST_SUITE_END() // CoreNetwork
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/core/notification-stream.cpp b/NFD/tests/core/notification-stream.cpp
deleted file mode 100644
index e231427..0000000
--- a/NFD/tests/core/notification-stream.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "core/notification-stream.hpp"
-#include "simple-notification.hpp"
-
-#include "tests/test-common.hpp"
-#include <ndn-cxx/util/dummy-client-face.hpp>
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(CoreNotificationStream, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Post)
-{
- shared_ptr<ndn::util::DummyClientFace> face = ndn::util::makeDummyClientFace();
- ndn::KeyChain keyChain;
- NotificationStream<ndn::util::DummyClientFace> notificationStream(*face,
- "/localhost/nfd/NotificationStreamTest", keyChain);
-
- SimpleNotification event1("msg1");
- notificationStream.postNotification(event1);
- face->processEvents();
- BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
- BOOST_CHECK_EQUAL(face->sentDatas[0].getName(),
- "/localhost/nfd/NotificationStreamTest/%FE%00");
- SimpleNotification decoded1;
- BOOST_CHECK_NO_THROW(decoded1.wireDecode(face->sentDatas[0].getContent().blockFromValue()));
- BOOST_CHECK_EQUAL(decoded1.getMessage(), "msg1");
-
- SimpleNotification event2("msg2");
- notificationStream.postNotification(event2);
- face->processEvents();
- BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 2);
- BOOST_CHECK_EQUAL(face->sentDatas[1].getName(),
- "/localhost/nfd/NotificationStreamTest/%FE%01");
- SimpleNotification decoded2;
- BOOST_CHECK_NO_THROW(decoded2.wireDecode(face->sentDatas[1].getContent().blockFromValue()));
- BOOST_CHECK_EQUAL(decoded2.getMessage(), "msg2");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/core/resolver.cpp b/NFD/tests/core/resolver.cpp
deleted file mode 100644
index 18d35b7..0000000
--- a/NFD/tests/core/resolver.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "core/resolver.hpp"
-#include "core/logger.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("tests.CoreResolver");
-
-using boost::asio::ip::address_v4;
-using boost::asio::ip::address_v6;
-using boost::asio::ip::tcp;
-using boost::asio::ip::udp;
-
-BOOST_FIXTURE_TEST_SUITE(CoreResolver, BaseFixture)
-
-template<class Protocol>
-class ResolverFixture : protected BaseFixture
-{
-public:
- ResolverFixture()
- : m_nFailures(0)
- , m_nSuccesses(0)
- {
- }
-
- void
- onSuccess(const typename Protocol::endpoint& resolvedEndpoint,
- const typename Protocol::endpoint& expectedEndpoint,
- bool isValid, bool wantCheckAddress = false)
- {
- NFD_LOG_DEBUG("Resolved to: " << resolvedEndpoint);
- ++m_nSuccesses;
-
- if (!isValid)
- {
- BOOST_FAIL("Resolved to " + boost::lexical_cast<std::string>(resolvedEndpoint)
- + ", but it should have failed");
- }
-
- BOOST_CHECK_EQUAL(resolvedEndpoint.port(), expectedEndpoint.port());
-
- BOOST_CHECK_EQUAL(resolvedEndpoint.address().is_v4(), expectedEndpoint.address().is_v4());
-
- // checking address is not deterministic and should be enabled only
- // if only one IP address will be returned by resolution
- if (wantCheckAddress)
- {
- BOOST_CHECK_EQUAL(resolvedEndpoint.address(), expectedEndpoint.address());
- }
- }
-
- void
- onFailure(bool isValid)
- {
- ++m_nFailures;
-
- if (!isValid)
- BOOST_FAIL("Resolution should not have failed");
-
- BOOST_CHECK_MESSAGE(true, "Resolution failed as expected");
- }
-
-
- uint32_t m_nFailures;
- uint32_t m_nSuccesses;
-};
-
-BOOST_FIXTURE_TEST_CASE(Tcp, ResolverFixture<tcp>)
-{
- TcpResolver::asyncResolve("www.named-data.net", "6363",
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v4(), 6363), true, false),
- bind(&ResolverFixture<tcp>::onFailure, this, false));
-
- TcpResolver::asyncResolve("www.named-data.net", "notport",
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v4(), 0), false, false),
- bind(&ResolverFixture<tcp>::onFailure, this, true)); // should fail
-
-
- TcpResolver::asyncResolve("nothost.nothost.nothost.arpa", "6363",
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v4(), 6363), false, false),
- bind(&ResolverFixture<tcp>::onFailure, this, true)); // should fail
-
- TcpResolver::asyncResolve("www.google.com", "80",
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v4(), 80), true, false),
- bind(&ResolverFixture<tcp>::onFailure, this, false),
- resolver::Ipv4Address()); // request IPv4 address
-
- TcpResolver::asyncResolve("www.google.com", "80",
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v6(), 80), true, false),
- bind(&ResolverFixture<tcp>::onFailure, this, false),
- resolver::Ipv6Address()); // request IPv6 address
-
- TcpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v6(), 80), true, false),
- bind(&ResolverFixture<tcp>::onFailure, this, false));
-
- TcpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v6(), 80), true, false),
- bind(&ResolverFixture<tcp>::onFailure, this, false),
- resolver::Ipv6Address());
-
- TcpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v6(), 80), false, false),
- bind(&ResolverFixture<tcp>::onFailure, this, true), // should fail
- resolver::Ipv4Address());
-
- TcpResolver::asyncResolve("192.0.2.1", "80",
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v4::from_string("192.0.2.1"), 80), true, true),
- bind(&ResolverFixture<tcp>::onFailure, this, false));
-
- TcpResolver::asyncResolve("2001:db8:3f9:0:3025:ccc5:eeeb:86d3", "80",
- bind(&ResolverFixture<tcp>::onSuccess, this, _1,
- tcp::endpoint(address_v6::
- from_string("2001:db8:3f9:0:3025:ccc5:eeeb:86d3"),
- 80), true, true),
- bind(&ResolverFixture<tcp>::onFailure, this, false));
-
- g_io.run();
-
- BOOST_CHECK_EQUAL(m_nFailures, 3);
- BOOST_CHECK_EQUAL(m_nSuccesses, 7);
-}
-
-BOOST_AUTO_TEST_CASE(SyncTcp)
-{
- tcp::endpoint endpoint;
- BOOST_CHECK_NO_THROW(endpoint = TcpResolver::syncResolve("www.named-data.net", "6363"));
- NFD_LOG_DEBUG("Resolved to: " << endpoint);
- BOOST_CHECK_EQUAL(endpoint.address().is_v4(), true);
- BOOST_CHECK_EQUAL(endpoint.port(), 6363);
-}
-
-BOOST_FIXTURE_TEST_CASE(Udp, ResolverFixture<udp>)
-{
- UdpResolver::asyncResolve("www.named-data.net", "6363",
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v4(), 6363), true, false),
- bind(&ResolverFixture<udp>::onFailure, this, false));
-
- UdpResolver::asyncResolve("www.named-data.net", "notport",
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v4(), 0), false, false),
- bind(&ResolverFixture<udp>::onFailure, this, true)); // should fail
-
-
- UdpResolver::asyncResolve("nothost.nothost.nothost.arpa", "6363",
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v4(), 6363), false, false),
- bind(&ResolverFixture<udp>::onFailure, this, true)); // should fail
-
- UdpResolver::asyncResolve("www.google.com", "80",
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v4(), 80), true, false),
- bind(&ResolverFixture<udp>::onFailure, this, false),
- resolver::Ipv4Address()); // request IPv4 address
-
- UdpResolver::asyncResolve("www.google.com", "80",
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v6(), 80), true, false),
- bind(&ResolverFixture<udp>::onFailure, this, false),
- resolver::Ipv6Address()); // request IPv6 address
-
- UdpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v6(), 80), true, false),
- bind(&ResolverFixture<udp>::onFailure, this, false));
-
- UdpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v6(), 80), true, false),
- bind(&ResolverFixture<udp>::onFailure, this, false),
- resolver::Ipv6Address());
-
- UdpResolver::asyncResolve("ipv6.google.com", "80", // only IPv6 address should be available
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v6(), 80), false, false),
- bind(&ResolverFixture<udp>::onFailure, this, true), // should fail
- resolver::Ipv4Address());
-
- UdpResolver::asyncResolve("192.0.2.1", "80",
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v4::from_string("192.0.2.1"), 80), true, true),
- bind(&ResolverFixture<udp>::onFailure, this, false));
-
- UdpResolver::asyncResolve("2001:db8:3f9:0:3025:ccc5:eeeb:86d3", "80",
- bind(&ResolverFixture<udp>::onSuccess, this, _1,
- udp::endpoint(address_v6::
- from_string("2001:db8:3f9:0:3025:ccc5:eeeb:86d3"),
- 80), true, true),
- bind(&ResolverFixture<udp>::onFailure, this, false));
-
- g_io.run();
-
- BOOST_CHECK_EQUAL(m_nFailures, 3);
- BOOST_CHECK_EQUAL(m_nSuccesses, 7);
-}
-
-BOOST_AUTO_TEST_CASE(SyncUdp)
-{
- udp::endpoint endpoint;
- BOOST_CHECK_NO_THROW(endpoint = UdpResolver::syncResolve("www.named-data.net", "6363"));
- NFD_LOG_DEBUG("Resolved to: " << endpoint);
- BOOST_CHECK_EQUAL(endpoint.address().is_v4(), true);
- BOOST_CHECK_EQUAL(endpoint.port(), 6363);
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/core/scheduler.cpp b/NFD/tests/core/scheduler.cpp
deleted file mode 100644
index 954c31e..0000000
--- a/NFD/tests/core/scheduler.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "core/scheduler.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(CoreScheduler, BaseFixture)
-
-class SchedulerFixture : protected BaseFixture
-{
-public:
- SchedulerFixture()
- : count1(0)
- , count2(0)
- , count3(0)
- {
- }
-
- void
- event1()
- {
- BOOST_CHECK_EQUAL(count3, 1);
- ++count1;
- }
-
- void
- event2()
- {
- ++count2;
- }
-
- void
- event3()
- {
- BOOST_CHECK_EQUAL(count1, 0);
- ++count3;
- }
-
- int count1;
- int count2;
- int count3;
-};
-
-BOOST_FIXTURE_TEST_CASE(Events, SchedulerFixture)
-{
- scheduler::schedule(time::milliseconds(500), bind(&SchedulerFixture::event1, this));
-
- EventId i = scheduler::schedule(time::seconds(1), bind(&SchedulerFixture::event2, this));
- scheduler::cancel(i);
-
- scheduler::schedule(time::milliseconds(250), bind(&SchedulerFixture::event3, this));
-
- i = scheduler::schedule(time::milliseconds(50), bind(&SchedulerFixture::event2, this));
- scheduler::cancel(i);
-
- g_io.run();
-
- BOOST_CHECK_EQUAL(count1, 1);
- BOOST_CHECK_EQUAL(count2, 0);
- BOOST_CHECK_EQUAL(count3, 1);
-}
-
-BOOST_AUTO_TEST_CASE(CancelEmptyEvent)
-{
- EventId i;
- scheduler::cancel(i);
-}
-
-class SelfCancelFixture : protected BaseFixture
-{
-public:
- void
- cancelSelf()
- {
- scheduler::cancel(m_selfEventId);
- }
-
- EventId m_selfEventId;
-};
-
-BOOST_FIXTURE_TEST_CASE(SelfCancel, SelfCancelFixture)
-{
- m_selfEventId = scheduler::schedule(time::milliseconds(100),
- bind(&SelfCancelFixture::cancelSelf, this));
-
- BOOST_REQUIRE_NO_THROW(g_io.run());
-}
-
-BOOST_FIXTURE_TEST_CASE(ScopedEventIdDestruct, UnitTestTimeFixture)
-{
- int hit = 0;
- {
- scheduler::ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; });
- } // se goes out of scope
- this->advanceClocks(time::milliseconds(1), 15);
- BOOST_CHECK_EQUAL(hit, 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(ScopedEventIdAssign, UnitTestTimeFixture)
-{
- int hit1 = 0, hit2 = 0;
- scheduler::ScopedEventId se1 = scheduler::schedule(time::milliseconds(10), [&] { ++hit1; });
- se1 = scheduler::schedule(time::milliseconds(10), [&] { ++hit2; });
- this->advanceClocks(time::milliseconds(1), 15);
- BOOST_CHECK_EQUAL(hit1, 0);
- BOOST_CHECK_EQUAL(hit2, 1);
-}
-
-BOOST_FIXTURE_TEST_CASE(ScopedEventIdRelease, UnitTestTimeFixture)
-{
- int hit = 0;
- {
- scheduler::ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; });
- se.release();
- } // se goes out of scope
- this->advanceClocks(time::milliseconds(1), 15);
- BOOST_CHECK_EQUAL(hit, 1);
-}
-
-BOOST_FIXTURE_TEST_CASE(ScopedEventIdMove, UnitTestTimeFixture)
-{
- int hit = 0;
- unique_ptr<scheduler::ScopedEventId> se2;
- {
- scheduler::ScopedEventId se = scheduler::schedule(time::milliseconds(10), [&] { ++hit; });
- se2.reset(new scheduler::ScopedEventId(std::move(se)));
- } // se goes out of scope
- this->advanceClocks(time::milliseconds(1), 15);
- BOOST_CHECK_EQUAL(hit, 1);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/core/segment-publisher.cpp b/NFD/tests/core/segment-publisher.cpp
deleted file mode 100644
index 565c314..0000000
--- a/NFD/tests/core/segment-publisher.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "core/segment-publisher.hpp"
-#include <ndn-cxx/encoding/tlv.hpp>
-
-#include "tests/test-common.hpp"
-#include <ndn-cxx/util/dummy-client-face.hpp>
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("SegmentPublisherTest");
-
-template<int64_t N=10000>
-class TestSegmentPublisher : public SegmentPublisher<ndn::util::DummyClientFace>
-{
-public:
- TestSegmentPublisher(ndn::util::DummyClientFace& face,
- const Name& prefix,
- ndn::KeyChain& keyChain)
- : SegmentPublisher(face, prefix, keyChain)
- , m_totalPayloadLength(0)
- {
-
- }
-
- virtual
- ~TestSegmentPublisher()
- {
- }
-
- uint16_t
- getLimit() const
- {
- return N;
- }
-
- size_t
- getTotalPayloadLength() const
- {
- return m_totalPayloadLength;
- }
-
-protected:
-
- virtual size_t
- generate(ndn::EncodingBuffer& outBuffer)
- {
- size_t totalLength = 0;
- for (int64_t i = 0; i < N; i++)
- {
- totalLength += prependNonNegativeIntegerBlock(outBuffer, tlv::Content, i);
- }
- m_totalPayloadLength += totalLength;
- return totalLength;
- }
-
-protected:
- size_t m_totalPayloadLength;
-};
-
-template<int64_t N>
-class SegmentPublisherFixture : public BaseFixture
-{
-public:
- SegmentPublisherFixture()
- : m_face(ndn::util::makeDummyClientFace())
- , m_publisher(*m_face, "/localhost/nfd/SegmentPublisherFixture", m_keyChain)
- {
- }
-
- void
- validate(const Data& data)
- {
- Block payload = data.getContent();
- NFD_LOG_DEBUG("payload size (w/o Content TLV): " << payload.value_size());
-
- m_buffer.appendByteArray(payload.value(), payload.value_size());
-
- uint64_t segmentNo = data.getName()[-1].toSegment();
- if (data.getFinalBlockId() != data.getName()[-1])
- {
- return;
- }
-
- NFD_LOG_DEBUG("got final block: #" << segmentNo);
-
- // wrap data in a single Content TLV for easy parsing
- m_buffer.prependVarNumber(m_buffer.size());
- m_buffer.prependVarNumber(tlv::Content);
-
- BOOST_TEST_CHECKPOINT("creating parser");
- ndn::Block parser(m_buffer.buf(), m_buffer.size());
- BOOST_TEST_CHECKPOINT("parsing aggregated response");
- parser.parse();
-
- BOOST_REQUIRE_EQUAL(parser.elements_size(), m_publisher.getLimit());
-
- uint64_t expectedNo = m_publisher.getLimit() - 1;
- for (Block::element_const_iterator i = parser.elements_begin();
- i != parser.elements_end();
- ++i)
- {
- uint64_t number = readNonNegativeInteger(*i);
- BOOST_REQUIRE_EQUAL(number, expectedNo);
- --expectedNo;
- }
- }
-
-protected:
- shared_ptr<ndn::util::DummyClientFace> m_face;
- TestSegmentPublisher<N> m_publisher;
- ndn::EncodingBuffer m_buffer;
- ndn::KeyChain m_keyChain;
-};
-
-using boost::mpl::int_;
-typedef boost::mpl::vector<int_<10000>, int_<100>, int_<10>, int_<0> > DatasetSizes;
-
-BOOST_AUTO_TEST_SUITE(SegmentPublisher)
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(Generate, T, DatasetSizes, SegmentPublisherFixture<T::value>)
-{
- this->m_publisher.publish();
- this->m_face->processEvents();
-
- size_t nSegments = this->m_publisher.getTotalPayloadLength() /
- this->m_publisher.getMaxSegmentSize();
- if (this->m_publisher.getTotalPayloadLength() % this->m_publisher.getMaxSegmentSize() != 0 ||
- nSegments == 0)
- ++nSegments;
-
- BOOST_CHECK_EQUAL(this->m_face->sentDatas.size(), nSegments);
- for (const Data& data : this->m_face->sentDatas) {
- this->validate(data);
- }
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/core/simple-notification.hpp b/NFD/tests/core/simple-notification.hpp
deleted file mode 100644
index 3c8fdef..0000000
--- a/NFD/tests/core/simple-notification.hpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_CORE_SIMPLE_NOTIFICATION_HPP
-#define NFD_TESTS_CORE_SIMPLE_NOTIFICATION_HPP
-
-#include "common.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-class SimpleNotification
-{
-public:
- SimpleNotification()
- {
- }
-
- SimpleNotification(const std::string& message)
- : m_message(message)
- {
- }
-
- ~SimpleNotification()
- {
- }
-
- Block
- wireEncode() const
- {
- ndn::EncodingBuffer buffer;
- prependByteArrayBlock(buffer,
- 0x8888,
- reinterpret_cast<const uint8_t*>(m_message.c_str()),
- m_message.size());
- return buffer.block();
- }
-
- void
- wireDecode(const Block& block)
- {
- m_message.assign(reinterpret_cast<const char*>(block.value()),
- block.value_size());
-
- // error for testing
- if (!m_message.empty() && m_message[0] == '\x07')
- throw tlv::Error("0x07 error");
- }
-
-public:
- const std::string&
- getMessage() const
- {
- return m_message;
- }
-
- void
- setMessage(const std::string& message)
- {
- m_message = message;
- }
-
-private:
- std::string m_message;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_CORE_SIMPLE_NOTIFICATION_HPP
diff --git a/NFD/tests/core/version.cpp b/NFD/tests/core/version.cpp
deleted file mode 100644
index 9fe3851..0000000
--- a/NFD/tests/core/version.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "version.hpp"
-#include "core/logger.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(CoreVersion, BaseFixture)
-
-NFD_LOG_INIT("VersionTest");
-
-BOOST_AUTO_TEST_CASE(Version)
-{
- NFD_LOG_INFO("NFD_VERSION " << NFD_VERSION);
-
- BOOST_CHECK_EQUAL(NFD_VERSION, NFD_VERSION_MAJOR * 1000000 +
- NFD_VERSION_MINOR * 1000 +
- NFD_VERSION_PATCH);
-}
-
-BOOST_AUTO_TEST_CASE(VersionString)
-{
- NFD_LOG_INFO("NFD_VERSION_STRING " << NFD_VERSION_STRING);
-
- BOOST_STATIC_ASSERT(NFD_VERSION_MAJOR < 1000);
- BOOST_STATIC_ASSERT(NFD_VERSION_MINOR < 1000);
- BOOST_STATIC_ASSERT(NFD_VERSION_PATCH < 1000);
- char buf[12];
- snprintf(buf, sizeof(buf), "%d.%d.%d", NFD_VERSION_MAJOR, NFD_VERSION_MINOR, NFD_VERSION_PATCH);
-
- BOOST_CHECK_EQUAL(std::string(NFD_VERSION_STRING), std::string(buf));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/dummy-face.hpp b/NFD/tests/daemon/face/dummy-face.hpp
deleted file mode 100644
index ec0adbf..0000000
--- a/NFD/tests/daemon/face/dummy-face.hpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_DAEMON_FACE_DUMMY_FACE_HPP
-#define NFD_TESTS_DAEMON_FACE_DUMMY_FACE_HPP
-
-#include "face/face.hpp"
-#include "face/local-face.hpp"
-
-namespace nfd {
-namespace tests {
-
-/** \class DummyFace
- * \brief a Face for unit testing
- */
-template<class FaceBase>
-class DummyFaceImpl : public FaceBase
-{
-public:
- DummyFaceImpl()
- : FaceBase(FaceUri("dummy://"), FaceUri("dummy://"))
- {
- }
-
- DummyFaceImpl(const std::string& remoteUri, const std::string& localUri)
- : FaceBase(FaceUri(remoteUri), FaceUri(localUri))
- {
- }
-
- virtual void
- sendInterest(const Interest& interest)
- {
- this->onSendInterest(interest);
- m_sentInterests.push_back(interest);
- this->afterSend();
- }
-
- virtual void
- sendData(const Data& data)
- {
- this->onSendData(data);
- m_sentDatas.push_back(data);
- this->afterSend();
- }
-
- virtual void
- close()
- {
- this->onFail("close");
- }
-
- void
- receiveInterest(const Interest& interest)
- {
- this->onReceiveInterest(interest);
- }
-
- void
- receiveData(const Data& data)
- {
- this->onReceiveData(data);
- }
-
- EventEmitter<> afterSend;
-
-public:
- std::vector<Interest> m_sentInterests;
- std::vector<Data> m_sentDatas;
-};
-
-typedef DummyFaceImpl<Face> DummyFace;
-typedef DummyFaceImpl<LocalFace> DummyLocalFace;
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_DAEMON_FACE_DUMMY_FACE_HPP
diff --git a/NFD/tests/daemon/face/dummy-stream-sender.hpp b/NFD/tests/daemon/face/dummy-stream-sender.hpp
deleted file mode 100644
index af0e114..0000000
--- a/NFD/tests/daemon/face/dummy-stream-sender.hpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_DAEMON_FACE_DUMMY_STREAM_SENDER_HPP
-#define NFD_TESTS_DAEMON_FACE_DUMMY_STREAM_SENDER_HPP
-
-#include "core/scheduler.hpp"
-#include "core/global-io.hpp"
-
-namespace nfd {
-namespace tests {
-
-
-template<class Protocol, class Dataset>
-class DummyStreamSender : public Dataset
-{
-public:
- typedef typename Protocol::endpoint Endpoint;
- typedef typename Protocol::socket Socket;
-
- class Error : public std::runtime_error
- {
- public:
- explicit
- Error(const std::string& what)
- : std::runtime_error(what)
- {
- }
- };
-
- DummyStreamSender()
- : socket(getGlobalIoService())
- {
- }
-
- void
- start(const Endpoint& endpoint)
- {
- socket.async_connect(endpoint,
- bind(&DummyStreamSender::onSuccessfullConnect, this, _1));
- }
-
- void
- onSuccessfullConnect(const boost::system::error_code& error)
- {
- if (error)
- {
- throw Error("Connection aborted");
- }
-
- // This value may need to be adjusted if some dataset exceeds 100k
- socket.set_option(boost::asio::socket_base::send_buffer_size(100000));
-
- for (typename Dataset::Container::iterator i = this->data.begin();
- i != this->data.end(); ++i)
- {
- socket.async_send(boost::asio::buffer(*i),
- bind(&DummyStreamSender::onSendFinished, this, _1, false));
- }
-
- socket.async_send(boost::asio::buffer(static_cast<const uint8_t*>(0), 0),
- bind(&DummyStreamSender::onSendFinished, this, _1, true));
- }
-
- void
- onSendFinished(const boost::system::error_code& error, bool isFinal)
- {
- if (error) {
- throw Error("Connection aborted");
- }
-
- if (isFinal) {
- scheduler::schedule(ndn::time::seconds(1),
- bind(&DummyStreamSender::stop, this));
- }
- }
-
- void
- stop()
- {
- // Terminate test
- boost::system::error_code error;
- socket.shutdown(Socket::shutdown_both, error);
- socket.close(error);
- }
-
-public:
- Socket socket;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_DAEMON_FACE_DUMMY_STREAM_SENDER_HPP
diff --git a/NFD/tests/daemon/face/ethernet.cpp b/NFD/tests/daemon/face/ethernet.cpp
deleted file mode 100644
index ab0181c..0000000
--- a/NFD/tests/daemon/face/ethernet.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face/ethernet-face.hpp"
-#include "face/ethernet-factory.hpp"
-
-#include "core/network-interface.hpp"
-#include "tests/test-common.hpp"
-
-#include <pcap/pcap.h>
-
-namespace nfd {
-namespace tests {
-
-class InterfacesFixture : protected BaseFixture
-{
-protected:
- InterfacesFixture()
- {
- EthernetFactory factory;
-
- for (const auto& netif : listNetworkInterfaces()) {
- if (!netif.isLoopback() && netif.isUp()) {
- try {
- factory.createMulticastFace(netif, ethernet::getBroadcastAddress());
- }
- catch (Face::Error&) {
- continue;
- }
-
- m_interfaces.push_back(netif);
- }
- }
- }
-
-protected:
- std::vector<NetworkInterfaceInfo> m_interfaces;
-};
-
-BOOST_FIXTURE_TEST_SUITE(FaceEthernet, InterfacesFixture)
-
-BOOST_AUTO_TEST_CASE(GetChannels)
-{
- EthernetFactory factory;
-
- auto channels = factory.getChannels();
- BOOST_CHECK_EQUAL(channels.empty(), true);
-}
-
-BOOST_AUTO_TEST_CASE(MulticastFacesMap)
-{
- if (m_interfaces.empty()) {
- BOOST_WARN_MESSAGE(false, "No interfaces available for pcap, "
- "cannot perform MulticastFacesMap test");
- return;
- }
-
- EthernetFactory factory;
- shared_ptr<EthernetFace> face1 = factory.createMulticastFace(m_interfaces.front(),
- ethernet::getBroadcastAddress());
- shared_ptr<EthernetFace> face1bis = factory.createMulticastFace(m_interfaces.front(),
- ethernet::getBroadcastAddress());
- BOOST_CHECK_EQUAL(face1, face1bis);
-
- if (m_interfaces.size() > 1) {
- shared_ptr<EthernetFace> face2 = factory.createMulticastFace(m_interfaces.back(),
- ethernet::getBroadcastAddress());
- BOOST_CHECK_NE(face1, face2);
- }
- else {
- BOOST_WARN_MESSAGE(false, "Only one interface available for pcap, "
- "cannot test second EthernetFace creation");
- }
-
- shared_ptr<EthernetFace> face3 = factory.createMulticastFace(m_interfaces.front(),
- ethernet::getDefaultMulticastAddress());
- BOOST_CHECK_NE(face1, face3);
-}
-
-BOOST_AUTO_TEST_CASE(SendPacket)
-{
- if (m_interfaces.empty()) {
- BOOST_WARN_MESSAGE(false, "No interfaces available for pcap, "
- "cannot perform SendPacket test");
- return;
- }
-
- EthernetFactory factory;
- shared_ptr<EthernetFace> face = factory.createMulticastFace(m_interfaces.front(),
- ethernet::getDefaultMulticastAddress());
-
- BOOST_REQUIRE(static_cast<bool>(face));
- BOOST_CHECK_EQUAL(face->isLocal(), false);
- BOOST_CHECK_EQUAL(face->isOnDemand(), false);
- BOOST_CHECK_EQUAL(face->getRemoteUri().toString(),
- "ether://[" + ethernet::getDefaultMulticastAddress().toString() + "]");
- BOOST_CHECK_EQUAL(face->getLocalUri().toString(),
- "dev://" + m_interfaces.front().name);
- BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 0);
- BOOST_CHECK_EQUAL(face->getCounters().getNOutBytes(), 0);
-
- face->onFail += [] (const std::string& reason) { BOOST_FAIL(reason); };
-
- shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
- shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
- shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
- shared_ptr<Data> data2 = makeData("ndn:/XNBV796f");
-
- face->sendInterest(*interest1);
- face->sendData (*data1 );
- face->sendInterest(*interest2);
- face->sendData (*data2 );
-
- BOOST_CHECK_EQUAL(face->getCounters().getNOutBytes(),
- 14 * 4 + // 4 NDNLP headers
- interest1->wireEncode().size() +
- data1->wireEncode().size() +
- interest2->wireEncode().size() +
- data2->wireEncode().size());
-
-// m_ioRemaining = 4;
-// m_ioService.run();
-// m_ioService.reset();
-
-// BOOST_REQUIRE_EQUAL(m_face1_receivedInterests.size(), 1);
-// BOOST_REQUIRE_EQUAL(m_face1_receivedDatas .size(), 1);
-// BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
-// BOOST_REQUIRE_EQUAL(m_face2_receivedDatas .size(), 1);
-
-// BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
-// BOOST_CHECK_EQUAL(m_face1_receivedDatas [0].getName(), data2.getName());
-// BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
-// BOOST_CHECK_EQUAL(m_face2_receivedDatas [0].getName(), data1.getName());
-}
-
-BOOST_AUTO_TEST_CASE(ProcessIncomingPacket)
-{
- if (m_interfaces.empty()) {
- BOOST_WARN_MESSAGE(false, "No interfaces available for pcap, "
- "cannot perform ProcessIncomingPacket test");
- return;
- }
-
- EthernetFactory factory;
- shared_ptr<EthernetFace> face = factory.createMulticastFace(m_interfaces.front(),
- ethernet::getDefaultMulticastAddress());
- BOOST_REQUIRE(static_cast<bool>(face));
-
- std::vector<Interest> recInterests;
- std::vector<Data> recDatas;
-
- face->onFail += [] (const std::string& reason) { BOOST_FAIL(reason); };
- face->onReceiveInterest += [&recInterests] (const Interest& i) { recInterests.push_back(i); };
- face->onReceiveData += [&recDatas] (const Data& d) { recDatas.push_back(d); };
-
- // check that packet data is not accessed if pcap didn't capture anything (caplen == 0)
- static const pcap_pkthdr header1{};
- face->processIncomingPacket(&header1, nullptr);
- BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 0);
- BOOST_CHECK_EQUAL(recInterests.size(), 0);
- BOOST_CHECK_EQUAL(recDatas.size(), 0);
-
- // runt frame (too short)
- static const pcap_pkthdr header2{{}, ethernet::HDR_LEN + 6};
- static const uint8_t packet2[ethernet::HDR_LEN + 6]{};
- face->processIncomingPacket(&header2, packet2);
- BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 0);
- BOOST_CHECK_EQUAL(recInterests.size(), 0);
- BOOST_CHECK_EQUAL(recDatas.size(), 0);
-
- // valid frame, but TLV block has invalid length
- static const pcap_pkthdr header3{{}, ethernet::HDR_LEN + ethernet::MIN_DATA_LEN};
- static const uint8_t packet3[ethernet::HDR_LEN + ethernet::MIN_DATA_LEN]{
- 0x01, 0x00, 0x5e, 0x00, 0x17, 0xaa, // destination address
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, // source address
- 0x86, 0x24, // NDN ethertype
- tlv::NdnlpData, // TLV type
- 0xfd, 0xff, 0xff // TLV length (invalid because greater than buffer size)
- };
- face->processIncomingPacket(&header3, packet3);
- BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 0);
- BOOST_CHECK_EQUAL(recInterests.size(), 0);
- BOOST_CHECK_EQUAL(recDatas.size(), 0);
-
- // valid frame, but TLV block has invalid type
- static const pcap_pkthdr header4{{}, ethernet::HDR_LEN + ethernet::MIN_DATA_LEN};
- static const uint8_t packet4[ethernet::HDR_LEN + ethernet::MIN_DATA_LEN]{
- 0x01, 0x00, 0x5e, 0x00, 0x17, 0xaa, // destination address
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, // source address
- 0x86, 0x24, // NDN ethertype
- 0x00, // TLV type (invalid)
- 0x00 // TLV length
- };
- face->processIncomingPacket(&header4, packet4);
- BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 2);
- BOOST_CHECK_EQUAL(recInterests.size(), 0);
- BOOST_CHECK_EQUAL(recDatas.size(), 0);
-
- // valid frame and valid NDNLP header, but invalid payload
- static const pcap_pkthdr header5{{}, ethernet::HDR_LEN + ethernet::MIN_DATA_LEN};
- static const uint8_t packet5[ethernet::HDR_LEN + ethernet::MIN_DATA_LEN]{
- 0x01, 0x00, 0x5e, 0x00, 0x17, 0xaa, // destination address
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, // source address
- 0x86, 0x24, // NDN ethertype
- tlv::NdnlpData, 0x0e, // NDNLP header
- tlv::NdnlpSequence, 0x08,
- 0, 0, 0, 0, 0, 0, 0, 0,
- tlv::NdnlpPayload, 0x02,
- 0x00, // NDN TLV type (invalid)
- 0x00 // NDN TLV length
- };
- face->processIncomingPacket(&header5, packet5);
- BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 18);
- BOOST_CHECK_EQUAL(recInterests.size(), 0);
- BOOST_CHECK_EQUAL(recDatas.size(), 0);
-
- // valid frame, valid NDNLP header, and valid NDN (interest) packet
- static const pcap_pkthdr header6{{}, ethernet::HDR_LEN + ethernet::MIN_DATA_LEN};
- static const uint8_t packet6[ethernet::HDR_LEN + ethernet::MIN_DATA_LEN]{
- 0x01, 0x00, 0x5e, 0x00, 0x17, 0xaa, // destination address
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, // source address
- 0x86, 0x24, // NDN ethertype
- tlv::NdnlpData, 0x24, // NDNLP TLV type and length
- 0x51, 0x08, 0x00, 0x00, 0x00, 0x00, // rest of NDNLP header
- 0x00, 0x00, 0x00, 0x00, 0x54, 0x18,
- tlv::Interest, 0x16, // NDN TLV type and length
- 0x07, 0x0e, 0x08, 0x07, 0x65, 0x78, // payload
- 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x08,
- 0x03, 0x66, 0x6f, 0x6f, 0x0a, 0x04,
- 0x03, 0xef, 0xe9, 0x7c
- };
- face->processIncomingPacket(&header6, packet6);
- BOOST_CHECK_EQUAL(face->getCounters().getNInBytes(), 56);
- BOOST_CHECK_EQUAL(recInterests.size(), 1);
- BOOST_CHECK_EQUAL(recDatas.size(), 0);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/face-counters.cpp b/NFD/tests/daemon/face/face-counters.cpp
deleted file mode 100644
index 3be0d88..0000000
--- a/NFD/tests/daemon/face/face-counters.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "face/face-counters.hpp"
-#include "dummy-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FaceFaceCounters, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(PacketCnt)
-{
- PacketCounter counter;
-
- uint64_t observation = counter;//implicit convertible
- BOOST_CHECK_EQUAL(observation, 0);
-
- ++counter;
- BOOST_CHECK_EQUAL(static_cast<int>(counter), 1);
- ++counter;
- ++counter;
- BOOST_CHECK_EQUAL(static_cast<int>(counter), 3);
-}
-
-BOOST_AUTO_TEST_CASE(ByteCnt)
-{
- ByteCounter counter;
-
- uint64_t observation = counter;//implicit convertible
- BOOST_CHECK_EQUAL(observation, 0);
-
- counter += 20;
- BOOST_CHECK_EQUAL(static_cast<int>(counter), 20);
- counter += 80;
- counter += 90;
- BOOST_CHECK_EQUAL(static_cast<int>(counter), 190);
-}
-
-BOOST_AUTO_TEST_CASE(Counters)
-{
- DummyFace face;
- const FaceCounters& counters = face.getCounters();
- BOOST_CHECK_EQUAL(counters.getNInInterests() , 0);
- BOOST_CHECK_EQUAL(counters.getNInDatas() , 0);
- BOOST_CHECK_EQUAL(counters.getNOutInterests(), 0);
- BOOST_CHECK_EQUAL(counters.getNOutDatas() , 0);
- BOOST_CHECK_EQUAL(counters.getNInBytes() , 0);
- BOOST_CHECK_EQUAL(counters.getNOutBytes() , 0);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/face.cpp b/NFD/tests/daemon/face/face.cpp
deleted file mode 100644
index 143dfe6..0000000
--- a/NFD/tests/daemon/face/face.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "face/face.hpp"
-#include "face/local-face.hpp"
-#include "dummy-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FaceFace, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Description)
-{
- DummyFace face;
- face.setDescription("3pFsKrvWr");
- BOOST_CHECK_EQUAL(face.getDescription(), "3pFsKrvWr");
-}
-
-BOOST_AUTO_TEST_CASE(LocalControlHeaderEnabled)
-{
- DummyLocalFace face;
-
- BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), false);
-
- face.setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID, true);
- BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), true);
- BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID), true);
- BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(
- LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID), false);
-
- face.setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID, false);
- BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), false);
- BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(
- LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID), false);
-}
-
-class FaceFailTestFace : public DummyFace
-{
-public:
- FaceFailTestFace()
- : failCount(0)
- {
- this->onFail += bind(&FaceFailTestFace::failHandler, this, _1);
- }
-
- void
- failOnce()
- {
- this->fail("reason");
- }
-
-private:
- void
- failHandler(const std::string& reason)
- {
- BOOST_CHECK_EQUAL(reason, "reason");
- ++this->failCount;
- }
-
-public:
- int failCount;
-};
-
-BOOST_AUTO_TEST_CASE(FailTwice)
-{
- FaceFailTestFace face;
- BOOST_CHECK_EQUAL(face.failCount, 0);
- face.failOnce();
- BOOST_CHECK_EQUAL(face.failCount, 1);
- face.failOnce();
- BOOST_CHECK_EQUAL(face.failCount, 1);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/ndnlp.cpp b/NFD/tests/daemon/face/ndnlp.cpp
deleted file mode 100644
index f5ba8e1..0000000
--- a/NFD/tests/daemon/face/ndnlp.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "face/ndnlp-sequence-generator.hpp"
-#include "face/ndnlp-slicer.hpp"
-#include "face/ndnlp-partial-message-store.hpp"
-
-#include "tests/test-common.hpp"
-
-#include <boost/scoped_array.hpp>
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FaceNdnlp, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(SequenceBlock)
-{
- ndnlp::SequenceBlock sb(0x8000, 2);
- BOOST_CHECK_EQUAL(sb.count(), 2);
- BOOST_CHECK_EQUAL(sb[0], 0x8000);
- BOOST_CHECK_EQUAL(sb[1], 0x8001);
- BOOST_CHECK_THROW(sb[2], std::out_of_range);
-}
-
-// sequence number can safely wrap around
-BOOST_AUTO_TEST_CASE(SequenceBlockWrap)
-{
- ndnlp::SequenceBlock sb(std::numeric_limits<uint64_t>::max(), 2);
- BOOST_CHECK_EQUAL(sb[0], std::numeric_limits<uint64_t>::max());
- BOOST_CHECK_EQUAL(sb[1], std::numeric_limits<uint64_t>::min());
- BOOST_CHECK_EQUAL(sb[1] - sb[0], 1);
-}
-
-BOOST_AUTO_TEST_CASE(SequenceGenerator)
-{
- ndnlp::SequenceGenerator seqgen;
-
- ndnlp::SequenceBlock sb1 = seqgen.nextBlock(2);
- BOOST_CHECK_EQUAL(sb1.count(), 2);
-
- ndnlp::SequenceBlock sb2 = seqgen.nextBlock(1);
- BOOST_CHECK_NE(sb1[0], sb2[0]);
- BOOST_CHECK_NE(sb1[1], sb2[0]);
-}
-
-// slice a Block to one NDNLP packet
-BOOST_AUTO_TEST_CASE(Slice1)
-{
- uint8_t blockValue[60];
- memset(blockValue, 0xcc, sizeof(blockValue));
- Block block = ndn::dataBlock(0x01, blockValue, sizeof(blockValue));
-
- ndnlp::Slicer slicer(9000);
- ndnlp::PacketArray pa = slicer.slice(block);
-
- BOOST_REQUIRE_EQUAL(pa->size(), 1);
-
- const Block& pkt = pa->at(0);
- BOOST_CHECK_EQUAL(pkt.type(), static_cast<uint32_t>(tlv::NdnlpData));
- pkt.parse();
-
- const Block::element_container& elements = pkt.elements();
- BOOST_REQUIRE_EQUAL(elements.size(), 2);
-
- const Block& sequenceElement = elements[0];
- BOOST_CHECK_EQUAL(sequenceElement.type(), static_cast<uint32_t>(tlv::NdnlpSequence));
- BOOST_REQUIRE_EQUAL(sequenceElement.value_size(), sizeof(uint64_t));
-
- const Block& payloadElement = elements[1];
- BOOST_CHECK_EQUAL(payloadElement.type(), static_cast<uint32_t>(tlv::NdnlpPayload));
- size_t payloadSize = payloadElement.value_size();
- BOOST_CHECK_EQUAL(payloadSize, block.size());
-
- BOOST_CHECK_EQUAL_COLLECTIONS(payloadElement.value_begin(), payloadElement.value_end(),
- block.begin(), block.end());
-}
-
-// slice a Block to four NDNLP packets
-BOOST_AUTO_TEST_CASE(Slice4)
-{
- uint8_t blockValue[5050];
- memset(blockValue, 0xcc, sizeof(blockValue));
- Block block = ndn::dataBlock(0x01, blockValue, sizeof(blockValue));
-
- ndnlp::Slicer slicer(1500);
- ndnlp::PacketArray pa = slicer.slice(block);
-
- BOOST_REQUIRE_EQUAL(pa->size(), 4);
-
- uint64_t seq0 = 0xdddd;
-
- size_t totalPayloadSize = 0;
-
- for (size_t i = 0; i < 4; ++i) {
- const Block& pkt = pa->at(i);
- BOOST_CHECK_EQUAL(pkt.type(), static_cast<uint32_t>(tlv::NdnlpData));
- pkt.parse();
-
- const Block::element_container& elements = pkt.elements();
- BOOST_REQUIRE_EQUAL(elements.size(), 4);
-
- const Block& sequenceElement = elements[0];
- BOOST_CHECK_EQUAL(sequenceElement.type(), static_cast<uint32_t>(tlv::NdnlpSequence));
- BOOST_REQUIRE_EQUAL(sequenceElement.value_size(), sizeof(uint64_t));
- uint64_t seq = be64toh(*reinterpret_cast<const uint64_t*>(
- &*sequenceElement.value_begin()));
- if (i == 0) {
- seq0 = seq;
- }
- BOOST_CHECK_EQUAL(seq, seq0 + i);
-
- const Block& fragIndexElement = elements[1];
- BOOST_CHECK_EQUAL(fragIndexElement.type(), static_cast<uint32_t>(tlv::NdnlpFragIndex));
- uint64_t fragIndex = ndn::readNonNegativeInteger(fragIndexElement);
- BOOST_CHECK_EQUAL(fragIndex, i);
-
- const Block& fragCountElement = elements[2];
- BOOST_CHECK_EQUAL(fragCountElement.type(), static_cast<uint32_t>(tlv::NdnlpFragCount));
- uint64_t fragCount = ndn::readNonNegativeInteger(fragCountElement);
- BOOST_CHECK_EQUAL(fragCount, 4);
-
- const Block& payloadElement = elements[3];
- BOOST_CHECK_EQUAL(payloadElement.type(), static_cast<uint32_t>(tlv::NdnlpPayload));
- size_t payloadSize = payloadElement.value_size();
- totalPayloadSize += payloadSize;
- }
-
- BOOST_CHECK_EQUAL(totalPayloadSize, block.size());
-}
-
-class ReassembleFixture : protected BaseFixture
-{
-protected:
- ReassembleFixture()
- : m_slicer(1500)
- {
- m_partialMessageStore.onReceive +=
- // push_back in C++11 has 2 overloads, and specific version needs to be selected
- bind(static_cast<void (std::vector<Block>::*)(const Block&)>(&std::vector<Block>::push_back),
- &m_received, _1);
- }
-
- Block
- makeBlock(size_t valueLength)
- {
- boost::scoped_array<uint8_t> blockValue(new uint8_t[valueLength]);
- memset(blockValue.get(), 0xcc, valueLength);
- return ndn::dataBlock(0x01, blockValue.get(), valueLength);
- }
-
-protected:
- ndnlp::Slicer m_slicer;
- ndnlp::PartialMessageStore m_partialMessageStore;
-
- // received network layer packets
- std::vector<Block> m_received;
-};
-
-// reassemble one NDNLP packets into one Block
-BOOST_FIXTURE_TEST_CASE(Reassemble1, ReassembleFixture)
-{
- Block block = makeBlock(60);
- ndnlp::PacketArray pa = m_slicer.slice(block);
- BOOST_REQUIRE_EQUAL(pa->size(), 1);
-
- BOOST_CHECK_EQUAL(m_received.size(), 0);
- m_partialMessageStore.receiveNdnlpData(pa->at(0));
-
- BOOST_REQUIRE_EQUAL(m_received.size(), 1);
- BOOST_CHECK_EQUAL_COLLECTIONS(m_received.at(0).begin(), m_received.at(0).end(),
- block.begin(), block.end());
-}
-
-// reassemble four and two NDNLP packets into two Blocks
-BOOST_FIXTURE_TEST_CASE(Reassemble4and2, ReassembleFixture)
-{
- Block block = makeBlock(5050);
- ndnlp::PacketArray pa = m_slicer.slice(block);
- BOOST_REQUIRE_EQUAL(pa->size(), 4);
-
- Block block2 = makeBlock(2000);
- ndnlp::PacketArray pa2 = m_slicer.slice(block2);
- BOOST_REQUIRE_EQUAL(pa2->size(), 2);
-
- BOOST_CHECK_EQUAL(m_received.size(), 0);
- m_partialMessageStore.receiveNdnlpData(pa->at(0));
- BOOST_CHECK_EQUAL(m_received.size(), 0);
- m_partialMessageStore.receiveNdnlpData(pa->at(1));
- BOOST_CHECK_EQUAL(m_received.size(), 0);
- m_partialMessageStore.receiveNdnlpData(pa2->at(1));
- BOOST_CHECK_EQUAL(m_received.size(), 0);
- m_partialMessageStore.receiveNdnlpData(pa->at(1));
- BOOST_CHECK_EQUAL(m_received.size(), 0);
- m_partialMessageStore.receiveNdnlpData(pa2->at(0));
- BOOST_CHECK_EQUAL(m_received.size(), 1);
- m_partialMessageStore.receiveNdnlpData(pa->at(3));
- BOOST_CHECK_EQUAL(m_received.size(), 1);
- m_partialMessageStore.receiveNdnlpData(pa->at(2));
-
- BOOST_REQUIRE_EQUAL(m_received.size(), 2);
- BOOST_CHECK_EQUAL_COLLECTIONS(m_received.at(1).begin(), m_received.at(1).end(),
- block.begin(), block.end());
- BOOST_CHECK_EQUAL_COLLECTIONS(m_received.at(0).begin(), m_received.at(0).end(),
- block2.begin(), block2.end());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/null.cpp b/NFD/tests/daemon/face/null.cpp
deleted file mode 100644
index db90410..0000000
--- a/NFD/tests/daemon/face/null.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face/null-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FaceNull, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Send)
-{
- shared_ptr<NullFace> face = make_shared<NullFace>();
-
- shared_ptr<Interest> interest = makeInterest("/A");
- BOOST_CHECK_NO_THROW(face->sendInterest(*interest));
-
- shared_ptr<Data> data = makeData("/B");
- BOOST_CHECK_NO_THROW(face->sendData(*data));
-
- BOOST_CHECK_NO_THROW(face->close());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/packet-datasets.cpp b/NFD/tests/daemon/face/packet-datasets.cpp
deleted file mode 100644
index cf661db..0000000
--- a/NFD/tests/daemon/face/packet-datasets.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "packet-datasets.hpp"
-#include "tests/test-common.hpp"
-
-#include <boost/foreach.hpp>
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(Datasets, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Corrupted)
-{
- {
- typedef CorruptedInterest Dataset;
- Dataset dataset;
-
- BOOST_FOREACH(Dataset::Container::value_type& data, dataset.data)
- {
- Block block(data.buf(), data.size());
-
- BOOST_CHECK_THROW((Interest(block)), tlv::Error);
- }
- }
-
- {
- typedef CorruptedInterestWithLocalControlHeader Dataset;
- Dataset dataset;
-
- BOOST_FOREACH(Dataset::Container::value_type& data, dataset.data)
- {
- Block block(data.buf(), data.size());
-
- BOOST_CHECK_THROW(ndn::nfd::LocalControlHeader::getPayload(block), tlv::Error);
- }
- }
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/packet-datasets.hpp b/NFD/tests/daemon/face/packet-datasets.hpp
deleted file mode 100644
index 373f4e6..0000000
--- a/NFD/tests/daemon/face/packet-datasets.hpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_DAEMON_FACE_PACKET_DATASETS_HPP
-#define NFD_TESTS_DAEMON_FACE_PACKET_DATASETS_HPP
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-class CorruptedInterestWithLocalControlHeader
-{
-public:
- typedef std::vector<ndn::Buffer> Container;
-
- static std::string
- getName()
- {
- return "CorruptedInterestWithLocalControlHeader";
- }
-
- CorruptedInterestWithLocalControlHeader()
- {
- static const uint8_t interest[] = {
- 0x50, 0x22, 0x51, 0x81, 0x0a, 0x05, 0x1d, 0x07, 0x14, 0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61,
- 0x6c, 0x08, 0x03, 0x6e, 0x64, 0x6e, 0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x09,
- 0x02, 0x12, 0x00, 0x0a, 0x01, 0x01
- };
-
- data.push_back(ndn::Buffer(interest, sizeof(interest)));
- }
-public:
- Container data;
-};
-
-class CorruptedInterest
-{
-public:
- typedef std::vector<ndn::Buffer> Container;
-
- static std::string
- getName()
- {
- return "CorruptedInterest";
- }
-
- CorruptedInterest()
- {
- static const uint8_t interest[] = {
- 0x05, 0x1d, 0x07, 0x84, 0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x08, 0x03, 0x6e, 0x64,
- 0x6e, 0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x09, 0x02, 0x12, 0x00, 0x0a, 0x01,
- 0x01
- };
-
- data.push_back(ndn::Buffer(interest, sizeof(interest)));
- }
-public:
- Container data;
-};
-
-
-typedef boost::mpl::vector< CorruptedInterestWithLocalControlHeader,
- CorruptedInterest> CorruptedPackets;
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_DAEMON_FACE_PACKET_DATASETS_HPP
diff --git a/NFD/tests/daemon/face/tcp.cpp b/NFD/tests/daemon/face/tcp.cpp
deleted file mode 100644
index 7c8e33b..0000000
--- a/NFD/tests/daemon/face/tcp.cpp
+++ /dev/null
@@ -1,773 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face/tcp-factory.hpp"
-#include "core/resolver.hpp"
-#include "core/network-interface.hpp"
-#include <ndn-cxx/security/key-chain.hpp>
-
-#include "tests/test-common.hpp"
-#include "tests/limited-io.hpp"
-#include "dummy-stream-sender.hpp"
-#include "packet-datasets.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FaceTcp, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(ChannelMap)
-{
- TcpFactory factory;
-
- shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
- shared_ptr<TcpChannel> channel1a = factory.createChannel("127.0.0.1", "20070");
- BOOST_CHECK_EQUAL(channel1, channel1a);
- BOOST_CHECK_EQUAL(channel1->getUri().toString(), "tcp4://127.0.0.1:20070");
-
- shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
- BOOST_CHECK_NE(channel1, channel2);
-
- shared_ptr<TcpChannel> channel3 = factory.createChannel("::1", "20071");
- BOOST_CHECK_NE(channel2, channel3);
- BOOST_CHECK_EQUAL(channel3->getUri().toString(), "tcp6://[::1]:20071");
-}
-
-BOOST_AUTO_TEST_CASE(GetChannels)
-{
- TcpFactory factory;
- BOOST_REQUIRE_EQUAL(factory.getChannels().empty(), true);
-
- std::vector<shared_ptr<const Channel>> expectedChannels;
- expectedChannels.push_back(factory.createChannel("127.0.0.1", "20070"));
- expectedChannels.push_back(factory.createChannel("127.0.0.1", "20071"));
- expectedChannels.push_back(factory.createChannel("::1", "20071"));
-
- for (const auto& ch : factory.getChannels()) {
- auto pos = std::find(expectedChannels.begin(), expectedChannels.end(), ch);
- BOOST_REQUIRE(pos != expectedChannels.end());
- expectedChannels.erase(pos);
- }
- BOOST_CHECK_EQUAL(expectedChannels.size(), 0);
-}
-
-class FaceCreateFixture : protected BaseFixture
-{
-public:
- void
- ignore()
- {
- }
-
- void
- checkError(const std::string& errorActual, const std::string& errorExpected)
- {
- BOOST_CHECK_EQUAL(errorActual, errorExpected);
- }
-
- void
- failIfError(const std::string& errorActual)
- {
- BOOST_FAIL("No error expected, but got: [" << errorActual << "]");
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(FaceCreate, FaceCreateFixture)
-{
- TcpFactory factory = TcpFactory();
-
- factory.createFace(FaceUri("tcp4://127.0.0.1"),
- bind(&FaceCreateFixture::ignore, this),
- bind(&FaceCreateFixture::failIfError, this, _1));
-
- factory.createFace(FaceUri("tcp4://127.0.0.1/"),
- bind(&FaceCreateFixture::ignore, this),
- bind(&FaceCreateFixture::failIfError, this, _1));
-
- factory.createFace(FaceUri("tcp4://127.0.0.1/path"),
- bind(&FaceCreateFixture::ignore, this),
- bind(&FaceCreateFixture::checkError, this, _1, "Invalid URI"));
-}
-
-class EndToEndFixture : protected BaseFixture
-{
-public:
- void
- channel1_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- BOOST_CHECK(!static_cast<bool>(face1));
- face1 = newFace;
- face1->onReceiveInterest +=
- bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- face1->onReceiveData +=
- bind(&EndToEndFixture::face1_onReceiveData, this, _1);
- face1->onFail +=
- bind(&EndToEndFixture::face1_onFail, this);
-
- limitedIo.afterOp();
- }
-
- void
- channel1_onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onReceiveInterest(const Interest& interest)
- {
- face1_receivedInterests.push_back(interest);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onReceiveData(const Data& data)
- {
- face1_receivedDatas.push_back(data);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onFail()
- {
- face1.reset();
- limitedIo.afterOp();
- }
-
- void
- channel2_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- BOOST_CHECK(!static_cast<bool>(face2));
- face2 = newFace;
- face2->onReceiveInterest +=
- bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- face2->onReceiveData +=
- bind(&EndToEndFixture::face2_onReceiveData, this, _1);
- face2->onFail +=
- bind(&EndToEndFixture::face2_onFail, this);
-
- limitedIo.afterOp();
- }
-
- void
- channel2_onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- face2_onReceiveInterest(const Interest& interest)
- {
- face2_receivedInterests.push_back(interest);
-
- limitedIo.afterOp();
- }
-
- void
- face2_onReceiveData(const Data& data)
- {
- face2_receivedDatas.push_back(data);
-
- limitedIo.afterOp();
- }
-
- void
- face2_onFail()
- {
- face2.reset();
- limitedIo.afterOp();
- }
-
- void
- channel_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- faces.push_back(newFace);
- limitedIo.afterOp();
- }
-
- void
- channel_onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- checkFaceList(size_t shouldBe)
- {
- BOOST_CHECK_EQUAL(faces.size(), shouldBe);
- }
-
- void
- connect(const shared_ptr<TcpChannel>& channel,
- const std::string& remoteHost,
- const std::string& remotePort)
- {
- channel->connect(remoteHost, remotePort,
- bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
- }
-
-public:
- LimitedIo limitedIo;
-
- shared_ptr<Face> face1;
- std::vector<Interest> face1_receivedInterests;
- std::vector<Data> face1_receivedDatas;
- shared_ptr<Face> face2;
- std::vector<Interest> face2_receivedInterests;
- std::vector<Data> face2_receivedDatas;
-
- std::list<shared_ptr<Face>> faces;
-};
-
-BOOST_FIXTURE_TEST_CASE(EndToEnd4, EndToEndFixture)
-{
- TcpFactory factory1;
-
- shared_ptr<TcpChannel> channel1 = factory1.createChannel("127.0.0.1", "20070");
- factory1.createChannel("127.0.0.1", "20071");
-
- BOOST_CHECK_EQUAL(channel1->isListening(), false);
-
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- BOOST_CHECK_EQUAL(channel1->isListening(), true);
-
- TcpFactory factory2;
-
- shared_ptr<TcpChannel> channel2 = factory2.createChannel("127.0.0.2", "20070");
- factory2.createChannel("127.0.0.2", "20071");
-
- factory2.createFace(FaceUri("tcp://127.0.0.1:20070"),
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot connect or cannot accept connection");
-
- BOOST_REQUIRE(static_cast<bool>(face1));
- BOOST_REQUIRE(static_cast<bool>(face2));
-
- BOOST_CHECK(face1->isOnDemand());
- BOOST_CHECK(!face2->isOnDemand());
-
- BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "tcp4://127.0.0.1:20070");
- BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "tcp4://127.0.0.1:20070");
- // face1 has an unknown remoteUri, since the source port is automatically chosen by OS
-
- BOOST_CHECK_EQUAL(face1->isLocal(), true);
- BOOST_CHECK_EQUAL(face2->isLocal(), true);
-
- BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face2)), true);
-
- // integrated tests needs to check that TcpFace for non-loopback fails these tests...
-
- shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
- shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
- shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
- shared_ptr<Data> data2 = makeData("ndn:/XNBV796f");
-
- face1->sendInterest(*interest1);
- face1->sendInterest(*interest1);
- face1->sendInterest(*interest1);
- face1->sendData (*data1 );
- size_t nBytesSent1 = interest1->wireEncode().size() * 3 + data1->wireEncode().size();
- face2->sendInterest(*interest2);
- face2->sendData (*data2 );
- face2->sendData (*data2 );
- face2->sendData (*data2 );
-
- BOOST_CHECK_MESSAGE(limitedIo.run(8, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 3);
- BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
- BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2->getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2->getName());
- BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1->getName());
- BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1->getName());
-
- // needed to ensure NOutBytes counters are accurate
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::seconds(1));
-
- const FaceCounters& counters1 = face1->getCounters();
- BOOST_CHECK_EQUAL(counters1.getNInInterests() , 1);
- BOOST_CHECK_EQUAL(counters1.getNInDatas() , 3);
- BOOST_CHECK_EQUAL(counters1.getNOutInterests(), 3);
- BOOST_CHECK_EQUAL(counters1.getNOutDatas() , 1);
- BOOST_CHECK_EQUAL(counters1.getNOutBytes(), nBytesSent1);
-
- const FaceCounters& counters2 = face2->getCounters();
- BOOST_CHECK_EQUAL(counters2.getNInInterests() , 3);
- BOOST_CHECK_EQUAL(counters2.getNInDatas() , 1);
- BOOST_CHECK_EQUAL(counters2.getNOutInterests(), 1);
- BOOST_CHECK_EQUAL(counters2.getNOutDatas() , 3);
- BOOST_CHECK_EQUAL(counters2.getNInBytes(), nBytesSent1);
-}
-
-BOOST_FIXTURE_TEST_CASE(EndToEnd6, EndToEndFixture)
-{
- TcpFactory factory1;
-
- shared_ptr<TcpChannel> channel1 = factory1.createChannel("::1", "20070");
- shared_ptr<TcpChannel> channel2 = factory1.createChannel("::1", "20071");
-
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- TcpFactory factory2;
-
- factory2.createChannel("::2", "20070");
-
- factory2.createFace(FaceUri("tcp://[::1]:20070"),
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot connect or cannot accept connection");
-
- BOOST_REQUIRE(static_cast<bool>(face1));
- BOOST_REQUIRE(static_cast<bool>(face2));
-
- BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "tcp6://[::1]:20070");
- BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "tcp6://[::1]:20070");
- // face1 has an unknown remoteUri, since the source port is automatically chosen by OS
-
- BOOST_CHECK_EQUAL(face1->isLocal(), true);
- BOOST_CHECK_EQUAL(face2->isLocal(), true);
-
- BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face2)), true);
-
- // integrated tests needs to check that TcpFace for non-loopback fails these tests...
-
- shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
- shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
- shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
- shared_ptr<Data> data2 = makeData("ndn:/XNBV796f");
-
- face1->sendInterest(*interest1);
- face1->sendData (*data1 );
- face2->sendInterest(*interest2);
- face2->sendData (*data2 );
-
- BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot send or receive Interest/Data packets");
-
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
- BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2->getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2->getName());
- BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1->getName());
- BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1->getName());
-}
-
-BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
-{
- TcpFactory factory;
-
- shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
- shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
-
- channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-
- channel2->connect("127.0.0.1", "20070",
- bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1),
- time::seconds(4)); // very short timeout
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot connect or cannot accept connection");
-
-
- BOOST_CHECK_EQUAL(faces.size(), 2);
-
- shared_ptr<TcpChannel> channel3 = factory.createChannel("127.0.0.1", "20072");
- channel3->connect("127.0.0.1", "20070",
- bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1),
- time::seconds(4)); // very short timeout
-
-
- shared_ptr<TcpChannel> channel4 = factory.createChannel("127.0.0.1", "20073");
-
- BOOST_CHECK_NE(channel3, channel4);
-
- scheduler::schedule(time::seconds(1),
- bind(&EndToEndFixture::connect, this, channel4, "127.0.0.1", "20070"));
-
- scheduler::schedule(time::milliseconds(500),
- bind(&EndToEndFixture::checkFaceList, this, 4));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(4,// 2 connects and 2 accepts
- time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot connect or cannot accept multiple connections");
-
- BOOST_CHECK_EQUAL(faces.size(), 6);
-}
-
-
-BOOST_FIXTURE_TEST_CASE(FaceClosing, EndToEndFixture)
-{
- TcpFactory factory;
-
- shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
- shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
-
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- channel2->connect("127.0.0.1", "20070",
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel2_onConnectFailed, this, _1),
- time::seconds(4)); // very short timeout
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot connect or cannot accept connection");
-
- BOOST_CHECK_EQUAL(channel1->size(), 1);
- BOOST_CHECK_EQUAL(channel2->size(), 1);
-
- BOOST_REQUIRE(static_cast<bool>(face1));
- BOOST_CHECK(static_cast<bool>(face2));
-
- // Face::close must be invoked during io run to be counted as an op
- scheduler::schedule(time::milliseconds(100), bind(&Face::close, face1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "FaceClosing error: cannot properly close faces");
-
- // both faces should get closed
- BOOST_CHECK(!static_cast<bool>(face1));
- BOOST_CHECK(!static_cast<bool>(face2));
-
- BOOST_CHECK_EQUAL(channel1->size(), 0);
- BOOST_CHECK_EQUAL(channel2->size(), 0);
-}
-
-
-class SimpleEndToEndFixture : protected BaseFixture
-{
-public:
- void
- onFaceCreated(const shared_ptr<Face>& face)
- {
- face->onReceiveInterest +=
- bind(&SimpleEndToEndFixture::onReceiveInterest, this, _1);
- face->onReceiveData +=
- bind(&SimpleEndToEndFixture::onReceiveData, this, _1);
- face->onFail +=
- bind(&SimpleEndToEndFixture::onFail, this, face);
-
- if (static_cast<bool>(dynamic_pointer_cast<LocalFace>(face))) {
- static_pointer_cast<LocalFace>(face)->setLocalControlHeaderFeature(
- LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
-
- static_pointer_cast<LocalFace>(face)->setLocalControlHeaderFeature(
- LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
- }
-
- limitedIo.afterOp();
- }
-
- void
- onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- onReceiveInterest(const Interest& interest)
- {
- receivedInterests.push_back(interest);
-
- limitedIo.afterOp();
- }
-
- void
- onReceiveData(const Data& data)
- {
- receivedDatas.push_back(data);
-
- limitedIo.afterOp();
- }
-
- void
- onFail(const shared_ptr<Face>& face)
- {
- limitedIo.afterOp();
- }
-
-public:
- LimitedIo limitedIo;
-
- std::vector<Interest> receivedInterests;
- std::vector<Data> receivedDatas;
-};
-
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(LocalFaceCorruptedInput, Dataset,
- CorruptedPackets, SimpleEndToEndFixture)
-{
- TcpFactory factory;
-
- shared_ptr<TcpChannel> channel = factory.createChannel("127.0.0.1", "20070");
- channel->listen(bind(&SimpleEndToEndFixture::onFaceCreated, this, _1),
- bind(&SimpleEndToEndFixture::onConnectFailed, this, _1));
- BOOST_REQUIRE_EQUAL(channel->isListening(), true);
-
- DummyStreamSender<boost::asio::ip::tcp, Dataset> sender;
- sender.start(Resolver<boost::asio::ip::tcp>::syncResolve("127.0.0.1", "20070"));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(LimitedIo::UNLIMITED_OPS,
- time::seconds(1)) == LimitedIo::EXCEED_TIME,
- "Exception thrown for " + Dataset::getName());
-}
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(FaceCorruptedInput, Dataset,
- CorruptedPackets, SimpleEndToEndFixture)
-{
- // tests with non-local Face
- std::string someIpv4Address;
- for (const auto& netif : listNetworkInterfaces()) {
- if (!netif.isLoopback() && netif.isUp() && !netif.ipv4Addresses.empty()) {
- someIpv4Address = netif.ipv4Addresses[0].to_string();
- break;
- }
- }
- if (someIpv4Address.empty()) {
- BOOST_TEST_MESSAGE("Test with non-local Face cannot be run "
- "(no non-local interface with IPv4 address available)");
- return;
- }
-
- TcpFactory factory;
-
- shared_ptr<TcpChannel> channel = factory.createChannel(someIpv4Address, "20070");
- channel->listen(bind(&SimpleEndToEndFixture::onFaceCreated, this, _1),
- bind(&SimpleEndToEndFixture::onConnectFailed, this, _1));
- BOOST_REQUIRE_EQUAL(channel->isListening(), true);
-
- DummyStreamSender<boost::asio::ip::tcp, Dataset> sender;
- sender.start(Resolver<boost::asio::ip::tcp>::syncResolve(someIpv4Address, "20070"));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(LimitedIo::UNLIMITED_OPS,
- time::seconds(1)) == LimitedIo::EXCEED_TIME,
- "Exception thrown for " + Dataset::getName());
-}
-
-class FaceCreateTimeoutFixture : protected BaseFixture
-{
-public:
- void
- onFaceCreated(const shared_ptr<Face>& newFace)
- {
- BOOST_CHECK_MESSAGE(false, "Timeout expected");
- BOOST_CHECK(!static_cast<bool>(face1));
- face1 = newFace;
-
- limitedIo.afterOp();
- }
-
- void
- onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(true, reason);
-
- limitedIo.afterOp();
- }
-
-public:
- LimitedIo limitedIo;
-
- shared_ptr<Face> face1;
-};
-
-BOOST_FIXTURE_TEST_CASE(FaceCreateTimeout, FaceCreateTimeoutFixture)
-{
- TcpFactory factory;
- shared_ptr<TcpChannel> channel = factory.createChannel("0.0.0.0", "20070");
-
- factory.createFace(FaceUri("tcp://192.0.2.1:20070"),
- bind(&FaceCreateTimeoutFixture::onFaceCreated, this, _1),
- bind(&FaceCreateTimeoutFixture::onConnectFailed, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot connect or cannot accept connection");
-
- BOOST_CHECK_EQUAL(static_cast<bool>(face1), false);
-}
-
-BOOST_FIXTURE_TEST_CASE(Bug1856, EndToEndFixture)
-{
- TcpFactory factory1;
-
- shared_ptr<TcpChannel> channel1 = factory1.createChannel("127.0.0.1", "20070");
- factory1.createChannel("127.0.0.1", "20071");
-
- BOOST_CHECK_EQUAL(channel1->isListening(), false);
-
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- BOOST_CHECK_EQUAL(channel1->isListening(), true);
-
- TcpFactory factory2;
-
- shared_ptr<TcpChannel> channel2 = factory2.createChannel("127.0.0.2", "20070");
- factory2.createChannel("127.0.0.2", "20071");
-
- factory2.createFace(FaceUri("tcp://127.0.0.1:20070"),
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "TcpChannel error: cannot connect or cannot accept connection");
-
- BOOST_REQUIRE(static_cast<bool>(face1));
- BOOST_REQUIRE(static_cast<bool>(face2));
-
- std::ostringstream hugeName;
- hugeName << "/huge-name/";
- for (size_t i = 0; i < ndn::MAX_NDN_PACKET_SIZE; i++)
- hugeName << 'a';
-
- shared_ptr<Interest> interest = makeInterest("ndn:/KfczhUqVix");
- shared_ptr<Interest> hugeInterest = makeInterest(hugeName.str());
-
- face1->sendInterest(*hugeInterest);
- face2->sendInterest(*interest);
- face2->sendInterest(*interest);
-
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::seconds(1));
- BOOST_TEST_MESSAGE("Unexpected assertion test passed");
-}
-
-class FakeNetworkInterfaceFixture : public BaseFixture
-{
-public:
- FakeNetworkInterfaceFixture()
- {
- using namespace boost::asio::ip;
-
- auto fakeInterfaces = make_shared<std::vector<NetworkInterfaceInfo>>();
-
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {0, "eth0",
- ethernet::Address::fromString("3e:15:c2:8b:65:00"),
- {address_v4::from_string("0.0.0.0")},
- {address_v6::from_string("::")},
- address_v4(),
- IFF_UP});
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {1, "eth0",
- ethernet::Address::fromString("3e:15:c2:8b:65:00"),
- {address_v4::from_string("192.168.2.1"), address_v4::from_string("192.168.2.2")},
- {},
- address_v4::from_string("192.168.2.255"),
- 0});
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {2, "eth1",
- ethernet::Address::fromString("3e:15:c2:8b:65:00"),
- {address_v4::from_string("198.51.100.1")},
- {address_v6::from_string("2001:db8::2"), address_v6::from_string("2001:db8::3")},
- address_v4::from_string("198.51.100.255"),
- IFF_MULTICAST | IFF_BROADCAST | IFF_UP});
-
- setDebugNetworkInterfaces(fakeInterfaces);
- }
-
- ~FakeNetworkInterfaceFixture()
- {
- setDebugNetworkInterfaces(nullptr);
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(Bug2292, FakeNetworkInterfaceFixture)
-{
- using namespace boost::asio::ip;
-
- TcpFactory factory;
- factory.prohibitEndpoint(tcp::Endpoint(address_v4::from_string("192.168.2.1"), 1024));
- BOOST_REQUIRE_EQUAL(factory.m_prohibitedEndpoints.size(), 1);
- BOOST_CHECK((factory.m_prohibitedEndpoints ==
- std::set<tcp::Endpoint> {
- tcp::Endpoint(address_v4::from_string("192.168.2.1"), 1024),
- }));
-
- factory.m_prohibitedEndpoints.clear();
- factory.prohibitEndpoint(tcp::Endpoint(address_v6::from_string("2001:db8::1"), 2048));
- BOOST_REQUIRE_EQUAL(factory.m_prohibitedEndpoints.size(), 1);
- BOOST_CHECK((factory.m_prohibitedEndpoints ==
- std::set<tcp::Endpoint> {
- tcp::Endpoint(address_v6::from_string("2001:db8::1"), 2048)
- }));
-
- factory.m_prohibitedEndpoints.clear();
- factory.prohibitEndpoint(tcp::Endpoint(address_v4(), 1024));
- BOOST_REQUIRE_EQUAL(factory.m_prohibitedEndpoints.size(), 4);
- BOOST_CHECK((factory.m_prohibitedEndpoints ==
- std::set<tcp::Endpoint> {
- tcp::Endpoint(address_v4::from_string("192.168.2.1"), 1024),
- tcp::Endpoint(address_v4::from_string("192.168.2.2"), 1024),
- tcp::Endpoint(address_v4::from_string("198.51.100.1"), 1024),
- tcp::Endpoint(address_v4::from_string("0.0.0.0"), 1024)
- }));
-
- factory.m_prohibitedEndpoints.clear();
- factory.prohibitEndpoint(tcp::Endpoint(address_v6(), 2048));
- BOOST_REQUIRE_EQUAL(factory.m_prohibitedEndpoints.size(), 3);
- BOOST_CHECK((factory.m_prohibitedEndpoints ==
- std::set<tcp::Endpoint> {
- tcp::Endpoint(address_v6::from_string("2001:db8::2"), 2048),
- tcp::Endpoint(address_v6::from_string("2001:db8::3"), 2048),
- tcp::Endpoint(address_v6::from_string("::"), 2048)
- }));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/udp.cpp b/NFD/tests/daemon/face/udp.cpp
deleted file mode 100644
index abab320..0000000
--- a/NFD/tests/daemon/face/udp.cpp
+++ /dev/null
@@ -1,1079 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face/udp-factory.hpp"
-#include "core/network-interface.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/limited-io.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FaceUdp, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(GetChannels)
-{
- UdpFactory factory;
- BOOST_REQUIRE_EQUAL(factory.getChannels().empty(), true);
-
- std::vector<shared_ptr<const Channel> > expectedChannels;
-
- expectedChannels.push_back(factory.createChannel("127.0.0.1", "20070"));
- expectedChannels.push_back(factory.createChannel("127.0.0.1", "20071"));
- expectedChannels.push_back(factory.createChannel("::1", "20071"));
-
- std::list<shared_ptr<const Channel> > channels = factory.getChannels();
- for (std::list<shared_ptr<const Channel> >::const_iterator i = channels.begin();
- i != channels.end(); ++i)
- {
- std::vector<shared_ptr<const Channel> >::iterator pos =
- std::find(expectedChannels.begin(), expectedChannels.end(), *i);
-
- BOOST_REQUIRE(pos != expectedChannels.end());
- expectedChannels.erase(pos);
- }
-
- BOOST_CHECK_EQUAL(expectedChannels.size(), 0);
-}
-
-class FactoryErrorCheck : protected BaseFixture
-{
-public:
- bool
- isTheSameMulticastEndpoint(const UdpFactory::Error& e) {
- return strcmp(e.what(),
- "Cannot create the requested UDP unicast channel, local "
- "endpoint is already allocated for a UDP multicast face") == 0;
- }
-
- bool
- isNotMulticastAddress(const UdpFactory::Error& e) {
- return strcmp(e.what(),
- "Cannot create the requested UDP multicast face, "
- "the multicast group given as input is not a multicast address") == 0;
- }
-
- bool
- isTheSameUnicastEndpoint(const UdpFactory::Error& e) {
- return strcmp(e.what(),
- "Cannot create the requested UDP multicast face, local "
- "endpoint is already allocated for a UDP unicast channel") == 0;
- }
-
- bool
- isLocalEndpointOnDifferentGroup(const UdpFactory::Error& e) {
- return strcmp(e.what(),
- "Cannot create the requested UDP multicast face, local "
- "endpoint is already allocated for a UDP multicast face "
- "on a different multicast group") == 0;
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(ChannelMapUdp, FactoryErrorCheck)
-{
- using boost::asio::ip::udp;
-
- UdpFactory factory = UdpFactory();
-
- //to instantiate multicast face on a specific ip address, change interfaceIp
- std::string interfaceIp = "0.0.0.0";
-
- shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
- shared_ptr<UdpChannel> channel1a = factory.createChannel("127.0.0.1", "20070");
- BOOST_CHECK_EQUAL(channel1, channel1a);
- BOOST_CHECK_EQUAL(channel1->getUri().toString(), "udp4://127.0.0.1:20070");
-
- shared_ptr<UdpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
- BOOST_CHECK_NE(channel1, channel2);
-
- shared_ptr<UdpChannel> channel3 = factory.createChannel(interfaceIp, "20070");
-
- shared_ptr<UdpChannel> channel4 = factory.createChannel("::1", "20071");
- BOOST_CHECK_NE(channel2, channel4);
- BOOST_CHECK_EQUAL(channel4->getUri().toString(), "udp6://[::1]:20071");
-
- //same endpoint of a unicast channel
- BOOST_CHECK_EXCEPTION(factory.createMulticastFace(interfaceIp,
- "224.0.0.1",
- "20070"),
- UdpFactory::Error,
- isTheSameUnicastEndpoint);
-
-
- shared_ptr<MulticastUdpFace> multicastFace1 = factory.createMulticastFace(interfaceIp,
- "224.0.0.1",
- "20072");
- shared_ptr<MulticastUdpFace> multicastFace1a = factory.createMulticastFace(interfaceIp,
- "224.0.0.1",
- "20072");
- BOOST_CHECK_EQUAL(multicastFace1, multicastFace1a);
-
-
- //same endpoint of a multicast face
- BOOST_CHECK_EXCEPTION(factory.createChannel(interfaceIp, "20072"),
- UdpFactory::Error,
- isTheSameMulticastEndpoint);
-
- //same multicast endpoint, different group
- BOOST_CHECK_EXCEPTION(factory.createMulticastFace(interfaceIp,
- "224.0.0.42",
- "20072"),
- UdpFactory::Error,
- isLocalEndpointOnDifferentGroup);
-
- BOOST_CHECK_EXCEPTION(factory.createMulticastFace(interfaceIp,
- "192.168.10.15",
- "20025"),
- UdpFactory::Error,
- isNotMulticastAddress);
-
-
-// //Test commented because it required to be run in a machine that can resolve ipv6 query
-// shared_ptr<UdpChannel> channel1v6 = factory.createChannel(//"::1",
-// "fe80::5e96:9dff:fe7d:9c8d%en1",
-// //"fe80::aa54:b2ff:fe08:27b8%wlan0",
-// "20070");
-//
-// //the creation of multicastFace2 works properly. It has been disable because it needs an IP address of
-// //an available network interface (different from the first one used)
-// shared_ptr<MulticastUdpFace> multicastFace2 = factory.createMulticastFace("192.168.1.17",
-// "224.0.0.1",
-// "20073");
-// BOOST_CHECK_NE(multicastFace1, multicastFace2);
-//
-//
-// //ipv6 - work in progress
-// shared_ptr<MulticastUdpFace> multicastFace3 = factory.createMulticastFace("fe80::5e96:9dff:fe7d:9c8d%en1",
-// "FF01:0:0:0:0:0:0:2",
-// "20073");
-//
-// shared_ptr<MulticastUdpFace> multicastFace4 = factory.createMulticastFace("fe80::aa54:b2ff:fe08:27b8%wlan0",
-// "FF01:0:0:0:0:0:0:2",
-// "20073");
-//
-// BOOST_CHECK_EQUAL(multicastFace3, multicastFace4);
-//
-// shared_ptr<MulticastUdpFace> multicastFace5 = factory.createMulticastFace("::1",
-// "FF01:0:0:0:0:0:0:2",
-// "20073");
-//
-// BOOST_CHECK_NE(multicastFace3, multicastFace5);
-//
-// //same local ipv6 endpoint for a different multicast group
-// BOOST_CHECK_THROW(factory.createMulticastFace("fe80::aa54:b2ff:fe08:27b8%wlan0",
-// "FE01:0:0:0:0:0:0:2",
-// "20073"),
-// UdpFactory::Error);
-//
-// //same local ipv6 (expect for th port number) endpoint for a different multicast group
-// BOOST_CHECK_THROW(factory.createMulticastFace("fe80::aa54:b2ff:fe08:27b8%wlan0",
-// "FE01:0:0:0:0:0:0:2",
-// "20075"),
-// UdpFactory::Error);
-//
-// BOOST_CHECK_THROW(factory.createMulticastFace("fa80::20a:9dff:fef6:12ff",
-// "FE12:0:0:0:0:0:0:2",
-// "20075"),
-// UdpFactory::Error);
-//
-// //not a multicast ipv6
-// BOOST_CHECK_THROW(factory.createMulticastFace("fa80::20a:9dff:fef6:12ff",
-// "A112:0:0:0:0:0:0:2",
-// "20075"),
-// UdpFactory::Error);
-}
-
-class FaceCreateFixture : protected BaseFixture
-{
-public:
- void
- ignore()
- {
- }
-
- void
- checkError(const std::string& errorActual, const std::string& errorExpected)
- {
- BOOST_CHECK_EQUAL(errorActual, errorExpected);
- }
-
- void
- failIfError(const std::string& errorActual)
- {
- BOOST_FAIL("No error expected, but got: [" << errorActual << "]");
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(FaceCreate, FaceCreateFixture)
-{
- UdpFactory factory = UdpFactory();
-
- factory.createFace(FaceUri("udp4://127.0.0.1"),
- bind(&FaceCreateFixture::ignore, this),
- bind(&FaceCreateFixture::failIfError, this, _1));
-
- factory.createFace(FaceUri("udp4://127.0.0.1/"),
- bind(&FaceCreateFixture::ignore, this),
- bind(&FaceCreateFixture::failIfError, this, _1));
-
- factory.createFace(FaceUri("udp4://127.0.0.1/path"),
- bind(&FaceCreateFixture::ignore, this),
- bind(&FaceCreateFixture::checkError, this, _1, "Invalid URI"));
-
-}
-
-class EndToEndFixture : protected BaseFixture
-{
-public:
- void
- channel1_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- BOOST_CHECK(!static_cast<bool>(face1));
- channel1_onFaceCreatedNoCheck(newFace);
- }
-
- void
- channel1_onFaceCreatedNoCheck(const shared_ptr<Face>& newFace)
- {
- face1 = newFace;
- face1->onReceiveInterest +=
- bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- face1->onReceiveData +=
- bind(&EndToEndFixture::face1_onReceiveData, this, _1);
- face1->onFail +=
- bind(&EndToEndFixture::face1_onFail, this);
- BOOST_CHECK_MESSAGE(true, "channel 1 face created");
-
- faces.push_back(face1);
-
- limitedIo.afterOp();
- }
-
- void
- channel1_onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onReceiveInterest(const Interest& interest)
- {
- face1_receivedInterests.push_back(interest);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onReceiveData(const Data& data)
- {
- face1_receivedDatas.push_back(data);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onFail()
- {
- face1.reset();
- limitedIo.afterOp();
- }
-
- void
- channel2_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- BOOST_CHECK(!static_cast<bool>(face2));
- face2 = newFace;
- face2->onReceiveInterest +=
- bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- face2->onReceiveData +=
- bind(&EndToEndFixture::face2_onReceiveData, this, _1);
- face2->onFail +=
- bind(&EndToEndFixture::face2_onFail, this);
-
- faces.push_back(face2);
-
- BOOST_CHECK_MESSAGE(true, "channel 2 face created");
- limitedIo.afterOp();
- }
-
- void
- channel2_onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- face2_onReceiveInterest(const Interest& interest)
- {
- face2_receivedInterests.push_back(interest);
-
- limitedIo.afterOp();
- }
-
- void
- face2_onReceiveData(const Data& data)
- {
- face2_receivedDatas.push_back(data);
-
- limitedIo.afterOp();
- }
-
- void
- face2_onFail()
- {
- face2.reset();
- limitedIo.afterOp();
- }
-
- void
- channel3_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- BOOST_CHECK(!static_cast<bool>(face1));
- face3 = newFace;
- faces.push_back(newFace);
-
- limitedIo.afterOp();
- }
-
- void
- channel_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- faces.push_back(newFace);
- limitedIo.afterOp();
- }
-
- void
- channel_onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- channel_onConnectFailedOk(const std::string& reason)
- {
- // it's ok, it was supposed to fail
- limitedIo.afterOp();
- }
-
- void
- checkFaceList(size_t shouldBe)
- {
- BOOST_CHECK_EQUAL(faces.size(), shouldBe);
- }
-
- void
- connect(const shared_ptr<UdpChannel>& channel,
- const std::string& remoteHost,
- const std::string& remotePort)
- {
- channel->connect(remoteHost, remotePort,
- bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
- }
-
-public:
- LimitedIo limitedIo;
-
- shared_ptr<Face> face1;
- std::vector<Interest> face1_receivedInterests;
- std::vector<Data> face1_receivedDatas;
- shared_ptr<Face> face2;
- std::vector<Interest> face2_receivedInterests;
- std::vector<Data> face2_receivedDatas;
- shared_ptr<Face> face3;
-
- std::list< shared_ptr<Face> > faces;
-};
-
-
-BOOST_FIXTURE_TEST_CASE(EndToEnd4, EndToEndFixture)
-{
- UdpFactory factory;
-
- factory.createChannel("127.0.0.1", "20071");
-
- factory.createFace(FaceUri("udp4://127.0.0.1:20070"),
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-
-
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot connect or cannot accept connection");
-
- BOOST_REQUIRE(static_cast<bool>(face2));
- BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "udp4://127.0.0.1:20070");
- BOOST_CHECK_EQUAL(face2->getLocalUri().toString(), "udp4://127.0.0.1:20071");
- BOOST_CHECK_EQUAL(face2->isLocal(), false);
- BOOST_CHECK_EQUAL(face2->getCounters().getNOutBytes(), 0);
- BOOST_CHECK_EQUAL(face2->getCounters().getNInBytes(), 0);
- // face1 is not created yet
-
- shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- Interest interest1("ndn:/TpnzGvW9R");
- Data data1 ("ndn:/KfczhUqVix");
- data1.setContent(0, 0);
- Interest interest2("ndn:/QWiIMfj5sL");
- Data data2 ("ndn:/XNBV796f");
- data2.setContent(0, 0);
- Interest interest3("ndn:/QWiIhjgkj5sL");
- Data data3 ("ndn:/XNBV794f");
- data3.setContent(0, 0);
-
-
- ndn::SignatureSha256WithRsa fakeSignature;
- fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
- reinterpret_cast<const uint8_t*>(0),
- 0));
-
- // set fake signature on data1 and data2
- data1.setSignature(fakeSignature);
- data2.setSignature(fakeSignature);
- data3.setSignature(fakeSignature);
-
- face2->sendInterest(interest2);
- face2->sendData (data2 );
- face2->sendData (data2 );
- face2->sendData (data2 );
- size_t nBytesSent2 = interest2.wireEncode().size() + data2.wireEncode().size() * 3;
-
- BOOST_CHECK_MESSAGE(limitedIo.run(5,//4 send + 1 listen return
- time::seconds(4)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE(static_cast<bool>(face1));
- BOOST_CHECK_EQUAL(face1->getRemoteUri().toString(), "udp4://127.0.0.1:20071");
- BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "udp4://127.0.0.1:20070");
- BOOST_CHECK_EQUAL(face1->isLocal(), false);
-
- face1->sendInterest(interest1);
- face1->sendInterest(interest1);
- face1->sendInterest(interest1);
- face1->sendData (data1 );
-
- BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(4)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 3);
- BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
- BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
- BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
- BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
-
-
-
- //checking if the connection accepting mechanism works properly.
-
- face2->sendData (data3 );
- face2->sendInterest(interest3);
- nBytesSent2 += data3.wireEncode().size() + interest3.wireEncode().size();
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 4);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [3].getName(), data3.getName());
-
- const FaceCounters& counters1 = face1->getCounters();
- BOOST_CHECK_EQUAL(counters1.getNInInterests() , 2);
- BOOST_CHECK_EQUAL(counters1.getNInDatas() , 4);
- BOOST_CHECK_EQUAL(counters1.getNOutInterests(), 3);
- BOOST_CHECK_EQUAL(counters1.getNOutDatas() , 1);
- BOOST_CHECK_EQUAL(counters1.getNInBytes(), nBytesSent2);
-
- const FaceCounters& counters2 = face2->getCounters();
- BOOST_CHECK_EQUAL(counters2.getNInInterests() , 3);
- BOOST_CHECK_EQUAL(counters2.getNInDatas() , 1);
- BOOST_CHECK_EQUAL(counters2.getNOutInterests(), 2);
- BOOST_CHECK_EQUAL(counters2.getNOutDatas() , 4);
- BOOST_CHECK_EQUAL(counters2.getNOutBytes(), nBytesSent2);
-}
-
-BOOST_FIXTURE_TEST_CASE(EndToEnd6, EndToEndFixture)
-{
- UdpFactory factory;
-
- factory.createChannel("::1", "20071");
-
- factory.createFace(FaceUri("udp://[::1]:20070"),
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-
-
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot connect or cannot accept connection");
-
- BOOST_REQUIRE(static_cast<bool>(face2));
- BOOST_CHECK_EQUAL(face2->getRemoteUri().toString(), "udp6://[::1]:20070");
- BOOST_CHECK_EQUAL(face2->getLocalUri().toString(), "udp6://[::1]:20071");
- BOOST_CHECK_EQUAL(face2->isLocal(), false);
- // face1 is not created yet
-
- shared_ptr<UdpChannel> channel1 = factory.createChannel("::1", "20070");
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- Interest interest1("ndn:/TpnzGvW9R");
- Data data1 ("ndn:/KfczhUqVix");
- data1.setContent(0, 0);
- Interest interest2("ndn:/QWiIMfj5sL");
- Data data2 ("ndn:/XNBV796f");
- data2.setContent(0, 0);
- Interest interest3("ndn:/QWiIhjgkj5sL");
- Data data3 ("ndn:/XNBV794f");
- data3.setContent(0, 0);
-
-
- ndn::SignatureSha256WithRsa fakeSignature;
- fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
- reinterpret_cast<const uint8_t*>(0),
- 0));
-
- // set fake signature on data1 and data2
- data1.setSignature(fakeSignature);
- data2.setSignature(fakeSignature);
- data3.setSignature(fakeSignature);
-
- face2->sendInterest(interest2);
- face2->sendData (data2 );
-
- BOOST_CHECK_MESSAGE(limitedIo.run(3,//2 send + 1 listen return
- time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE(static_cast<bool>(face1));
- BOOST_CHECK_EQUAL(face1->getRemoteUri().toString(), "udp6://[::1]:20071");
- BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "udp6://[::1]:20070");
- BOOST_CHECK_EQUAL(face1->isLocal(), false);
-
- face1->sendInterest(interest1);
- face1->sendData (data1 );
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
- BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
- BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
- BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
-
-
-
- //checking if the connection accepting mechanism works properly.
-
- face2->sendData (data3 );
- face2->sendInterest(interest3);
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 2);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [1].getName(), data3.getName());
-}
-
-BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
-{
- Interest interest1("ndn:/TpnzGvW9R");
- Interest interest2("ndn:/QWiIMfj5sL");
-
- UdpFactory factory;
-
- shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
- shared_ptr<UdpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
-
- channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-
- channel2->connect("127.0.0.1", "20070",
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-
-
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot connect or cannot accept connection");
-
- BOOST_CHECK_EQUAL(faces.size(), 1);
-
- shared_ptr<UdpChannel> channel3 = factory.createChannel("127.0.0.1", "20072");
- channel3->connect("127.0.0.1", "20070",
- bind(&EndToEndFixture::channel3_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-
- shared_ptr<UdpChannel> channel4 = factory.createChannel("127.0.0.1", "20073");
-
- BOOST_CHECK_NE(channel3, channel4);
-
- scheduler::schedule(time::milliseconds(500),
- bind(&EndToEndFixture::connect, this, channel4, "127.0.0.1", "20070"));
-
- scheduler::schedule(time::milliseconds(400), bind(&EndToEndFixture::checkFaceList, this, 2));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2,// 2 connects
- time::seconds(4)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot connect or cannot accept multiple connections");
-
- BOOST_CHECK_EQUAL(faces.size(), 3);
-
-
- face2->sendInterest(interest1);
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_CHECK_EQUAL(faces.size(), 4);
-
- face3->sendInterest(interest2);
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
- //channel1 should have created 2 faces, one when face2 sent an interest, one when face3 sent an interest
- BOOST_CHECK_EQUAL(faces.size(), 5);
- BOOST_CHECK_THROW(channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailedOk, this, _1)),
- UdpChannel::Error);
-}
-
-//Test commented because it required to be run in a machine that can resolve ipv6 query
-//BOOST_FIXTURE_TEST_CASE(EndToEndIpv6, EndToEndFixture)
-//{
-// UdpFactory factory = UdpFactory();
-// Scheduler scheduler(g_io); // to limit the amount of time the test may take
-//
-// EventId abortEvent =
-// scheduler.scheduleEvent(time::seconds(1),
-// bind(&EndToEndFixture::abortTestCase, this,
-// "UdpChannel error: cannot connect or cannot accept connection"));
-//
-// limitedIoRemaining = 1;
-//
-// shared_ptr<UdpChannel> channel1 = factory.createChannel("::1", "20070");
-// shared_ptr<UdpChannel> channel2 = factory.createChannel("::1", "20071");
-//
-// channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
-// bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-//
-// channel2->connect("::1", "20070",
-// bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
-// bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-// g_io.run();
-// g_io.reset();
-// scheduler.cancelEvent(abortEvent);
-//
-// BOOST_REQUIRE(static_cast<bool>(face2));
-//
-// abortEvent =
-// scheduler.scheduleEvent(time::seconds(1),
-// bind(&EndToEndFixture::abortTestCase, this,
-// "UdpChannel error: cannot send or receive Interest/Data packets"));
-//
-// Interest interest1("ndn:/TpnzGvW9R");
-// Data data1 ("ndn:/KfczhUqVix");
-// data1.setContent(0, 0);
-// Interest interest2("ndn:/QWiIMfj5sL");
-// Data data2 ("ndn:/XNBV796f");
-// data2.setContent(0, 0);
-// Interest interest3("ndn:/QWiIhjgkj5sL");
-// Data data3 ("ndn:/XNBV794f");
-// data3.setContent(0, 0);
-//
-// ndn::SignatureSha256WithRsa fakeSignature;
-// fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
-//
-// // set fake signature on data1 and data2
-// data1.setSignature(fakeSignature);
-// data2.setSignature(fakeSignature);
-// data3.setSignature(fakeSignature);
-//
-// face2->sendInterest(interest2);
-// face2->sendData (data2 );
-//
-// limitedIoRemaining = 3; //2 send + 1 listen return
-// g_io.run();
-// g_io.reset();
-// scheduler.cancelEvent(abortEvent);
-//
-// BOOST_REQUIRE(static_cast<bool>(face1));
-//
-// face1->sendInterest(interest1);
-// face1->sendData (data1 );
-//
-// abortEvent =
-// scheduler.scheduleEvent(time::seconds(1),
-// bind(&EndToEndFixture::abortTestCase, this,
-// "UdpChannel error: cannot send or receive Interest/Data packets"));
-// limitedIoRemaining = 2;
-// g_io.run();
-// g_io.reset();
-// scheduler.cancelEvent(abortEvent);
-//
-// BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
-// BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
-// BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
-// BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
-//
-// BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2.getName());
-// BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2.getName());
-// BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1.getName());
-// BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1.getName());
-//
-// //checking if the connection accepting mechanism works properly.
-//
-// face2->sendData (data3 );
-// face2->sendInterest(interest3);
-//
-// abortEvent =
-// scheduler.scheduleEvent(time::seconds(1),
-// bind(&EndToEndFixture::abortTestCase, this,
-// "UdpChannel error: cannot send or receive Interest/Data packets"));
-// limitedIoRemaining = 2;
-// g_io.run();
-// g_io.reset();
-// scheduler.cancelEvent(abortEvent);
-//
-// BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 2);
-// BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 2);
-//
-// BOOST_CHECK_EQUAL(face1_receivedInterests[1].getName(), interest3.getName());
-// BOOST_CHECK_EQUAL(face1_receivedDatas [1].getName(), data3.getName());
-//
-//}
-
-
-//Test commented because it required to be run in a machine that can resolve ipv6 query
-//BOOST_FIXTURE_TEST_CASE(MultipleAcceptsIpv6, EndToEndFixture)
-//{
-// Interest interest1("ndn:/TpnzGvW9R");
-// Interest interest2("ndn:/QWiIMfj5sL");
-// Interest interest3("ndn:/QWiIhjgkj5sL");
-//
-// UdpFactory factory = UdpFactory();
-// Scheduler scheduler(g_io); // to limit the amount of time the test may take
-//
-// EventId abortEvent =
-// scheduler.scheduleEvent(time::seconds(4),
-// bind(&EndToEndFixture::abortTestCase, this,
-// "UdpChannel error: cannot connect or cannot accept connection"));
-//
-// shared_ptr<UdpChannel> channel1 = factory.createChannel("::1", "20070");
-// shared_ptr<UdpChannel> channel2 = factory.createChannel("::1", "20071");
-//
-// channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
-// bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-//
-// channel2->connect("::1", "20070",
-// bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
-// bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-//
-// limitedIoRemaining = 1;
-// g_io.run();
-// g_io.reset();
-// scheduler.cancelEvent(abortEvent);
-//
-// BOOST_CHECK_EQUAL(faces.size(), 1);
-//
-// shared_ptr<UdpChannel> channel3 = factory.createChannel("::1", "20072");
-// channel3->connect("::1", "20070",
-// bind(&EndToEndFixture::channel3_onFaceCreated, this, _1),
-// bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-//
-// shared_ptr<UdpChannel> channel4 = factory.createChannel("::1", "20073");
-//
-// BOOST_CHECK_NE(channel3, channel4);
-//
-// scheduler
-// .scheduleEvent(time::milliseconds(500),
-// bind(&UdpChannel::connect, channel4,
-// "::1", "20070",
-// static_cast<UdpChannel::FaceCreatedCallback>(bind(&EndToEndFixture::
-// channel_onFaceCreated, this, _1)),
-// static_cast<UdpChannel::ConnectFailedCallback>(bind(&EndToEndFixture::
-// channel_onConnectFailed, this, _1))));
-//
-// limitedIoRemaining = 2; // 2 connects
-// abortEvent =
-// scheduler.scheduleEvent(time::seconds(4),
-// bind(&EndToEndFixture::abortTestCase, this,
-// "UdpChannel error: cannot connect or cannot accept multiple connections"));
-//
-// scheduler.scheduleEvent(time::seconds(0.4),
-// bind(&EndToEndFixture::checkFaceList, this, 2));
-//
-// g_io.run();
-// g_io.reset();
-//
-// BOOST_CHECK_EQUAL(faces.size(), 3);
-//
-//
-// face2->sendInterest(interest1);
-// abortEvent =
-// scheduler.scheduleEvent(time::seconds(1),
-// bind(&EndToEndFixture::abortTestCase, this,
-// "UdpChannel error: cannot send or receive Interest/Data packets"));
-// limitedIoRemaining = 1;
-// g_io.run();
-// g_io.reset();
-// scheduler.cancelEvent(abortEvent);
-//
-// BOOST_CHECK_EQUAL(faces.size(), 4);
-//
-// face3->sendInterest(interest2);
-// abortEvent =
-// scheduler.scheduleEvent(time::seconds(1),
-// bind(&EndToEndFixture::abortTestCase, this,
-// "UdpChannel error: cannot send or receive Interest/Data packets"));
-// limitedIoRemaining = 1;
-// g_io.run();
-// g_io.reset();
-// scheduler.cancelEvent(abortEvent);
-//
-// //channel1 should have created 2 faces, one when face2 sent an interest, one when face3 sent an interest
-// BOOST_CHECK_EQUAL(faces.size(), 5);
-// BOOST_CHECK_THROW(channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated,
-// this,
-// _1),
-// bind(&EndToEndFixture::channel_onConnectFailedOk,
-// this,
-// _1)),
-// UdpChannel::Error);
-//}
-
-
-BOOST_FIXTURE_TEST_CASE(FaceClosing, EndToEndFixture)
-{
- UdpFactory factory = UdpFactory();
-
- shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
- shared_ptr<UdpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
-
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- channel2->connect("127.0.0.1", "20070",
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot connect or cannot accept connection");
-
- BOOST_CHECK_EQUAL(channel2->size(), 1);
-
- BOOST_CHECK(static_cast<bool>(face2));
-
- // Face::close must be invoked during io run to be counted as an op
- scheduler::schedule(time::milliseconds(100), bind(&Face::close, face2));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
- "FaceClosing error: cannot properly close faces");
-
- BOOST_CHECK(!static_cast<bool>(face2));
-
- BOOST_CHECK_EQUAL(channel2->size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(ClosingIdleFace, EndToEndFixture)
-{
- Interest interest1("ndn:/TpnzGvW9R");
- Interest interest2("ndn:/QWiIMfj5sL");
-
- UdpFactory factory;
-
- shared_ptr<UdpChannel> channel1 = factory.createChannel("127.0.0.1", "20070",
- time::seconds(2));
- shared_ptr<UdpChannel> channel2 = factory.createChannel("127.0.0.1", "20071",
- time::seconds(2));
-
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- channel2->connect("127.0.0.1", "20070",
- bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel2_onConnectFailed, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot connect or cannot accept connection");
-
- face2->sendInterest(interest1);
- BOOST_CHECK(!face2->isOnDemand());
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2,//1 send + 1 listen return
- time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_CHECK_EQUAL(faces.size(), 2);
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(2)) == LimitedIo::EXCEED_TIME,
- "Idle face should be still open because has been used recently");
- BOOST_CHECK_EQUAL(faces.size(), 2);
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_OPS,
- "Closing idle face error: face should be closed by now");
-
- //the face on listen should be closed now
- BOOST_CHECK_EQUAL(channel1->size(), 0);
- //checking that face2 has not been closed
- BOOST_CHECK_EQUAL(channel2->size(), 1);
- BOOST_REQUIRE(static_cast<bool>(face2));
-
- face2->sendInterest(interest2);
- BOOST_CHECK_MESSAGE(limitedIo.run(2,//1 send + 1 listen return
- time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot send or receive Interest/Data packets");
- //channel1 should have created a new face by now
- BOOST_CHECK_EQUAL(channel1->size(), 1);
- BOOST_CHECK_EQUAL(channel2->size(), 1);
- BOOST_REQUIRE(static_cast<bool>(face1));
- BOOST_CHECK(face1->isOnDemand());
-
- channel1->connect("127.0.0.1", "20071",
- bind(&EndToEndFixture::channel1_onFaceCreatedNoCheck, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(1,//1 connect
- time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UdpChannel error: cannot connect");
-
- BOOST_CHECK(!face1->isOnDemand());
-
- //the connect should have set face1 as permanent face,
- //but it shouln't have created any additional faces
- BOOST_CHECK_EQUAL(channel1->size(), 1);
- BOOST_CHECK_EQUAL(channel2->size(), 1);
- BOOST_CHECK_MESSAGE(limitedIo.run(1, time::seconds(4)) == LimitedIo::EXCEED_TIME,
- "Idle face should be still open because it's permanent now");
- //both faces are permanent, nothing should have changed
- BOOST_CHECK_EQUAL(channel1->size(), 1);
- BOOST_CHECK_EQUAL(channel2->size(), 1);
-}
-
-class FakeNetworkInterfaceFixture : public BaseFixture
-{
-public:
- FakeNetworkInterfaceFixture()
- {
- using namespace boost::asio::ip;
-
- auto fakeInterfaces = make_shared<std::vector<NetworkInterfaceInfo>>();
-
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {0, "eth0",
- ethernet::Address::fromString("3e:15:c2:8b:65:00"),
- {address_v4::from_string("0.0.0.0")},
- {address_v6::from_string("::")},
- address_v4(),
- IFF_UP});
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {1, "eth0",
- ethernet::Address::fromString("3e:15:c2:8b:65:00"),
- {address_v4::from_string("192.168.2.1"), address_v4::from_string("192.168.2.2")},
- {},
- address_v4::from_string("192.168.2.255"),
- 0});
- fakeInterfaces->push_back(
- NetworkInterfaceInfo {2, "eth1",
- ethernet::Address::fromString("3e:15:c2:8b:65:00"),
- {address_v4::from_string("198.51.100.1")},
- {address_v6::from_string("2001:db8::2"), address_v6::from_string("2001:db8::3")},
- address_v4::from_string("198.51.100.255"),
- IFF_MULTICAST | IFF_BROADCAST | IFF_UP});
-
- setDebugNetworkInterfaces(fakeInterfaces);
- }
-
- ~FakeNetworkInterfaceFixture()
- {
- setDebugNetworkInterfaces(nullptr);
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(Bug2292, FakeNetworkInterfaceFixture)
-{
- using namespace boost::asio::ip;
-
- UdpFactory factory;
- factory.prohibitEndpoint(udp::Endpoint(address_v4::from_string("192.168.2.1"), 1024));
- BOOST_REQUIRE_EQUAL(factory.m_prohibitedEndpoints.size(), 1);
- BOOST_CHECK((factory.m_prohibitedEndpoints ==
- std::set<udp::Endpoint> {
- udp::Endpoint(address_v4::from_string("192.168.2.1"), 1024),
- }));
-
- factory.m_prohibitedEndpoints.clear();
- factory.prohibitEndpoint(udp::Endpoint(address_v6::from_string("2001:db8::1"), 2048));
- BOOST_REQUIRE_EQUAL(factory.m_prohibitedEndpoints.size(), 1);
- BOOST_CHECK((factory.m_prohibitedEndpoints ==
- std::set<udp::Endpoint> {
- udp::Endpoint(address_v6::from_string("2001:db8::1"), 2048),
- }));
-
- factory.m_prohibitedEndpoints.clear();
- factory.prohibitEndpoint(udp::Endpoint(address_v4(), 1024));
- BOOST_REQUIRE_EQUAL(factory.m_prohibitedEndpoints.size(), 6);
- BOOST_CHECK((factory.m_prohibitedEndpoints ==
- std::set<udp::Endpoint> {
- udp::Endpoint(address_v4::from_string("192.168.2.1"), 1024),
- udp::Endpoint(address_v4::from_string("192.168.2.2"), 1024),
- udp::Endpoint(address_v4::from_string("198.51.100.1"), 1024),
- udp::Endpoint(address_v4::from_string("198.51.100.255"), 1024),
- udp::Endpoint(address_v4::from_string("255.255.255.255"), 1024),
- udp::Endpoint(address_v4::from_string("0.0.0.0"), 1024)
- }));
-
- factory.m_prohibitedEndpoints.clear();
- factory.prohibitEndpoint(udp::Endpoint(address_v6(), 2048));
- BOOST_REQUIRE_EQUAL(factory.m_prohibitedEndpoints.size(), 3);
- BOOST_CHECK((factory.m_prohibitedEndpoints ==
- std::set<udp::Endpoint> {
- udp::Endpoint(address_v6::from_string("2001:db8::2"), 2048),
- udp::Endpoint(address_v6::from_string("2001:db8::3"), 2048),
- udp::Endpoint(address_v6::from_string("::"), 2048),
- }));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/unix-stream.cpp b/NFD/tests/daemon/face/unix-stream.cpp
deleted file mode 100644
index 24154ec..0000000
--- a/NFD/tests/daemon/face/unix-stream.cpp
+++ /dev/null
@@ -1,505 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face/unix-stream-factory.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/limited-io.hpp"
-#include "dummy-stream-sender.hpp"
-#include "packet-datasets.hpp"
-
-namespace nfd {
-namespace tests {
-
-using namespace boost::asio::local;
-
-#define CHANNEL_PATH1 "unix-stream-test.1.sock"
-#define CHANNEL_PATH2 "unix-stream-test.2.sock"
-
-BOOST_FIXTURE_TEST_SUITE(FaceUnixStream, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(ChannelMap)
-{
- UnixStreamFactory factory;
-
- shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
- shared_ptr<UnixStreamChannel> channel1a = factory.createChannel(CHANNEL_PATH1);
- BOOST_CHECK_EQUAL(channel1, channel1a);
- std::string channel1uri = channel1->getUri().toString();
- BOOST_CHECK_EQUAL(channel1uri.find("unix:///"), 0); // third '/' is the path separator
- BOOST_CHECK_EQUAL(channel1uri.rfind(CHANNEL_PATH1),
- channel1uri.size() - std::string(CHANNEL_PATH1).size());
-
- shared_ptr<UnixStreamChannel> channel2 = factory.createChannel(CHANNEL_PATH2);
- BOOST_CHECK_NE(channel1, channel2);
-}
-
-BOOST_AUTO_TEST_CASE(GetChannels)
-{
- UnixStreamFactory factory;
- BOOST_REQUIRE_EQUAL(factory.getChannels().empty(), true);
-
- std::vector<shared_ptr<const Channel> > expectedChannels;
-
- expectedChannels.push_back(factory.createChannel(CHANNEL_PATH1));
- expectedChannels.push_back(factory.createChannel(CHANNEL_PATH2));
-
- std::list<shared_ptr<const Channel> > channels = factory.getChannels();
- for (std::list<shared_ptr<const Channel> >::const_iterator i = channels.begin();
- i != channels.end(); ++i)
- {
- std::vector<shared_ptr<const Channel> >::iterator pos =
- std::find(expectedChannels.begin(), expectedChannels.end(), *i);
-
- BOOST_REQUIRE(pos != expectedChannels.end());
- expectedChannels.erase(pos);
- }
-
- BOOST_CHECK_EQUAL(expectedChannels.size(), 0);
-}
-
-class EndToEndFixture : protected BaseFixture
-{
-public:
- void
- client_onConnect(const boost::system::error_code& error)
- {
- BOOST_CHECK_MESSAGE(!error, error.message());
-
- limitedIo.afterOp();
- }
-
- void
- channel1_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- BOOST_CHECK(!static_cast<bool>(face1));
- face1 = static_pointer_cast<UnixStreamFace>(newFace);
- face1->onReceiveInterest +=
- bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- face1->onReceiveData +=
- bind(&EndToEndFixture::face1_onReceiveData, this, _1);
-
- limitedIo.afterOp();
- }
-
- void
- channel1_onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onReceiveInterest(const Interest& interest)
- {
- face1_receivedInterests.push_back(interest);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onReceiveData(const Data& data)
- {
- face1_receivedDatas.push_back(data);
-
- limitedIo.afterOp();
- }
-
- void
- face2_onReceiveInterest(const Interest& interest)
- {
- face2_receivedInterests.push_back(interest);
-
- limitedIo.afterOp();
- }
-
- void
- face2_onReceiveData(const Data& data)
- {
- face2_receivedDatas.push_back(data);
-
- limitedIo.afterOp();
- }
-
- void
- channel_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- faces.push_back(static_pointer_cast<UnixStreamFace>(newFace));
-
- limitedIo.afterOp();
- }
-
- void
- channel_onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
-protected:
- LimitedIo limitedIo;
-
- shared_ptr<UnixStreamFace> face1;
- std::vector<Interest> face1_receivedInterests;
- std::vector<Data> face1_receivedDatas;
- shared_ptr<UnixStreamFace> face2;
- std::vector<Interest> face2_receivedInterests;
- std::vector<Data> face2_receivedDatas;
-
- std::list< shared_ptr<UnixStreamFace> > faces;
-};
-
-
-BOOST_FIXTURE_TEST_CASE(EndToEnd, EndToEndFixture)
-{
- UnixStreamFactory factory;
-
- shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- shared_ptr<stream_protocol::socket> client = make_shared<stream_protocol::socket>(ref(g_io));
- client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
- bind(&EndToEndFixture::client_onConnect, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UnixStreamChannel error: cannot connect or cannot accept connection");
-
- BOOST_REQUIRE(static_cast<bool>(face1));
-
- BOOST_CHECK_EQUAL(face1->getRemoteUri().getScheme(), "fd");
- BOOST_CHECK_NO_THROW(boost::lexical_cast<int>(face1->getRemoteUri().getHost()));
- std::string face1localUri = face1->getLocalUri().toString();
- BOOST_CHECK_EQUAL(face1localUri.find("unix:///"), 0); // third '/' is the path separator
- BOOST_CHECK_EQUAL(face1localUri.rfind(CHANNEL_PATH1),
- face1localUri.size() - std::string(CHANNEL_PATH1).size());
-
- face2 = make_shared<UnixStreamFace>(client);
- face2->onReceiveInterest +=
- bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- face2->onReceiveData +=
- bind(&EndToEndFixture::face2_onReceiveData, this, _1);
-
- shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
- shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
- shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
- shared_ptr<Data> data2 = makeData("ndn:/XNBV796f");
-
- face1->sendInterest(*interest1);
- face1->sendInterest(*interest1);
- face1->sendInterest(*interest1);
- face1->sendData (*data1 );
- size_t nBytesSent1 = interest1->wireEncode().size() * 3 + data1->wireEncode().size();
- face2->sendInterest(*interest2);
- face2->sendData (*data2 );
- face2->sendData (*data2 );
- face2->sendData (*data2 );
- size_t nBytesSent2 = interest2->wireEncode().size() + data2->wireEncode().size() * 3;
-
- BOOST_CHECK_MESSAGE(limitedIo.run(8, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UnixStreamChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 3);
- BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 3);
- BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2->getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2->getName());
- BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1->getName());
- BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1->getName());
-
- // needed to ensure NOutBytes counters are accurate
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::seconds(1));
-
- const FaceCounters& counters1 = face1->getCounters();
- BOOST_CHECK_EQUAL(counters1.getNInInterests() , 1);
- BOOST_CHECK_EQUAL(counters1.getNInDatas() , 3);
- BOOST_CHECK_EQUAL(counters1.getNOutInterests(), 3);
- BOOST_CHECK_EQUAL(counters1.getNOutDatas() , 1);
- BOOST_CHECK_EQUAL(counters1.getNInBytes(), nBytesSent2);
- BOOST_CHECK_EQUAL(counters1.getNOutBytes(), nBytesSent1);
-
- const FaceCounters& counters2 = face2->getCounters();
- BOOST_CHECK_EQUAL(counters2.getNInInterests() , 3);
- BOOST_CHECK_EQUAL(counters2.getNInDatas() , 1);
- BOOST_CHECK_EQUAL(counters2.getNOutInterests(), 1);
- BOOST_CHECK_EQUAL(counters2.getNOutDatas() , 3);
-}
-
-BOOST_FIXTURE_TEST_CASE(MultipleAccepts, EndToEndFixture)
-{
- UnixStreamFactory factory;
-
- shared_ptr<UnixStreamChannel> channel = factory.createChannel(CHANNEL_PATH1);
- channel->listen(bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-
- shared_ptr<stream_protocol::socket> client1 = make_shared<stream_protocol::socket>(ref(g_io));
- client1->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
- bind(&EndToEndFixture::client_onConnect, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UnixStreamChannel error: cannot connect or cannot accept connection");
-
- BOOST_CHECK_EQUAL(faces.size(), 1);
-
- shared_ptr<stream_protocol::socket> client2 = make_shared<stream_protocol::socket>(ref(g_io));
- client2->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
- bind(&EndToEndFixture::client_onConnect, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UnixStreamChannel error: cannot accept multiple connections");
-
- BOOST_CHECK_EQUAL(faces.size(), 2);
-
- // now close one of the faces
- faces.front()->close();
-
- // we should still be able to send/receive with the other one
- face1 = faces.back();
- face1->onReceiveInterest += bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- face1->onReceiveData += bind(&EndToEndFixture::face1_onReceiveData, this, _1);
-
- face2 = make_shared<UnixStreamFace>(client2);
- face2->onReceiveInterest += bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- face2->onReceiveData += bind(&EndToEndFixture::face2_onReceiveData, this, _1);
-
- shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
- shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
- shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
- shared_ptr<Data> data2 = makeData("ndn:/XNBV796f");
-
- face1->sendInterest(*interest1);
- face1->sendData (*data1 );
- face2->sendInterest(*interest2);
- face2->sendData (*data2 );
-
- BOOST_CHECK_MESSAGE(limitedIo.run(4, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UnixStreamChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
- BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest2->getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2->getName());
- BOOST_CHECK_EQUAL(face2_receivedInterests[0].getName(), interest1->getName());
- BOOST_CHECK_EQUAL(face2_receivedDatas [0].getName(), data1->getName());
-}
-
-static inline void
-noOp()
-{
-}
-
-BOOST_FIXTURE_TEST_CASE(UnixStreamFaceLocalControlHeader, EndToEndFixture)
-{
- UnixStreamFactory factory;
-
- shared_ptr<UnixStreamChannel> channel1 = factory.createChannel(CHANNEL_PATH1);
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1),
- bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-
- shared_ptr<stream_protocol::socket> client = make_shared<stream_protocol::socket>(ref(g_io));
- client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
- bind(&EndToEndFixture::client_onConnect, this, _1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UnixStreamChannel error: cannot connect or cannot accept connection");
-
- BOOST_REQUIRE(static_cast<bool>(face1));
-
- face2 = make_shared<UnixStreamFace>(client);
- face2->onReceiveInterest +=
- bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
- face2->onReceiveData +=
- bind(&EndToEndFixture::face2_onReceiveData, this, _1);
-
- shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
- shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
-
- face1->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
- face1->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
-
- BOOST_CHECK(face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_CHECK(face1->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
-
- face2->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
- face2->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
-
- BOOST_CHECK(face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_CHECK(face2->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
-
- ////////////////////////////////////////////////////////
-
- interest1->setIncomingFaceId(11);
- interest1->setNextHopFaceId(111);
-
- face1->sendInterest(*interest1);
-
- data1->setIncomingFaceId(22);
- data1->getLocalControlHeader().setNextHopFaceId(222);
-
- face1->sendData(*data1);
-
- //
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UnixStreamChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face2_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face2_receivedDatas .size(), 1);
-
- // sending allows only IncomingFaceId, receiving allows only NextHopFaceId
- BOOST_CHECK_EQUAL(face2_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
- BOOST_CHECK_EQUAL(face2_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), false);
-
- BOOST_CHECK_EQUAL(face2_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
- BOOST_CHECK_EQUAL(face2_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
-
- ////////////////////////////////////////////////////////
-
- using namespace boost::asio;
-
- std::vector<const_buffer> interestWithHeader;
- Block iHeader = interest1->getLocalControlHeader().wireEncode(*interest1, true, true);
- Block iPayload = interest1->wireEncode();
- interestWithHeader.push_back(buffer(iHeader.wire(), iHeader.size()));
- interestWithHeader.push_back(buffer(iPayload.wire(), iPayload.size()));
-
- std::vector<const_buffer> dataWithHeader;
- Block dHeader = data1->getLocalControlHeader().wireEncode(*data1, true, true);
- Block dPayload = data1->wireEncode();
- dataWithHeader.push_back(buffer(dHeader.wire(), dHeader.size()));
- dataWithHeader.push_back(buffer(dPayload.wire(), dPayload.size()));
-
- //
-
- client->async_send(interestWithHeader, bind(&noOp));
- client->async_send(dataWithHeader, bind(&noOp));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(1)) == LimitedIo::EXCEED_OPS,
- "UnixStreamChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 1);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getLocalControlHeader().hasIncomingFaceId(), false);
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getLocalControlHeader().hasNextHopFaceId(), true);
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getNextHopFaceId(), 111);
-
- BOOST_CHECK_EQUAL(face1_receivedDatas[0].getLocalControlHeader().hasIncomingFaceId(), false);
- BOOST_CHECK_EQUAL(face1_receivedDatas[0].getLocalControlHeader().hasNextHopFaceId(), false);
-}
-
-
-class SimpleEndToEndFixture : protected BaseFixture
-{
-public:
- void
- onFaceCreated(const shared_ptr<Face>& face)
- {
- face->onReceiveInterest +=
- bind(&SimpleEndToEndFixture::onReceiveInterest, this, _1);
- face->onReceiveData +=
- bind(&SimpleEndToEndFixture::onReceiveData, this, _1);
- face->onFail +=
- bind(&SimpleEndToEndFixture::onFail, this, face);
-
- if (static_cast<bool>(dynamic_pointer_cast<LocalFace>(face))) {
- static_pointer_cast<LocalFace>(face)->setLocalControlHeaderFeature(
- LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
-
- static_pointer_cast<LocalFace>(face)->setLocalControlHeaderFeature(
- LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
- }
-
- limitedIo.afterOp();
- }
-
- void
- onConnectFailed(const std::string& reason)
- {
- BOOST_CHECK_MESSAGE(false, reason);
-
- limitedIo.afterOp();
- }
-
- void
- onReceiveInterest(const Interest& interest)
- {
- receivedInterests.push_back(interest);
-
- limitedIo.afterOp();
- }
-
- void
- onReceiveData(const Data& data)
- {
- receivedDatas.push_back(data);
-
- limitedIo.afterOp();
- }
-
- void
- onFail(const shared_ptr<Face>& face)
- {
- limitedIo.afterOp();
- }
-
-public:
- LimitedIo limitedIo;
-
- std::vector<Interest> receivedInterests;
- std::vector<Data> receivedDatas;
-};
-
-
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(CorruptedInput, Dataset,
- CorruptedPackets, SimpleEndToEndFixture)
-{
- UnixStreamFactory factory;
-
- shared_ptr<UnixStreamChannel> channel = factory.createChannel(CHANNEL_PATH1);
- channel->listen(bind(&SimpleEndToEndFixture::onFaceCreated, this, _1),
- bind(&SimpleEndToEndFixture::onConnectFailed, this, _1));
-
- DummyStreamSender<stream_protocol, Dataset> sender;
- sender.start(stream_protocol::endpoint(CHANNEL_PATH1));
-
- BOOST_CHECK_MESSAGE(limitedIo.run(LimitedIo::UNLIMITED_OPS,
- time::seconds(1)) == LimitedIo::EXCEED_TIME,
- "Exception thrown for " + Dataset::getName());
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/face/websocket.cpp b/NFD/tests/daemon/face/websocket.cpp
deleted file mode 100644
index fa93b6a..0000000
--- a/NFD/tests/daemon/face/websocket.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face/websocket-factory.hpp"
-#include "tests/test-common.hpp"
-#include "tests/limited-io.hpp"
-
-#include <websocketpp/config/asio_no_tls_client.hpp>
-#include <websocketpp/client.hpp>
-
-typedef websocketpp::client<websocketpp::config::asio_client> Client;
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FaceWebSocket, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(GetChannels)
-{
- WebSocketFactory factory("19596");
- BOOST_REQUIRE_EQUAL(factory.getChannels().empty(), true);
-
- std::vector<shared_ptr<const Channel> > expectedChannels;
-
- expectedChannels.push_back(factory.createChannel("127.0.0.1", "20070"));
- expectedChannels.push_back(factory.createChannel("127.0.0.1", "20071"));
- expectedChannels.push_back(factory.createChannel("::1", "20071"));
-
- std::list<shared_ptr<const Channel> > channels = factory.getChannels();
- for (std::list<shared_ptr<const Channel> >::const_iterator i = channels.begin();
- i != channels.end(); ++i)
- {
- std::vector<shared_ptr<const Channel> >::iterator pos =
- std::find(expectedChannels.begin(), expectedChannels.end(), *i);
-
- BOOST_REQUIRE(pos != expectedChannels.end());
- expectedChannels.erase(pos);
- }
-
- BOOST_CHECK_EQUAL(expectedChannels.size(), 0);
-}
-
-class EndToEndFixture : protected BaseFixture
-{
-public:
- void
- channel1_onFaceCreated(const shared_ptr<Face>& newFace)
- {
- BOOST_CHECK(!static_cast<bool>(face1));
- face1 = newFace;
- face1->onReceiveInterest +=
- bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
- face1->onReceiveData +=
- bind(&EndToEndFixture::face1_onReceiveData, this, _1);
- face1->onFail +=
- bind(&EndToEndFixture::face1_onFail, this);
-
- limitedIo.afterOp();
- }
-
- void
- face1_onReceiveInterest(const Interest& interest)
- {
- face1_receivedInterests.push_back(interest);
- limitedIo.afterOp();
- }
-
- void
- face1_onReceiveData(const Data& data)
- {
- face1_receivedDatas.push_back(data);
- limitedIo.afterOp();
- }
-
- void
- face1_onFail()
- {
- face1.reset();
- limitedIo.afterOp();
- }
-
- void
- client1_onOpen(websocketpp::connection_hdl hdl)
- {
- handle = hdl;
- limitedIo.afterOp();
- }
-
- void
- client1_onClose(websocketpp::connection_hdl hdl)
- {
- limitedIo.afterOp();
- }
-
- void
- client1_onFail(websocketpp::connection_hdl hdl)
- {
- limitedIo.afterOp();
- }
-
- bool
- client1_onPing(websocketpp::connection_hdl hdl, std::string msg)
- {
- limitedIo.afterOp();
- // Return false to suppress the pong response,
- // which will cause timeout in the websocket channel
- return false;
- }
-
- void
- client1_sendInterest(const Interest& interest)
- {
- const Block& payload = interest.wireEncode();
- client1.send(handle, payload.wire(), payload.size(), websocketpp::frame::opcode::binary);
- }
-
- void
- client1_sendData(const Data& data)
- {
- const Block& payload = data.wireEncode();
- client1.send(handle, payload.wire(), payload.size(), websocketpp::frame::opcode::binary);
- }
-
- void
- client1_onMessage(websocketpp::connection_hdl hdl,
- websocketpp::config::asio_client::message_type::ptr msg)
- {
- bool isOk = true;
- Block element;
- const std::string& payload = msg->get_payload();
- isOk = Block::fromBuffer(reinterpret_cast<const uint8_t*>(payload.c_str()),
- payload.size(), element);
- if (isOk)
- {
- try {
- if (element.type() == tlv::Interest)
- {
- shared_ptr<Interest> i = make_shared<Interest>();
- i->wireDecode(element);
- client1_onReceiveInterest(*i);
- }
- else if (element.type() == tlv::Data)
- {
- shared_ptr<Data> d = make_shared<Data>();
- d->wireDecode(element);
- client1_onReceiveData(*d);
- }
- }
- catch (tlv::Error&) {
- // Do something?
- }
- }
- limitedIo.afterOp();
- }
-
- void
- client1_onReceiveInterest(const Interest& interest)
- {
- client1_receivedInterests.push_back(interest);
- limitedIo.afterOp();
- }
-
- void
- client1_onReceiveData(const Data& data)
- {
- client1_receivedDatas.push_back(data);
- limitedIo.afterOp();
- }
-
-public:
- LimitedIo limitedIo;
-
- shared_ptr<Face> face1;
- std::vector<Interest> face1_receivedInterests;
- std::vector<Data> face1_receivedDatas;
- Client client1;
- websocketpp::connection_hdl handle;
- std::vector<Interest> client1_receivedInterests;
- std::vector<Data> client1_receivedDatas;
-};
-
-BOOST_FIXTURE_TEST_CASE(EndToEnd4, EndToEndFixture)
-{
- WebSocketFactory factory1("9696");
-
- shared_ptr<WebSocketChannel> channel1 = factory1.createChannel("127.0.0.1", "20070");
- channel1->setPingInterval(time::milliseconds(3000));
- channel1->setPongTimeout(time::milliseconds(1000));
-
- BOOST_CHECK_EQUAL(channel1->isListening(), false);
-
- channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated, this, _1));
-
- BOOST_CHECK_EQUAL(channel1->isListening(), true);
-
- // Clear all logging info from websocketpp library
- client1.clear_access_channels(websocketpp::log::alevel::all);
-
- client1.init_asio(&getGlobalIoService());
- client1.set_open_handler(bind(&EndToEndFixture::client1_onOpen, this, _1));
- client1.set_close_handler(bind(&EndToEndFixture::client1_onClose, this, _1));
- client1.set_fail_handler(bind(&EndToEndFixture::client1_onFail, this, _1));
- client1.set_message_handler(bind(&EndToEndFixture::client1_onMessage, this, _1, _2));
- client1.set_ping_handler(bind(&EndToEndFixture::client1_onPing, this, _1, _2));
-
- websocketpp::lib::error_code ec;
- Client::connection_ptr con = client1.get_connection("ws://127.0.0.1:20070", ec);
- client1.connect(con);
-
- BOOST_CHECK_MESSAGE(limitedIo.run(2, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "WebSocketChannel error: cannot connect or cannot accept connection");
-
- BOOST_CHECK_EQUAL(channel1->size(), 1);
-
- BOOST_CHECK_EQUAL(face1->getLocalUri().toString(), "ws://127.0.0.1:20070");
- BOOST_CHECK_EQUAL(face1->isOnDemand(), true);
-
- //BOOST_CHECK_EQUAL(face1->isLocal(), true);
-
- //BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(face1)), false);
-
- shared_ptr<Interest> interest1 = makeInterest("ndn:/TpnzGvW9R");
- shared_ptr<Data> data1 = makeData("ndn:/KfczhUqVix");
- shared_ptr<Interest> interest2 = makeInterest("ndn:/QWiIMfj5sL");
- shared_ptr<Data> data2 = makeData("ndn:/XNBV796f");
-
- std::string bigName("ndn:/");
- bigName.append(9000, 'a');
- shared_ptr<Interest> bigInterest = makeInterest(bigName);
-
- client1_sendInterest(*interest1);
- client1_sendInterest(*interest1);
- client1_sendInterest(*interest1);
- client1_sendInterest(*bigInterest); // This one should be ignored by face1
- face1->sendData (*data1);
- face1->sendInterest (*interest2);
- client1_sendData (*data2);
- client1_sendData (*data2);
- client1_sendData (*data2);
- size_t nBytesSent = data1->wireEncode().size() + interest2->wireEncode().size();
- size_t nBytesReceived = interest1->wireEncode().size() * 3 + data2->wireEncode().size() * 3;
-
- BOOST_CHECK_MESSAGE(limitedIo.run(8, time::seconds(10)) == LimitedIo::EXCEED_OPS,
- "WebSocketChannel error: cannot send or receive Interest/Data packets");
-
- BOOST_REQUIRE_EQUAL(face1_receivedInterests.size(), 3);
- BOOST_REQUIRE_EQUAL(face1_receivedDatas .size(), 3);
- BOOST_REQUIRE_EQUAL(client1_receivedInterests.size(), 1);
- BOOST_REQUIRE_EQUAL(client1_receivedDatas .size(), 1);
-
- BOOST_CHECK_EQUAL(face1_receivedInterests[0].getName(), interest1->getName());
- BOOST_CHECK_EQUAL(face1_receivedDatas [0].getName(), data2->getName());
- BOOST_CHECK_EQUAL(client1_receivedInterests[0].getName(), interest2->getName());
- BOOST_CHECK_EQUAL(client1_receivedDatas [0].getName(), data1->getName());
-
- const FaceCounters& counters1 = face1->getCounters();
- BOOST_CHECK_EQUAL(counters1.getNInInterests() , 3);
- BOOST_CHECK_EQUAL(counters1.getNInDatas() , 3);
- BOOST_CHECK_EQUAL(counters1.getNOutInterests(), 1);
- BOOST_CHECK_EQUAL(counters1.getNOutDatas() , 1);
- BOOST_CHECK_EQUAL(counters1.getNInBytes(), nBytesReceived);
- BOOST_CHECK_EQUAL(counters1.getNOutBytes(), nBytesSent);
-
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::seconds(8));
- BOOST_CHECK_EQUAL(channel1->size(), 0);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/fw/best-route-strategy2.cpp b/NFD/tests/daemon/fw/best-route-strategy2.cpp
deleted file mode 100644
index d956e9f..0000000
--- a/NFD/tests/daemon/fw/best-route-strategy2.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "fw/best-route-strategy2.hpp"
-#include "strategy-tester.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FwBestRouteStrategy2, UnitTestTimeFixture)
-
-BOOST_AUTO_TEST_CASE(Forward)
-{
- Forwarder forwarder;
- typedef StrategyTester<fw::BestRouteStrategy2> BestRouteStrategy2Tester;
- BestRouteStrategy2Tester strategy(forwarder);
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face4 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face5 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
- forwarder.addFace(face4);
- forwarder.addFace(face5);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10);
- fibEntry->addNextHop(face2, 20);
- fibEntry->addNextHop(face3, 30);
-
- shared_ptr<Interest> interest = makeInterest("ndn:/BzgFBchqA");
- Pit& pit = forwarder.getPit();
- shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
-
- const time::nanoseconds TICK = time::duration_cast<time::nanoseconds>(
- fw::BestRouteStrategy2::MIN_RETRANSMISSION_INTERVAL * 0.01);
- const time::nanoseconds RETRANSMISSION_10P = time::duration_cast<time::nanoseconds>(
- fw::BestRouteStrategy2::MIN_RETRANSMISSION_INTERVAL * 0.1); // 10%
- const time::nanoseconds RETRANSMISSION_70P = time::duration_cast<time::nanoseconds>(
- fw::BestRouteStrategy2::MIN_RETRANSMISSION_INTERVAL * 0.7); // 70%
- const time::nanoseconds RETRANSMISSION_2 = time::duration_cast<time::nanoseconds>(
- fw::BestRouteStrategy2::MIN_RETRANSMISSION_INTERVAL * 2.0); // x2
-
- // first Interest goes to nexthop with lowest FIB cost,
- // however face1 is downstream so it cannot be used
- pitEntry->insertOrUpdateInRecord(face1, *interest);
- strategy.afterReceiveInterest(*face1, *interest, fibEntry, pitEntry);
- BOOST_REQUIRE_EQUAL(strategy.m_sendInterestHistory.size(), 1);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory.back().get<1>(), face2);
-
- // downstream retransmits frequently, but the strategy should not send Interests
- // more often than MIN_RETRANSMISSION_INTERVAL
- scheduler::EventId retxFrom4Evt;
- size_t nSentLast = strategy.m_sendInterestHistory.size();
- time::steady_clock::TimePoint timeSentLast = time::steady_clock::now();
- function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
- periodicalRetxFrom4 = [&] {
- pitEntry->insertOrUpdateInRecord(face4, *interest);
- strategy.afterReceiveInterest(*face4, *interest, fibEntry, pitEntry);
-
- size_t nSent = strategy.m_sendInterestHistory.size();
- if (nSent > nSentLast) {
- BOOST_CHECK_EQUAL(nSent - nSentLast, 1);
- time::steady_clock::TimePoint timeSent = time::steady_clock::now();
- BOOST_CHECK_GE(timeSent - timeSentLast, RETRANSMISSION_70P);
- nSentLast = nSent;
- timeSentLast = timeSent;
- }
-
- retxFrom4Evt = scheduler::schedule(RETRANSMISSION_10P, periodicalRetxFrom4);
- };
- periodicalRetxFrom4();
- this->advanceClocks(TICK, fw::BestRouteStrategy2::MIN_RETRANSMISSION_INTERVAL * 16);
- scheduler::cancel(retxFrom4Evt);
-
- // nexthops for accepted retransmissions: follow FIB cost,
- // later forward to an eligible upstream with earliest OutRecord
- BOOST_REQUIRE_GE(strategy.m_sendInterestHistory.size(), 6);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[1].get<1>(), face1);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[2].get<1>(), face3);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[3].get<1>(), face2);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[4].get<1>(), face1);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[5].get<1>(), face3);
-
- fibEntry->removeNextHop(face1);
-
- strategy.m_sendInterestHistory.clear();
- for (int i = 0; i < 3; ++i) {
- this->advanceClocks(TICK, RETRANSMISSION_2);
- pitEntry->insertOrUpdateInRecord(face5, *interest);
- strategy.afterReceiveInterest(*face5, *interest, fibEntry, pitEntry);
- }
- BOOST_REQUIRE_EQUAL(strategy.m_sendInterestHistory.size(), 3);
- BOOST_CHECK_NE(strategy.m_sendInterestHistory[0].get<1>(), face1);
- BOOST_CHECK_NE(strategy.m_sendInterestHistory[1].get<1>(), face1);
- BOOST_CHECK_NE(strategy.m_sendInterestHistory[2].get<1>(), face1);
- // face1 cannot be used because it's gone from FIB entry
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/fw/broadcast-strategy.cpp b/NFD/tests/daemon/fw/broadcast-strategy.cpp
deleted file mode 100644
index cde9b44..0000000
--- a/NFD/tests/daemon/fw/broadcast-strategy.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "fw/broadcast-strategy.hpp"
-#include "strategy-tester.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FwBroadcastStrategy, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Forward2)
-{
- Forwarder forwarder;
- typedef StrategyTester<fw::BroadcastStrategy> BroadcastStrategyTester;
- BroadcastStrategyTester strategy(forwarder);
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 0);
- fibEntry->addNextHop(face2, 0);
- fibEntry->addNextHop(face3, 0);
-
- shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
- Pit& pit = forwarder.getPit();
- shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(face3, *interest);
-
- strategy.afterReceiveInterest(*face3, *interest, fibEntry, pitEntry);
- BOOST_CHECK_EQUAL(strategy.m_rejectPendingInterestHistory.size(), 0);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory.size(), 2);
- bool hasFace1 = false;
- bool hasFace2 = false;
- for (std::vector<BroadcastStrategyTester::SendInterestArgs>::iterator it =
- strategy.m_sendInterestHistory.begin();
- it != strategy.m_sendInterestHistory.end(); ++it) {
- if (it->get<1>() == face1) {
- hasFace1 = true;
- }
- if (it->get<1>() == face2) {
- hasFace2 = true;
- }
- }
- BOOST_CHECK(hasFace1 && hasFace2);
-}
-
-BOOST_AUTO_TEST_CASE(RejectScope)
-{
- Forwarder forwarder;
- typedef StrategyTester<fw::BroadcastStrategy> BroadcastStrategyTester;
- BroadcastStrategyTester strategy(forwarder);
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert("ndn:/localhop/uS09bub6tm").first;
- fibEntry->addNextHop(face2, 0);
-
- shared_ptr<Interest> interest = makeInterest("ndn:/localhop/uS09bub6tm/eG3MMoP6z");
- Pit& pit = forwarder.getPit();
- shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(face1, *interest);
-
- strategy.afterReceiveInterest(*face1, *interest, fibEntry, pitEntry);
- BOOST_CHECK_EQUAL(strategy.m_rejectPendingInterestHistory.size(), 1);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory.size(), 0);
-}
-
-BOOST_AUTO_TEST_CASE(RejectLoopback)
-{
- Forwarder forwarder;
- typedef StrategyTester<fw::BroadcastStrategy> BroadcastStrategyTester;
- BroadcastStrategyTester strategy(forwarder);
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- forwarder.addFace(face1);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 0);
-
- shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
- Pit& pit = forwarder.getPit();
- shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(face1, *interest);
-
- strategy.afterReceiveInterest(*face1, *interest, fibEntry, pitEntry);
- BOOST_CHECK_EQUAL(strategy.m_rejectPendingInterestHistory.size(), 1);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory.size(), 0);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/fw/client-control-strategy.cpp b/NFD/tests/daemon/fw/client-control-strategy.cpp
deleted file mode 100644
index c76fb52..0000000
--- a/NFD/tests/daemon/fw/client-control-strategy.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "fw/client-control-strategy.hpp"
-#include "strategy-tester.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FwClientControlStrategy, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Forward3)
-{
- Forwarder forwarder;
- typedef StrategyTester<fw::ClientControlStrategy> ClientControlStrategyTester;
- ClientControlStrategyTester strategy(forwarder);
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
- shared_ptr<DummyLocalFace> face4 = make_shared<DummyLocalFace>();
- face4->setLocalControlHeaderFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
- forwarder.addFace(face4);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face2, 0);
-
- Pit& pit = forwarder.getPit();
-
- // Interest with valid NextHopFaceId
- shared_ptr<Interest> interest1 = makeInterest("ndn:/0z8r6yDDe");
- interest1->setNextHopFaceId(face1->getId());
- shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
- pitEntry1->insertOrUpdateInRecord(face4, *interest1);
-
- strategy.m_sendInterestHistory.clear();
- strategy.afterReceiveInterest(*face4, *interest1, fibEntry, pitEntry1);
- BOOST_REQUIRE_EQUAL(strategy.m_sendInterestHistory.size(), 1);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[0].get<1>(), face1);
-
- // Interest without NextHopFaceId
- shared_ptr<Interest> interest2 = makeInterest("ndn:/y6JQADGVz");
- shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
- pitEntry2->insertOrUpdateInRecord(face4, *interest2);
-
- strategy.m_sendInterestHistory.clear();
- strategy.afterReceiveInterest(*face4, *interest2, fibEntry, pitEntry2);
- BOOST_REQUIRE_EQUAL(strategy.m_sendInterestHistory.size(), 1);
- BOOST_CHECK_EQUAL(strategy.m_sendInterestHistory[0].get<1>(), face2);
-
- // Interest with invalid NextHopFaceId
- shared_ptr<Interest> interest3 = makeInterest("ndn:/0z8r6yDDe");
- interest3->setNextHopFaceId(face3->getId());
- shared_ptr<pit::Entry> pitEntry3 = pit.insert(*interest3).first;
- pitEntry3->insertOrUpdateInRecord(face4, *interest3);
-
- face3->close(); // face3 is closed and its FaceId becomes invalid
- strategy.m_sendInterestHistory.clear();
- strategy.m_rejectPendingInterestHistory.clear();
- strategy.afterReceiveInterest(*face4, *interest3, fibEntry, pitEntry3);
- BOOST_REQUIRE_EQUAL(strategy.m_sendInterestHistory.size(), 0);
- BOOST_REQUIRE_EQUAL(strategy.m_rejectPendingInterestHistory.size(), 1);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/fw/dummy-strategy.hpp b/NFD/tests/daemon/fw/dummy-strategy.hpp
deleted file mode 100644
index 50de93e..0000000
--- a/NFD/tests/daemon/fw/dummy-strategy.hpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_DAEMON_FW_DUMMY_STRATEGY_HPP
-#define NFD_TESTS_DAEMON_FW_DUMMY_STRATEGY_HPP
-
-#include "fw/strategy.hpp"
-
-namespace nfd {
-namespace tests {
-
-/** \brief strategy for unit testing
- *
- * Triggers on DummyStrategy are recorded but does nothing
- */
-class DummyStrategy : public fw::Strategy
-{
-public:
- DummyStrategy(Forwarder& forwarder, const Name& name)
- : Strategy(forwarder, name)
- {
- }
-
- virtual void
- afterReceiveInterest(const Face& inFace,
- const Interest& interest,
- shared_ptr<fib::Entry> fibEntry,
- shared_ptr<pit::Entry> pitEntry) DECL_OVERRIDE
- {
- ++m_afterReceiveInterest_count;
-
- if (static_cast<bool>(m_interestOutFace)) {
- this->sendInterest(pitEntry, m_interestOutFace);
- }
- else {
- this->rejectPendingInterest(pitEntry);
- }
- }
-
- virtual void
- beforeSatisfyInterest(shared_ptr<pit::Entry> pitEntry,
- const Face& inFace, const Data& data) DECL_OVERRIDE
- {
- ++m_beforeSatisfyInterest_count;
- }
-
- virtual void
- beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry) DECL_OVERRIDE
- {
- ++m_beforeExpirePendingInterest_count;
- }
-
-public:
- int m_afterReceiveInterest_count;
- int m_beforeSatisfyInterest_count;
- int m_beforeExpirePendingInterest_count;
-
- /// outFace to use in afterReceiveInterest, nullptr to reject
- shared_ptr<Face> m_interestOutFace;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_DAEMON_FW_DUMMY_STRATEGY_HPP
diff --git a/NFD/tests/daemon/fw/face-table.cpp b/NFD/tests/daemon/fw/face-table.cpp
deleted file mode 100644
index b2bfab4..0000000
--- a/NFD/tests/daemon/fw/face-table.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "fw/face-table.hpp"
-#include "fw/forwarder.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FwFaceTable, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(AddRemove)
-{
- Forwarder forwarder;
-
- FaceTable& faceTable = forwarder.getFaceTable();
- std::vector<FaceId> onAddHistory;
- std::vector<FaceId> onRemoveHistory;
- faceTable.onAdd.connect([&] (shared_ptr<Face> face) {
- onAddHistory.push_back(face->getId());
- });
- faceTable.onRemove.connect([&] (shared_ptr<Face> face) {
- onRemoveHistory.push_back(face->getId());
- });
-
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
-
- BOOST_CHECK_EQUAL(face1->getId(), INVALID_FACEID);
- BOOST_CHECK_EQUAL(face2->getId(), INVALID_FACEID);
-
- forwarder.addFace(face1);
- forwarder.addFace(face2);
-
- BOOST_CHECK_NE(face1->getId(), INVALID_FACEID);
- BOOST_CHECK_NE(face2->getId(), INVALID_FACEID);
- BOOST_CHECK_NE(face1->getId(), face2->getId());
- BOOST_CHECK_GT(face1->getId(), FACEID_RESERVED_MAX);
- BOOST_CHECK_GT(face2->getId(), FACEID_RESERVED_MAX);
-
- FaceId oldId1 = face1->getId();
- faceTable.add(face1);
- BOOST_CHECK_EQUAL(face1->getId(), oldId1);
- BOOST_CHECK_EQUAL(faceTable.size(), 2);
-
- BOOST_REQUIRE_EQUAL(onAddHistory.size(), 2);
- BOOST_CHECK_EQUAL(onAddHistory[0], face1->getId());
- BOOST_CHECK_EQUAL(onAddHistory[1], face2->getId());
-
- face1->close();
-
- BOOST_CHECK_EQUAL(face1->getId(), INVALID_FACEID);
-
- BOOST_REQUIRE_EQUAL(onRemoveHistory.size(), 1);
- BOOST_CHECK_EQUAL(onRemoveHistory[0], onAddHistory[0]);
-}
-
-BOOST_AUTO_TEST_CASE(AddReserved)
-{
- Forwarder forwarder;
- FaceTable& faceTable = forwarder.getFaceTable();
-
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- BOOST_CHECK_EQUAL(face1->getId(), INVALID_FACEID);
-
- faceTable.addReserved(face1, 5);
- BOOST_CHECK_EQUAL(face1->getId(), 5);
-}
-
-BOOST_AUTO_TEST_CASE(Enumerate)
-{
- Forwarder forwarder;
- FaceTable& faceTable = forwarder.getFaceTable();
-
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
- bool hasFace1 = false, hasFace2 = false;
-
- BOOST_CHECK_EQUAL(faceTable.size(), 0);
- BOOST_CHECK_EQUAL(std::distance(faceTable.begin(), faceTable.end()), faceTable.size());
-
- faceTable.add(face1);
- BOOST_CHECK_EQUAL(faceTable.size(), 1);
- BOOST_CHECK_EQUAL(std::distance(faceTable.begin(), faceTable.end()), faceTable.size());
- hasFace1 = hasFace2 = false;
- for (FaceTable::const_iterator it = faceTable.begin(); it != faceTable.end(); ++it) {
- if (*it == face1) {
- hasFace1 = true;
- }
- }
- BOOST_CHECK(hasFace1);
-
- faceTable.add(face2);
- BOOST_CHECK_EQUAL(faceTable.size(), 2);
- BOOST_CHECK_EQUAL(std::distance(faceTable.begin(), faceTable.end()), faceTable.size());
- hasFace1 = hasFace2 = false;
- for (FaceTable::const_iterator it = faceTable.begin(); it != faceTable.end(); ++it) {
- if (*it == face1) {
- hasFace1 = true;
- }
- if (*it == face2) {
- hasFace2 = true;
- }
- }
- BOOST_CHECK(hasFace1);
- BOOST_CHECK(hasFace2);
-
- face1->close();
- BOOST_CHECK_EQUAL(faceTable.size(), 1);
- BOOST_CHECK_EQUAL(std::distance(faceTable.begin(), faceTable.end()), faceTable.size());
- hasFace1 = hasFace2 = false;
- for (FaceTable::const_iterator it = faceTable.begin(); it != faceTable.end(); ++it) {
- if (*it == face1) {
- hasFace1 = true;
- }
- if (*it == face2) {
- hasFace2 = true;
- }
- }
- BOOST_CHECK(!hasFace1);
- BOOST_CHECK(hasFace2);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/fw/forwarder.cpp b/NFD/tests/daemon/fw/forwarder.cpp
deleted file mode 100644
index 1b74f37..0000000
--- a/NFD/tests/daemon/fw/forwarder.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "fw/forwarder.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-#include "dummy-strategy.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/limited-io.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FwForwarder, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(SimpleExchange)
-{
- LimitedIo limitedIo;
- auto afterOp = bind(&LimitedIo::afterOp, &limitedIo);;
- Forwarder forwarder;
-
- Name nameA ("ndn:/A");
- Name nameAB ("ndn:/A/B");
- Name nameABC("ndn:/A/B/C");
- shared_ptr<Interest> interestAB = makeInterest(nameAB);
- interestAB->setInterestLifetime(time::seconds(4));
- shared_ptr<Data> dataABC = makeData(nameABC);
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- face1->afterSend += afterOp;
- face2->afterSend += afterOp;
- forwarder.addFace(face1);
- forwarder.addFace(face2);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
- fibEntry->addNextHop(face2, 0);
-
- BOOST_CHECK_EQUAL(forwarder.getCounters().getNInInterests (), 0);
- BOOST_CHECK_EQUAL(forwarder.getCounters().getNOutInterests(), 0);
- g_io.post([&] { face1->receiveInterest(*interestAB); });
- BOOST_CHECK_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
- BOOST_REQUIRE_EQUAL(face2->m_sentInterests.size(), 1);
- BOOST_CHECK_EQUAL(face2->m_sentInterests[0].getName(), nameAB);
- BOOST_CHECK_EQUAL(face2->m_sentInterests[0].getIncomingFaceId(), face1->getId());
- BOOST_CHECK_EQUAL(forwarder.getCounters().getNInInterests (), 1);
- BOOST_CHECK_EQUAL(forwarder.getCounters().getNOutInterests(), 1);
-
- BOOST_CHECK_EQUAL(forwarder.getCounters().getNInDatas (), 0);
- BOOST_CHECK_EQUAL(forwarder.getCounters().getNOutDatas(), 0);
- g_io.post([&] { face2->receiveData(*dataABC); });
- BOOST_CHECK_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
- BOOST_REQUIRE_EQUAL(face1->m_sentDatas.size(), 1);
- BOOST_CHECK_EQUAL(face1->m_sentDatas[0].getName(), nameABC);
- BOOST_CHECK_EQUAL(face1->m_sentDatas[0].getIncomingFaceId(), face2->getId());
- BOOST_CHECK_EQUAL(forwarder.getCounters().getNInDatas (), 1);
- BOOST_CHECK_EQUAL(forwarder.getCounters().getNOutDatas(), 1);
-}
-
-BOOST_AUTO_TEST_CASE(CsMatched)
-{
- LimitedIo limitedIo;
- Forwarder forwarder;
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
-
- shared_ptr<Interest> interestA = makeInterest("ndn:/A");
- interestA->setInterestLifetime(time::seconds(4));
- shared_ptr<Data> dataA = makeData("ndn:/A");
- dataA->setIncomingFaceId(face3->getId());
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
- fibEntry->addNextHop(face2, 0);
-
- Pit& pit = forwarder.getPit();
- BOOST_CHECK_EQUAL(pit.size(), 0);
-
- Cs& cs = forwarder.getCs();
- BOOST_REQUIRE(cs.insert(*dataA));
-
- face1->receiveInterest(*interestA);
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(5));
- // Interest matching ContentStore should not be forwarded
- BOOST_REQUIRE_EQUAL(face2->m_sentInterests.size(), 0);
-
- BOOST_REQUIRE_EQUAL(face1->m_sentDatas.size(), 1);
- // IncomingFaceId field should be reset to represent CS
- BOOST_CHECK_EQUAL(face1->m_sentDatas[0].getIncomingFaceId(), FACEID_CONTENT_STORE);
-
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(500));
- // PIT entry should not be left behind
- BOOST_CHECK_EQUAL(pit.size(), 0);
-}
-
-class ScopeLocalhostIncomingTestForwarder : public Forwarder
-{
-public:
- ScopeLocalhostIncomingTestForwarder()
- {
- }
-
- virtual void
- onDataUnsolicited(Face& inFace, const Data& data)
- {
- ++m_onDataUnsolicited_count;
- }
-
-protected:
- virtual void
- dispatchToStrategy(shared_ptr<pit::Entry> pitEntry, function<void(fw::Strategy*)> f)
- {
- ++m_dispatchToStrategy_count;
- }
-
-public:
- int m_dispatchToStrategy_count;
- int m_onDataUnsolicited_count;
-};
-
-BOOST_AUTO_TEST_CASE(ScopeLocalhostIncoming)
-{
- ScopeLocalhostIncomingTestForwarder forwarder;
- shared_ptr<Face> face1 = make_shared<DummyLocalFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
-
- // local face, /localhost: OK
- forwarder.m_dispatchToStrategy_count = 0;
- shared_ptr<Interest> i1 = makeInterest("/localhost/A1");
- forwarder.onIncomingInterest(*face1, *i1);
- BOOST_CHECK_EQUAL(forwarder.m_dispatchToStrategy_count, 1);
-
- // non-local face, /localhost: violate
- forwarder.m_dispatchToStrategy_count = 0;
- shared_ptr<Interest> i2 = makeInterest("/localhost/A2");
- forwarder.onIncomingInterest(*face2, *i2);
- BOOST_CHECK_EQUAL(forwarder.m_dispatchToStrategy_count, 0);
-
- // local face, non-/localhost: OK
- forwarder.m_dispatchToStrategy_count = 0;
- shared_ptr<Interest> i3 = makeInterest("/A3");
- forwarder.onIncomingInterest(*face1, *i3);
- BOOST_CHECK_EQUAL(forwarder.m_dispatchToStrategy_count, 1);
-
- // non-local face, non-/localhost: OK
- forwarder.m_dispatchToStrategy_count = 0;
- shared_ptr<Interest> i4 = makeInterest("/A4");
- forwarder.onIncomingInterest(*face2, *i4);
- BOOST_CHECK_EQUAL(forwarder.m_dispatchToStrategy_count, 1);
-
- // local face, /localhost: OK
- forwarder.m_onDataUnsolicited_count = 0;
- shared_ptr<Data> d1 = makeData("/localhost/B1");
- forwarder.onIncomingData(*face1, *d1);
- BOOST_CHECK_EQUAL(forwarder.m_onDataUnsolicited_count, 1);
-
- // non-local face, /localhost: OK
- forwarder.m_onDataUnsolicited_count = 0;
- shared_ptr<Data> d2 = makeData("/localhost/B2");
- forwarder.onIncomingData(*face2, *d2);
- BOOST_CHECK_EQUAL(forwarder.m_onDataUnsolicited_count, 0);
-
- // local face, non-/localhost: OK
- forwarder.m_onDataUnsolicited_count = 0;
- shared_ptr<Data> d3 = makeData("/B3");
- forwarder.onIncomingData(*face1, *d3);
- BOOST_CHECK_EQUAL(forwarder.m_onDataUnsolicited_count, 1);
-
- // non-local face, non-/localhost: OK
- forwarder.m_onDataUnsolicited_count = 0;
- shared_ptr<Data> d4 = makeData("/B4");
- forwarder.onIncomingData(*face2, *d4);
- BOOST_CHECK_EQUAL(forwarder.m_onDataUnsolicited_count, 1);
-}
-
-BOOST_AUTO_TEST_CASE(ScopeLocalhostOutgoing)
-{
- Forwarder forwarder;
- shared_ptr<DummyLocalFace> face1 = make_shared<DummyLocalFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<Face> face3 = make_shared<DummyLocalFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
- Pit& pit = forwarder.getPit();
-
- // local face, /localhost: OK
- shared_ptr<Interest> interestA1 = makeInterest("/localhost/A1");
- shared_ptr<pit::Entry> pitA1 = pit.insert(*interestA1).first;
- pitA1->insertOrUpdateInRecord(face3, *interestA1);
- face1->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pitA1, *face1);
- BOOST_CHECK_EQUAL(face1->m_sentInterests.size(), 1);
-
- // non-local face, /localhost: violate
- shared_ptr<Interest> interestA2 = makeInterest("/localhost/A2");
- shared_ptr<pit::Entry> pitA2 = pit.insert(*interestA2).first;
- pitA2->insertOrUpdateInRecord(face3, *interestA2);
- face2->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pitA2, *face2);
- BOOST_CHECK_EQUAL(face2->m_sentInterests.size(), 0);
-
- // local face, non-/localhost: OK
- shared_ptr<Interest> interestA3 = makeInterest("/A3");
- shared_ptr<pit::Entry> pitA3 = pit.insert(*interestA3).first;
- pitA3->insertOrUpdateInRecord(face3, *interestA3);
- face1->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pitA3, *face1);
- BOOST_CHECK_EQUAL(face1->m_sentInterests.size(), 1);
-
- // non-local face, non-/localhost: OK
- shared_ptr<Interest> interestA4 = makeInterest("/A4");
- shared_ptr<pit::Entry> pitA4 = pit.insert(*interestA4).first;
- pitA4->insertOrUpdateInRecord(face3, *interestA4);
- face2->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pitA4, *face2);
- BOOST_CHECK_EQUAL(face2->m_sentInterests.size(), 1);
-
- // local face, /localhost: OK
- face1->m_sentDatas.clear();
- forwarder.onOutgoingData(Data("/localhost/B1"), *face1);
- BOOST_CHECK_EQUAL(face1->m_sentDatas.size(), 1);
-
- // non-local face, /localhost: OK
- face2->m_sentDatas.clear();
- forwarder.onOutgoingData(Data("/localhost/B2"), *face2);
- BOOST_CHECK_EQUAL(face2->m_sentDatas.size(), 0);
-
- // local face, non-/localhost: OK
- face1->m_sentDatas.clear();
- forwarder.onOutgoingData(Data("/B3"), *face1);
- BOOST_CHECK_EQUAL(face1->m_sentDatas.size(), 1);
-
- // non-local face, non-/localhost: OK
- face2->m_sentDatas.clear();
- forwarder.onOutgoingData(Data("/B4"), *face2);
- BOOST_CHECK_EQUAL(face2->m_sentDatas.size(), 1);
-}
-
-BOOST_AUTO_TEST_CASE(ScopeLocalhopOutgoing)
-{
- Forwarder forwarder;
- shared_ptr<DummyLocalFace> face1 = make_shared<DummyLocalFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyLocalFace> face3 = make_shared<DummyLocalFace>();
- shared_ptr<DummyFace> face4 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
- forwarder.addFace(face4);
- Pit& pit = forwarder.getPit();
-
- // from local face, to local face: OK
- shared_ptr<Interest> interest1 = makeInterest("/localhop/1");
- shared_ptr<pit::Entry> pit1 = pit.insert(*interest1).first;
- pit1->insertOrUpdateInRecord(face1, *interest1);
- face3->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pit1, *face3);
- BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
-
- // from non-local face, to local face: OK
- shared_ptr<Interest> interest2 = makeInterest("/localhop/2");
- shared_ptr<pit::Entry> pit2 = pit.insert(*interest2).first;
- pit2->insertOrUpdateInRecord(face2, *interest2);
- face3->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pit2, *face3);
- BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
-
- // from local face, to non-local face: OK
- shared_ptr<Interest> interest3 = makeInterest("/localhop/3");
- shared_ptr<pit::Entry> pit3 = pit.insert(*interest3).first;
- pit3->insertOrUpdateInRecord(face1, *interest3);
- face4->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pit3, *face4);
- BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 1);
-
- // from non-local face, to non-local face: violate
- shared_ptr<Interest> interest4 = makeInterest("/localhop/4");
- shared_ptr<pit::Entry> pit4 = pit.insert(*interest4).first;
- pit4->insertOrUpdateInRecord(face2, *interest4);
- face4->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pit4, *face4);
- BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 0);
-
- // from local face and non-local face, to local face: OK
- shared_ptr<Interest> interest5 = makeInterest("/localhop/5");
- shared_ptr<pit::Entry> pit5 = pit.insert(*interest5).first;
- pit5->insertOrUpdateInRecord(face1, *interest5);
- pit5->insertOrUpdateInRecord(face2, *interest5);
- face3->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pit5, *face3);
- BOOST_CHECK_EQUAL(face3->m_sentInterests.size(), 1);
-
- // from local face and non-local face, to non-local face: OK
- shared_ptr<Interest> interest6 = makeInterest("/localhop/6");
- shared_ptr<pit::Entry> pit6 = pit.insert(*interest6).first;
- pit6->insertOrUpdateInRecord(face1, *interest6);
- pit6->insertOrUpdateInRecord(face2, *interest6);
- face4->m_sentInterests.clear();
- forwarder.onOutgoingInterest(pit6, *face4);
- BOOST_CHECK_EQUAL(face4->m_sentInterests.size(), 1);
-}
-
-BOOST_AUTO_TEST_CASE(StrategyDispatch)
-{
- LimitedIo limitedIo;
- Forwarder forwarder;
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
-
- StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
- shared_ptr<DummyStrategy> strategyP = make_shared<DummyStrategy>(
- ref(forwarder), "ndn:/strategyP");
- shared_ptr<DummyStrategy> strategyQ = make_shared<DummyStrategy>(
- ref(forwarder), "ndn:/strategyQ");
- strategyChoice.install(strategyP);
- strategyChoice.install(strategyQ);
- strategyChoice.insert("ndn:/" , strategyP->getName());
- strategyChoice.insert("ndn:/B", strategyQ->getName());
-
- shared_ptr<Interest> interest1 = makeInterest("ndn:/A/1");
- strategyP->m_afterReceiveInterest_count = 0;
- strategyP->m_interestOutFace = face2;
- forwarder.onInterest(*face1, *interest1);
- BOOST_CHECK_EQUAL(strategyP->m_afterReceiveInterest_count, 1);
-
- shared_ptr<Interest> interest2 = makeInterest("ndn:/B/2");
- strategyQ->m_afterReceiveInterest_count = 0;
- strategyQ->m_interestOutFace = face2;
- forwarder.onInterest(*face1, *interest2);
- BOOST_CHECK_EQUAL(strategyQ->m_afterReceiveInterest_count, 1);
-
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(5));
-
- shared_ptr<Data> data1 = makeData("ndn:/A/1/a");
- strategyP->m_beforeSatisfyInterest_count = 0;
- forwarder.onData(*face2, *data1);
- BOOST_CHECK_EQUAL(strategyP->m_beforeSatisfyInterest_count, 1);
-
- shared_ptr<Data> data2 = makeData("ndn:/B/2/b");
- strategyQ->m_beforeSatisfyInterest_count = 0;
- forwarder.onData(*face2, *data2);
- BOOST_CHECK_EQUAL(strategyQ->m_beforeSatisfyInterest_count, 1);
-
- shared_ptr<Interest> interest3 = makeInterest("ndn:/A/3");
- interest3->setInterestLifetime(time::milliseconds(30));
- forwarder.onInterest(*face1, *interest3);
- shared_ptr<Interest> interest4 = makeInterest("ndn:/B/4");
- interest4->setInterestLifetime(time::milliseconds(5000));
- forwarder.onInterest(*face1, *interest4);
-
- strategyP->m_beforeExpirePendingInterest_count = 0;
- strategyQ->m_beforeExpirePendingInterest_count = 0;
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(100));
- BOOST_CHECK_EQUAL(strategyP->m_beforeExpirePendingInterest_count, 1);
- BOOST_CHECK_EQUAL(strategyQ->m_beforeExpirePendingInterest_count, 0);
-}
-
-BOOST_AUTO_TEST_CASE(IncomingData)
-{
- LimitedIo limitedIo;
- Forwarder forwarder;
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face4 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
- forwarder.addFace(face4);
-
- Pit& pit = forwarder.getPit();
- shared_ptr<Interest> interest0 = makeInterest("ndn:/");
- shared_ptr<pit::Entry> pit0 = pit.insert(*interest0).first;
- pit0->insertOrUpdateInRecord(face1, *interest0);
- shared_ptr<Interest> interestA = makeInterest("ndn:/A");
- shared_ptr<pit::Entry> pitA = pit.insert(*interestA).first;
- pitA->insertOrUpdateInRecord(face1, *interestA);
- pitA->insertOrUpdateInRecord(face2, *interestA);
- shared_ptr<Interest> interestC = makeInterest("ndn:/A/B/C");
- shared_ptr<pit::Entry> pitC = pit.insert(*interestC).first;
- pitC->insertOrUpdateInRecord(face3, *interestC);
- pitC->insertOrUpdateInRecord(face4, *interestC);
-
- shared_ptr<Data> dataD = makeData("ndn:/A/B/C/D");
- forwarder.onIncomingData(*face3, *dataD);
- limitedIo.run(LimitedIo::UNLIMITED_OPS, time::milliseconds(5));
-
- BOOST_CHECK_EQUAL(face1->m_sentDatas.size(), 1);
- BOOST_CHECK_EQUAL(face2->m_sentDatas.size(), 1);
- BOOST_CHECK_EQUAL(face3->m_sentDatas.size(), 0);
- BOOST_CHECK_EQUAL(face4->m_sentDatas.size(), 1);
-}
-
-BOOST_FIXTURE_TEST_CASE(InterestLoopWithShortLifetime, UnitTestTimeFixture) // Bug 1953
-{
- Forwarder forwarder;
- auto face1 = make_shared<DummyFace>();
- auto face2 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
-
- // cause an Interest sent out of face2 to loop back into face1 after a delay
- face2->onSendInterest += [&face1] (const Interest& interest) {
- scheduler::schedule(time::milliseconds(170), [&] { face1->receiveInterest(interest); });
- };
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
- fibEntry->addNextHop(face2, 0);
-
- // receive an Interest
- shared_ptr<Interest> interest = makeInterest("ndn:/A/1");
- interest->setNonce(82101183);
- interest->setInterestLifetime(time::milliseconds(50));
- face1->receiveInterest(*interest);
-
- // interest should be forwarded only once, as long as Nonce is in Dead Nonce List
- BOOST_ASSERT(time::milliseconds(25) * 40 < forwarder.getDeadNonceList().getLifetime());
- this->advanceClocks(time::milliseconds(25), 40);
-
- BOOST_CHECK_EQUAL(face2->m_sentInterests.size(), 1);
-
- // It's unnecessary to check that Interest with duplicate Nonce can be forwarded again
- // after it's gone from Dead Nonce List, because the entry lifetime of Dead Nonce List
- // is an implementation decision. NDN protocol requires Name+Nonce to be unique,
- // without specifying when Name+Nonce could repeat. Forwarder is permitted to suppress
- // an Interest if its Name+Nonce has appeared any point in the past.
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/fw/ncc-strategy.cpp b/NFD/tests/daemon/fw/ncc-strategy.cpp
deleted file mode 100644
index ab3f641..0000000
--- a/NFD/tests/daemon/fw/ncc-strategy.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "fw/ncc-strategy.hpp"
-#include "strategy-tester.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-#include "tests/limited-io.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FwNccStrategy, UnitTestTimeFixture)
-
-// NccStrategy is fairly complex.
-// The most important property is:
-// it remembers which upstream is the fastest to return Data,
-// and favors this upstream in subsequent Interests.
-BOOST_AUTO_TEST_CASE(FavorRespondingUpstream)
-{
- LimitedIo limitedIo(this);
- Forwarder forwarder;
- typedef StrategyTester<fw::NccStrategy> NccStrategyTester;
- shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(ref(forwarder));
- strategy->onAction.connect(bind(&LimitedIo::afterOp, &limitedIo));
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10);
- fibEntry->addNextHop(face2, 20);
-
- StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
- strategyChoice.install(strategy);
- strategyChoice.insert(Name(), strategy->getName());
-
- Pit& pit = forwarder.getPit();
-
- // first Interest: strategy knows nothing and follows routing
- shared_ptr<Interest> interest1p = makeInterest("ndn:/0Jm1ajrW/%00");
- Interest& interest1 = *interest1p;
- interest1.setInterestLifetime(time::milliseconds(8000));
- shared_ptr<pit::Entry> pitEntry1 = pit.insert(interest1).first;
-
- pitEntry1->insertOrUpdateInRecord(face3, interest1);
- strategy->afterReceiveInterest(*face3, interest1, fibEntry, pitEntry1);
-
- // forwards to face1 because routing says it's best
- // (no io run here: afterReceiveInterest has already sent the Interest)
- BOOST_REQUIRE_EQUAL(strategy->m_sendInterestHistory.size(), 1);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[0].get<1>(), face1);
-
- // forwards to face2 because face1 doesn't respond
- limitedIo.run(1, time::milliseconds(500), time::milliseconds(10));
- BOOST_REQUIRE_EQUAL(strategy->m_sendInterestHistory.size(), 2);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[1].get<1>(), face2);
-
- // face2 responds
- shared_ptr<Data> data1p = makeData("ndn:/0Jm1ajrW/%00");
- Data& data1 = *data1p;
- strategy->beforeSatisfyInterest(pitEntry1, *face2, data1);
- this->advanceClocks(time::milliseconds(10), time::milliseconds(500));
-
- // second Interest: strategy knows face2 is best
- shared_ptr<Interest> interest2p = makeInterest("ndn:/0Jm1ajrW/%00%01");
- Interest& interest2 = *interest2p;
- interest2.setInterestLifetime(time::milliseconds(8000));
- shared_ptr<pit::Entry> pitEntry2 = pit.insert(interest2).first;
-
- pitEntry2->insertOrUpdateInRecord(face3, interest2);
- strategy->afterReceiveInterest(*face3, interest2, fibEntry, pitEntry2);
-
- // forwards to face2 because it responds previously
- this->advanceClocks(time::milliseconds(1));
- BOOST_REQUIRE_GE(strategy->m_sendInterestHistory.size(), 3);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[2].get<1>(), face2);
-}
-
-BOOST_AUTO_TEST_CASE(Bug1853)
-{
- Forwarder forwarder;
- typedef StrategyTester<fw::NccStrategy> NccStrategyTester;
- shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(ref(forwarder));
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10);
-
- StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
- strategyChoice.install(strategy);
- strategyChoice.insert(Name(), strategy->getName());
-
- Pit& pit = forwarder.getPit();
-
- // first Interest: strategy follows routing and forwards to face1
- shared_ptr<Interest> interest1 = makeInterest("ndn:/nztwIvHX/%00");
- interest1->setInterestLifetime(time::milliseconds(8000));
- shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
-
- pitEntry1->insertOrUpdateInRecord(face3, *interest1);
- strategy->afterReceiveInterest(*face3, *interest1, fibEntry, pitEntry1);
-
- this->advanceClocks(time::milliseconds(1));
- BOOST_REQUIRE_EQUAL(strategy->m_sendInterestHistory.size(), 1);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[0].get<1>(), face1);
-
- // face1 responds
- shared_ptr<Data> data1 = makeData("ndn:/nztwIvHX/%00");
- strategy->beforeSatisfyInterest(pitEntry1, *face1, *data1);
- this->advanceClocks(time::milliseconds(10), time::milliseconds(500));
-
- // second Interest: bestFace is face1, nUpstreams becomes 0,
- // therefore pitEntryInfo->maxInterval cannot be calculated from deferRange and nUpstreams
- shared_ptr<Interest> interest2 = makeInterest("ndn:/nztwIvHX/%01");
- interest2->setInterestLifetime(time::milliseconds(8000));
- shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
-
- pitEntry2->insertOrUpdateInRecord(face3, *interest2);
- strategy->afterReceiveInterest(*face3, *interest2, fibEntry, pitEntry2);
-
- // FIB entry is changed before doPropagate executes
- fibEntry->addNextHop(face2, 20);
- this->advanceClocks(time::milliseconds(10), time::milliseconds(1000));// should not crash
-}
-
-BOOST_AUTO_TEST_CASE(Bug1961)
-{
- LimitedIo limitedIo(this);
- Forwarder forwarder;
- typedef StrategyTester<fw::NccStrategy> NccStrategyTester;
- shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(ref(forwarder));
- strategy->onAction.connect(bind(&LimitedIo::afterOp, &limitedIo));
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face3 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- forwarder.addFace(face3);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10);
- fibEntry->addNextHop(face2, 20);
-
- StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
- strategyChoice.install(strategy);
- strategyChoice.insert(Name(), strategy->getName());
-
- Pit& pit = forwarder.getPit();
-
- // first Interest: strategy forwards to face1 and face2
- shared_ptr<Interest> interest1 = makeInterest("ndn:/seRMz5a6/%00");
- interest1->setInterestLifetime(time::milliseconds(2000));
- shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
-
- pitEntry1->insertOrUpdateInRecord(face3, *interest1);
- strategy->afterReceiveInterest(*face3, *interest1, fibEntry, pitEntry1);
- limitedIo.run(2 - strategy->m_sendInterestHistory.size(),
- time::milliseconds(2000), time::milliseconds(10));
- BOOST_REQUIRE_EQUAL(strategy->m_sendInterestHistory.size(), 2);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[0].get<1>(), face1);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[1].get<1>(), face2);
-
- // face1 responds
- shared_ptr<Data> data1 = makeData("ndn:/seRMz5a6/%00");
- strategy->beforeSatisfyInterest(pitEntry1, *face1, *data1);
- pitEntry1->deleteInRecords();
- this->advanceClocks(time::milliseconds(10));
- // face2 also responds
- strategy->beforeSatisfyInterest(pitEntry1, *face2, *data1);
- this->advanceClocks(time::milliseconds(10));
-
- // second Interest: bestFace should be face 1
- shared_ptr<Interest> interest2 = makeInterest("ndn:/seRMz5a6/%01");
- interest2->setInterestLifetime(time::milliseconds(2000));
- shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
-
- pitEntry2->insertOrUpdateInRecord(face3, *interest2);
- strategy->afterReceiveInterest(*face3, *interest2, fibEntry, pitEntry2);
- limitedIo.run(3 - strategy->m_sendInterestHistory.size(),
- time::milliseconds(2000), time::milliseconds(10));
-
- BOOST_REQUIRE_GE(strategy->m_sendInterestHistory.size(), 3);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[2].get<1>(), face1);
-}
-
-BOOST_AUTO_TEST_CASE(Bug1971)
-{
- LimitedIo limitedIo(this);
- Forwarder forwarder;
- typedef StrategyTester<fw::NccStrategy> NccStrategyTester;
- shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(ref(forwarder));
- strategy->onAction.connect(bind(&LimitedIo::afterOp, &limitedIo));
-
- shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
- shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
-
- Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face2, 10);
-
- StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
- strategyChoice.install(strategy);
- strategyChoice.insert(Name(), strategy->getName());
-
- Pit& pit = forwarder.getPit();
-
- // first Interest: strategy forwards to face2
- shared_ptr<Interest> interest1 = makeInterest("ndn:/M4mBXCsd");
- interest1->setInterestLifetime(time::milliseconds(2000));
- shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
-
- pitEntry1->insertOrUpdateInRecord(face1, *interest1);
- strategy->afterReceiveInterest(*face1, *interest1, fibEntry, pitEntry1);
- limitedIo.run(1 - strategy->m_sendInterestHistory.size(),
- time::milliseconds(2000), time::milliseconds(10));
- BOOST_REQUIRE_EQUAL(strategy->m_sendInterestHistory.size(), 1);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[0].get<1>(), face2);
-
- // face2 responds
- shared_ptr<Data> data1 = makeData("ndn:/M4mBXCsd");
- data1->setFreshnessPeriod(time::milliseconds(5));
- strategy->beforeSatisfyInterest(pitEntry1, *face2, *data1);
- pitEntry1->deleteOutRecord(*face2);
- pitEntry1->deleteInRecords();
- this->advanceClocks(time::milliseconds(10));
-
- // similar Interest: strategy should still forward it
- pitEntry1->insertOrUpdateInRecord(face1, *interest1);
- strategy->afterReceiveInterest(*face1, *interest1, fibEntry, pitEntry1);
- limitedIo.run(2 - strategy->m_sendInterestHistory.size(),
- time::milliseconds(2000), time::milliseconds(10));
- BOOST_REQUIRE_EQUAL(strategy->m_sendInterestHistory.size(), 2);
- BOOST_CHECK_EQUAL(strategy->m_sendInterestHistory[1].get<1>(), face2);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/fw/rtt-estimator.cpp b/NFD/tests/daemon/fw/rtt-estimator.cpp
deleted file mode 100644
index b5af0ab..0000000
--- a/NFD/tests/daemon/fw/rtt-estimator.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "fw/rtt-estimator.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FwRttEstimator, BaseFixture)
-
-static inline double
-computeRtoAsFloatSeconds(RttEstimator& rtt)
-{
- typedef time::duration<double, time::seconds::period> FloatSeconds;
-
- RttEstimator::Duration rto = rtt.computeRto();
- return time::duration_cast<FloatSeconds>(rto).count();
-}
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
- RttEstimator rtt;
-
- for (int i = 0; i < 100; ++i) {
- rtt.addMeasurement(time::seconds(5));
- }
- double rto1 = computeRtoAsFloatSeconds(rtt);
- BOOST_CHECK_CLOSE(rto1, 5.0, 0.1);
-
- rtt.doubleMultiplier();
- double rto2 = computeRtoAsFloatSeconds(rtt);
- BOOST_CHECK_CLOSE(rto2, 10.0, 0.1);
-
- rtt.doubleMultiplier();
- double rto3 = computeRtoAsFloatSeconds(rtt);
- BOOST_CHECK_CLOSE(rto3, 20.0, 0.1);
-
- rtt.addMeasurement(time::seconds(5)); // reset multiplier
- double rto4 = computeRtoAsFloatSeconds(rtt);
- BOOST_CHECK_CLOSE(rto4, 5.0, 0.1);
-
- rtt.incrementMultiplier();
- double rto5 = computeRtoAsFloatSeconds(rtt);
- BOOST_CHECK_CLOSE(rto5, 10.0, 0.1);
-
- for (int i = 0; i < 5; ++i) {
- rtt.addMeasurement(time::seconds(6));
- } // increased variance
- double rto6 = computeRtoAsFloatSeconds(rtt);
- BOOST_CHECK_GT(rto6, rto1);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/fw/strategy-tester.hpp b/NFD/tests/daemon/fw/strategy-tester.hpp
deleted file mode 100644
index 980144d..0000000
--- a/NFD/tests/daemon/fw/strategy-tester.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_NFD_FW_STRATEGY_TESTER_HPP
-#define NFD_TESTS_NFD_FW_STRATEGY_TESTER_HPP
-
-#include <boost/tuple/tuple_comparison.hpp>
-#include "fw/strategy.hpp"
-
-namespace nfd {
-namespace tests {
-
-/** \class StrategyTester
- * \brief extends strategy S for unit testing
- *
- * Actions invoked by S are recorded but not passed to forwarder
- */
-template<typename S>
-class StrategyTester : public S
-{
-public:
- explicit
- StrategyTester(Forwarder& forwarder)
- : S(forwarder, Name(S::STRATEGY_NAME).append("tester"))
- {
- }
-
- /// fires after each Action
- signal::Signal<StrategyTester<S>> onAction;
-
-protected:
- virtual void
- sendInterest(shared_ptr<pit::Entry> pitEntry,
- shared_ptr<Face> outFace,
- bool wantNewNonce = false) DECL_OVERRIDE;
-
- virtual void
- rejectPendingInterest(shared_ptr<pit::Entry> pitEntry) DECL_OVERRIDE;
-
-public:
- typedef boost::tuple<shared_ptr<pit::Entry>, shared_ptr<Face>> SendInterestArgs;
- std::vector<SendInterestArgs> m_sendInterestHistory;
-
- typedef boost::tuple<shared_ptr<pit::Entry>> RejectPendingInterestArgs;
- std::vector<RejectPendingInterestArgs> m_rejectPendingInterestHistory;
-};
-
-
-template<typename S>
-inline void
-StrategyTester<S>::sendInterest(shared_ptr<pit::Entry> pitEntry,
- shared_ptr<Face> outFace,
- bool wantNewNonce)
-{
- m_sendInterestHistory.push_back(SendInterestArgs(pitEntry, outFace));
- pitEntry->insertOrUpdateOutRecord(outFace, pitEntry->getInterest());
- onAction();
-}
-
-template<typename S>
-inline void
-StrategyTester<S>::rejectPendingInterest(shared_ptr<pit::Entry> pitEntry)
-{
- m_rejectPendingInterestHistory.push_back(RejectPendingInterestArgs(pitEntry));
- onAction();
-}
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_NFD_FW_STRATEGY_TESTER_HPP
diff --git a/NFD/tests/daemon/fw/strategy.cpp b/NFD/tests/daemon/fw/strategy.cpp
deleted file mode 100644
index 066b280..0000000
--- a/NFD/tests/daemon/fw/strategy.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "fw/strategy.hpp"
-#include "dummy-strategy.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-#include <boost/range/adaptor/filtered.hpp>
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FwStrategy, BaseFixture)
-
-class FaceTableAccessTestStrategy : public DummyStrategy
-{
-public:
- explicit
- FaceTableAccessTestStrategy(Forwarder& forwarder)
- : DummyStrategy(forwarder, Name("ndn:/strategy"))
- {
- this->afterAddFace.connect([this] (shared_ptr<Face> face) {
- this->addedFaces.push_back(face->getId());
- });
- this->beforeRemoveFace.connect([this] (shared_ptr<Face> face) {
- this->removedFaces.push_back(face->getId());
- });
- }
-
- std::vector<FaceId>
- getLocalFaces()
- {
- auto enumerable = this->getFaceTable() |
- boost::adaptors::filtered([] (shared_ptr<Face> face) {
- return face->isLocal();
- });
-
- std::vector<FaceId> results;
- for (shared_ptr<Face> face : enumerable) {
- results.push_back(face->getId());
- }
- return results;
- }
-
-public:
- std::vector<FaceId> addedFaces;
- std::vector<FaceId> removedFaces;
-};
-
-BOOST_AUTO_TEST_CASE(FaceTableAccess)
-{
- Forwarder forwarder;
- FaceTableAccessTestStrategy strategy(forwarder);
-
- auto face1 = make_shared<DummyFace>();
- auto face2 = make_shared<DummyLocalFace>();
- forwarder.addFace(face1);
- forwarder.addFace(face2);
- FaceId id1 = face1->getId();
- FaceId id2 = face2->getId();
-
- BOOST_CHECK(strategy.getLocalFaces() == std::vector<FaceId>{id2});
-
- face2->close();
- face1->close();
-
- BOOST_CHECK((strategy.addedFaces == std::vector<FaceId>{id1, id2}));
- BOOST_CHECK((strategy.removedFaces == std::vector<FaceId>{id2, id1}));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/channel-status-common.hpp b/NFD/tests/daemon/mgmt/channel-status-common.hpp
deleted file mode 100644
index 4954cc3..0000000
--- a/NFD/tests/daemon/mgmt/channel-status-common.hpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_NFD_MGMT_CHANNEL_STATUS_COMMON_HPP
-#define NFD_TESTS_NFD_MGMT_CHANNEL_STATUS_COMMON_HPP
-
-#include "face/protocol-factory.hpp"
-#include "face/channel.hpp"
-
-#include "tests/test-common.hpp"
-
-#include <ndn-cxx/management/nfd-channel-status.hpp>
-
-
-
-namespace nfd {
-namespace tests {
-
-class DummyChannel : public Channel
-{
-public:
-
- DummyChannel(const std::string& uri)
- {
- setUri(FaceUri(uri));
- }
-
- virtual
- ~DummyChannel()
- {
- }
-};
-
-class DummyProtocolFactory : public ProtocolFactory
-{
-public:
-
- DummyProtocolFactory()
- {
-
- }
-
- virtual void
- createFace(const FaceUri& uri,
- const FaceCreatedCallback& onCreated,
- const FaceConnectFailedCallback& onConnectFailed)
- {
- }
-
- virtual void
- addChannel(const std::string& channelUri)
- {
- m_channels.push_back(make_shared<DummyChannel>(channelUri));
- }
-
- virtual std::list<shared_ptr<const Channel> >
- getChannels() const
- {
- return m_channels;
- }
-
- virtual size_t
- getNChannels() const
- {
- return m_channels.size();
- }
-
-private:
- std::list<shared_ptr<const Channel> > m_channels;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_NFD_MGMT_CHANNEL_STATUS_COMMON_HPP
diff --git a/NFD/tests/daemon/mgmt/channel-status-publisher.cpp b/NFD/tests/daemon/mgmt/channel-status-publisher.cpp
deleted file mode 100644
index 370efe1..0000000
--- a/NFD/tests/daemon/mgmt/channel-status-publisher.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/channel-status-publisher.hpp"
-#include "mgmt/internal-face.hpp"
-
-#include "channel-status-common.hpp"
-
-#include "core/logger.hpp"
-NFD_LOG_INIT("TestChannelStatusPublisher");
-
-namespace nfd {
-namespace tests {
-
-class ChannelStatusPublisherFixture : BaseFixture
-{
-public:
- ChannelStatusPublisherFixture()
- : m_face(make_shared<InternalFace>())
- , m_publisher(m_factories, *m_face, "/localhost/nfd/faces/channels", m_keyChain)
- , m_finished(false)
- {
- }
-
- virtual
- ~ChannelStatusPublisherFixture()
- {
- }
-
- // virtual shared_ptr<DummyProtocolFactory>
- // addProtocolFactory(const std::string& protocol)
- // {
- // shared_ptr<DummyProtocolFactory> factory(make_shared<DummyProtocolFactory>());
- // m_factories[protocol] = factory;
-
- // return factory;
- // }
-
- void
- validatePublish(const Data& data)
- {
- Block payload = data.getContent();
-
- m_buffer.appendByteArray(payload.value(), payload.value_size());
-
- BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
- if (data.getFinalBlockId() != data.getName()[-1])
- {
- return;
- }
-
- // wrap the Channel Status entries in a single Content TLV for easy parsing
- m_buffer.prependVarNumber(m_buffer.size());
- m_buffer.prependVarNumber(tlv::Content);
-
- ndn::Block parser(m_buffer.buf(), m_buffer.size());
- parser.parse();
-
- BOOST_REQUIRE_EQUAL(parser.elements_size(), m_expectedEntries.size());
-
- for (Block::element_const_iterator i = parser.elements_begin();
- i != parser.elements_end();
- ++i)
- {
- if (i->type() != ndn::tlv::nfd::ChannelStatus)
- {
- BOOST_FAIL("expected ChannelStatus, got type #" << i->type());
- }
-
- ndn::nfd::ChannelStatus entry(*i);
-
- NFD_LOG_DEBUG("looking for channelstatus " << entry.getLocalUri());
-
- std::map<std::string, ndn::nfd::ChannelStatus>::const_iterator expectedEntryPos =
- m_expectedEntries.find(entry.getLocalUri());
-
- BOOST_REQUIRE(expectedEntryPos != m_expectedEntries.end());
- const ndn::nfd::ChannelStatus& expectedEntry = expectedEntryPos->second;
-
- BOOST_CHECK_EQUAL(entry.getLocalUri(), expectedEntry.getLocalUri());
-
- m_matchedEntries.insert(entry.getLocalUri());
- }
-
- BOOST_CHECK_EQUAL(m_matchedEntries.size(), m_expectedEntries.size());
-
- m_finished = true;
- }
-
-protected:
- ChannelStatusPublisher::FactoryMap m_factories;
- shared_ptr<InternalFace> m_face;
- ChannelStatusPublisher m_publisher;
-
- ndn::EncodingBuffer m_buffer;
-
- std::map<std::string, ndn::nfd::ChannelStatus> m_expectedEntries;
- std::set<std::string> m_matchedEntries;
-
- bool m_finished;
-
- ndn::KeyChain m_keyChain;
-};
-
-BOOST_FIXTURE_TEST_SUITE(MgmtChannelStatusPublisher, ChannelStatusPublisherFixture)
-
-BOOST_AUTO_TEST_CASE(Publish)
-{
- const std::string protocol = "dummy";
-
- shared_ptr<DummyProtocolFactory> factory(make_shared<DummyProtocolFactory>());
- m_factories[protocol] = factory;
-
- for (int i = 0; i < 10; ++i)
- {
- const std::string uri = protocol + "://path" + boost::lexical_cast<std::string>(i);
- factory->addChannel(uri);
-
- ndn::nfd::ChannelStatus expectedEntry;
- expectedEntry.setLocalUri(DummyChannel(uri).getUri().toString());
-
- m_expectedEntries[expectedEntry.getLocalUri()] = expectedEntry;
- }
-
- m_face->onReceiveData +=
- bind(&ChannelStatusPublisherFixture::validatePublish, this, _1);
-
- m_publisher.publish();
- BOOST_REQUIRE(m_finished);
-}
-
-BOOST_AUTO_TEST_CASE(DuplicateFactories)
-{
- const std::string protocol1 = "dummy1";
- const std::string protocol2 = "dummy2";
-
- shared_ptr<DummyProtocolFactory> factory(make_shared<DummyProtocolFactory>());
- m_factories[protocol1] = factory;
- m_factories[protocol2] = factory;
-
- for (int i = 0; i < 10; ++i)
- {
- ndn::nfd::ChannelStatus expectedEntry;
- const std::string uri = protocol1 + "://path" + boost::lexical_cast<std::string>(i);
-
- factory->addChannel(uri);
-
- expectedEntry.setLocalUri(DummyChannel(uri).getUri().toString());
- m_expectedEntries[expectedEntry.getLocalUri()] = expectedEntry;
- }
-
- m_face->onReceiveData +=
- bind(&ChannelStatusPublisherFixture::validatePublish, this, _1);
-
- m_publisher.publish();
- BOOST_REQUIRE(m_finished);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-
-
-
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/command-validator.cpp b/NFD/tests/daemon/mgmt/command-validator.cpp
deleted file mode 100644
index ac32a6e..0000000
--- a/NFD/tests/daemon/mgmt/command-validator.cpp
+++ /dev/null
@@ -1,657 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "mgmt/command-validator.hpp"
-#include "core/config-file.hpp"
-
-#include "tests/test-common.hpp"
-
-#include <ndn-cxx/util/command-interest-generator.hpp>
-#include <ndn-cxx/util/io.hpp>
-#include <boost/filesystem.hpp>
-#include <fstream>
-
-namespace nfd {
-
-namespace tests {
-
-NFD_LOG_INIT("CommandValidatorTest");
-
-BOOST_FIXTURE_TEST_SUITE(MgmtCommandValidator, BaseFixture)
-
-// authorizations
-// {
-// authorize
-// {
-// certfile "tests/daemon/mgmt/cert1.ndncert"
-// privileges
-// {
-// fib
-// stats
-// }
-// }
-
-// authorize
-// {
-// certfile "tests/daemon/mgmt/cert2.ndncert"
-// privileges
-// {
-// faces
-// }
-// }
-// }
-
-const std::string CONFIG =
-"authorizations\n"
-"{\n"
-" authorize\n"
-" {\n"
-" certfile \"tests/daemon/mgmt/cert1.ndncert\"\n"
-" privileges\n"
-" {\n"
-" fib\n"
-" stats\n"
-" }\n"
-" }\n"
-" authorize\n"
-" {\n"
-" certfile \"tests/daemon/mgmt/cert2.ndncert\"\n"
-" privileges\n"
-" {\n"
-" faces\n"
-" }\n"
-" }\n"
- "}\n";
-
-const boost::filesystem::path CONFIG_PATH =
- boost::filesystem::current_path() /= std::string("unit-test-nfd.conf");
-
-class CommandValidatorTester
-{
-public:
-
- CommandValidatorTester()
- : m_validated(false),
- m_validationFailed(false)
- {
-
- }
-
- void
- generateIdentity(const Name& prefix)
- {
- m_identityName = prefix;
- m_identityName.appendVersion();
-
- const Name certName = m_keys.createIdentity(m_identityName);
-
- m_certificate = m_keys.getCertificate(certName);
- }
-
- void
- saveIdentityToFile(const char* filename)
- {
- std::ofstream out;
- out.open(filename);
-
- BOOST_REQUIRE(out.is_open());
- BOOST_REQUIRE(static_cast<bool>(m_certificate));
-
- ndn::io::save<ndn::IdentityCertificate>(*m_certificate, out);
-
- out.close();
- }
-
- const Name&
- getIdentityName() const
- {
- BOOST_REQUIRE_NE(m_identityName, Name());
- return m_identityName;
- }
-
- const Name&
- getPublicKeyName() const
- {
- BOOST_REQUIRE(static_cast<bool>(m_certificate));
- return m_certificate->getPublicKeyName();
- }
-
- void
- onValidated(const shared_ptr<const Interest>& interest)
- {
- // NFD_LOG_DEBUG("validated command");
- m_validated = true;
- }
-
- void
- onValidationFailed(const shared_ptr<const Interest>& interest, const std::string& info)
- {
- NFD_LOG_DEBUG("validation failed: " << info);
- m_validationFailed = true;
- }
-
- bool
- commandValidated() const
- {
- return m_validated;
- }
-
- bool
- commandValidationFailed() const
- {
- return m_validationFailed;
- }
-
- void
- resetValidation()
- {
- m_validated = false;
- m_validationFailed = false;
- }
-
- ~CommandValidatorTester()
- {
- m_keys.deleteIdentity(m_identityName);
- }
-
-private:
- bool m_validated;
- bool m_validationFailed;
-
- ndn::KeyChain m_keys;
- Name m_identityName;
- shared_ptr<ndn::IdentityCertificate> m_certificate;
-};
-
-class TwoValidatorFixture : public BaseFixture
-{
-public:
- TwoValidatorFixture()
- {
- m_tester1.generateIdentity("/test/CommandValidator/TwoKeys/id1");
- m_tester1.saveIdentityToFile("tests/daemon/mgmt/cert1.ndncert");
-
- m_tester2.generateIdentity("/test/CommandValidator/TwoKeys/id2");
- m_tester2.saveIdentityToFile("tests/daemon/mgmt/cert2.ndncert");
- }
-
- ~TwoValidatorFixture()
- {
- boost::system::error_code error;
- boost::filesystem::remove("tests/daemon/mgmt/cert1.ndncert", error);
- boost::filesystem::remove("tests/daemon/mgmt/cert2.ndncert", error);
- }
-
-protected:
- CommandValidatorTester m_tester1;
- CommandValidatorTester m_tester2;
-};
-
-BOOST_FIXTURE_TEST_CASE(TwoKeys, TwoValidatorFixture)
-{
- shared_ptr<Interest> fibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
- shared_ptr<Interest> statsCommand = make_shared<Interest>("/localhost/nfd/stats/dosomething");
- shared_ptr<Interest> facesCommand = make_shared<Interest>("/localhost/nfd/faces/create");
-
- ndn::CommandInterestGenerator generator;
- generator.generateWithIdentity(*fibCommand, m_tester1.getIdentityName());
- generator.generateWithIdentity(*statsCommand, m_tester1.getIdentityName());
- generator.generateWithIdentity(*facesCommand, m_tester2.getIdentityName());
-
- ConfigFile config;
- CommandValidator validator;
- validator.addSupportedPrivilege("faces");
- validator.addSupportedPrivilege("fib");
- validator.addSupportedPrivilege("stats");
-
- validator.setConfigFile(config);
-
- config.parse(CONFIG, false, CONFIG_PATH.native());
-
- validator.validate(*fibCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
-
- BOOST_REQUIRE(m_tester1.commandValidated());
- m_tester1.resetValidation();
-
- validator.validate(*statsCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
-
- BOOST_REQUIRE(m_tester1.commandValidated());
-
- validator.validate(*facesCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester2, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester2, _1, _2));
-
- BOOST_REQUIRE(m_tester2.commandValidated());
- m_tester2.resetValidation();
-
- // use cert2 for fib command (authorized for cert1 only)
- shared_ptr<Interest> unauthorizedFibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
- generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
-
- validator.validate(*unauthorizedFibCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester2, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester2, _1, _2));
-
- BOOST_REQUIRE(m_tester2.commandValidationFailed());
-}
-
-BOOST_FIXTURE_TEST_CASE(TwoKeysDryRun, TwoValidatorFixture)
-{
- CommandValidatorTester tester1;
- tester1.generateIdentity("/test/CommandValidator/TwoKeys/id1");
- tester1.saveIdentityToFile("tests/daemon/mgmt/cert1.ndncert");
-
- CommandValidatorTester tester2;
- tester2.generateIdentity("/test/CommandValidator/TwoKeys/id2");
- tester2.saveIdentityToFile("tests/daemon/mgmt/cert2.ndncert");
-
- shared_ptr<Interest> fibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
- shared_ptr<Interest> statsCommand = make_shared<Interest>("/localhost/nfd/stats/dosomething");
- shared_ptr<Interest> facesCommand = make_shared<Interest>("/localhost/nfd/faces/create");
-
- ndn::CommandInterestGenerator generator;
- generator.generateWithIdentity(*fibCommand, m_tester1.getIdentityName());
- generator.generateWithIdentity(*statsCommand, m_tester1.getIdentityName());
- generator.generateWithIdentity(*facesCommand, m_tester2.getIdentityName());
-
- ConfigFile config;
- CommandValidator validator;
- validator.addSupportedPrivilege("faces");
- validator.addSupportedPrivilege("fib");
- validator.addSupportedPrivilege("stats");
-
- validator.setConfigFile(config);
-
- config.parse(CONFIG, true, CONFIG_PATH.native());
-
- validator.validate(*fibCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
-
- BOOST_REQUIRE(m_tester1.commandValidationFailed());
- m_tester1.resetValidation();
-
- validator.validate(*statsCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
-
- BOOST_REQUIRE(m_tester1.commandValidationFailed());
-
- validator.validate(*facesCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester2, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester2, _1, _2));
-
- BOOST_REQUIRE(m_tester2.commandValidationFailed());
- m_tester2.resetValidation();
-
- // use cert2 for fib command (authorized for cert1 only)
- shared_ptr<Interest> unauthorizedFibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
- generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
-
- validator.validate(*unauthorizedFibCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester2, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester2, _1, _2));
-
- BOOST_REQUIRE(m_tester2.commandValidationFailed());
-}
-
-BOOST_AUTO_TEST_CASE(NoAuthorizeSections)
-{
- const std::string NO_AUTHORIZE_CONFIG =
- "authorizations\n"
- "{\n"
- "}\n";
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
- BOOST_CHECK_THROW(config.parse(NO_AUTHORIZE_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
-}
-
-BOOST_AUTO_TEST_CASE(NoPrivilegesSections)
-{
- const std::string NO_PRIVILEGES_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/cert1.ndncert\"\n"
- " }\n"
- "}\n";
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
-
- BOOST_CHECK_THROW(config.parse(NO_PRIVILEGES_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
-}
-
-BOOST_AUTO_TEST_CASE(InvalidCertfile)
-{
- const std::string INVALID_CERT_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/notacertfile.ndncert\"\n"
- " privileges\n"
- " {\n"
- " fib\n"
- " stats\n"
- " }\n"
- " }\n"
- "}\n";
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
- BOOST_CHECK_THROW(config.parse(INVALID_CERT_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
-}
-
-BOOST_AUTO_TEST_CASE(NoCertfile)
-{
- const std::string NO_CERT_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " privileges\n"
- " {\n"
- " fib\n"
- " stats\n"
- " }\n"
- " }\n"
- "}\n";
-
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
- BOOST_CHECK_THROW(config.parse(NO_CERT_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
-}
-
-BOOST_AUTO_TEST_CASE(MalformedCert)
-{
- const std::string MALFORMED_CERT_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/malformed.ndncert\"\n"
- " privileges\n"
- " {\n"
- " fib\n"
- " stats\n"
- " }\n"
- " }\n"
- "}\n";
-
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
- BOOST_CHECK_THROW(config.parse(MALFORMED_CERT_CONFIG, false, CONFIG_PATH.native()), ConfigFile::Error);
-}
-
-bool
-validateErrorMessage(const std::string& expectedMessage, const ConfigFile::Error& error)
-{
- bool gotExpected = error.what() == expectedMessage;
- if (!gotExpected)
- {
- NFD_LOG_WARN("\ncaught exception: " << error.what()
- << "\n\nexpected exception: " << expectedMessage);
- }
- return gotExpected;
-}
-
-BOOST_AUTO_TEST_CASE(NoAuthorizeSectionsDryRun)
-{
- const std::string NO_AUTHORIZE_CONFIG =
- "authorizations\n"
- "{\n"
- "}\n";
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
- BOOST_CHECK_EXCEPTION(config.parse(NO_AUTHORIZE_CONFIG, true, CONFIG_PATH.native()),
- ConfigFile::Error,
- bind(&validateErrorMessage,
- "No authorize sections found", _1));
-}
-
-BOOST_FIXTURE_TEST_CASE(NoPrivilegesSectionsDryRun, TwoValidatorFixture)
-{
- const std::string NO_PRIVILEGES_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/cert1.ndncert\"\n"
- " }\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/cert2.ndncert\"\n"
- " }\n"
- "}\n";
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
-
- std::stringstream expectedError;
- expectedError << "No privileges section found for certificate file tests/daemon/mgmt/cert1.ndncert "
- << "(" << m_tester1.getPublicKeyName().toUri() << ")\n"
- << "No privileges section found for certificate file tests/daemon/mgmt/cert2.ndncert "
- << "(" << m_tester2.getPublicKeyName().toUri() << ")";
-
- BOOST_CHECK_EXCEPTION(config.parse(NO_PRIVILEGES_CONFIG, true, CONFIG_PATH.native()),
- ConfigFile::Error,
- bind(&validateErrorMessage, expectedError.str(), _1));
-}
-
-BOOST_AUTO_TEST_CASE(InvalidCertfileDryRun)
-{
- using namespace boost::filesystem;
-
- const std::string INVALID_KEY_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/notacertfile.ndncert\"\n"
- " privileges\n"
- " {\n"
- " fib\n"
- " stats\n"
- " }\n"
- " }\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/stillnotacertfile.ndncert\"\n"
- " privileges\n"
- " {\n"
- " }\n"
- " }\n"
- "}\n";
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
-
- std::stringstream error;
- error << "Unable to open certificate file "
- << absolute("tests/daemon/mgmt/notacertfile.ndncert").native() << "\n"
- << "Unable to open certificate file "
- << absolute("tests/daemon/mgmt/stillnotacertfile.ndncert").native();
-
- BOOST_CHECK_EXCEPTION(config.parse(INVALID_KEY_CONFIG, true, CONFIG_PATH.native()),
- ConfigFile::Error,
- bind(&validateErrorMessage, error.str(), _1));
-}
-
-BOOST_AUTO_TEST_CASE(NoCertfileDryRun)
-{
- const std::string NO_CERT_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " privileges\n"
- " {\n"
- " fib\n"
- " stats\n"
- " }\n"
- " }\n"
- " authorize\n"
- " {\n"
- " }\n"
- "}\n";
-
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
- BOOST_CHECK_EXCEPTION(config.parse(NO_CERT_CONFIG, true, CONFIG_PATH.native()),
- ConfigFile::Error,
- bind(&validateErrorMessage,
- "No certfile specified\n"
- "No certfile specified", _1));
-}
-
-BOOST_AUTO_TEST_CASE(MalformedCertDryRun)
-{
- using namespace boost::filesystem;
-
- const std::string MALFORMED_CERT_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/malformed.ndncert\"\n"
- " privileges\n"
- " {\n"
- " fib\n"
- " stats\n"
- " }\n"
- " }\n"
- " authorize\n"
- " {\n"
- " certfile \"tests/daemon/mgmt/malformed.ndncert\"\n"
- " }\n"
- "}\n";
-
-
- ConfigFile config;
- CommandValidator validator;
-
- validator.setConfigFile(config);
-
- std::stringstream error;
- error << "Malformed certificate file "
- << absolute("tests/daemon/mgmt/malformed.ndncert").native() << "\n"
- << "Malformed certificate file "
- << absolute("tests/daemon/mgmt/malformed.ndncert").native();
-
- BOOST_CHECK_EXCEPTION(config.parse(MALFORMED_CERT_CONFIG, true, CONFIG_PATH.native()),
- ConfigFile::Error,
- bind(&validateErrorMessage, error.str(), _1));
-}
-
-BOOST_FIXTURE_TEST_CASE(Wildcard, TwoValidatorFixture)
-{
- const std::string WILDCARD_CERT_CONFIG =
- "authorizations\n"
- "{\n"
- " authorize\n"
- " {\n"
- " certfile any\n"
- " privileges\n"
- " {\n"
- " faces\n"
- " stats\n"
- " }\n"
- " }\n"
- "}\n";
-
- shared_ptr<Interest> fibCommand = make_shared<Interest>("/localhost/nfd/fib/insert");
- shared_ptr<Interest> statsCommand = make_shared<Interest>("/localhost/nfd/stats/dosomething");
- shared_ptr<Interest> facesCommand = make_shared<Interest>("/localhost/nfd/faces/create");
-
- ndn::CommandInterestGenerator generator;
- generator.generateWithIdentity(*fibCommand, m_tester1.getIdentityName());
- generator.generateWithIdentity(*statsCommand, m_tester1.getIdentityName());
- generator.generateWithIdentity(*facesCommand, m_tester1.getIdentityName());
-
- ConfigFile config;
- CommandValidator validator;
- validator.addSupportedPrivilege("faces");
- validator.addSupportedPrivilege("fib");
- validator.addSupportedPrivilege("stats");
-
- validator.setConfigFile(config);
-
- config.parse(WILDCARD_CERT_CONFIG, false, CONFIG_PATH.native());
-
- validator.validate(*fibCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
-
- BOOST_REQUIRE(m_tester1.commandValidationFailed());
- m_tester1.resetValidation();
-
- validator.validate(*statsCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
-
- BOOST_REQUIRE(m_tester1.commandValidated());
- m_tester1.resetValidation();
-
- validator.validate(*facesCommand,
- bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
- bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
-
- BOOST_REQUIRE(m_tester1.commandValidated());
- m_tester1.resetValidation();
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/face-manager.cpp b/NFD/tests/daemon/mgmt/face-manager.cpp
deleted file mode 100644
index 047f00c..0000000
--- a/NFD/tests/daemon/mgmt/face-manager.cpp
+++ /dev/null
@@ -1,1859 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/face-manager.hpp"
-#include "mgmt/internal-face.hpp"
-#include "mgmt/face-status-publisher.hpp"
-
-#include "face/face.hpp"
-#include "../face/dummy-face.hpp"
-#include "fw/face-table.hpp"
-#include "fw/forwarder.hpp"
-#include "face/udp-factory.hpp"
-
-#ifdef HAVE_LIBPCAP
-#include "face/ethernet-factory.hpp"
-#endif // HAVE_LIBPCAP
-
-#include "common.hpp"
-#include "tests/test-common.hpp"
-#include "validation-common.hpp"
-#include "face-status-publisher-common.hpp"
-#include "face-query-status-publisher-common.hpp"
-#include "channel-status-common.hpp"
-
-#include <ndn-cxx/encoding/tlv.hpp>
-#include <ndn-cxx/management/nfd-face-event-notification.hpp>
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("FaceManagerTest");
-
-class FaceManagerTestFace : public DummyFace
-{
-public:
-
- FaceManagerTestFace()
- : m_closeFired(false)
- {
-
- }
-
- virtual
- ~FaceManagerTestFace()
- {
-
- }
-
- virtual void
- close()
- {
- m_closeFired = true;
- }
-
- bool
- didCloseFire() const
- {
- return m_closeFired;
- }
-
-private:
- bool m_closeFired;
-};
-
-class TestFaceTable : public FaceTable
-{
-public:
- TestFaceTable(Forwarder& forwarder)
- : FaceTable(forwarder),
- m_addFired(false),
- m_getFired(false),
- m_dummy(make_shared<FaceManagerTestFace>())
- {
-
- }
-
- virtual
- ~TestFaceTable()
- {
-
- }
-
- virtual void
- add(shared_ptr<Face> face)
- {
- m_addFired = true;
- }
-
- virtual shared_ptr<Face>
- get(FaceId id) const
- {
- m_getFired = true;
- return m_dummy;
- }
-
- bool
- didAddFire() const
- {
- return m_addFired;
- }
-
- bool
- didGetFire() const
- {
- return m_getFired;
- }
-
- void
- reset()
- {
- m_addFired = false;
- m_getFired = false;
- }
-
- shared_ptr<FaceManagerTestFace>&
- getDummyFace()
- {
- return m_dummy;
- }
-
-private:
- bool m_addFired;
- mutable bool m_getFired;
- shared_ptr<FaceManagerTestFace> m_dummy;
-};
-
-
-class TestFaceTableFixture : public BaseFixture
-{
-public:
- TestFaceTableFixture()
- : m_faceTable(m_forwarder)
- {
-
- }
-
- virtual
- ~TestFaceTableFixture()
- {
-
- }
-
-protected:
- Forwarder m_forwarder;
- TestFaceTable m_faceTable;
-};
-
-class TestFaceManagerCommon
-{
-public:
- TestFaceManagerCommon()
- : m_face(make_shared<InternalFace>()),
- m_callbackFired(false)
- {
-
- }
-
- virtual
- ~TestFaceManagerCommon()
- {
-
- }
-
- shared_ptr<InternalFace>&
- getFace()
- {
- return m_face;
- }
-
- void
- validateControlResponseCommon(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- ControlResponse& control)
- {
- m_callbackFired = true;
- Block controlRaw = response.getContent().blockFromValue();
-
- control.wireDecode(controlRaw);
-
- // NFD_LOG_DEBUG("received control response"
- // << " Name: " << response.getName()
- // << " code: " << control.getCode()
- // << " text: " << control.getText());
-
- BOOST_CHECK_EQUAL(response.getName(), expectedName);
- BOOST_CHECK_EQUAL(control.getCode(), expectedCode);
- BOOST_CHECK_EQUAL(control.getText(), expectedText);
- }
-
- void
- validateControlResponse(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText)
- {
- ControlResponse control;
- validateControlResponseCommon(response, expectedName,
- expectedCode, expectedText, control);
-
- if (!control.getBody().empty())
- {
- BOOST_FAIL("found unexpected control response body");
- }
- }
-
- void
- validateControlResponse(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- const Block& expectedBody)
- {
- ControlResponse control;
- validateControlResponseCommon(response, expectedName,
- expectedCode, expectedText, control);
-
- BOOST_REQUIRE(!control.getBody().empty());
- BOOST_REQUIRE(control.getBody().value_size() == expectedBody.value_size());
-
- BOOST_CHECK(memcmp(control.getBody().value(), expectedBody.value(),
- expectedBody.value_size()) == 0);
-
- }
-
- bool
- didCallbackFire() const
- {
- return m_callbackFired;
- }
-
- void
- resetCallbackFired()
- {
- m_callbackFired = false;
- }
-
-protected:
- shared_ptr<InternalFace> m_face;
- bool m_callbackFired;
- ndn::KeyChain m_testKeyChain;
-};
-
-class FaceManagerFixture : public TestFaceTableFixture, public TestFaceManagerCommon
-{
-public:
- FaceManagerFixture()
- : m_manager(m_faceTable, m_face, m_testKeyChain)
- {
- m_manager.setConfigFile(m_config);
- }
-
- virtual
- ~FaceManagerFixture()
- {
-
- }
-
- void
- parseConfig(const std::string configuration, bool isDryRun)
- {
- m_config.parse(configuration, isDryRun, "dummy-config");
- }
-
- FaceManager&
- getManager()
- {
- return m_manager;
- }
-
- void
- addInterestRule(const std::string& regex,
- ndn::IdentityCertificate& certificate)
- {
- m_manager.addInterestRule(regex, certificate);
- }
-
- bool
- didFaceTableAddFire() const
- {
- return m_faceTable.didAddFire();
- }
-
- bool
- didFaceTableGetFire() const
- {
- return m_faceTable.didGetFire();
- }
-
- void
- resetFaceTable()
- {
- m_faceTable.reset();
- }
-
-protected:
- FaceManager m_manager;
- ConfigFile m_config;
-};
-
-BOOST_FIXTURE_TEST_SUITE(MgmtFaceManager, FaceManagerFixture)
-
-bool
-isExpectedException(const ConfigFile::Error& error, const std::string& expectedMessage)
-{
- if (error.what() != expectedMessage)
- {
- NFD_LOG_ERROR("expected: " << expectedMessage << "\tgot: " << error.what());
- }
- return error.what() == expectedMessage;
-}
-
-#ifdef HAVE_UNIX_SOCKETS
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUnix)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " unix\n"
- " {\n"
- " path /tmp/nfd.sock\n"
- " }\n"
- "}\n";
- BOOST_TEST_CHECKPOINT("Calling parse");
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG, false));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUnixDryRun)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " unix\n"
- " {\n"
- " path /var/run/nfd.sock\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG, true));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUnixUnknownOption)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " unix\n"
- " {\n"
- " hello\n"
- " }\n"
- "}\n";
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Unrecognized option \"hello\" in \"unix\" section"));
-}
-
-#endif // HAVE_UNIX_SOCKETS
-
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionTcp)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " tcp\n"
- " {\n"
- " listen yes\n"
- " port 6363\n"
- " enable_v4 yes\n"
- " enable_v6 yes\n"
- " }\n"
- "}\n";
- try
- {
- parseConfig(CONFIG, false);
- }
- catch (const std::runtime_error& e)
- {
- const std::string reason = e.what();
- if (reason.find("Address in use") != std::string::npos)
- {
- BOOST_FAIL(reason);
- }
- }
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionTcpDryRun)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " tcp\n"
- " {\n"
- " listen yes\n"
- " port 6363\n"
- " enable_v4 yes\n"
- " enable_v6 yes\n"
- " }\n"
- "}\n";
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG, true));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionTcpBadListen)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " tcp\n"
- " {\n"
- " listen hello\n"
- " }\n"
- "}\n";
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Invalid value for option \"listen\" in \"tcp\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionTcpChannelsDisabled)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " tcp\n"
- " {\n"
- " port 6363\n"
- " enable_v4 no\n"
- " enable_v6 no\n"
- " }\n"
- "}\n";
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "IPv4 and IPv6 channels have been disabled."
- " Remove \"tcp\" section to disable TCP channels or"
- " re-enable at least one channel type."));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionTcpUnknownOption)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " tcp\n"
- " {\n"
- " hello\n"
- " }\n"
- "}\n";
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Unrecognized option \"hello\" in \"tcp\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdp)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " port 6363\n"
- " enable_v4 yes\n"
- " enable_v6 yes\n"
- " idle_timeout 30\n"
- " keep_alive_interval 25\n"
- " mcast yes\n"
- " mcast_port 56363\n"
- " mcast_group 224.0.23.170\n"
- " }\n"
- "}\n";
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG, false));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpDryRun)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " port 6363\n"
- " idle_timeout 30\n"
- " keep_alive_interval 25\n"
- " mcast yes\n"
- " mcast_port 56363\n"
- " mcast_group 224.0.23.170\n"
- " }\n"
- "}\n";
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG, true));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpBadIdleTimeout)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " idle_timeout hello\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Invalid value for option \"idle_timeout\" in \"udp\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpBadMcast)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " mcast hello\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Invalid value for option \"mcast\" in \"udp\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpBadMcastGroup)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " mcast no\n"
- " mcast_port 50\n"
- " mcast_group hello\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Invalid value for option \"mcast_group\" in \"udp\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpBadMcastGroupV6)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " mcast no\n"
- " mcast_port 50\n"
- " mcast_group ::1\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Invalid value for option \"mcast_group\" in \"udp\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpChannelsDisabled)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " port 6363\n"
- " enable_v4 no\n"
- " enable_v6 no\n"
- " idle_timeout 30\n"
- " keep_alive_interval 25\n"
- " mcast yes\n"
- " mcast_port 56363\n"
- " mcast_group 224.0.23.170\n"
- " }\n"
- "}\n";
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "IPv4 and IPv6 channels have been disabled."
- " Remove \"udp\" section to disable UDP channels or"
- " re-enable at least one channel type."));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpConflictingMcast)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " port 6363\n"
- " enable_v4 no\n"
- " enable_v6 yes\n"
- " idle_timeout 30\n"
- " keep_alive_interval 25\n"
- " mcast yes\n"
- " mcast_port 56363\n"
- " mcast_group 224.0.23.170\n"
- " }\n"
- "}\n";
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "IPv4 multicast requested, but IPv4 channels"
- " have been disabled (conflicting configuration options set)"));
-}
-
-
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpUnknownOption)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " hello\n"
- " }\n"
- "}\n";
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Unrecognized option \"hello\" in \"udp\" section"));
-}
-
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionUdpMulticastReinit)
-{
- const std::string CONFIG_WITH_MCAST =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " mcast yes\n"
- " }\n"
- "}\n";
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG_WITH_MCAST, false));
-
- shared_ptr<UdpFactory> factory = static_pointer_cast<UdpFactory>(getManager().findFactory("udp"));
- BOOST_REQUIRE(static_cast<bool>(factory));
-
- if (factory->getMulticastFaces().size() == 0) {
- BOOST_TEST_MESSAGE("Destroying multicast faces is not tested because "
- "no UDP multicast faces are available");
- }
-
- const std::string CONFIG_WITHOUT_MCAST =
- "face_system\n"
- "{\n"
- " udp\n"
- " {\n"
- " mcast no\n"
- " }\n"
- "}\n";
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG_WITHOUT_MCAST, false));
- BOOST_CHECK_EQUAL(factory->getMulticastFaces().size(), 0);
-}
-
-
-#ifdef HAVE_LIBPCAP
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionEther)
-{
-
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " ether\n"
- " {\n"
- " mcast yes\n"
- " mcast_group 01:00:5E:00:17:AA\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG, false));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionEtherDryRun)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " ether\n"
- " {\n"
- " mcast yes\n"
- " mcast_group 01:00:5E:00:17:AA\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG, true));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionEtherBadMcast)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " ether\n"
- " {\n"
- " mcast hello\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Invalid value for option \"mcast\" in \"ether\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionEtherBadMcastGroup)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " ether\n"
- " {\n"
- " mcast yes\n"
- " mcast_group\n"
- " }\n"
- "}\n";
-
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Invalid value for option \"mcast_group\" in \"ether\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionEtherUnknownOption)
-{
- const std::string CONFIG =
- "face_system\n"
- "{\n"
- " ether\n"
- " {\n"
- " hello\n"
- " }\n"
- "}\n";
- BOOST_CHECK_EXCEPTION(parseConfig(CONFIG, false), ConfigFile::Error,
- bind(&isExpectedException, _1,
- "Unrecognized option \"hello\" in \"ether\" section"));
-}
-
-BOOST_AUTO_TEST_CASE(TestProcessSectionEtherMulticastReinit)
-{
- const std::string CONFIG_WITH_MCAST =
- "face_system\n"
- "{\n"
- " ether\n"
- " {\n"
- " mcast yes\n"
- " }\n"
- "}\n";
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG_WITH_MCAST, false));
-
- shared_ptr<EthernetFactory> factory =
- static_pointer_cast<EthernetFactory>(getManager().findFactory("ether"));
- BOOST_REQUIRE(static_cast<bool>(factory));
-
- if (factory->getMulticastFaces().size() == 0) {
- BOOST_TEST_MESSAGE("Destroying multicast faces is not tested because "
- "no Ethernet multicast faces are available");
- }
-
- const std::string CONFIG_WITHOUT_MCAST =
- "face_system\n"
- "{\n"
- " ether\n"
- " {\n"
- " mcast no\n"
- " }\n"
- "}\n";
- BOOST_CHECK_NO_THROW(parseConfig(CONFIG_WITHOUT_MCAST, false));
- BOOST_CHECK_EQUAL(factory->getMulticastFaces().size(), 0);
-}
-
-#endif // HAVE_LIBPCAP
-
-BOOST_AUTO_TEST_CASE(ShortName)
-{
- shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/faces"));
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getFace()->sendInterest(*command);
- g_io.run_one();
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(MalformedCommmand)
-{
- shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/faces"));
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getManager().onFaceRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(UnsignedCommand)
-{
- ControlParameters parameters;
- parameters.setUri("tcp4://127.0.0.1:6363");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 401, "Signature required");
- };
-
- getManager().onFaceRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(UnauthorizedCommand, UnauthorizedCommandFixture<FaceManagerFixture>)
-{
- ControlParameters parameters;
- parameters.setUri("tcp4://127.0.0.1:6363");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 403, "Unauthorized command");
- };
-
- getManager().onFaceRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-template <typename T> class AuthorizedCommandFixture : public CommandFixture<T>
-{
-public:
- AuthorizedCommandFixture()
- {
- const std::string regex = "^<localhost><nfd><faces>";
- T::addInterestRule(regex, *CommandFixture<T>::m_certificate);
- }
-
- virtual
- ~AuthorizedCommandFixture()
- {
-
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(UnsupportedCommand, AuthorizedCommandFixture<FaceManagerFixture>)
-{
- ControlParameters parameters;
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("unsupported");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 501, "Unsupported command");
- };
-
- getManager().onFaceRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-class ValidatedFaceRequestFixture : public TestFaceTableFixture,
- public TestFaceManagerCommon,
- public FaceManager
-{
-public:
-
- ValidatedFaceRequestFixture()
- : FaceManager(TestFaceTableFixture::m_faceTable, TestFaceManagerCommon::m_face, m_testKeyChain),
- m_createFaceFired(false),
- m_destroyFaceFired(false)
- {
-
- }
-
- virtual void
- createFace(const Interest& request,
- ControlParameters& parameters)
- {
- m_createFaceFired = true;
- }
-
- virtual void
- destroyFace(const Interest& request,
- ControlParameters& parameters)
- {
- m_destroyFaceFired = true;
- }
-
- virtual
- ~ValidatedFaceRequestFixture()
- {
-
- }
-
- bool
- didCreateFaceFire() const
- {
- return m_createFaceFired;
- }
-
- bool
- didDestroyFaceFire() const
- {
- return m_destroyFaceFired;
- }
-
-private:
- bool m_createFaceFired;
- bool m_destroyFaceFired;
-};
-
-BOOST_FIXTURE_TEST_CASE(ValidatedFaceRequestBadOptionParse,
- AuthorizedCommandFixture<ValidatedFaceRequestFixture>)
-{
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append("NotReallyParameters");
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- onValidatedFaceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(ValidatedFaceRequestCreateFace,
- AuthorizedCommandFixture<ValidatedFaceRequestFixture>)
-{
- ControlParameters parameters;
- parameters.setUri("tcp4://127.0.0.1:6363");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- onValidatedFaceRequest(command);
- BOOST_CHECK(didCreateFaceFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(ValidatedFaceRequestDestroyFace,
- AuthorizedCommandFixture<ValidatedFaceRequestFixture>)
-{
- ControlParameters parameters;
- parameters.setUri("tcp4://127.0.0.1:6363");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("destroy");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- onValidatedFaceRequest(command);
- BOOST_CHECK(didDestroyFaceFire());
-}
-
-class FaceTableFixture
-{
-public:
- FaceTableFixture()
- : m_faceTable(m_forwarder)
- {
- }
-
- virtual
- ~FaceTableFixture()
- {
- }
-
-protected:
- Forwarder m_forwarder;
- FaceTable m_faceTable;
-};
-
-class LocalControlFixture : public FaceTableFixture,
- public TestFaceManagerCommon,
- public FaceManager
-{
-public:
- LocalControlFixture()
- : FaceManager(FaceTableFixture::m_faceTable, TestFaceManagerCommon::m_face, m_testKeyChain)
- {
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(LocalControlInFaceId,
- AuthorizedCommandFixture<LocalControlFixture>)
-{
- shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
- BOOST_REQUIRE(dummy->isLocal());
- FaceTableFixture::m_faceTable.add(dummy);
-
- ControlParameters parameters;
- parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name enable("/localhost/nfd/faces/enable-local-control");
- enable.append(encodedParameters);
-
- shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
- enableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*enableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData +=
- [this, enableCommand, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, enableCommand->getName(),
- 200, "Success", encodedParameters);
- };
-
- onValidatedFaceRequest(enableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
-
- TestFaceManagerCommon::m_face->onReceiveData.clear();
- resetCallbackFired();
-
- Name disable("/localhost/nfd/faces/disable-local-control");
- disable.append(encodedParameters);
-
- shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
- disableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*disableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData +=
- [this, disableCommand, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, disableCommand->getName(),
- 200, "Success", encodedParameters);
- };
-
- onValidatedFaceRequest(disableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
-}
-
-BOOST_FIXTURE_TEST_CASE(LocalControlInFaceIdFaceNotFound,
- AuthorizedCommandFixture<LocalControlFixture>)
-{
- shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
- BOOST_REQUIRE(dummy->isLocal());
- FaceTableFixture::m_faceTable.add(dummy);
-
- ControlParameters parameters;
- parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name enable("/localhost/nfd/faces/enable-local-control");
- enable.append(encodedParameters);
-
- shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
- enableCommand->setIncomingFaceId(dummy->getId() + 100);
-
- generateCommand(*enableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, enableCommand] (const Data& response) {
- this->validateControlResponse(response, enableCommand->getName(), 410, "Face not found");
- };
-
- onValidatedFaceRequest(enableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
-
- TestFaceManagerCommon::m_face->onReceiveData.clear();
- resetCallbackFired();
-
- Name disable("/localhost/nfd/faces/disable-local-control");
- disable.append(encodedParameters);
-
- shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
- disableCommand->setIncomingFaceId(dummy->getId() + 100);
-
- generateCommand(*disableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, disableCommand] (const Data& response) {
- this->validateControlResponse(response, disableCommand->getName(), 410, "Face not found");
- };
-
- onValidatedFaceRequest(disableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
-}
-
-BOOST_FIXTURE_TEST_CASE(LocalControlMissingFeature,
- AuthorizedCommandFixture<LocalControlFixture>)
-{
- shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
- BOOST_REQUIRE(dummy->isLocal());
- FaceTableFixture::m_faceTable.add(dummy);
-
- ControlParameters parameters;
-
- Block encodedParameters(parameters.wireEncode());
-
- Name enable("/localhost/nfd/faces/enable-local-control");
- enable.append(encodedParameters);
-
- shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
- enableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*enableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, enableCommand] (const Data& response) {
- this->validateControlResponse(response, enableCommand->getName(), 400, "Malformed command");
- };
-
- onValidatedFaceRequest(enableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
-
- TestFaceManagerCommon::m_face->onReceiveData.clear();
- resetCallbackFired();
-
- Name disable("/localhost/nfd/faces/disable-local-control");
- disable.append(encodedParameters);
-
- shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
- disableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*disableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, disableCommand] (const Data& response) {
- this->validateControlResponse(response, disableCommand->getName(), 400, "Malformed command");
- };
-
- onValidatedFaceRequest(disableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
-}
-
-BOOST_FIXTURE_TEST_CASE(LocalControlInFaceIdNonLocal,
- AuthorizedCommandFixture<LocalControlFixture>)
-{
- shared_ptr<DummyFace> dummy = make_shared<DummyFace>();
- BOOST_REQUIRE(!dummy->isLocal());
- FaceTableFixture::m_faceTable.add(dummy);
-
- ControlParameters parameters;
- parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name enable("/localhost/nfd/faces/enable-local-control");
- enable.append(encodedParameters);
-
- shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
- enableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*enableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, enableCommand] (const Data& response) {
- this->validateControlResponse(response, enableCommand->getName(), 412, "Face is non-local");
- };
-
- onValidatedFaceRequest(enableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
-
- TestFaceManagerCommon::m_face->onReceiveData.clear();
- resetCallbackFired();
-
- Name disable("/localhost/nfd/faces/disable-local-control");
- enable.append(encodedParameters);
-
- shared_ptr<Interest> disableCommand(make_shared<Interest>(enable));
- disableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*disableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, disableCommand] (const Data& response) {
- this->validateControlResponse(response, disableCommand->getName(), 412, "Face is non-local");
- };
-
- onValidatedFaceRequest(disableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(LocalControlNextHopFaceId,
- AuthorizedCommandFixture<LocalControlFixture>)
-{
- shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
- BOOST_REQUIRE(dummy->isLocal());
- FaceTableFixture::m_faceTable.add(dummy);
-
- ControlParameters parameters;
- parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name enable("/localhost/nfd/faces/enable-local-control");
- enable.append(encodedParameters);
-
- shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
- enableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*enableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData +=
- [this, enableCommand, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, enableCommand->getName(),
- 200, "Success", encodedParameters);
- };
-
- onValidatedFaceRequest(enableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
- BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
-
-
- TestFaceManagerCommon::m_face->onReceiveData.clear();
- resetCallbackFired();
-
- Name disable("/localhost/nfd/faces/disable-local-control");
- disable.append(encodedParameters);
-
- shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
- disableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*disableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData +=
- [this, disableCommand, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, disableCommand->getName(),
- 200, "Success", encodedParameters);
- };
-
- onValidatedFaceRequest(disableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
- BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
-}
-
-BOOST_FIXTURE_TEST_CASE(LocalControlNextHopFaceIdFaceNotFound,
- AuthorizedCommandFixture<LocalControlFixture>)
-{
- shared_ptr<LocalFace> dummy = make_shared<DummyLocalFace>();
- BOOST_REQUIRE(dummy->isLocal());
- FaceTableFixture::m_faceTable.add(dummy);
-
- ControlParameters parameters;
- parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name enable("/localhost/nfd/faces/enable-local-control");
- enable.append(encodedParameters);
-
- shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
- enableCommand->setIncomingFaceId(dummy->getId() + 100);
-
- generateCommand(*enableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, enableCommand] (const Data& response) {
- this->validateControlResponse(response, enableCommand->getName(), 410, "Face not found");
- };
-
- onValidatedFaceRequest(enableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
- BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
-
-
- TestFaceManagerCommon::m_face->onReceiveData.clear();
- resetCallbackFired();
-
- Name disable("/localhost/nfd/faces/disable-local-control");
- disable.append(encodedParameters);
-
- shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
- disableCommand->setIncomingFaceId(dummy->getId() + 100);
-
- generateCommand(*disableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, disableCommand] (const Data& response) {
- this->validateControlResponse(response, disableCommand->getName(), 410, "Face not found");
- };
-
- onValidatedFaceRequest(disableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
- BOOST_CHECK(!dummy->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID));
-}
-
-BOOST_FIXTURE_TEST_CASE(LocalControlNextHopFaceIdNonLocal,
- AuthorizedCommandFixture<LocalControlFixture>)
-{
- shared_ptr<DummyFace> dummy = make_shared<DummyFace>();
- BOOST_REQUIRE(!dummy->isLocal());
- FaceTableFixture::m_faceTable.add(dummy);
-
- ControlParameters parameters;
- parameters.setLocalControlFeature(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name enable("/localhost/nfd/faces/enable-local-control");
- enable.append(encodedParameters);
-
- shared_ptr<Interest> enableCommand(make_shared<Interest>(enable));
- enableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*enableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, enableCommand] (const Data& response) {
- this->validateControlResponse(response, enableCommand->getName(), 412, "Face is non-local");
- };
-
- onValidatedFaceRequest(enableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
-
- TestFaceManagerCommon::m_face->onReceiveData.clear();
- resetCallbackFired();
-
- Name disable("/localhost/nfd/faces/disable-local-control");
- disable.append(encodedParameters);
-
- shared_ptr<Interest> disableCommand(make_shared<Interest>(disable));
- disableCommand->setIncomingFaceId(dummy->getId());
-
- generateCommand(*disableCommand);
-
- TestFaceManagerCommon::m_face->onReceiveData += [this, disableCommand] (const Data& response) {
- this->validateControlResponse(response, disableCommand->getName(), 412, "Face is non-local");
- };
-
- onValidatedFaceRequest(disableCommand);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-class FaceFixture : public FaceTableFixture,
- public TestFaceManagerCommon,
- public FaceManager
-{
-public:
- FaceFixture()
- : FaceManager(FaceTableFixture::m_faceTable,
- TestFaceManagerCommon::m_face,
- m_testKeyChain)
- , m_receivedNotification(false)
- {
-
- }
-
- virtual
- ~FaceFixture()
- {
-
- }
-
- void
- callbackDispatch(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- const Block& expectedBody,
- const ndn::nfd::FaceEventNotification& expectedFaceEvent)
- {
- Block payload = response.getContent().blockFromValue();
- if (payload.type() == ndn::tlv::nfd::ControlResponse)
- {
- validateControlResponse(response, expectedName, expectedCode,
- expectedText, expectedBody);
- }
- else if (payload.type() == ndn::tlv::nfd::FaceEventNotification)
- {
- validateFaceEvent(payload, expectedFaceEvent);
- }
- else
- {
- BOOST_FAIL("Received unknown message type: #" << payload.type());
- }
- }
-
- void
- callbackDispatch(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- const ndn::nfd::FaceEventNotification& expectedFaceEvent)
- {
- Block payload = response.getContent().blockFromValue();
- if (payload.type() == ndn::tlv::nfd::ControlResponse)
- {
- validateControlResponse(response, expectedName,
- expectedCode, expectedText);
- }
- else if (payload.type() == ndn::tlv::nfd::FaceEventNotification)
- {
- validateFaceEvent(payload, expectedFaceEvent);
- }
- else
- {
- BOOST_FAIL("Received unknown message type: #" << payload.type());
- }
- }
-
- void
- validateFaceEvent(const Block& wire,
- const ndn::nfd::FaceEventNotification& expectedFaceEvent)
- {
-
- m_receivedNotification = true;
-
- ndn::nfd::FaceEventNotification notification(wire);
-
- BOOST_CHECK_EQUAL(notification.getKind(), expectedFaceEvent.getKind());
- BOOST_CHECK_EQUAL(notification.getFaceId(), expectedFaceEvent.getFaceId());
- BOOST_CHECK_EQUAL(notification.getRemoteUri(), expectedFaceEvent.getRemoteUri());
- BOOST_CHECK_EQUAL(notification.getLocalUri(), expectedFaceEvent.getLocalUri());
- BOOST_CHECK_EQUAL(notification.getFaceScope(), expectedFaceEvent.getFaceScope());
- BOOST_CHECK_EQUAL(notification.getFacePersistency(), expectedFaceEvent.getFacePersistency());
- BOOST_CHECK_EQUAL(notification.getLinkType(), expectedFaceEvent.getLinkType());
- }
-
- bool
- didReceiveNotication() const
- {
- return m_receivedNotification;
- }
-
-protected:
- bool m_receivedNotification;
-};
-
-BOOST_FIXTURE_TEST_CASE(CreateFaceBadUri, AuthorizedCommandFixture<FaceFixture>)
-{
- ControlParameters parameters;
- parameters.setUri("tcp4:/127.0.0.1:6363");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- createFace(*command, parameters);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-BOOST_FIXTURE_TEST_CASE(CreateFaceNoncanonicalUri, AuthorizedCommandFixture<FaceFixture>)
-{
- ControlParameters parameters;
- parameters.setUri("tcp://127.0.0.1");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Non-canonical URI");
- };
-
- createFace(*command, parameters);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(CreateFaceMissingUri, AuthorizedCommandFixture<FaceFixture>)
-{
- ControlParameters parameters;
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- createFace(*command, parameters);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(CreateFaceUnknownScheme, AuthorizedCommandFixture<FaceFixture>)
-{
- ControlParameters parameters;
- // this will be an unsupported protocol because no factories have been
- // added to the face manager
- parameters.setUri("tcp4://127.0.0.1:6363");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 501, "Unsupported protocol");
- };
-
- createFace(*command, parameters);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(OnCreated, AuthorizedCommandFixture<FaceFixture>)
-{
- ControlParameters parameters;
- parameters.setUri("tcp4://127.0.0.1:6363");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- ControlParameters resultParameters;
- resultParameters.setUri("dummy://");
- resultParameters.setFaceId(FACEID_RESERVED_MAX + 1);
-
- shared_ptr<DummyFace> dummy(make_shared<DummyFace>());
-
- ndn::nfd::FaceEventNotification expectedFaceEvent;
- expectedFaceEvent.setKind(ndn::nfd::FACE_EVENT_CREATED)
- .setFaceId(FACEID_RESERVED_MAX + 1)
- .setRemoteUri(dummy->getRemoteUri().toString())
- .setLocalUri(dummy->getLocalUri().toString())
- .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
- .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
-
- Block encodedResultParameters(resultParameters.wireEncode());
-
- getFace()->onReceiveData +=
- [this, command, encodedResultParameters, expectedFaceEvent] (const Data& response) {
- this->callbackDispatch(response,command->getName(), 200, "Success",
- encodedResultParameters, expectedFaceEvent);
- };
-
- onCreated(command->getName(), parameters, dummy);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(didReceiveNotication());
-}
-
-BOOST_FIXTURE_TEST_CASE(OnConnectFailed, AuthorizedCommandFixture<FaceFixture>)
-{
- ControlParameters parameters;
- parameters.setUri("tcp4://127.0.0.1:6363");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("create");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 408, "unit-test-reason");
- };
-
- onConnectFailed(command->getName(), "unit-test-reason");
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_CHECK_EQUAL(didReceiveNotication(), false);
-}
-
-
-BOOST_FIXTURE_TEST_CASE(DestroyFace, AuthorizedCommandFixture<FaceFixture>)
-{
- shared_ptr<DummyFace> dummy(make_shared<DummyFace>());
- FaceTableFixture::m_faceTable.add(dummy);
-
- ControlParameters parameters;
- parameters.setFaceId(dummy->getId());
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/faces");
- commandName.append("destroy");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- ndn::nfd::FaceEventNotification expectedFaceEvent;
- expectedFaceEvent.setKind(ndn::nfd::FACE_EVENT_DESTROYED)
- .setFaceId(dummy->getId())
- .setRemoteUri(dummy->getRemoteUri().toString())
- .setLocalUri(dummy->getLocalUri().toString())
- .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
- .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
-
- getFace()->onReceiveData +=
- [this, command, encodedParameters, expectedFaceEvent] (const Data& response) {
- this->callbackDispatch(response,command->getName(), 200, "Success",
- encodedParameters, expectedFaceEvent);
- };
-
- destroyFace(*command, parameters);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(didReceiveNotication());
-}
-
-class FaceListFixture : public FaceStatusPublisherFixture
-{
-public:
- FaceListFixture()
- : m_manager(m_table, m_face, m_testKeyChain)
- {
-
- }
-
- virtual
- ~FaceListFixture()
- {
-
- }
-
-protected:
- FaceManager m_manager;
- ndn::KeyChain m_testKeyChain;
-};
-
-BOOST_FIXTURE_TEST_CASE(TestFaceList, FaceListFixture)
-{
- Name commandName("/localhost/nfd/faces/list");
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- // MAX_SEGMENT_SIZE == 4400, FaceStatus size with filler counters is 75
- // use 59 FaceStatuses to force a FaceStatus to span Data packets
- for (int i = 0; i < 59; i++)
- {
- shared_ptr<TestCountersFace> dummy(make_shared<TestCountersFace>());
-
- uint64_t filler = std::numeric_limits<uint64_t>::max() - 1;
- dummy->setCounters(filler, filler, filler, filler, filler, filler);
-
- m_referenceFaces.push_back(dummy);
-
- add(dummy);
- }
-
- ndn::EncodingBuffer buffer;
-
- m_face->onReceiveData +=
- bind(&FaceStatusPublisherFixture::decodeFaceStatusBlock, this, _1);
-
- m_manager.listFaces(*command);
- BOOST_REQUIRE(m_finished);
-}
-
-class ChannelStatusFixture : public FaceManagerFixture
-{
-public:
- void
- validatePublish(const Data& data, const ndn::nfd::ChannelStatus& expectedEntry)
- {
- m_callbackFired = true;
- Block b = data.getContent().blockFromValue();
- ndn::nfd::ChannelStatus entry(b);
- BOOST_CHECK_EQUAL(entry.getLocalUri(), expectedEntry.getLocalUri());
- }
-
- virtual shared_ptr<DummyProtocolFactory>
- addProtocolFactory(const std::string& protocol)
- {
- shared_ptr<DummyProtocolFactory> factory(make_shared<DummyProtocolFactory>());
- m_manager.m_factories[protocol] = factory;
-
- return factory;
- }
-};
-
-BOOST_FIXTURE_TEST_CASE(TestChannelStatus, ChannelStatusFixture)
-{
- shared_ptr<DummyProtocolFactory> factory(addProtocolFactory("dummy"));
- factory->addChannel("dummy://");
-
- Name requestName("/localhost/nfd/faces/channels");
- shared_ptr<Interest> request(make_shared<Interest>(requestName));
-
- ndn::nfd::ChannelStatus expectedEntry;
- expectedEntry.setLocalUri(DummyChannel("dummy://").getUri().toString());
-
- m_face->onReceiveData +=
- bind(&ChannelStatusFixture::validatePublish, this, _1, expectedEntry);
-
- m_manager.listChannels(*request);
- BOOST_REQUIRE(m_callbackFired);
-}
-
-class FaceQueryListFixture : public FaceQueryStatusPublisherFixture
-{
-public:
- FaceQueryListFixture()
- : m_manager(m_table, m_face, m_testKeyChain)
- {
-
- }
-
- virtual
- ~FaceQueryListFixture()
- {
-
- }
-
-protected:
- FaceManager m_manager;
- ndn::KeyChain m_testKeyChain;
-};
-
-BOOST_FIXTURE_TEST_CASE(TestValidQueryFilter, FaceQueryListFixture)
-{
- Name queryName("/localhost/nfd/faces/query");
- ndn::nfd::FaceQueryFilter queryFilter;
- queryFilter.setUriScheme("dummy");
- queryName.append(queryFilter.wireEncode());
-
- shared_ptr<Interest> query(make_shared<Interest>(queryName));
-
- // add expected faces
- shared_ptr<DummyLocalFace> expectedFace1(make_shared<DummyLocalFace>());
- m_referenceFaces.push_back(expectedFace1);
- add(expectedFace1);
-
- shared_ptr<DummyFace> expectedFace2(make_shared<DummyFace>());
- m_referenceFaces.push_back(expectedFace2);
- add(expectedFace2);
-
- // add other faces
- shared_ptr<DummyFace> face1(make_shared<DummyFace>("udp://", "udp://"));
- add(face1);
- shared_ptr<DummyLocalFace> face2(make_shared<DummyLocalFace>("tcp://", "tcp://"));
- add(face2);
-
- m_face->onReceiveData +=
- bind(&FaceQueryStatusPublisherFixture::decodeFaceStatusBlock, this, _1);
-
- m_manager.listQueriedFaces(*query);
- BOOST_REQUIRE(m_finished);
-}
-
-BOOST_FIXTURE_TEST_CASE(TestInvalidQueryFilter, FaceQueryListFixture)
-{
- Name queryName("/localhost/nfd/faces/query");
- ndn::nfd::FaceStatus queryFilter;
- queryName.append(queryFilter.wireEncode());
-
- shared_ptr<Interest> query(make_shared<Interest>(queryName));
-
- shared_ptr<DummyLocalFace> face(make_shared<DummyLocalFace>());
- add(face);
-
- m_face->onReceiveData +=
- bind(&FaceQueryStatusPublisherFixture::decodeNackBlock, this, _1);
-
- m_manager.listQueriedFaces(*query);
- BOOST_REQUIRE(m_finished);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/face-query-status-publisher-common.hpp b/NFD/tests/daemon/mgmt/face-query-status-publisher-common.hpp
deleted file mode 100644
index a274c52..0000000
--- a/NFD/tests/daemon/mgmt/face-query-status-publisher-common.hpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
-#define NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
-
-#include "mgmt/face-query-status-publisher.hpp"
-#include "mgmt/app-face.hpp"
-#include "mgmt/internal-face.hpp"
-#include "fw/forwarder.hpp"
-#include "face/udp-factory.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include <ndn-cxx/management/nfd-face-status.hpp>
-
-namespace nfd {
-namespace tests {
-
-class FaceQueryStatusPublisherFixture : public BaseFixture
-{
-public:
-
- FaceQueryStatusPublisherFixture()
- : m_table(m_forwarder)
- , m_face(make_shared<InternalFace>())
- , m_dummyFace(make_shared<DummyFace>())
- , m_dummyLocalFace(make_shared<DummyLocalFace>())
- , m_dummyUri(make_shared<DummyFace>("dummy://remoteUri", "dummy://localUri"))
- , m_factory(UdpFactory())
- , m_finished(false)
- {
- }
-
- virtual
- ~FaceQueryStatusPublisherFixture()
- {
- }
-
- void
- add(shared_ptr<Face> face)
- {
- m_table.add(face);
- }
-
- void
- validateFaceStatus(const Block& statusBlock, const shared_ptr<Face>& reference)
- {
- ndn::nfd::FaceStatus status;
- BOOST_REQUIRE_NO_THROW(status.wireDecode(statusBlock));
-
- BOOST_CHECK_EQUAL(status.getFaceId(), reference->getId());
- BOOST_CHECK_EQUAL(status.getRemoteUri(), reference->getRemoteUri().toString());
- BOOST_CHECK_EQUAL(status.getLocalUri(), reference->getLocalUri().toString());
-
- if (reference->isLocal()) {
- BOOST_CHECK_EQUAL(status.getFaceScope(), ndn::nfd::FACE_SCOPE_LOCAL);
- }
- else {
- BOOST_CHECK_EQUAL(status.getFaceScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
- }
-
- if (reference->isOnDemand()) {
- BOOST_CHECK_EQUAL(status.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
- }
- else {
- BOOST_CHECK_EQUAL(status.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
- }
-
- if (reference->isMultiAccess()) {
- BOOST_CHECK_EQUAL(status.getLinkType(), ndn::nfd::LINK_TYPE_MULTI_ACCESS);
- }
- else {
- BOOST_CHECK_EQUAL(status.getLinkType(), ndn::nfd::LINK_TYPE_POINT_TO_POINT);
- }
- }
-
- void
- decodeFaceStatusBlock(const Data& data)
- {
- BOOST_REQUIRE_EQUAL(data.getContentType(), tlv::ContentType_Blob);
-
- Block payload = data.getContent();
- m_buffer.appendByteArray(payload.value(), payload.value_size());
-
- BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
- if (data.getFinalBlockId() != data.getName()[-1]) {
- return;
- }
-
- // wrap the Face Statuses in a single Content TLV for easy parsing
- m_buffer.prependVarNumber(m_buffer.size());
- m_buffer.prependVarNumber(tlv::Content);
-
- ndn::Block parser(m_buffer.buf(), m_buffer.size());
- parser.parse();
-
- BOOST_REQUIRE_EQUAL(parser.elements_size(), m_referenceFaces.size());
-
- std::list<shared_ptr<Face> >::const_iterator iReference = m_referenceFaces.begin();
- for (Block::element_const_iterator i = parser.elements_begin();
- i != parser.elements_end();
- ++i) {
- if (i->type() != ndn::tlv::nfd::FaceStatus) {
- BOOST_FAIL("expected face status, got type #" << i->type());
- }
- validateFaceStatus(*i, *iReference);
- ++iReference;
- }
- m_finished = true;
- }
-
- void
- decodeNackBlock(const Data& data)
- {
- BOOST_REQUIRE_EQUAL(data.getContentType(), tlv::ContentType_Nack);
-
- m_finished = true;
- }
-
-protected:
- Forwarder m_forwarder;
- FaceTable m_table;
- shared_ptr<InternalFace> m_face;
- ndn::EncodingBuffer m_buffer;
- std::list<shared_ptr<Face> > m_referenceFaces;
- ndn::KeyChain m_keyChain;
- shared_ptr<DummyFace> m_dummyFace;
- shared_ptr<DummyLocalFace> m_dummyLocalFace;
- shared_ptr<DummyFace> m_dummyUri;
- UdpFactory m_factory;
-
-protected:
- bool m_finished;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_NFD_MGMT_FACE_QUERY_STATUS_PUBLISHER_COMMON_HPP
diff --git a/NFD/tests/daemon/mgmt/face-query-status-publisher.cpp b/NFD/tests/daemon/mgmt/face-query-status-publisher.cpp
deleted file mode 100644
index 948ee88..0000000
--- a/NFD/tests/daemon/mgmt/face-query-status-publisher.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face-query-status-publisher-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("FaceQueryStatusPublisherTest");
-
-BOOST_FIXTURE_TEST_SUITE(MgmtFaceQuerySatusPublisher, FaceQueryStatusPublisherFixture)
-
-BOOST_AUTO_TEST_CASE(NoConditionFilter)
-{
- // filter without conditions matches all faces
- ndn::nfd::FaceQueryFilter filter;
- FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
- "/localhost/nfd/FaceStatusPublisherFixture",
- filter, m_keyChain);
-
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), true);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyLocalFace), true);
-}
-
-BOOST_AUTO_TEST_CASE(AllConditionFilter)
-{
- ndn::nfd::FaceQueryFilter filter;
- filter.setUriScheme("dummy")
- .setRemoteUri("dummy://")
- .setLocalUri("dummy://")
- .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
- .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
- .setLinkType(ndn::nfd::LINK_TYPE_POINT_TO_POINT);
-
- FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
- "/localhost/nfd/FaceStatusPublisherFixture",
- filter, m_keyChain);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), true);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyLocalFace), false);
-}
-
-BOOST_AUTO_TEST_CASE(UriSchemeFilter)
-{
- ndn::nfd::FaceQueryFilter filter;
- filter.setUriScheme("dummyurischeme");
- FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
- "/localhost/nfd/FaceStatusPublisherFixture",
- filter, m_keyChain);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
- auto dummyUriScheme = make_shared<DummyFace>("dummyurischeme://", "dummyurischeme://");
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(dummyUriScheme), true);
-}
-
-BOOST_AUTO_TEST_CASE(RemoteUriFilter)
-{
- ndn::nfd::FaceQueryFilter filter;
- filter.setRemoteUri("dummy://remoteUri");
- FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
- "/localhost/nfd/FaceStatusPublisherFixture",
- filter, m_keyChain);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyUri), true);
-}
-
-BOOST_AUTO_TEST_CASE(LocalUriFilter)
-{
- ndn::nfd::FaceQueryFilter filter;
- filter.setLocalUri("dummy://localUri");
- FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
- "/localhost/nfd/FaceStatusPublisherFixture",
- filter, m_keyChain);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyUri), true);
-}
-
-
-BOOST_AUTO_TEST_CASE(LinkTypeFilter)
-{
- shared_ptr<MulticastUdpFace> multicastFace = m_factory.createMulticastFace("0.0.0.0",
- "224.0.0.1",
- "20070");
- ndn::nfd::FaceQueryFilter filter;
- filter.setLinkType(ndn::nfd::LINK_TYPE_MULTI_ACCESS);
- FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
- "/localhost/nfd/FaceStatusPublisherFixture",
- filter, m_keyChain);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(multicastFace), true);
-}
-
-BOOST_AUTO_TEST_CASE(PersistencyFilter)
-{
- shared_ptr<MulticastUdpFace> multicastFace = m_factory.createMulticastFace("0.0.0.0",
- "224.0.0.1",
- "20070");
- ndn::nfd::FaceQueryFilter filter;
- filter.setFacePersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
- FaceQueryStatusPublisher faceQueryStatusPublisher(m_table, *m_face,
- "/localhost/nfd/FaceStatusPublisherFixture",
- filter, m_keyChain);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(m_dummyFace), false);
- multicastFace->setOnDemand(true);
- BOOST_CHECK_EQUAL(faceQueryStatusPublisher.doesMatchFilter(multicastFace), true);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/face-status-publisher-common.hpp b/NFD/tests/daemon/mgmt/face-status-publisher-common.hpp
deleted file mode 100644
index 11f4913..0000000
--- a/NFD/tests/daemon/mgmt/face-status-publisher-common.hpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_NFD_MGMT_FACE_STATUS_PUBLISHER_COMMON_HPP
-#define NFD_TESTS_NFD_MGMT_FACE_STATUS_PUBLISHER_COMMON_HPP
-
-#include "mgmt/face-status-publisher.hpp"
-#include "mgmt/app-face.hpp"
-#include "mgmt/internal-face.hpp"
-#include "fw/forwarder.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include <ndn-cxx/management/nfd-face-status.hpp>
-
-namespace nfd {
-namespace tests {
-
-class TestCountersFace : public DummyFace
-{
-public:
-
- TestCountersFace()
- {
- }
-
- virtual
- ~TestCountersFace()
- {
- }
-
- void
- setCounters(PacketCounter::rep nInInterests,
- PacketCounter::rep nInDatas,
- PacketCounter::rep nOutInterests,
- PacketCounter::rep nOutDatas,
- ByteCounter::rep nInBytes,
- ByteCounter::rep nOutBytes)
- {
- FaceCounters& counters = getMutableCounters();
- counters.getNInInterests().set(nInInterests);
- counters.getNInDatas().set(nInDatas);
- counters.getNOutInterests().set(nOutInterests);
- counters.getNOutDatas().set(nOutDatas);
- counters.getNInBytes().set(nInBytes);
- counters.getNOutBytes().set(nOutBytes);
- }
-
-
-};
-
-static inline uint64_t
-readNonNegativeIntegerType(const Block& block,
- uint32_t type)
-{
- if (block.type() == type)
- {
- return readNonNegativeInteger(block);
- }
- std::stringstream error;
- error << "expected type " << type << " got " << block.type();
- throw tlv::Error(error.str());
-}
-
-static inline uint64_t
-checkedReadNonNegativeIntegerType(Block::element_const_iterator& i,
- Block::element_const_iterator end,
- uint32_t type)
-{
- if (i != end)
- {
- const Block& block = *i;
- ++i;
- return readNonNegativeIntegerType(block, type);
- }
- throw tlv::Error("Unexpected end of FaceStatus");
-}
-
-class FaceStatusPublisherFixture : public BaseFixture
-{
-public:
-
- FaceStatusPublisherFixture()
- : m_table(m_forwarder)
- , m_face(make_shared<InternalFace>())
- , m_publisher(m_table, *m_face, "/localhost/nfd/FaceStatusPublisherFixture", m_keyChain)
- , m_finished(false)
- {
-
- }
-
- virtual
- ~FaceStatusPublisherFixture()
- {
-
- }
-
- void
- add(shared_ptr<Face> face)
- {
- m_table.add(face);
- }
-
- void
- validateFaceStatus(const Block& statusBlock, const shared_ptr<Face>& reference)
- {
- ndn::nfd::FaceStatus status;
- BOOST_REQUIRE_NO_THROW(status.wireDecode(statusBlock));
- const FaceCounters& counters = reference->getCounters();
-
- BOOST_CHECK_EQUAL(status.getFaceId(), reference->getId());
- BOOST_CHECK_EQUAL(status.getRemoteUri(), reference->getRemoteUri().toString());
- BOOST_CHECK_EQUAL(status.getLocalUri(), reference->getLocalUri().toString());
-
- if (reference->isLocal()) {
- BOOST_CHECK_EQUAL(status.getFaceScope(), ndn::nfd::FACE_SCOPE_LOCAL);
- }
- else {
- BOOST_CHECK_EQUAL(status.getFaceScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
- }
-
- if (reference->isOnDemand()) {
- BOOST_CHECK_EQUAL(status.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
- }
- else {
- BOOST_CHECK_EQUAL(status.getFacePersistency(), ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
- }
-
- if (reference->isMultiAccess()) {
- BOOST_CHECK_EQUAL(status.getLinkType(), ndn::nfd::LINK_TYPE_MULTI_ACCESS);
- }
- else {
- BOOST_CHECK_EQUAL(status.getLinkType(), ndn::nfd::LINK_TYPE_POINT_TO_POINT);
- }
-
- BOOST_CHECK_EQUAL(status.getNInInterests(), counters.getNInInterests());
- BOOST_CHECK_EQUAL(status.getNInDatas(), counters.getNInDatas());
- BOOST_CHECK_EQUAL(status.getNOutInterests(), counters.getNOutInterests());
- BOOST_CHECK_EQUAL(status.getNOutDatas(), counters.getNOutDatas());
- BOOST_CHECK_EQUAL(status.getNInBytes(), counters.getNInBytes());
- BOOST_CHECK_EQUAL(status.getNOutBytes(), counters.getNOutBytes());
- }
-
- void
- decodeFaceStatusBlock(const Data& data)
- {
- Block payload = data.getContent();
-
- m_buffer.appendByteArray(payload.value(), payload.value_size());
-
- BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
- if (data.getFinalBlockId() != data.getName()[-1])
- {
- return;
- }
-
- // wrap the Face Statuses in a single Content TLV for easy parsing
- m_buffer.prependVarNumber(m_buffer.size());
- m_buffer.prependVarNumber(tlv::Content);
-
- ndn::Block parser(m_buffer.buf(), m_buffer.size());
- parser.parse();
-
- BOOST_REQUIRE_EQUAL(parser.elements_size(), m_referenceFaces.size());
-
- std::list<shared_ptr<Face> >::const_iterator iReference = m_referenceFaces.begin();
- for (Block::element_const_iterator i = parser.elements_begin();
- i != parser.elements_end();
- ++i)
- {
- if (i->type() != ndn::tlv::nfd::FaceStatus)
- {
- BOOST_FAIL("expected face status, got type #" << i->type());
- }
- validateFaceStatus(*i, *iReference);
- ++iReference;
- }
- m_finished = true;
- }
-
-protected:
- Forwarder m_forwarder;
- FaceTable m_table;
- shared_ptr<InternalFace> m_face;
- FaceStatusPublisher m_publisher;
- ndn::EncodingBuffer m_buffer;
- std::list<shared_ptr<Face> > m_referenceFaces;
- ndn::KeyChain m_keyChain;
-
-protected:
- bool m_finished;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_NFD_MGMT_FACE_STATUS_PUBLISHER_COMMON_HPP
diff --git a/NFD/tests/daemon/mgmt/face-status-publisher.cpp b/NFD/tests/daemon/mgmt/face-status-publisher.cpp
deleted file mode 100644
index 145fe0e..0000000
--- a/NFD/tests/daemon/mgmt/face-status-publisher.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "face-status-publisher-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("FaceStatusPublisherTest");
-
-BOOST_FIXTURE_TEST_SUITE(MgmtFaceSatusPublisher, FaceStatusPublisherFixture)
-
-BOOST_AUTO_TEST_CASE(EncodingDecoding)
-{
- Name commandName("/localhost/nfd/faces/list");
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- // MAX_SEGMENT_SIZE == 4400, FaceStatus size with filler counters is 75
- // use 59 FaceStatuses to force a FaceStatus to span Data packets
- for (int i = 0; i < 59; i++)
- {
- shared_ptr<TestCountersFace> dummy(make_shared<TestCountersFace>());
-
- uint64_t filler = std::numeric_limits<uint64_t>::max() - 1;
- dummy->setCounters(filler, filler, filler, filler, filler, filler);
-
- m_referenceFaces.push_back(dummy);
-
- add(dummy);
- }
-
- ndn::EncodingBuffer buffer;
-
- m_face->onReceiveData +=
- bind(&FaceStatusPublisherFixture::decodeFaceStatusBlock, this, _1);
-
- m_publisher.publish();
- BOOST_REQUIRE(m_finished);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp b/NFD/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
deleted file mode 100644
index cbb7280..0000000
--- a/NFD/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_NFD_MGMT_FIB_ENUMERATION_PUBLISHER_COMMON_HPP
-#define NFD_TESTS_NFD_MGMT_FIB_ENUMERATION_PUBLISHER_COMMON_HPP
-
-#include "mgmt/fib-enumeration-publisher.hpp"
-
-#include "mgmt/app-face.hpp"
-#include "mgmt/internal-face.hpp"
-#include "table/fib.hpp"
-#include "table/name-tree.hpp"
-
-#include "tests/test-common.hpp"
-#include "../face/dummy-face.hpp"
-
-#include <ndn-cxx/encoding/tlv.hpp>
-
-namespace nfd {
-namespace tests {
-
-static inline uint64_t
-readNonNegativeIntegerType(const Block& block,
- uint32_t type)
-{
- if (block.type() == type)
- {
- return readNonNegativeInteger(block);
- }
- std::stringstream error;
- error << "Expected type " << type << " got " << block.type();
- throw tlv::Error(error.str());
-}
-
-static inline uint64_t
-checkedReadNonNegativeIntegerType(Block::element_const_iterator& i,
- Block::element_const_iterator end,
- uint32_t type)
-{
- if (i != end)
- {
- const Block& block = *i;
- ++i;
- return readNonNegativeIntegerType(block, type);
- }
- std::stringstream error;
- error << "Unexpected end of Block while attempting to read type #"
- << type;
- throw tlv::Error(error.str());
-}
-
-class FibEnumerationPublisherFixture : public BaseFixture
-{
-public:
-
- FibEnumerationPublisherFixture()
- : m_fib(m_nameTree)
- , m_face(make_shared<InternalFace>())
- , m_publisher(m_fib, *m_face, "/localhost/nfd/FibEnumerationPublisherFixture", m_keyChain)
- , m_finished(false)
- {
- }
-
- virtual
- ~FibEnumerationPublisherFixture()
- {
- }
-
- bool
- hasNextHopWithCost(const fib::NextHopList& nextHops,
- FaceId faceId,
- uint64_t cost)
- {
- for (fib::NextHopList::const_iterator i = nextHops.begin();
- i != nextHops.end();
- ++i)
- {
- if (i->getFace()->getId() == faceId && i->getCost() == cost)
- {
- return true;
- }
- }
- return false;
- }
-
- bool
- entryHasPrefix(const shared_ptr<fib::Entry> entry, const Name& prefix)
- {
- return entry->getPrefix() == prefix;
- }
-
- void
- validateFibEntry(const Block& entry)
- {
- entry.parse();
-
- Block::element_const_iterator i = entry.elements_begin();
- BOOST_REQUIRE(i != entry.elements_end());
-
-
- BOOST_REQUIRE(i->type() == tlv::Name);
- Name prefix(*i);
- ++i;
-
- std::set<shared_ptr<fib::Entry> >::const_iterator referenceIter =
- std::find_if(m_referenceEntries.begin(), m_referenceEntries.end(),
- bind(&FibEnumerationPublisherFixture::entryHasPrefix,
- this, _1, prefix));
-
- BOOST_REQUIRE(referenceIter != m_referenceEntries.end());
-
- const shared_ptr<fib::Entry>& reference = *referenceIter;
- BOOST_REQUIRE_EQUAL(prefix, reference->getPrefix());
-
- // 0 or more next hop records
- size_t nRecords = 0;
- const fib::NextHopList& referenceNextHops = reference->getNextHops();
- for (; i != entry.elements_end(); ++i)
- {
- const ndn::Block& nextHopRecord = *i;
- BOOST_REQUIRE(nextHopRecord.type() == ndn::tlv::nfd::NextHopRecord);
- nextHopRecord.parse();
-
- Block::element_const_iterator j = nextHopRecord.elements_begin();
-
- FaceId faceId =
- checkedReadNonNegativeIntegerType(j,
- entry.elements_end(),
- ndn::tlv::nfd::FaceId);
-
- uint64_t cost =
- checkedReadNonNegativeIntegerType(j,
- entry.elements_end(),
- ndn::tlv::nfd::Cost);
-
- BOOST_REQUIRE(hasNextHopWithCost(referenceNextHops, faceId, cost));
-
- BOOST_REQUIRE(j == nextHopRecord.elements_end());
- nRecords++;
- }
- BOOST_REQUIRE_EQUAL(nRecords, referenceNextHops.size());
-
- BOOST_REQUIRE(i == entry.elements_end());
- m_referenceEntries.erase(referenceIter);
- }
-
- void
- decodeFibEntryBlock(const Data& data)
- {
- Block payload = data.getContent();
-
- m_buffer.appendByteArray(payload.value(), payload.value_size());
-
- BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
- if (data.getFinalBlockId() != data.getName()[-1])
- {
- return;
- }
-
- // wrap the FIB Entry blocks in a single Content TLV for easy parsing
- m_buffer.prependVarNumber(m_buffer.size());
- m_buffer.prependVarNumber(tlv::Content);
-
- ndn::Block parser(m_buffer.buf(), m_buffer.size());
- parser.parse();
-
- BOOST_REQUIRE_EQUAL(parser.elements_size(), m_referenceEntries.size());
-
- for (Block::element_const_iterator i = parser.elements_begin();
- i != parser.elements_end();
- ++i)
- {
- if (i->type() != ndn::tlv::nfd::FibEntry)
- {
- BOOST_FAIL("expected fib entry, got type #" << i->type());
- }
-
- validateFibEntry(*i);
- }
- m_finished = true;
- }
-
-protected:
- NameTree m_nameTree;
- Fib m_fib;
- shared_ptr<InternalFace> m_face;
- FibEnumerationPublisher m_publisher;
- ndn::EncodingBuffer m_buffer;
- std::set<shared_ptr<fib::Entry> > m_referenceEntries;
- ndn::KeyChain m_keyChain;
-
-protected:
- bool m_finished;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_NFD_MGMT_FIB_ENUMERATION_PUBLISHER_COMMON_HPP
diff --git a/NFD/tests/daemon/mgmt/fib-enumeration-publisher.cpp b/NFD/tests/daemon/mgmt/fib-enumeration-publisher.cpp
deleted file mode 100644
index ed330aa..0000000
--- a/NFD/tests/daemon/mgmt/fib-enumeration-publisher.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/fib-enumeration-publisher.hpp"
-
-#include "mgmt/app-face.hpp"
-#include "mgmt/internal-face.hpp"
-
-#include "tests/test-common.hpp"
-#include "../face/dummy-face.hpp"
-
-#include "fib-enumeration-publisher-common.hpp"
-
-#include <ndn-cxx/encoding/tlv.hpp>
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("TestFibEnumerationPublisher");
-
-
-
-BOOST_FIXTURE_TEST_SUITE(MgmtFibEnumeration, FibEnumerationPublisherFixture)
-
-BOOST_AUTO_TEST_CASE(TestFibEnumerationPublisher)
-{
- for (int i = 0; i < 87; i++)
- {
- Name prefix("/test");
- prefix.appendSegment(i);
-
- shared_ptr<DummyFace> dummy1(make_shared<DummyFace>());
- shared_ptr<DummyFace> dummy2(make_shared<DummyFace>());
-
- shared_ptr<fib::Entry> entry = m_fib.insert(prefix).first;
- entry->addNextHop(dummy1, std::numeric_limits<uint64_t>::max() - 1);
- entry->addNextHop(dummy2, std::numeric_limits<uint64_t>::max() - 2);
-
- m_referenceEntries.insert(entry);
- }
- for (int i = 0; i < 2; i++)
- {
- Name prefix("/test2");
- prefix.appendSegment(i);
-
- shared_ptr<DummyFace> dummy1(make_shared<DummyFace>());
- shared_ptr<DummyFace> dummy2(make_shared<DummyFace>());
-
- shared_ptr<fib::Entry> entry = m_fib.insert(prefix).first;
- entry->addNextHop(dummy1, std::numeric_limits<uint8_t>::max() - 1);
- entry->addNextHop(dummy2, std::numeric_limits<uint8_t>::max() - 2);
-
- m_referenceEntries.insert(entry);
- }
-
- ndn::EncodingBuffer buffer;
-
- m_face->onReceiveData +=
- bind(&FibEnumerationPublisherFixture::decodeFibEntryBlock, this, _1);
-
- m_publisher.publish();
- BOOST_REQUIRE(m_finished);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/fib-manager.cpp b/NFD/tests/daemon/mgmt/fib-manager.cpp
deleted file mode 100644
index 525dfc8..0000000
--- a/NFD/tests/daemon/mgmt/fib-manager.cpp
+++ /dev/null
@@ -1,920 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/fib-manager.hpp"
-#include "table/fib.hpp"
-#include "table/fib-nexthop.hpp"
-#include "face/face.hpp"
-#include "mgmt/internal-face.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include "validation-common.hpp"
-#include "tests/test-common.hpp"
-
-#include "fib-enumeration-publisher-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("FibManagerTest");
-
-class FibManagerFixture : public FibEnumerationPublisherFixture
-{
-public:
-
- virtual
- ~FibManagerFixture()
- {
- }
-
- shared_ptr<Face>
- getFace(FaceId id)
- {
- if (id > 0 && static_cast<size_t>(id) <= m_faces.size())
- {
- return m_faces[id - 1];
- }
- NFD_LOG_DEBUG("No face found returning NULL");
- return shared_ptr<DummyFace>();
- }
-
- void
- addFace(shared_ptr<Face> face)
- {
- m_faces.push_back(face);
- }
-
- void
- validateControlResponseCommon(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- ControlResponse& control)
- {
- m_callbackFired = true;
- Block controlRaw = response.getContent().blockFromValue();
-
- control.wireDecode(controlRaw);
-
- // NFD_LOG_DEBUG("received control response"
- // << " Name: " << response.getName()
- // << " code: " << control.getCode()
- // << " text: " << control.getText());
-
- BOOST_CHECK_EQUAL(response.getName(), expectedName);
- BOOST_CHECK_EQUAL(control.getCode(), expectedCode);
- BOOST_CHECK_EQUAL(control.getText(), expectedText);
- }
-
- void
- validateControlResponse(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText)
- {
- ControlResponse control;
- validateControlResponseCommon(response, expectedName,
- expectedCode, expectedText, control);
-
- if (!control.getBody().empty())
- {
- BOOST_FAIL("found unexpected control response body");
- }
- }
-
- void
- validateControlResponse(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- const Block& expectedBody)
- {
- ControlResponse control;
- validateControlResponseCommon(response, expectedName,
- expectedCode, expectedText, control);
-
- BOOST_REQUIRE(!control.getBody().empty());
- BOOST_REQUIRE_EQUAL(control.getBody().value_size(), expectedBody.value_size());
-
- BOOST_CHECK(memcmp(control.getBody().value(), expectedBody.value(),
- expectedBody.value_size()) == 0);
-
- }
-
- bool
- didCallbackFire()
- {
- return m_callbackFired;
- }
-
- void
- resetCallbackFired()
- {
- m_callbackFired = false;
- }
-
- shared_ptr<InternalFace>
- getInternalFace()
- {
- return m_face;
- }
-
- FibManager&
- getFibManager()
- {
- return m_manager;
- }
-
- Fib&
- getFib()
- {
- return m_fib;
- }
-
- void
- addInterestRule(const std::string& regex,
- ndn::IdentityCertificate& certificate)
- {
- m_manager.addInterestRule(regex, certificate);
- }
-
-protected:
- FibManagerFixture()
- : m_manager(ref(m_fib), bind(&FibManagerFixture::getFace, this, _1), m_face, m_keyChain)
- , m_callbackFired(false)
- {
- }
-
-protected:
- FibManager m_manager;
-
- std::vector<shared_ptr<Face> > m_faces;
- bool m_callbackFired;
- ndn::KeyChain m_keyChain;
-};
-
-template <typename T>
-class AuthorizedCommandFixture : public CommandFixture<T>
-{
-public:
- AuthorizedCommandFixture()
- {
- const std::string regex = "^<localhost><nfd><fib>";
- T::addInterestRule(regex, *CommandFixture<T>::m_certificate);
- }
-
- virtual
- ~AuthorizedCommandFixture()
- {
- }
-};
-
-BOOST_FIXTURE_TEST_SUITE(MgmtFibManager, AuthorizedCommandFixture<FibManagerFixture>)
-
-bool
-foundNextHop(FaceId id, uint32_t cost, const fib::NextHop& next)
-{
- return id == next.getFace()->getId() && next.getCost() == cost;
-}
-
-bool
-addedNextHopWithCost(const Fib& fib, const Name& prefix, size_t oldSize, uint32_t cost)
-{
- shared_ptr<fib::Entry> entry = fib.findExactMatch(prefix);
-
- if (static_cast<bool>(entry))
- {
- const fib::NextHopList& hops = entry->getNextHops();
- return hops.size() == oldSize + 1 &&
- std::find_if(hops.begin(), hops.end(), bind(&foundNextHop, -1, cost, _1)) != hops.end();
- }
- return false;
-}
-
-bool
-foundNextHopWithFace(FaceId id, uint32_t cost,
- shared_ptr<Face> face, const fib::NextHop& next)
-{
- return id == next.getFace()->getId() && next.getCost() == cost && face == next.getFace();
-}
-
-bool
-addedNextHopWithFace(const Fib& fib, const Name& prefix, size_t oldSize,
- uint32_t cost, shared_ptr<Face> face)
-{
- shared_ptr<fib::Entry> entry = fib.findExactMatch(prefix);
-
- if (static_cast<bool>(entry))
- {
- const fib::NextHopList& hops = entry->getNextHops();
- return hops.size() == oldSize + 1 &&
- std::find_if(hops.begin(), hops.end(), bind(&foundNextHop, -1, cost, _1)) != hops.end();
- }
- return false;
-}
-
-BOOST_AUTO_TEST_CASE(ShortName)
-{
- shared_ptr<InternalFace> face = getInternalFace();
-
- shared_ptr<Interest> command = makeInterest("/localhost/nfd/fib");
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- face->sendInterest(*command);
- g_io.run_one();
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(MalformedCommmand)
-{
- shared_ptr<InternalFace> face = getInternalFace();
-
- BOOST_REQUIRE(didCallbackFire() == false);
-
- Interest command("/localhost/nfd/fib");
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command.getName(), 400, "Malformed command");
- };
-
- getFibManager().onFibRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(UnsupportedVerb)
-{
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
- parameters.setCost(1);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("unsupported");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 501, "Unsupported command");
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(UnsignedCommand)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
- parameters.setCost(101);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- Interest command(commandName);
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command.getName(), 401, "Signature required");
- };
-
- getFibManager().onFibRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!addedNextHopWithCost(getFib(), "/hello", 0, 101));
-}
-
-BOOST_FIXTURE_TEST_CASE(UnauthorizedCommand, UnauthorizedCommandFixture<FibManagerFixture>)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
- parameters.setCost(101);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 403, "Unauthorized command");
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(!addedNextHopWithCost(getFib(), "/hello", 0, 101));
-}
-
-BOOST_AUTO_TEST_CASE(BadOptionParse)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append("NotReallyParameters");
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(UnknownFaceId)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1000);
- parameters.setCost(101);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 410, "Face not found");
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(addedNextHopWithCost(getFib(), "/hello", 0, 101) == false);
-}
-
-BOOST_AUTO_TEST_CASE(AddNextHopVerbImplicitFaceId)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- std::vector<ControlParameters> testedParameters;
- testedParameters.push_back(ControlParameters().setName("/hello").setCost(101).setFaceId(0));
- testedParameters.push_back(ControlParameters().setName("/hello").setCost(101));
-
- for (std::vector<ControlParameters>::iterator parameters = testedParameters.begin();
- parameters != testedParameters.end(); ++parameters) {
-
- Block encodedParameters(parameters->wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- ControlParameters expectedParameters;
- expectedParameters.setName("/hello");
- expectedParameters.setFaceId(1);
- expectedParameters.setCost(101);
-
- Block encodedExpectedParameters(expectedParameters.wireEncode());
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- command->setIncomingFaceId(1);
- generateCommand(*command);
-
- face->onReceiveData += [this, command, encodedExpectedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedExpectedParameters);
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(addedNextHopWithFace(getFib(), "/hello", 0, 101, getFace(1)));
-
- face->onReceiveData.clear();
- getFib().erase("/hello");
- BOOST_REQUIRE_EQUAL(getFib().size(), 0);
- }
-}
-
-BOOST_AUTO_TEST_CASE(AddNextHopVerbInitialAdd)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
- parameters.setCost(101);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(addedNextHopWithCost(getFib(), "/hello", 0, 101));
-}
-
-BOOST_AUTO_TEST_CASE(AddNextHopVerbImplicitCost)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- ControlParameters resultParameters;
- resultParameters.setName("/hello");
- resultParameters.setFaceId(1);
- resultParameters.setCost(0);
-
- face->onReceiveData += [this, command, resultParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", resultParameters.wireEncode());
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
- BOOST_REQUIRE(addedNextHopWithCost(getFib(), "/hello", 0, 0));
-}
-
-BOOST_AUTO_TEST_CASE(AddNextHopVerbAddToExisting)
-{
- addFace(make_shared<DummyFace>());
- shared_ptr<InternalFace> face = getInternalFace();
-
- for (int i = 1; i <= 2; i++)
- {
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
- parameters.setCost(100 + i);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getFibManager().onFibRequest(*command);
- BOOST_REQUIRE(didCallbackFire());
- resetCallbackFired();
-
- shared_ptr<fib::Entry> entry = getFib().findExactMatch("/hello");
-
- if (static_cast<bool>(entry))
- {
- const fib::NextHopList& hops = entry->getNextHops();
- BOOST_REQUIRE(hops.size() == 1);
- BOOST_REQUIRE(std::find_if(hops.begin(), hops.end(),
- bind(&foundNextHop, -1, 100 + i, _1)) != hops.end());
-
- }
- else
- {
- BOOST_FAIL("Failed to find expected fib entry");
- }
-
- face->onReceiveData.clear();
- }
-}
-
-BOOST_AUTO_TEST_CASE(AddNextHopVerbUpdateFaceCost)
-{
- addFace(make_shared<DummyFace>());
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
-
- {
- parameters.setCost(1);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
- }
-
- resetCallbackFired();
- face->onReceiveData.clear();
-
- {
- parameters.setCost(102);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
- }
-
- shared_ptr<fib::Entry> entry = getFib().findExactMatch("/hello");
-
- // Add faces with cost == FaceID for the name /hello
- // This test assumes:
- // FaceIDs are -1 because we don't add them to a forwarder
- if (static_cast<bool>(entry))
- {
- const fib::NextHopList& hops = entry->getNextHops();
- BOOST_REQUIRE(hops.size() == 1);
- BOOST_REQUIRE(std::find_if(hops.begin(),
- hops.end(),
- bind(&foundNextHop, -1, 102, _1)) != hops.end());
- }
- else
- {
- BOOST_FAIL("Failed to find expected fib entry");
- }
-}
-
-BOOST_AUTO_TEST_CASE(AddNextHopVerbMissingPrefix)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setFaceId(1);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("add-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-bool
-removedNextHopWithCost(const Fib& fib, const Name& prefix, size_t oldSize, uint32_t cost)
-{
- shared_ptr<fib::Entry> entry = fib.findExactMatch(prefix);
-
- if (static_cast<bool>(entry))
- {
- const fib::NextHopList& hops = entry->getNextHops();
- return hops.size() == oldSize - 1 &&
- std::find_if(hops.begin(), hops.end(), bind(&foundNextHop, -1, cost, _1)) == hops.end();
- }
- return false;
-}
-
-void
-testRemoveNextHop(CommandFixture<FibManagerFixture>* fixture,
- FibManager& manager,
- Fib& fib,
- shared_ptr<Face> face,
- const Name& targetName,
- FaceId targetFace)
-{
- ControlParameters parameters;
- parameters.setName(targetName);
- parameters.setFaceId(targetFace);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("remove-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- fixture->generateCommand(*command);
-
- face->onReceiveData += [fixture, command, encodedParameters] (const Data& response) {
- fixture->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- manager.onFibRequest(*command);
-
- BOOST_REQUIRE(fixture->didCallbackFire());
-
- fixture->resetCallbackFired();
- face->onReceiveData.clear();
-}
-
-BOOST_AUTO_TEST_CASE(RemoveNextHop)
-{
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
- shared_ptr<Face> face3 = make_shared<DummyFace>();
-
- addFace(face1);
- addFace(face2);
- addFace(face3);
-
- shared_ptr<InternalFace> face = getInternalFace();
- FibManager& manager = getFibManager();
- Fib& fib = getFib();
-
- shared_ptr<fib::Entry> entry = fib.insert("/hello").first;
-
- entry->addNextHop(face1, 101);
- entry->addNextHop(face2, 202);
- entry->addNextHop(face3, 303);
-
- testRemoveNextHop(this, manager, fib, face, "/hello", 2);
- BOOST_REQUIRE(removedNextHopWithCost(fib, "/hello", 3, 202));
-
- testRemoveNextHop(this, manager, fib, face, "/hello", 3);
- BOOST_REQUIRE(removedNextHopWithCost(fib, "/hello", 2, 303));
-
- testRemoveNextHop(this, manager, fib, face, "/hello", 1);
- // BOOST_REQUIRE(removedNextHopWithCost(fib, "/hello", 1, 101));
-
- BOOST_CHECK(!static_cast<bool>(getFib().findExactMatch("/hello")));
-}
-
-BOOST_AUTO_TEST_CASE(RemoveFaceNotFound)
-{
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("remove-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(RemovePrefixNotFound)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setName("/hello");
- parameters.setFaceId(1);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("remove-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(RemoveMissingPrefix)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- ControlParameters parameters;
- parameters.setFaceId(1);
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("remove-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- face->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(RemoveImplicitFaceId)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face = getInternalFace();
-
- std::vector<ControlParameters> testedParameters;
- testedParameters.push_back(ControlParameters().setName("/hello").setFaceId(0));
- testedParameters.push_back(ControlParameters().setName("/hello"));
-
- for (std::vector<ControlParameters>::iterator parameters = testedParameters.begin();
- parameters != testedParameters.end(); ++parameters) {
- Block encodedParameters(parameters->wireEncode());
-
- Name commandName("/localhost/nfd/fib");
- commandName.append("remove-nexthop");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- command->setIncomingFaceId(1);
- generateCommand(*command);
-
- ControlParameters resultParameters;
- resultParameters.setFaceId(1);
- resultParameters.setName("/hello");
-
- face->onReceiveData += [this, command, resultParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", resultParameters.wireEncode());
- };
-
- getFibManager().onFibRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-
- face->onReceiveData.clear();
- }
-}
-
-BOOST_FIXTURE_TEST_CASE(TestFibEnumerationRequest, FibManagerFixture)
-{
- for (int i = 0; i < 87; i++)
- {
- Name prefix("/test");
- prefix.appendSegment(i);
-
- shared_ptr<DummyFace> dummy1(make_shared<DummyFace>());
- shared_ptr<DummyFace> dummy2(make_shared<DummyFace>());
-
- shared_ptr<fib::Entry> entry = m_fib.insert(prefix).first;
- entry->addNextHop(dummy1, std::numeric_limits<uint64_t>::max() - 1);
- entry->addNextHop(dummy2, std::numeric_limits<uint64_t>::max() - 2);
-
- m_referenceEntries.insert(entry);
- }
- for (int i = 0; i < 2; i++)
- {
- Name prefix("/test2");
- prefix.appendSegment(i);
-
- shared_ptr<DummyFace> dummy1(make_shared<DummyFace>());
- shared_ptr<DummyFace> dummy2(make_shared<DummyFace>());
-
- shared_ptr<fib::Entry> entry = m_fib.insert(prefix).first;
- entry->addNextHop(dummy1, std::numeric_limits<uint8_t>::max() - 1);
- entry->addNextHop(dummy2, std::numeric_limits<uint8_t>::max() - 2);
-
- m_referenceEntries.insert(entry);
- }
-
- ndn::EncodingBuffer buffer;
-
- m_face->onReceiveData +=
- bind(&FibEnumerationPublisherFixture::decodeFibEntryBlock, this, _1);
-
- shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/fib/list"));
-
- m_manager.onFibRequest(*command);
- BOOST_REQUIRE(m_finished);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/general-config-section.cpp b/NFD/tests/daemon/mgmt/general-config-section.cpp
deleted file mode 100644
index 29e5e7a..0000000
--- a/NFD/tests/daemon/mgmt/general-config-section.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/general-config-section.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(MgmtGeneralConfigSection, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(UserAndGroupConfig)
-{
- const std::string CONFIG =
- "general\n"
- "{\n"
- " user nobody\n"
- " group nogroup\n"
- "}\n";
-
- ConfigFile configFile;
-
- general::setConfigFile(configFile);
- BOOST_CHECK_NO_THROW(configFile.parse(CONFIG, true, "test-general-config-section"));
-
-}
-
-BOOST_AUTO_TEST_CASE(DefaultConfig)
-{
- const std::string CONFIG =
- "general\n"
- "{\n"
- "}\n";
-
- ConfigFile configFile;
-
- general::setConfigFile(configFile);
- BOOST_CHECK_NO_THROW(configFile.parse(CONFIG, true, "test-general-config-section"));
-}
-
-BOOST_AUTO_TEST_CASE(NoUserConfig)
-{
- const std::string CONFIG =
- "general\n"
- "{\n"
- " group nogroup\n"
- "}\n";
-
- ConfigFile configFile;
-
- general::setConfigFile(configFile);
- BOOST_CHECK_NO_THROW(configFile.parse(CONFIG, true, "test-general-config-section"));
-}
-
-BOOST_AUTO_TEST_CASE(NoGroupConfig)
-{
- const std::string CONFIG =
- "general\n"
- "{\n"
- " user nobody\n"
- "}\n";
-
- ConfigFile configFile;
-
- general::setConfigFile(configFile);
- BOOST_CHECK_NO_THROW(configFile.parse(CONFIG, true, "test-general-config-section"));
-}
-
-static bool
-checkExceptionMessage(const ConfigFile::Error& error, const std::string& expected)
-{
- return error.what() == expected;
-}
-
-BOOST_AUTO_TEST_CASE(InvalidUserConfig)
-{
- const std::string CONFIG =
- "general\n"
- "{\n"
- " user\n"
- "}\n";
-
- ConfigFile configFile;
- general::setConfigFile(configFile);
-
- const std::string expected = "Invalid value for \"user\" in \"general\" section";
- BOOST_REQUIRE_EXCEPTION(configFile.parse(CONFIG, true, "test-general-config-section"),
- ConfigFile::Error,
- bind(&checkExceptionMessage, _1, expected));
-}
-
-BOOST_AUTO_TEST_CASE(InvalidGroupConfig)
-{
- const std::string CONFIG =
- "general\n"
- "{\n"
- " group\n"
- "}\n";
-
- ConfigFile configFile;
- general::setConfigFile(configFile);
-
- const std::string expected = "Invalid value for \"group\" in \"general\" section";
- BOOST_REQUIRE_EXCEPTION(configFile.parse(CONFIG, true, "test-general-config-section"),
- ConfigFile::Error,
- bind(&checkExceptionMessage, _1, expected));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/internal-face.cpp b/NFD/tests/daemon/mgmt/internal-face.cpp
deleted file mode 100644
index 2215c0e..0000000
--- a/NFD/tests/daemon/mgmt/internal-face.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/internal-face.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("InternalFaceTest");
-
-class InternalFaceFixture : protected BaseFixture
-{
-public:
-
- InternalFaceFixture()
- : m_onInterestFired(false),
- m_noOnInterestFired(false)
- {
-
- }
-
- void
- validateOnInterestCallback(const Name& name, const Interest& interest)
- {
- m_onInterestFired = true;
- }
-
- void
- validateNoOnInterestCallback(const Name& name, const Interest& interest)
- {
- m_noOnInterestFired = true;
- }
-
- void
- addFace(shared_ptr<Face> face)
- {
- m_faces.push_back(face);
- }
-
- bool
- didOnInterestFire()
- {
- return m_onInterestFired;
- }
-
- bool
- didNoOnInterestFire()
- {
- return m_noOnInterestFired;
- }
-
- void
- resetOnInterestFired()
- {
- m_onInterestFired = false;
- }
-
- void
- resetNoOnInterestFired()
- {
- m_noOnInterestFired = false;
- }
-
-protected:
- ndn::KeyChain m_keyChain;
-
-private:
- std::vector<shared_ptr<Face> > m_faces;
- bool m_onInterestFired;
- bool m_noOnInterestFired;
-};
-
-BOOST_FIXTURE_TEST_SUITE(MgmtInternalFace, InternalFaceFixture)
-
-void
-validatePutData(bool& called, const Name& expectedName, const Data& data)
-{
- called = true;
- BOOST_CHECK_EQUAL(expectedName, data.getName());
-}
-
-BOOST_AUTO_TEST_CASE(PutData)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face(new InternalFace);
-
- bool didPutData = false;
- Name dataName("/hello");
- face->onReceiveData += bind(&validatePutData, ref(didPutData), dataName, _1);
-
- Data testData(dataName);
- m_keyChain.sign(testData);
- face->put(testData);
-
- BOOST_REQUIRE(didPutData);
-
- BOOST_CHECK_THROW(face->close(), InternalFace::Error);
-}
-
-BOOST_AUTO_TEST_CASE(SendInterestHitEnd)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face(new InternalFace);
-
- face->setInterestFilter("/localhost/nfd/fib",
- bind(&InternalFaceFixture::validateOnInterestCallback,
- this, _1, _2));
-
- // generate command whose name is canonically
- // ordered after /localhost/nfd/fib so that
- // we hit the end of the std::map
-
- Name commandName("/localhost/nfd/fib/end");
- shared_ptr<Interest> command = makeInterest(commandName);
- face->sendInterest(*command);
- g_io.run_one();
-
- BOOST_REQUIRE(didOnInterestFire());
- BOOST_REQUIRE(didNoOnInterestFire() == false);
-}
-
-BOOST_AUTO_TEST_CASE(SendInterestHitBegin)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face(new InternalFace);
-
- face->setInterestFilter("/localhost/nfd/fib",
- bind(&InternalFaceFixture::validateNoOnInterestCallback,
- this, _1, _2));
-
- // generate command whose name is canonically
- // ordered before /localhost/nfd/fib so that
- // we hit the beginning of the std::map
-
- Name commandName("/localhost/nfd");
- shared_ptr<Interest> command = makeInterest(commandName);
- face->sendInterest(*command);
- g_io.run_one();
-
- BOOST_REQUIRE(didNoOnInterestFire() == false);
-}
-
-BOOST_AUTO_TEST_CASE(SendInterestHitExact)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face(new InternalFace);
-
- face->setInterestFilter("/localhost/nfd/eib",
- bind(&InternalFaceFixture::validateNoOnInterestCallback,
- this, _1, _2));
-
- face->setInterestFilter("/localhost/nfd/fib",
- bind(&InternalFaceFixture::validateOnInterestCallback,
- this, _1, _2));
-
- face->setInterestFilter("/localhost/nfd/gib",
- bind(&InternalFaceFixture::validateNoOnInterestCallback,
- this, _1, _2));
-
- // generate command whose name exactly matches
- // /localhost/nfd/fib
-
- Name commandName("/localhost/nfd/fib");
- shared_ptr<Interest> command = makeInterest(commandName);
- face->sendInterest(*command);
- g_io.run_one();
-
- BOOST_REQUIRE(didOnInterestFire());
- BOOST_REQUIRE(didNoOnInterestFire() == false);
-}
-
-BOOST_AUTO_TEST_CASE(SendInterestHitPrevious)
-{
- addFace(make_shared<DummyFace>());
-
- shared_ptr<InternalFace> face(new InternalFace);
-
- face->setInterestFilter("/localhost/nfd/fib",
- bind(&InternalFaceFixture::validateOnInterestCallback,
- this, _1, _2));
-
- face->setInterestFilter("/localhost/nfd/fib/zzzzzzzzzzzzz/",
- bind(&InternalFaceFixture::validateNoOnInterestCallback,
- this, _1, _2));
-
- // generate command whose name exactly matches
- // an Interest filter
-
- Name commandName("/localhost/nfd/fib/previous");
- shared_ptr<Interest> command = makeInterest(commandName);
- face->sendInterest(*command);
- g_io.run_one();
-
- BOOST_REQUIRE(didOnInterestFire());
- BOOST_REQUIRE(didNoOnInterestFire() == false);
-}
-
-BOOST_AUTO_TEST_CASE(InterestGone)
-{
- shared_ptr<InternalFace> face = make_shared<InternalFace>();
- shared_ptr<Interest> interest = makeInterest("ndn:/localhost/nfd/gone");
- face->sendInterest(*interest);
-
- interest.reset();
- BOOST_CHECK_NO_THROW(g_io.poll());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/malformed.ndncert b/NFD/tests/daemon/mgmt/malformed.ndncert
deleted file mode 100644
index 38b2fbb..0000000
--- a/NFD/tests/daemon/mgmt/malformed.ndncert
+++ /dev/null
@@ -1 +0,0 @@
-definitely not a key
\ No newline at end of file
diff --git a/NFD/tests/daemon/mgmt/manager-base.cpp b/NFD/tests/daemon/mgmt/manager-base.cpp
deleted file mode 100644
index 0aa7077..0000000
--- a/NFD/tests/daemon/mgmt/manager-base.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/manager-base.hpp"
-#include "mgmt/internal-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("ManagerBaseTest");
-
-class ManagerBaseTest : public ManagerBase, protected BaseFixture
-{
-
-public:
-
- ManagerBaseTest()
- : ManagerBase(make_shared<InternalFace>(), "TEST-PRIVILEGE", m_keyChain),
- m_callbackFired(false)
- {
-
- }
-
- void
- testSetResponse(ControlResponse& response,
- uint32_t code,
- const std::string& text)
- {
- setResponse(response, code, text);
- }
-
- void
- testSendResponse(const Name& name,
- uint32_t code,
- const std::string& text,
- const Block& body)
- {
- sendResponse(name, code, text, body);
- }
-
- void
- testSendResponse(const Name& name,
- uint32_t code,
- const std::string& text)
- {
- sendResponse(name, code, text);
- }
-
- void
- testSendResponse(const Name& name,
- const ControlResponse& response)
- {
- sendResponse(name, response);
- }
-
- shared_ptr<InternalFace>
- getInternalFace()
- {
- return static_pointer_cast<InternalFace>(m_face);
- }
-
- void
- validateControlResponse(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText)
- {
- m_callbackFired = true;
- Block controlRaw = response.getContent().blockFromValue();
-
- ControlResponse control;
- control.wireDecode(controlRaw);
-
- NFD_LOG_DEBUG("received control response"
- << " name: " << response.getName()
- << " code: " << control.getCode()
- << " text: " << control.getText());
-
- BOOST_REQUIRE(response.getName() == expectedName);
- BOOST_REQUIRE(control.getCode() == expectedCode);
- BOOST_REQUIRE(control.getText() == expectedText);
- }
-
- void
- validateControlResponse(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- const Block& expectedBody)
- {
- m_callbackFired = true;
- Block controlRaw = response.getContent().blockFromValue();
-
- ControlResponse control;
- control.wireDecode(controlRaw);
-
- NFD_LOG_DEBUG("received control response"
- << " name: " << response.getName()
- << " code: " << control.getCode()
- << " text: " << control.getText());
-
- BOOST_REQUIRE(response.getName() == expectedName);
- BOOST_REQUIRE(control.getCode() == expectedCode);
- BOOST_REQUIRE(control.getText() == expectedText);
-
- BOOST_REQUIRE(control.getBody().value_size() == expectedBody.value_size());
-
- BOOST_CHECK(memcmp(control.getBody().value(), expectedBody.value(),
- expectedBody.value_size()) == 0);
- }
-
- bool
- didCallbackFire()
- {
- return m_callbackFired;
- }
-
-private:
-
- bool m_callbackFired;
- ndn::KeyChain m_keyChain;
-
-};
-
-BOOST_FIXTURE_TEST_SUITE(MgmtManagerBase, ManagerBaseTest)
-
-BOOST_AUTO_TEST_CASE(SetResponse)
-{
- ControlResponse response(200, "OK");
-
- BOOST_CHECK_EQUAL(response.getCode(), 200);
- BOOST_CHECK_EQUAL(response.getText(), "OK");
-
- testSetResponse(response, 100, "test");
-
- BOOST_CHECK_EQUAL(response.getCode(), 100);
- BOOST_CHECK_EQUAL(response.getText(), "test");
-}
-
-BOOST_AUTO_TEST_CASE(SendResponse4Arg)
-{
- ndn::nfd::ControlParameters parameters;
- parameters.setName("/test/body");
-
- getInternalFace()->onReceiveData += [this, parameters] (const Data& response) {
- this->validateControlResponse(response, "/response", 100, "test", parameters.wireEncode());
- };
-
- testSendResponse("/response", 100, "test", parameters.wireEncode());
- BOOST_REQUIRE(didCallbackFire());
-}
-
-
-BOOST_AUTO_TEST_CASE(SendResponse3Arg)
-{
- getInternalFace()->onReceiveData += [this] (const Data& response) {
- this->validateControlResponse(response, "/response", 100, "test");
- };
-
- testSendResponse("/response", 100, "test");
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(SendResponse2Arg)
-{
- getInternalFace()->onReceiveData += [this] (const Data& response) {
- this->validateControlResponse(response, "/response", 100, "test");
- };
-
- ControlResponse response(100, "test");
-
- testSendResponse("/response", 100, "test");
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/status-server.cpp b/NFD/tests/daemon/mgmt/status-server.cpp
deleted file mode 100644
index bda69a4..0000000
--- a/NFD/tests/daemon/mgmt/status-server.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/status-server.hpp"
-#include "fw/forwarder.hpp"
-#include "version.hpp"
-#include "mgmt/internal-face.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(MgmtStatusServer, BaseFixture)
-
-shared_ptr<const Data> g_response;
-
-void
-interceptResponse(const Data& data)
-{
- g_response = data.shared_from_this();
-}
-
-BOOST_AUTO_TEST_CASE(Status)
-{
- // initialize
- time::system_clock::TimePoint t1 = time::system_clock::now();
- Forwarder forwarder;
- shared_ptr<InternalFace> internalFace = make_shared<InternalFace>();
- internalFace->onReceiveData += &interceptResponse;
- ndn::KeyChain keyChain;
- StatusServer statusServer(internalFace, ref(forwarder), keyChain);
- time::system_clock::TimePoint t2 = time::system_clock::now();
-
- // populate tables
- forwarder.getFib().insert("ndn:/fib1");
- forwarder.getPit().insert(*makeInterest("ndn:/pit1"));
- forwarder.getPit().insert(*makeInterest("ndn:/pit2"));
- forwarder.getPit().insert(*makeInterest("ndn:/pit3"));
- forwarder.getPit().insert(*makeInterest("ndn:/pit4"));
- forwarder.getMeasurements().get("ndn:/measurements1");
- forwarder.getMeasurements().get("ndn:/measurements2");
- forwarder.getMeasurements().get("ndn:/measurements3");
- BOOST_CHECK_GE(forwarder.getFib().size(), 1);
- BOOST_CHECK_GE(forwarder.getPit().size(), 4);
- BOOST_CHECK_GE(forwarder.getMeasurements().size(), 3);
-
- // request
- shared_ptr<Interest> request = makeInterest("ndn:/localhost/nfd/status");
- request->setMustBeFresh(true);
- request->setChildSelector(1);
-
- g_response.reset();
- time::system_clock::TimePoint t3 = time::system_clock::now();
- internalFace->sendInterest(*request);
- g_io.run_one();
- time::system_clock::TimePoint t4 = time::system_clock::now();
- BOOST_REQUIRE(static_cast<bool>(g_response));
-
- // verify
- ndn::nfd::ForwarderStatus status;
- BOOST_REQUIRE_NO_THROW(status.wireDecode(g_response->getContent()));
-
- BOOST_CHECK_EQUAL(status.getNfdVersion(), NFD_VERSION_BUILD_STRING);
- BOOST_CHECK_GE(time::toUnixTimestamp(status.getStartTimestamp()), time::toUnixTimestamp(t1));
- BOOST_CHECK_LE(time::toUnixTimestamp(status.getStartTimestamp()), time::toUnixTimestamp(t2));
- BOOST_CHECK_GE(time::toUnixTimestamp(status.getCurrentTimestamp()), time::toUnixTimestamp(t3));
- BOOST_CHECK_LE(time::toUnixTimestamp(status.getCurrentTimestamp()), time::toUnixTimestamp(t4));
-
- // StatusServer under test isn't added to Forwarder,
- // so request and response won't affect table size
- BOOST_CHECK_EQUAL(status.getNNameTreeEntries(), forwarder.getNameTree().size());
- BOOST_CHECK_EQUAL(status.getNFibEntries(), forwarder.getFib().size());
- BOOST_CHECK_EQUAL(status.getNPitEntries(), forwarder.getPit().size());
- BOOST_CHECK_EQUAL(status.getNMeasurementsEntries(), forwarder.getMeasurements().size());
- BOOST_CHECK_EQUAL(status.getNCsEntries(), forwarder.getCs().size());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/strategy-choice-manager.cpp b/NFD/tests/daemon/mgmt/strategy-choice-manager.cpp
deleted file mode 100644
index 570c1d8..0000000
--- a/NFD/tests/daemon/mgmt/strategy-choice-manager.cpp
+++ /dev/null
@@ -1,646 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/strategy-choice-manager.hpp"
-#include "face/face.hpp"
-#include "mgmt/internal-face.hpp"
-#include "table/name-tree.hpp"
-#include "table/strategy-choice.hpp"
-#include "fw/forwarder.hpp"
-#include "fw/strategy.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-#include "tests/daemon/fw/dummy-strategy.hpp"
-
-#include <ndn-cxx/management/nfd-strategy-choice.hpp>
-
-#include "tests/test-common.hpp"
-#include "validation-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("MgmtStrategyChoiceManager");
-
-class StrategyChoiceManagerFixture : protected BaseFixture
-{
-public:
-
- StrategyChoiceManagerFixture()
- : m_strategyChoice(m_forwarder.getStrategyChoice())
- , m_face(make_shared<InternalFace>())
- , m_manager(m_strategyChoice, m_face, m_keyChain)
- , m_callbackFired(false)
- {
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-a"));
- m_strategyChoice.insert("ndn:/", "/localhost/nfd/strategy/test-strategy-a");
- }
-
- virtual
- ~StrategyChoiceManagerFixture()
- {
-
- }
-
- void
- validateControlResponseCommon(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- ControlResponse& control)
- {
- m_callbackFired = true;
- Block controlRaw = response.getContent().blockFromValue();
-
- control.wireDecode(controlRaw);
-
- NFD_LOG_DEBUG("received control response"
- << " Name: " << response.getName()
- << " code: " << control.getCode()
- << " text: " << control.getText());
-
- BOOST_CHECK_EQUAL(response.getName(), expectedName);
- BOOST_CHECK_EQUAL(control.getCode(), expectedCode);
- BOOST_CHECK_EQUAL(control.getText(), expectedText);
- }
-
- void
- validateControlResponse(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText)
- {
- ControlResponse control;
- validateControlResponseCommon(response, expectedName,
- expectedCode, expectedText, control);
-
- if (!control.getBody().empty())
- {
- BOOST_FAIL("found unexpected control response body");
- }
- }
-
- void
- validateControlResponse(const Data& response,
- const Name& expectedName,
- uint32_t expectedCode,
- const std::string& expectedText,
- const Block& expectedBody)
- {
- ControlResponse control;
- validateControlResponseCommon(response, expectedName,
- expectedCode, expectedText, control);
-
- BOOST_REQUIRE(!control.getBody().empty());
- BOOST_REQUIRE(control.getBody().value_size() == expectedBody.value_size());
-
- BOOST_CHECK(memcmp(control.getBody().value(), expectedBody.value(),
- expectedBody.value_size()) == 0);
-
- }
-
- void
- validateList(const Data& data, const ndn::nfd::StrategyChoice& expectedChoice)
- {
- m_callbackFired = true;
- ndn::nfd::StrategyChoice choice(data.getContent().blockFromValue());
- BOOST_CHECK_EQUAL(choice.getStrategy(), expectedChoice.getStrategy());
- BOOST_CHECK_EQUAL(choice.getName(), expectedChoice.getName());
- }
-
- bool
- didCallbackFire()
- {
- return m_callbackFired;
- }
-
- void
- resetCallbackFired()
- {
- m_callbackFired = false;
- }
-
- shared_ptr<InternalFace>&
- getFace()
- {
- return m_face;
- }
-
- StrategyChoiceManager&
- getManager()
- {
- return m_manager;
- }
-
- StrategyChoice&
- getStrategyChoice()
- {
- return m_strategyChoice;
- }
-
- void
- addInterestRule(const std::string& regex,
- ndn::IdentityCertificate& certificate)
- {
- m_manager.addInterestRule(regex, certificate);
- }
-
-protected:
- Forwarder m_forwarder;
- StrategyChoice& m_strategyChoice;
- shared_ptr<InternalFace> m_face;
- StrategyChoiceManager m_manager;
- ndn::KeyChain m_keyChain;
-
-private:
- bool m_callbackFired;
-};
-
-class AllStrategiesFixture : public StrategyChoiceManagerFixture
-{
-public:
- AllStrategiesFixture()
- {
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-b"));
-
- const Name strategyCVersion1("/localhost/nfd/strategy/test-strategy-c/%FD%01");
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- strategyCVersion1));
-
- const Name strategyCVersion2("/localhost/nfd/strategy/test-strategy-c/%FD%02");
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- strategyCVersion2));
- }
-
- virtual
- ~AllStrategiesFixture()
- {
-
- }
-};
-
-template <typename T> class AuthorizedCommandFixture : public CommandFixture<T>
-{
-public:
- AuthorizedCommandFixture()
- {
- const std::string regex = "^<localhost><nfd><strategy-choice>";
- T::addInterestRule(regex, *CommandFixture<T>::m_certificate);
- }
-
- virtual
- ~AuthorizedCommandFixture()
- {
-
- }
-};
-
-BOOST_FIXTURE_TEST_SUITE(MgmtStrategyChoiceManager,
- AuthorizedCommandFixture<AllStrategiesFixture>)
-
-BOOST_FIXTURE_TEST_CASE(ShortName, AllStrategiesFixture)
-{
- shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/strategy-choice"));
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getFace()->sendInterest(*command);
- g_io.run_one();
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(MalformedCommmand, AllStrategiesFixture)
-{
- shared_ptr<Interest> command(make_shared<Interest>("/localhost/nfd/strategy-choice"));
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getManager().onStrategyChoiceRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(UnsignedCommand, AllStrategiesFixture)
-{
- ControlParameters parameters;
- parameters.setName("/test");
- parameters.setStrategy("/localhost/nfd/strategy/best-route");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 401, "Signature required");
- };
-
- getManager().onStrategyChoiceRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_FIXTURE_TEST_CASE(UnauthorizedCommand,
- UnauthorizedCommandFixture<StrategyChoiceManagerFixture>)
-{
- ControlParameters parameters;
- parameters.setName("/test");
- parameters.setStrategy("/localhost/nfd/strategy/best-route");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 403, "Unauthorized command");
- };
-
- getManager().onStrategyChoiceRequest(*command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(UnsupportedVerb)
-{
- ControlParameters parameters;
- parameters.setName("/test");
- parameters.setStrategy("/localhost/nfd/strategy/test-strategy-b");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("unsupported");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 501, "Unsupported command");
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(BadOptionParse)
-{
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append("NotReallyParameters");
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(SetStrategies)
-{
- ControlParameters parameters;
- parameters.setName("/test");
- parameters.setStrategy("/localhost/nfd/strategy/test-strategy-b");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- getFace()->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
- fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
- BOOST_REQUIRE_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-b");
-}
-
-BOOST_AUTO_TEST_CASE(SetStrategySpecifiedVersion)
-{
- ControlParameters parameters;
- parameters.setName("/test");
- parameters.setStrategy("/localhost/nfd/strategy/test-strategy-c/%FD%01");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- getFace()->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
- fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
- BOOST_REQUIRE_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-c/%FD%01");
-}
-
-BOOST_AUTO_TEST_CASE(SetStrategyLatestVersion)
-{
- ControlParameters parameters;
- parameters.setName("/test");
- parameters.setStrategy("/localhost/nfd/strategy/test-strategy-c");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- ControlParameters responseParameters;
- responseParameters.setName("/test");
- responseParameters.setStrategy("/localhost/nfd/strategy/test-strategy-c/%FD%02");
-
- getFace()->onReceiveData += [this, command, responseParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", responseParameters.wireEncode());
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
- fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
- BOOST_REQUIRE_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-c/%FD%02");
-}
-
-BOOST_AUTO_TEST_CASE(SetStrategiesMissingName)
-{
- ControlParameters parameters;
- parameters.setStrategy("/localhost/nfd/strategy/test-strategy-b");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_CASE(SetStrategiesMissingStrategy)
-{
- ControlParameters parameters;
- parameters.setName("/test");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
- fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
- BOOST_REQUIRE_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
-}
-
-BOOST_AUTO_TEST_CASE(SetUnsupportedStrategy)
-{
- ControlParameters parameters;
- parameters.setName("/test");
- parameters.setStrategy("/localhost/nfd/strategy/unit-test-doesnotexist");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("set");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 504, "Unsupported strategy");
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
- fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
- BOOST_CHECK_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
-}
-
-class DefaultStrategyOnlyFixture : public StrategyChoiceManagerFixture
-{
-public:
- DefaultStrategyOnlyFixture()
- : StrategyChoiceManagerFixture()
- {
-
- }
-
- virtual
- ~DefaultStrategyOnlyFixture()
- {
-
- }
-};
-
-
-/// \todo I'm not sure this code branch (code 405) can happen. The manager tests for the strategy first and will return 504.
-// BOOST_FIXTURE_TEST_CASE(SetNotInstalled, DefaultStrategyOnlyFixture)
-// {
-// BOOST_REQUIRE(!getStrategyChoice().hasStrategy("/localhost/nfd/strategy/test-strategy-b"));
-// ControlParameters parameters;
-// parameters.setName("/test");
-// parameters.setStrategy("/localhost/nfd/strategy/test-strategy-b");
-
-// Block encodedParameters(parameters.wireEncode());
-
-// Name commandName("/localhost/nfd/strategy-choice");
-// commandName.append("set");
-// commandName.append(encodedParameters);
-
-// shared_ptr<Interest> command(make_shared<Interest>(commandName));
-// generateCommand(*command);
-
-// getFace()->onReceiveData +=
-// bind(&StrategyChoiceManagerFixture::validateControlResponse, this, _1,
-// command->getName(), 405, "Strategy not installed");
-
-// getManager().onValidatedStrategyChoiceRequest(command);
-
-// BOOST_REQUIRE(didCallbackFire());
-// fw::Strategy& strategy = getStrategyChoice().findEffectiveStrategy("/test");
-// BOOST_CHECK_EQUAL(strategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
-// }
-
-BOOST_AUTO_TEST_CASE(Unset)
-{
- ControlParameters parameters;
- parameters.setName("/test");
-
- BOOST_REQUIRE(m_strategyChoice.insert("/test", "/localhost/nfd/strategy/test-strategy-b"));
- BOOST_REQUIRE_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
- "/localhost/nfd/strategy/test-strategy-b");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("unset");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command, encodedParameters] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 200, "Success", encodedParameters);
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
-
- BOOST_CHECK_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
- "/localhost/nfd/strategy/test-strategy-a");
-}
-
-BOOST_AUTO_TEST_CASE(UnsetRoot)
-{
- ControlParameters parameters;
- parameters.setName("/");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("unset");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(),
- 403, "Cannot unset root prefix strategy");
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
-
- BOOST_CHECK_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
- "/localhost/nfd/strategy/test-strategy-a");
-}
-
-BOOST_AUTO_TEST_CASE(UnsetMissingName)
-{
- ControlParameters parameters;
-
- BOOST_REQUIRE(m_strategyChoice.insert("/test", "/localhost/nfd/strategy/test-strategy-b"));
- BOOST_REQUIRE_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
- "/localhost/nfd/strategy/test-strategy-b");
-
- Block encodedParameters(parameters.wireEncode());
-
- Name commandName("/localhost/nfd/strategy-choice");
- commandName.append("unset");
- commandName.append(encodedParameters);
-
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
- generateCommand(*command);
-
- getFace()->onReceiveData += [this, command] (const Data& response) {
- this->validateControlResponse(response, command->getName(), 400, "Malformed command");
- };
-
- getManager().onValidatedStrategyChoiceRequest(command);
-
- BOOST_REQUIRE(didCallbackFire());
-
- BOOST_CHECK_EQUAL(m_strategyChoice.findEffectiveStrategy("/test").getName(),
- "/localhost/nfd/strategy/test-strategy-b");
-}
-
-BOOST_AUTO_TEST_CASE(Publish)
-{
- Name commandName("/localhost/nfd/strategy-choice/list");
- shared_ptr<Interest> command(make_shared<Interest>(commandName));
-
- ndn::nfd::StrategyChoice expectedChoice;
- expectedChoice.setStrategy("/localhost/nfd/strategy/test-strategy-a");
- expectedChoice.setName("/");
-
- getFace()->onReceiveData +=
- bind(&StrategyChoiceManagerFixture::validateList, this, _1, expectedChoice);
-
- m_manager.onStrategyChoiceRequest(*command);
- BOOST_REQUIRE(didCallbackFire());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/strategy-choice-publisher.cpp b/NFD/tests/daemon/mgmt/strategy-choice-publisher.cpp
deleted file mode 100644
index e85bc4a..0000000
--- a/NFD/tests/daemon/mgmt/strategy-choice-publisher.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_NFD_MGMT_STRATEGY_CHOICE_PUBLISHER_HPP
-#define NFD_TESTS_NFD_MGMT_STRATEGY_CHOICE_PUBLISHER_HPP
-
-#include "mgmt/strategy-choice-publisher.hpp"
-#include "mgmt/app-face.hpp"
-#include "mgmt/internal-face.hpp"
-#include "fw/forwarder.hpp"
-#include "../fw/dummy-strategy.hpp"
-
-#include "tests/test-common.hpp"
-
-#include <ndn-cxx/management/nfd-strategy-choice.hpp>
-
-namespace nfd {
-namespace tests {
-
-class StrategyChoicePublisherFixture : BaseFixture
-{
-public:
-
- StrategyChoicePublisherFixture()
- : m_strategyChoice(m_forwarder.getStrategyChoice())
- , m_face(make_shared<InternalFace>())
- , m_publisher(m_strategyChoice, *m_face, "/localhost/nfd/strategy-choice/list", m_keyChain)
- , STRATEGY_A(make_shared<DummyStrategy>(boost::ref(m_forwarder),
- "/localhost/nfd/strategy/dummy-strategy-a"))
- , STRATEGY_B(make_shared<DummyStrategy>(boost::ref(m_forwarder),
- "/localhost/nfd/strategy/dummy-strategy-b"))
- , m_finished(false)
- {
- m_strategyChoice.install(STRATEGY_A);
- m_strategyChoice.install(STRATEGY_B);
-
- ndn::nfd::StrategyChoice expectedRootEntry;
- expectedRootEntry.setStrategy(STRATEGY_A->getName());
- expectedRootEntry.setName("/");
-
- m_strategyChoice.insert("/", STRATEGY_A->getName());
- m_expectedEntries["/"] = expectedRootEntry;
- }
-
- void
- validatePublish(const Data& data)
- {
- Block payload = data.getContent();
-
- m_buffer.appendByteArray(payload.value(), payload.value_size());
-
- BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
- if (data.getFinalBlockId() != data.getName()[-1])
- {
- return;
- }
-
- // wrap the Strategy Choice entries in a single Content TLV for easy parsing
- m_buffer.prependVarNumber(m_buffer.size());
- m_buffer.prependVarNumber(tlv::Content);
-
- ndn::Block parser(m_buffer.buf(), m_buffer.size());
- parser.parse();
-
- BOOST_REQUIRE_EQUAL(parser.elements_size(), m_expectedEntries.size());
-
- for (Block::element_const_iterator i = parser.elements_begin();
- i != parser.elements_end();
- ++i)
- {
- if (i->type() != ndn::tlv::nfd::StrategyChoice)
- {
- BOOST_FAIL("expected StrategyChoice, got type #" << i->type());
- }
-
- ndn::nfd::StrategyChoice entry(*i);
-
- std::map<std::string, ndn::nfd::StrategyChoice>::const_iterator expectedEntryPos =
- m_expectedEntries.find(entry.getName().toUri());
-
- BOOST_REQUIRE(expectedEntryPos != m_expectedEntries.end());
- const ndn::nfd::StrategyChoice& expectedEntry = expectedEntryPos->second;
-
- BOOST_CHECK_EQUAL(entry.getStrategy(), expectedEntry.getStrategy());
- BOOST_CHECK_EQUAL(entry.getName(), expectedEntry.getName());
-
- m_matchedEntries.insert(entry.getName().toUri());
- }
-
- BOOST_CHECK_EQUAL(m_matchedEntries.size(), m_expectedEntries.size());
-
- m_finished = true;
- }
-
-protected:
- Forwarder m_forwarder;
- StrategyChoice& m_strategyChoice;
- shared_ptr<InternalFace> m_face;
- StrategyChoicePublisher m_publisher;
-
- shared_ptr<DummyStrategy> STRATEGY_A;
- shared_ptr<DummyStrategy> STRATEGY_B;
-
- ndn::EncodingBuffer m_buffer;
-
- std::map<std::string, ndn::nfd::StrategyChoice> m_expectedEntries;
- std::set<std::string> m_matchedEntries;
-
- bool m_finished;
-
- ndn::KeyChain m_keyChain;
-};
-
-
-
-BOOST_FIXTURE_TEST_SUITE(MgmtStrategyChoicePublisher, StrategyChoicePublisherFixture)
-
-BOOST_AUTO_TEST_CASE(Publish)
-{
- m_strategyChoice.insert("/test/a", STRATEGY_A->getName());
- m_strategyChoice.insert("/test/b", STRATEGY_B->getName());
-
- ndn::nfd::StrategyChoice expectedEntryA;
- expectedEntryA.setStrategy(STRATEGY_A->getName());
- expectedEntryA.setName("/test/a");
-
- ndn::nfd::StrategyChoice expectedEntryB;
- expectedEntryB.setStrategy(STRATEGY_B->getName());
- expectedEntryB.setName("/test/b");
-
- m_expectedEntries["/test/a"] = expectedEntryA;
- m_expectedEntries["/test/b"] = expectedEntryB;
-
- m_face->onReceiveData +=
- bind(&StrategyChoicePublisherFixture::validatePublish, this, _1);
-
- m_publisher.publish();
- BOOST_REQUIRE(m_finished);
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_NFD_MGMT_STRATEGY_CHOICE_PUBLISHER_HPP
diff --git a/NFD/tests/daemon/mgmt/tables-config-section.cpp b/NFD/tests/daemon/mgmt/tables-config-section.cpp
deleted file mode 100644
index 5129287..0000000
--- a/NFD/tests/daemon/mgmt/tables-config-section.cpp
+++ /dev/null
@@ -1,399 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/tables-config-section.hpp"
-#include "fw/forwarder.hpp"
-
-
-#include "tests/test-common.hpp"
-#include "tests/daemon/fw/dummy-strategy.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("MgmtTablesConfigSection");
-
-class TablesConfigSectionFixture : protected BaseFixture
-{
-public:
-
- TablesConfigSectionFixture()
- : m_cs(m_forwarder.getCs())
- , m_pit(m_forwarder.getPit())
- , m_fib(m_forwarder.getFib())
- , m_strategyChoice(m_forwarder.getStrategyChoice())
- , m_measurements(m_forwarder.getMeasurements())
- , m_tablesConfig(m_cs, m_pit, m_fib, m_strategyChoice, m_measurements)
- {
- m_tablesConfig.setConfigFile(m_config);
- }
-
- void
- runConfig(const std::string& CONFIG, bool isDryRun)
- {
- m_config.parse(CONFIG, isDryRun, "dummy-config");
- }
-
- bool
- validateException(const std::runtime_error& exception, const std::string& expectedMsg)
- {
- if (exception.what() != expectedMsg)
- {
- NFD_LOG_DEBUG("exception.what(): " << exception.what());
- NFD_LOG_DEBUG("msg: : " << expectedMsg);
-
- return false;
- }
- return true;
- }
-
-protected:
- Forwarder m_forwarder;
-
- Cs& m_cs;
- Pit& m_pit;
- Fib& m_fib;
- StrategyChoice& m_strategyChoice;
- Measurements& m_measurements;
-
- TablesConfigSection m_tablesConfig;
- ConfigFile m_config;
-};
-
-BOOST_FIXTURE_TEST_SUITE(TestTableConfigSection, TablesConfigSectionFixture)
-
-BOOST_AUTO_TEST_CASE(ConfigureTablesWithDefaults)
-{
- const size_t initialLimit = m_cs.getLimit();
-
- m_tablesConfig.ensureTablesAreConfigured();
- BOOST_CHECK_NE(initialLimit, m_cs.getLimit());
-}
-
-BOOST_AUTO_TEST_CASE(EmptyTablesSection)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- "}\n";
-
- const size_t nCsMaxPackets = m_cs.getLimit();
-
- BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, true));
- BOOST_CHECK_EQUAL(m_cs.getLimit(), nCsMaxPackets);
-
- BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false));
- BOOST_CHECK_NE(m_cs.getLimit(), nCsMaxPackets);
-
- const size_t defaultLimit = m_cs.getLimit();
-
- m_tablesConfig.ensureTablesAreConfigured();
- BOOST_CHECK_EQUAL(defaultLimit, m_cs.getLimit());
-}
-
-BOOST_AUTO_TEST_CASE(ValidCsMaxPackets)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- " cs_max_packets 101\n"
- "}\n";
-
- BOOST_REQUIRE_NE(m_cs.getLimit(), 101);
-
- BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, true));
- BOOST_CHECK_NE(m_cs.getLimit(), 101);
-
- BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false));
- BOOST_CHECK_EQUAL(m_cs.getLimit(), 101);
-
- m_tablesConfig.ensureTablesAreConfigured();
- BOOST_CHECK_EQUAL(m_cs.getLimit(), 101);
-}
-
-BOOST_AUTO_TEST_CASE(MissingValueCsMaxPackets)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- " cs_max_packets\n"
- "}\n";
-
- const std::string expectedMsg =
- "Invalid value for option \"cs_max_packets\" in \"tables\" section";
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-}
-
-BOOST_AUTO_TEST_CASE(InvalidValueCsMaxPackets)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- " cs_max_packets invalid\n"
- "}\n";
-
- const std::string expectedMsg =
- "Invalid value for option \"cs_max_packets\" in \"tables\" section";
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-}
-
-BOOST_AUTO_TEST_CASE(ConfigStrategy)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- "strategy_choice\n"
- "{\n"
- " / /localhost/nfd/strategy/test-strategy-a\n"
- " /a /localhost/nfd/strategy/test-strategy-b\n"
- "}\n"
- "}\n";
-
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-a"));
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-b"));
-
- runConfig(CONFIG, true);
- {
- fw::Strategy& rootStrategy = m_strategyChoice.findEffectiveStrategy("/");
- BOOST_REQUIRE_NE(rootStrategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
- BOOST_REQUIRE_NE(rootStrategy.getName(), "/localhost/nfd/strategy/test-strategy-b");
-
- fw::Strategy& aStrategy = m_strategyChoice.findEffectiveStrategy("/a");
- BOOST_REQUIRE_NE(aStrategy.getName(), "/localhost/nfd/strategy/test-strategy-b");
- BOOST_REQUIRE_NE(aStrategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
- }
-
- runConfig(CONFIG, false);
- {
- fw::Strategy& rootStrategy = m_strategyChoice.findEffectiveStrategy("/");
- BOOST_REQUIRE_EQUAL(rootStrategy.getName(), "/localhost/nfd/strategy/test-strategy-a");
-
- fw::Strategy& aStrategy = m_strategyChoice.findEffectiveStrategy("/a");
- BOOST_REQUIRE_EQUAL(aStrategy.getName(), "/localhost/nfd/strategy/test-strategy-b");
- }
-}
-
-BOOST_AUTO_TEST_CASE(ConfigVersionedStrategy)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- "strategy_choice\n"
- "{\n"
- " /test/latest /localhost/nfd/strategy/test-strategy-a\n"
- " /test/old /localhost/nfd/strategy/test-strategy-a/%FD%01\n"
- "}\n"
- "}\n";
-
-
- auto version1 = make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-a/%FD%01");
-
- auto version2 = make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-a/%FD%02");
- m_strategyChoice.install(version1);
- m_strategyChoice.install(version2);
-
- runConfig(CONFIG, true);
- {
- fw::Strategy& testLatestStrategy = m_strategyChoice.findEffectiveStrategy("/test/latest");
- BOOST_REQUIRE_NE(testLatestStrategy.getName(),
- "/localhost/nfd/strategy/test-strategy-a/%FD%01");
- BOOST_REQUIRE_NE(testLatestStrategy.getName(),
- "/localhost/nfd/strategy/test-strategy-a/%FD%02");
-
- fw::Strategy& testOldStrategy = m_strategyChoice.findEffectiveStrategy("/test/old");
- BOOST_REQUIRE_NE(testOldStrategy.getName(),
- "/localhost/nfd/strategy/test-strategy-a/%FD%01");
- BOOST_REQUIRE_NE(testOldStrategy.getName(),
- "/localhost/nfd/strategy/test-strategy-a/%FD%02");
- }
-
- runConfig(CONFIG, false);
- {
- fw::Strategy& testLatestStrategy = m_strategyChoice.findEffectiveStrategy("/test/latest");
- BOOST_REQUIRE_EQUAL(testLatestStrategy.getName(),
- "/localhost/nfd/strategy/test-strategy-a/%FD%02");
-
- fw::Strategy& testOldStrategy = m_strategyChoice.findEffectiveStrategy("/test/old");
- BOOST_REQUIRE_EQUAL(testOldStrategy.getName(),
- "/localhost/nfd/strategy/test-strategy-a/%FD%01");
- }
-}
-
-BOOST_AUTO_TEST_CASE(InvalidStrategy)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- "strategy_choice\n"
- "{\n"
- " / /localhost/nfd/strategy/test-doesnotexist\n"
- "}\n"
- "}\n";
-
-
- const std::string expectedMsg =
- "Invalid strategy choice \"/localhost/nfd/strategy/test-doesnotexist\" "
- "for prefix \"/\" in \"strategy_choice\" section";
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-}
-
-BOOST_AUTO_TEST_CASE(MissingStrategyPrefix)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- "strategy_choice\n"
- "{\n"
- " /localhost/nfd/strategy/test-strategy-a\n"
- "}\n"
- "}\n";
-
-
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-a"));
-
-
- const std::string expectedMsg = "Invalid strategy choice \"\" for prefix "
- "\"/localhost/nfd/strategy/test-strategy-a\" in \"strategy_choice\" section";
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-}
-
-BOOST_AUTO_TEST_CASE(DuplicateStrategy)
-{
- const std::string CONFIG =
- "tables\n"
- "{\n"
- "strategy_choice\n"
- "{\n"
- " / /localhost/nfd/strategy/test-strategy-a\n"
- " /a /localhost/nfd/strategy/test-strategy-b\n"
- " / /localhost/nfd/strategy/test-strategy-b\n"
- "}\n"
- "}\n";
-
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-a"));
- m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
- "/localhost/nfd/strategy/test-strategy-b"));
-
- const std::string expectedMsg =
- "Duplicate strategy choice for prefix \"/\" in \"strategy_choice\" section";
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, true),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-
- BOOST_CHECK_EXCEPTION(runConfig(CONFIG, false),
- ConfigFile::Error,
- bind(&TablesConfigSectionFixture::validateException,
- this, _1, expectedMsg));
-}
-
-class IgnoreNotTablesSection
-{
-public:
- void
- operator()(const std::string& filename,
- const std::string& sectionName,
- const ConfigSection& section,
- bool isDryRun)
-
- {
- // Ignore "not_tables" section
- if (sectionName == "not_tables")
- {
- // do nothing
- }
- }
-};
-
-BOOST_AUTO_TEST_CASE(MissingTablesSection)
-{
- const std::string CONFIG =
- "not_tables\n"
- "{\n"
- " some_other_field 0\n"
- "}\n";
-
- ConfigFile passiveConfig((IgnoreNotTablesSection()));
-
- const size_t initialLimit = m_cs.getLimit();
-
- passiveConfig.parse(CONFIG, true, "dummy-config");
- BOOST_REQUIRE_EQUAL(initialLimit, m_cs.getLimit());
-
- passiveConfig.parse(CONFIG, false, "dummy-config");
- BOOST_REQUIRE_EQUAL(initialLimit, m_cs.getLimit());
-
- m_tablesConfig.ensureTablesAreConfigured();
- BOOST_CHECK_NE(initialLimit, m_cs.getLimit());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/validation-common.cpp b/NFD/tests/daemon/mgmt/validation-common.cpp
deleted file mode 100644
index 6065c27..0000000
--- a/NFD/tests/daemon/mgmt/validation-common.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "validation-common.hpp"
-
-#include <boost/test/unit_test.hpp>
-
-namespace nfd {
-namespace tests {
-
-const Name CommandIdentityGlobalFixture::s_identityName("/unit-test/CommandFixture/id");
-shared_ptr<ndn::IdentityCertificate> CommandIdentityGlobalFixture::s_certificate;
-
-CommandIdentityGlobalFixture::CommandIdentityGlobalFixture()
-{
- BOOST_ASSERT(!static_cast<bool>(s_certificate));
- s_certificate = m_keys.getCertificate(m_keys.createIdentity(s_identityName));
-}
-
-CommandIdentityGlobalFixture::~CommandIdentityGlobalFixture()
-{
- s_certificate.reset();
- m_keys.deleteIdentity(s_identityName);
-}
-
-BOOST_GLOBAL_FIXTURE(CommandIdentityGlobalFixture)
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/mgmt/validation-common.hpp b/NFD/tests/daemon/mgmt/validation-common.hpp
deleted file mode 100644
index f8b1367..0000000
--- a/NFD/tests/daemon/mgmt/validation-common.hpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NFD_TESTS_NFD_MGMT_VALIDATION_COMMON_HPP
-#define NFD_TESTS_NFD_MGMT_VALIDATION_COMMON_HPP
-
-#include "common.hpp"
-#include <ndn-cxx/util/command-interest-generator.hpp>
-
-namespace nfd {
-namespace tests {
-
-// class ValidatedManagementFixture
-// {
-// public:
-// ValidatedManagementFixture()
-// : m_validator(make_shared<ndn::CommandInterestValidator>())
-// {
-// }
-
-// virtual
-// ~ValidatedManagementFixture()
-// {
-// }
-
-// protected:
-// shared_ptr<ndn::CommandInterestValidator> m_validator;
-// };
-
-/// a global fixture that holds the identity for CommandFixture
-class CommandIdentityGlobalFixture
-{
-public:
- CommandIdentityGlobalFixture();
-
- ~CommandIdentityGlobalFixture();
-
- static const Name& getIdentityName()
- {
- return s_identityName;
- }
-
- static shared_ptr<ndn::IdentityCertificate> getCertificate()
- {
- BOOST_ASSERT(static_cast<bool>(s_certificate));
- return s_certificate;
- }
-
-private:
- ndn::KeyChain m_keys;
- static const Name s_identityName;
- static shared_ptr<ndn::IdentityCertificate> s_certificate;
-};
-
-template<typename T>
-class CommandFixture : public T
-{
-public:
- virtual
- ~CommandFixture()
- {
- }
-
- void
- generateCommand(Interest& interest)
- {
- m_generator.generateWithIdentity(interest, getIdentityName());
- }
-
- const Name&
- getIdentityName() const
- {
- return CommandIdentityGlobalFixture::getIdentityName();
- }
-
-protected:
- CommandFixture()
- : m_certificate(CommandIdentityGlobalFixture::getCertificate())
- {
- }
-
-protected:
- shared_ptr<ndn::IdentityCertificate> m_certificate;
- ndn::CommandInterestGenerator m_generator;
-};
-
-template <typename T>
-class UnauthorizedCommandFixture : public CommandFixture<T>
-{
-public:
- UnauthorizedCommandFixture()
- {
- }
-
- virtual
- ~UnauthorizedCommandFixture()
- {
- }
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_NFD_MGMT_VALIDATION_COMMON_HPP
diff --git a/NFD/tests/daemon/table/cs.cpp b/NFD/tests/daemon/table/cs.cpp
deleted file mode 100644
index 4032ff4..0000000
--- a/NFD/tests/daemon/table/cs.cpp
+++ /dev/null
@@ -1,1028 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- *
- * \author Ilya Moiseenko <iliamo@ucla.edu>
- **/
-
-#include "table/cs.hpp"
-#include "table/cs-entry.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-class CsAccessor : public Cs
-{
-public:
- bool
- evictItem_accessor()
- {
- return evictItem();
- }
-};
-
-BOOST_FIXTURE_TEST_SUITE(TableCs, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(SetLimit)
-{
- Cs cs(1);
-
- BOOST_CHECK_EQUAL(cs.insert(*makeData("/1")), true);
- BOOST_CHECK_EQUAL(cs.insert(*makeData("/2")), true);
- BOOST_CHECK_EQUAL(cs.size(), 1);
-
- cs.setLimit(3);
- BOOST_CHECK_EQUAL(cs.insert(*makeData("/3")), true);
- BOOST_CHECK_EQUAL(cs.insert(*makeData("/4")), true);
- BOOST_CHECK_EQUAL(cs.insert(*makeData("/5")), true);
- BOOST_CHECK_EQUAL(cs.size(), 3);
-
- cs.setLimit(2);
- BOOST_CHECK_EQUAL(cs.size(), 2);
-}
-
-BOOST_AUTO_TEST_CASE(Insertion)
-{
- Cs cs;
-
- BOOST_CHECK_EQUAL(cs.insert(*makeData("/insertion")), true);
-}
-
-BOOST_AUTO_TEST_CASE(Insertion2)
-{
- Cs cs;
-
- cs.insert(*makeData("/a"));
- cs.insert(*makeData("/b"));
- cs.insert(*makeData("/c"));
- cs.insert(*makeData("/d"));
-
- BOOST_CHECK_EQUAL(cs.size(), 4);
-}
-
-BOOST_AUTO_TEST_CASE(DuplicateInsertion)
-{
- Cs cs;
-
- shared_ptr<Data> data0 = makeData("/insert/smth");
- BOOST_CHECK_EQUAL(cs.insert(*data0), true);
-
- shared_ptr<Data> data = makeData("/insert/duplicate");
- BOOST_CHECK_EQUAL(cs.insert(*data), true);
-
- cs.insert(*data);
- BOOST_CHECK_EQUAL(cs.size(), 2);
-}
-
-
-BOOST_AUTO_TEST_CASE(DuplicateInsertion2)
-{
- Cs cs;
-
- shared_ptr<Data> data = makeData("/insert/duplicate");
- BOOST_CHECK_EQUAL(cs.insert(*data), true);
-
- cs.insert(*data);
- BOOST_CHECK_EQUAL(cs.size(), 1);
-
- shared_ptr<Data> data2 = makeData("/insert/original");
- BOOST_CHECK_EQUAL(cs.insert(*data2), true);
- BOOST_CHECK_EQUAL(cs.size(), 2);
-}
-
-BOOST_AUTO_TEST_CASE(InsertAndFind)
-{
- Cs cs;
-
- Name name("/insert/and/find");
-
- shared_ptr<Data> data = makeData(name);
- BOOST_CHECK_EQUAL(cs.insert(*data), true);
-
- shared_ptr<Interest> interest = make_shared<Interest>(name);
-
- const Data* found = cs.find(*interest);
-
- BOOST_REQUIRE(found != 0);
- BOOST_CHECK_EQUAL(data->getName(), found->getName());
-}
-
-BOOST_AUTO_TEST_CASE(InsertAndNotFind)
-{
- Cs cs;
-
- Name name("/insert/and/find");
- shared_ptr<Data> data = makeData(name);
- BOOST_CHECK_EQUAL(cs.insert(*data), true);
-
- Name name2("/not/find");
- shared_ptr<Interest> interest = make_shared<Interest>(name2);
-
- const Data* found = cs.find(*interest);
-
- BOOST_CHECK_EQUAL(found, static_cast<const Data*>(0));
-}
-
-
-BOOST_AUTO_TEST_CASE(InsertAndErase)
-{
- CsAccessor cs;
-
- shared_ptr<Data> data = makeData("/insertandelete");
- cs.insert(*data);
- BOOST_CHECK_EQUAL(cs.size(), 1);
-
- cs.evictItem_accessor();
- BOOST_CHECK_EQUAL(cs.size(), 0);
-}
-
-BOOST_AUTO_TEST_CASE(StalenessQueue)
-{
- CsAccessor cs;
-
- Name name2("/insert/fresh");
- shared_ptr<Data> data2 = makeData(name2);
- data2->setFreshnessPeriod(time::milliseconds(5000));
- signData(data2);
- cs.insert(*data2);
-
- Name name("/insert/expire");
- shared_ptr<Data> data = makeData(name);
- data->setFreshnessPeriod(time::milliseconds(500));
- signData(data);
- cs.insert(*data);
-
- BOOST_CHECK_EQUAL(cs.size(), 2);
-
- sleep(3);
-
- cs.evictItem_accessor();
- BOOST_CHECK_EQUAL(cs.size(), 1);
-
- shared_ptr<Interest> interest = make_shared<Interest>(name2);
- const Data* found = cs.find(*interest);
- BOOST_REQUIRE(found != 0);
- BOOST_CHECK_EQUAL(found->getName(), name2);
-}
-
-BOOST_AUTO_TEST_CASE(Bug2043) // eviction order of unsolicited packets
-{
- Cs cs(3);
-
- cs.insert(*makeData("/a"), true);
- cs.insert(*makeData("/b"), true);
- cs.insert(*makeData("/c"), true);
- BOOST_CHECK_EQUAL(cs.size(), 3);
-
- cs.insert(*makeData("/d"), true);
- BOOST_CHECK_EQUAL(cs.size(), 3);
-
- const Data* oldestData = cs.find(Interest("/a"));
- const Data* newestData = cs.find(Interest("/c"));
- BOOST_CHECK(oldestData == 0);
- BOOST_CHECK(newestData != 0);
-}
-
-BOOST_AUTO_TEST_CASE(UnsolicitedWithSolicitedEvictionOrder)
-{
- Cs cs(3);
-
- cs.insert(*makeData("/a"), true);
- cs.insert(*makeData("/b"), false);
- cs.insert(*makeData("/c"), true);
- BOOST_CHECK_EQUAL(cs.size(), 3);
-
- cs.insert(*makeData("/d"), true);
- BOOST_CHECK_EQUAL(cs.size(), 3);
-
- const Data* oldestData = cs.find(Interest("/a"));
- const Data* newestData = cs.find(Interest("/c"));
- BOOST_CHECK(oldestData == 0);
- BOOST_CHECK(newestData != 0);
-}
-
-//even max size
-BOOST_AUTO_TEST_CASE(ReplacementEvenSize)
-{
- Cs cs(4);
-
- shared_ptr<Data> data = makeData("/a");
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/b");
- cs.insert(*data2);
-
- shared_ptr<Data> data3 = makeData("/c");
- cs.insert(*data3);
-
- shared_ptr<Data> data4 = makeData("/d");
- cs.insert(*data4);
-
- shared_ptr<Data> data5 = makeData("/e");
- cs.insert(*data5);
-
- BOOST_CHECK_EQUAL(cs.size(), 4);
-}
-
-//odd max size
-BOOST_AUTO_TEST_CASE(Replacement2)
-{
- Cs cs(3);
-
- shared_ptr<Data> data = makeData("/a");
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/b");
- cs.insert(*data2);
-
- shared_ptr<Data> data3 = makeData("/c");
- cs.insert(*data3);
-
- shared_ptr<Data> data4 = makeData("/d");
- cs.insert(*data4);
-
- BOOST_CHECK_EQUAL(cs.size(), 3);
-}
-
-BOOST_AUTO_TEST_CASE(InsertAndEraseByName)
-{
- CsAccessor cs;
-
- Name name("/insertandremovebyname");
- shared_ptr<Data> data = makeData(name);
- cs.insert(*data);
-
- ndn::ConstBufferPtr digest1 = ndn::crypto::sha256(data->wireEncode().wire(),
- data->wireEncode().size());
-
- shared_ptr<Data> data2 = makeData("/a");
- cs.insert(*data2);
-
- shared_ptr<Data> data3 = makeData("/z");
- cs.insert(*data3);
-
- BOOST_CHECK_EQUAL(cs.size(), 3);
-
- name.appendImplicitSha256Digest(digest1);
- cs.erase(name);
- BOOST_CHECK_EQUAL(cs.size(), 2);
-}
-
-BOOST_AUTO_TEST_CASE(DigestCalculation)
-{
- shared_ptr<Data> data = makeData("/digest/compute");
-
- ndn::ConstBufferPtr digest1 = ndn::crypto::sha256(data->wireEncode().wire(),
- data->wireEncode().size());
- BOOST_CHECK_EQUAL(digest1->size(), 32);
-
- cs::Entry* entry = new cs::Entry();
- entry->setData(*data, false);
-
- BOOST_CHECK_EQUAL_COLLECTIONS(digest1->begin(), digest1->end(),
- entry->getFullName()[-1].value_begin(),
- entry->getFullName()[-1].value_end());
-}
-
-BOOST_AUTO_TEST_CASE(InsertCanonical)
-{
- Cs cs;
-
- shared_ptr<Data> data = makeData("/a");
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/b");
- cs.insert(*data2);
-
- shared_ptr<Data> data3 = makeData("/c");
- cs.insert(*data3);
-
- shared_ptr<Data> data4 = makeData("/d");
- cs.insert(*data4);
-
- shared_ptr<Data> data5 = makeData("/c/c/1/2/3/4/5/6");
- cs.insert(*data5);
-
- shared_ptr<Data> data6 = makeData("/c/c/1/2/3");
- cs.insert(*data6);
-
- shared_ptr<Data> data7 = makeData("/c/c/1");
- cs.insert(*data7);
-}
-
-BOOST_AUTO_TEST_CASE(EraseCanonical)
-{
- Cs cs;
-
- shared_ptr<Data> data = makeData("/a");
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/b");
- cs.insert(*data2);
-
- shared_ptr<Data> data3 = makeData("/c");
- cs.insert(*data3);
-
- shared_ptr<Data> data4 = makeData("/d");
- cs.insert(*data4);
-
- shared_ptr<Data> data5 = makeData("/c/c/1/2/3/4/5/6");
- cs.insert(*data5);
-
- shared_ptr<Data> data6 = makeData("/c/c/1/2/3");
- cs.insert(*data6);
-
- shared_ptr<Data> data7 = makeData("/c/c/1");
- cs.insert(*data7);
-
- ndn::ConstBufferPtr digest1 = ndn::crypto::sha256(data->wireEncode().wire(),
- data->wireEncode().size());
-
- Name name("/a");
- name.appendImplicitSha256Digest(digest1->buf(), digest1->size());
- cs.erase(name);
- BOOST_CHECK_EQUAL(cs.size(), 6);
-}
-
-BOOST_AUTO_TEST_CASE(ImplicitDigestSelector)
-{
- CsAccessor cs;
-
- Name name("/digest/works");
- shared_ptr<Data> data = makeData(name);
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/a");
- cs.insert(*data2);
-
- shared_ptr<Data> data3 = makeData("/z/z/z");
- cs.insert(*data3);
-
- ndn::ConstBufferPtr digest1 = ndn::crypto::sha256(data->wireEncode().wire(),
- data->wireEncode().size());
- uint8_t digest2[32] = {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1};
-
- shared_ptr<Interest> interest = make_shared<Interest>();
- interest->setName(Name(name).append(digest1->buf(), digest1->size()));
- interest->setMinSuffixComponents(0);
- interest->setMaxSuffixComponents(0);
-
- const Data* found = cs.find(*interest);
- BOOST_CHECK_NE(found, static_cast<const Data*>(0));
- BOOST_CHECK_EQUAL(found->getName(), name);
-
- shared_ptr<Interest> interest2 = make_shared<Interest>();
- interest2->setName(Name(name).append(digest2, 32));
- interest2->setMinSuffixComponents(0);
- interest2->setMaxSuffixComponents(0);
-
- const Data* notfound = cs.find(*interest2);
- BOOST_CHECK_EQUAL(notfound, static_cast<const Data*>(0));
-}
-
-BOOST_AUTO_TEST_CASE(ChildSelector)
-{
- Cs cs;
-
- shared_ptr<Data> data = makeData("/a");
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/b");
- cs.insert(*data2);
-
- shared_ptr<Data> data4 = makeData("/d");
- cs.insert(*data4);
-
- shared_ptr<Data> data5 = makeData("/c/c");
- cs.insert(*data5);
-
- shared_ptr<Data> data6 = makeData("/c/f");
- cs.insert(*data6);
-
- shared_ptr<Data> data7 = makeData("/c/n");
- cs.insert(*data7);
-
- shared_ptr<Interest> interest = make_shared<Interest>("/c");
- interest->setChildSelector(1);
-
- const Data* found = cs.find(*interest);
- BOOST_CHECK_EQUAL(found->getName(), "/c/n");
-
- shared_ptr<Interest> interest2 = make_shared<Interest>("/c");
- interest2->setChildSelector(0);
-
- const Data* found2 = cs.find(*interest2);
- BOOST_CHECK_EQUAL(found2->getName(), "/c/c");
-}
-
-BOOST_AUTO_TEST_CASE(ChildSelector2)
-{
- Cs cs;
-
- shared_ptr<Data> data = makeData("/a/b/1");
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/a/b/2");
- cs.insert(*data2);
-
- shared_ptr<Data> data3 = makeData("/a/z/1");
- cs.insert(*data3);
-
- shared_ptr<Data> data4 = makeData("/a/z/2");
- cs.insert(*data4);
-
- shared_ptr<Interest> interest = make_shared<Interest>("/a");
- interest->setChildSelector(1);
-
- const Data* found = cs.find(*interest);
- BOOST_CHECK_EQUAL(found->getName(), "/a/z/1");
-}
-
-BOOST_AUTO_TEST_CASE(MustBeFreshSelector)
-{
- Cs cs;
-
- Name name("/insert/nonfresh");
- shared_ptr<Data> data = makeData(name);
- data->setFreshnessPeriod(time::milliseconds(500));
- signData(data);
- cs.insert(*data);
-
- sleep(1);
-
- shared_ptr<Interest> interest = make_shared<Interest>(name);
- interest->setMustBeFresh(true);
-
- const Data* found = cs.find(*interest);
- BOOST_CHECK_EQUAL(found, static_cast<const Data*>(0));
-}
-
-BOOST_AUTO_TEST_CASE(PublisherKeySelector)
-{
- Cs cs;
-
- Name name("/insert/withkey");
- shared_ptr<Data> data = makeData(name);
- cs.insert(*data);
-
- shared_ptr<Interest> interest = make_shared<Interest>(name);
- Name keyName("/somewhere/key");
-
- ndn::KeyLocator locator(keyName);
- interest->setPublisherPublicKeyLocator(locator);
-
- const Data* found = cs.find(*interest);
- BOOST_CHECK_EQUAL(found, static_cast<const Data*>(0));
-}
-
-BOOST_AUTO_TEST_CASE(PublisherKeySelector2)
-{
- Cs cs;
- Name name("/insert/withkey");
- shared_ptr<Data> data = makeData(name);
- cs.insert(*data);
-
- Name name2("/insert/withkey2");
- shared_ptr<Data> data2 = make_shared<Data>(name2);
-
- Name keyName("/somewhere/key");
- const ndn::KeyLocator locator(keyName);
-
- ndn::SignatureSha256WithRsa fakeSignature;
- fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
- reinterpret_cast<const uint8_t*>(0), 0));
-
- fakeSignature.setKeyLocator(locator);
- data2->setSignature(fakeSignature);
- data2->wireEncode();
-
- cs.insert(*data2);
-
- shared_ptr<Interest> interest = make_shared<Interest>(name2);
- interest->setPublisherPublicKeyLocator(locator);
-
- const Data* found = cs.find(*interest);
- BOOST_CHECK_NE(found, static_cast<const Data*>(0));
- BOOST_CHECK_EQUAL(found->getName(), data2->getName());
-}
-
-
-/// @todo Expected failures, needs to be fixed as part of Issue #2118
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MinMaxComponentsSelector, 1)
-BOOST_AUTO_TEST_CASE(MinMaxComponentsSelector)
-{
- Cs cs;
-
- shared_ptr<Data> data = makeData("/a");
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/b");
- cs.insert(*data2);
-
- shared_ptr<Data> data4 = makeData("/d");
- cs.insert(*data4);
-
- shared_ptr<Data> data5 = makeData("/c/c/1/2/3/4/5/6");
- cs.insert(*data5);
-
- shared_ptr<Data> data6 = makeData("/c/c/6/7/8/9");
- cs.insert(*data6);
-
- shared_ptr<Data> data7 = makeData("/c/c/1/2/3");
- cs.insert(*data7);
-
- shared_ptr<Data> data8 = makeData("/c/c/1");
- cs.insert(*data8);
-
- shared_ptr<Interest> interest = make_shared<Interest>("/c/c");
- interest->setMinSuffixComponents(3);
- interest->setChildSelector(0);
-
- const Data* found = cs.find(*interest);
- BOOST_CHECK_EQUAL(found->getName(), "/c/c/1/2/3/4/5/6");
-
- shared_ptr<Interest> interest2 = make_shared<Interest>("/c/c");
- interest2->setMinSuffixComponents(4);
- interest2->setChildSelector(1);
-
- const Data* found2 = cs.find(*interest2);
- BOOST_CHECK_EQUAL(found2->getName(), "/c/c/6/7/8/9");
-
- shared_ptr<Interest> interest3 = make_shared<Interest>("/c/c");
- interest3->setMaxSuffixComponents(2);
- interest3->setChildSelector(1);
-
- const Data* found3 = cs.find(*interest3);
- BOOST_CHECK_EQUAL(found3->getName(), "/c/c/1");
-}
-
-BOOST_AUTO_TEST_CASE(ExcludeSelector)
-{
- Cs cs;
-
- shared_ptr<Data> data = makeData("/a");
- cs.insert(*data);
-
- shared_ptr<Data> data2 = makeData("/b");
- cs.insert(*data2);
-
- shared_ptr<Data> data3 = makeData("/c/a");
- cs.insert(*data3);
-
- shared_ptr<Data> data4 = makeData("/d");
- cs.insert(*data4);
-
- shared_ptr<Data> data5 = makeData("/c/c");
- cs.insert(*data5);
-
- shared_ptr<Data> data6 = makeData("/c/f");
- cs.insert(*data6);
-
- shared_ptr<Data> data7 = makeData("/c/n");
- cs.insert(*data7);
-
- shared_ptr<Interest> interest = make_shared<Interest>("/c");
- interest->setChildSelector(1);
- Exclude e;
- e.excludeOne (Name::Component("n"));
- interest->setExclude(e);
-
- const Data* found = cs.find(*interest);
- BOOST_CHECK_EQUAL(found->getName(), "/c/f");
-
- shared_ptr<Interest> interest2 = make_shared<Interest>("/c");
- interest2->setChildSelector(0);
-
- Exclude e2;
- e2.excludeOne (Name::Component("a"));
- interest2->setExclude(e2);
-
- const Data* found2 = cs.find(*interest2);
- BOOST_CHECK_EQUAL(found2->getName(), "/c/c");
-
- shared_ptr<Interest> interest3 = make_shared<Interest>("/c");
- interest3->setChildSelector(0);
-
- Exclude e3;
- e3.excludeOne (Name::Component("c"));
- interest3->setExclude(e3);
-
- const Data* found3 = cs.find(*interest3);
- BOOST_CHECK_EQUAL(found3->getName(), "/c/a");
-}
-
-//
-
-class FindFixture : protected BaseFixture
-{
-protected:
- void
- insert(uint32_t id, const Name& name)
- {
- shared_ptr<Data> data = makeData(name);
- data->setFreshnessPeriod(time::milliseconds(99999));
- data->setContent(reinterpret_cast<const uint8_t*>(&id), sizeof(id));
- signData(data);
-
- m_cs.insert(*data);
- }
-
- Interest&
- startInterest(const Name& name)
- {
- m_interest = make_shared<Interest>(name);
- return *m_interest;
- }
-
- uint32_t
- find()
- {
- const Data* found = m_cs.find(*m_interest);
- if (found == 0) {
- return 0;
- }
- const Block& content = found->getContent();
- if (content.value_size() != sizeof(uint32_t)) {
- return 0;
- }
- return *reinterpret_cast<const uint32_t*>(content.value());
- }
-
-protected:
- Cs m_cs;
- shared_ptr<Interest> m_interest;
-};
-
-BOOST_FIXTURE_TEST_SUITE(Find, FindFixture)
-
-BOOST_AUTO_TEST_CASE(EmptyDataName)
-{
- insert(1, "ndn:/");
-
- startInterest("ndn:/");
- BOOST_CHECK_EQUAL(find(), 1);
-}
-
-BOOST_AUTO_TEST_CASE(EmptyInterestName)
-{
- insert(1, "ndn:/A");
-
- startInterest("ndn:/");
- BOOST_CHECK_EQUAL(find(), 1);
-}
-
-BOOST_AUTO_TEST_CASE(Leftmost)
-{
- insert(1, "ndn:/A");
- insert(2, "ndn:/B/p/1");
- insert(3, "ndn:/B/p/2");
- insert(4, "ndn:/B/q/1");
- insert(5, "ndn:/B/q/2");
- insert(6, "ndn:/C");
-
- startInterest("ndn:/B");
- BOOST_CHECK_EQUAL(find(), 2);
-}
-
-BOOST_AUTO_TEST_CASE(Rightmost)
-{
- insert(1, "ndn:/A");
- insert(2, "ndn:/B/p/1");
- insert(3, "ndn:/B/p/2");
- insert(4, "ndn:/B/q/1");
- insert(5, "ndn:/B/q/2");
- insert(6, "ndn:/C");
-
- startInterest("ndn:/B")
- .setChildSelector(1);
- BOOST_CHECK_EQUAL(find(), 4);
-}
-
-/// @todo Expected failures, needs to be fixed as part of Issue #2118
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(Leftmost_ExactName1, 1)
-BOOST_AUTO_TEST_CASE(Leftmost_ExactName1)
-{
- insert(1, "ndn:/");
- insert(2, "ndn:/A/B");
- insert(3, "ndn:/A/C");
- insert(4, "ndn:/A");
- insert(5, "ndn:/D");
-
- // Intuitively you would think Data 4 should be between Data 1 and 2,
- // but Data 4 has full Name ndn:/A/<32-octet hash>.
- startInterest("ndn:/A");
- BOOST_CHECK_EQUAL(find(), 2);
-}
-
-BOOST_AUTO_TEST_CASE(Leftmost_ExactName33)
-{
- insert(1, "ndn:/");
- insert(2, "ndn:/A");
- insert(3, "ndn:/A/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"); // 33 'B's
- insert(4, "ndn:/A/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"); // 33 'C's
- insert(5, "ndn:/D");
-
- // Data 2 is returned, because <32-octet hash> is less than Data 3.
- startInterest("ndn:/A");
- BOOST_CHECK_EQUAL(find(), 2);
-}
-
-/// @todo Expected failures, needs to be fixed as part of Issue #2118
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MinSuffixComponents, 2)
-BOOST_AUTO_TEST_CASE(MinSuffixComponents)
-{
- insert(1, "ndn:/A/1/2/3/4");
- insert(2, "ndn:/B/1/2/3");
- insert(3, "ndn:/C/1/2");
- insert(4, "ndn:/D/1");
- insert(5, "ndn:/E");
- insert(6, "ndn:/");
-
- startInterest("ndn:/")
- .setChildSelector(1)
- .setMinSuffixComponents(0);
- BOOST_CHECK_EQUAL(find(), 6);
-
- startInterest("ndn:/")
- .setChildSelector(1)
- .setMinSuffixComponents(1);
- BOOST_CHECK_EQUAL(find(), 6);
-
- startInterest("ndn:/")
- .setChildSelector(1)
- .setMinSuffixComponents(2);
- BOOST_CHECK_EQUAL(find(), 5);
-
- startInterest("ndn:/")
- .setChildSelector(1)
- .setMinSuffixComponents(3);
- BOOST_CHECK_EQUAL(find(), 4);
-
- startInterest("ndn:/")
- .setChildSelector(1)
- .setMinSuffixComponents(4);
- BOOST_CHECK_EQUAL(find(), 3);
-
- startInterest("ndn:/")
- .setChildSelector(1)
- .setMinSuffixComponents(5);
- BOOST_CHECK_EQUAL(find(), 2);
-
- startInterest("ndn:/")
- .setChildSelector(1)
- .setMinSuffixComponents(6);
- BOOST_CHECK_EQUAL(find(), 1);
-
- startInterest("ndn:/")
- .setChildSelector(1)
- .setMinSuffixComponents(7);
- BOOST_CHECK_EQUAL(find(), 0);
-}
-
-/// @todo Expected failures, needs to be fixed as part of Issue #2118
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MaxSuffixComponents, 5)
-BOOST_AUTO_TEST_CASE(MaxSuffixComponents)
-{
- insert(1, "ndn:/");
- insert(2, "ndn:/A");
- insert(3, "ndn:/A/B");
- insert(4, "ndn:/A/B/C");
- insert(5, "ndn:/A/B/C/D");
- insert(6, "ndn:/A/B/C/D/E");
- // Order is 6,5,4,3,2,1, because <32-octet hash> is greater than a 1-octet component.
-
- startInterest("ndn:/")
- .setMaxSuffixComponents(0);
- BOOST_CHECK_EQUAL(find(), 0);
-
- startInterest("ndn:/")
- .setMaxSuffixComponents(1);
- BOOST_CHECK_EQUAL(find(), 1);
-
- startInterest("ndn:/")
- .setMaxSuffixComponents(2);
- BOOST_CHECK_EQUAL(find(), 2);
-
- startInterest("ndn:/")
- .setMaxSuffixComponents(3);
- BOOST_CHECK_EQUAL(find(), 3);
-
- startInterest("ndn:/")
- .setMaxSuffixComponents(4);
- BOOST_CHECK_EQUAL(find(), 4);
-
- startInterest("ndn:/")
- .setMaxSuffixComponents(5);
- BOOST_CHECK_EQUAL(find(), 5);
-
- startInterest("ndn:/")
- .setMaxSuffixComponents(6);
- BOOST_CHECK_EQUAL(find(), 6);
-}
-
-BOOST_AUTO_TEST_CASE(DigestOrder)
-{
- insert(1, "ndn:/A");
- insert(2, "ndn:/A");
- // We don't know which comes first, but there must be some order
-
- startInterest("ndn:/A")
- .setChildSelector(0);
- uint32_t leftmost = find();
-
- startInterest("ndn:/A")
- .setChildSelector(1);
- uint32_t rightmost = find();
-
- BOOST_CHECK_NE(leftmost, rightmost);
-}
-
-/// @todo Expected failures, needs to be fixed as part of Issue #2118
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(DigestExclude, 1)
-BOOST_AUTO_TEST_CASE(DigestExclude)
-{
- insert(1, "ndn:/A/B");
- insert(2, "ndn:/A");
- insert(3, "ndn:/A/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"); // 33 'C's
-
- startInterest("ndn:/A")
- .setExclude(Exclude().excludeBefore(name::Component(reinterpret_cast<const uint8_t*>(
- "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
- "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"), 31))); // 31 0xFF's
- BOOST_CHECK_EQUAL(find(), 2);
-
- startInterest("ndn:/A")
- .setChildSelector(1)
- .setExclude(Exclude().excludeAfter(name::Component(reinterpret_cast<const uint8_t*>(
- "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
- "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
- "\x00"), 33))); // 33 0x00's
- BOOST_CHECK_EQUAL(find(), 2);
-}
-
-BOOST_AUTO_TEST_CASE(ExactName32)
-{
- insert(1, "ndn:/A/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"); // 32 'B's
- insert(2, "ndn:/A/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"); // 32 'C's
-
- startInterest("ndn:/A/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB");
- BOOST_CHECK_EQUAL(find(), 1);
-}
-
-/// @todo Expected failures, needs to be fixed as part of Issue #2118
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MinSuffixComponents32, 2)
-BOOST_AUTO_TEST_CASE(MinSuffixComponents32)
-{
- insert(1, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/1/2/3/4"); // 32 'x's
- insert(2, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/B/1/2/3");
- insert(3, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/C/1/2");
- insert(4, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/D/1");
- insert(5, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/E");
- insert(6, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setChildSelector(1)
- .setMinSuffixComponents(0);
- BOOST_CHECK_EQUAL(find(), 6);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setChildSelector(1)
- .setMinSuffixComponents(1);
- BOOST_CHECK_EQUAL(find(), 6);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setChildSelector(1)
- .setMinSuffixComponents(2);
- BOOST_CHECK_EQUAL(find(), 5);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setChildSelector(1)
- .setMinSuffixComponents(3);
- BOOST_CHECK_EQUAL(find(), 4);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setChildSelector(1)
- .setMinSuffixComponents(4);
- BOOST_CHECK_EQUAL(find(), 3);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setChildSelector(1)
- .setMinSuffixComponents(5);
- BOOST_CHECK_EQUAL(find(), 2);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setChildSelector(1)
- .setMinSuffixComponents(6);
- BOOST_CHECK_EQUAL(find(), 1);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setChildSelector(1)
- .setMinSuffixComponents(7);
- BOOST_CHECK_EQUAL(find(), 0);
-}
-
-/// @todo Expected failures, needs to be fixed as part of Issue #2118
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(MaxSuffixComponents32, 5)
-BOOST_AUTO_TEST_CASE(MaxSuffixComponents32)
-{
- insert(1, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/"); // 32 'x's
- insert(2, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A");
- insert(3, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/B");
- insert(4, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/B/C");
- insert(5, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/B/C/D");
- insert(6, "ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/A/B/C/D/E");
- // Order is 6,5,4,3,2,1, because <32-octet hash> is greater than a 1-octet component.
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setMaxSuffixComponents(0);
- BOOST_CHECK_EQUAL(find(), 0);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setMaxSuffixComponents(1);
- BOOST_CHECK_EQUAL(find(), 1);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setMaxSuffixComponents(2);
- BOOST_CHECK_EQUAL(find(), 2);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setMaxSuffixComponents(3);
- BOOST_CHECK_EQUAL(find(), 3);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setMaxSuffixComponents(4);
- BOOST_CHECK_EQUAL(find(), 4);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setMaxSuffixComponents(5);
- BOOST_CHECK_EQUAL(find(), 5);
-
- startInterest("ndn:/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
- .setMaxSuffixComponents(6);
- BOOST_CHECK_EQUAL(find(), 6);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // Find
-
-BOOST_AUTO_TEST_CASE(Iterator)
-{
- Cs cs;
-
- Name nameA("/A");
- Name nameAB("/A/B");
- Name nameABC("/A/B/C");
- Name nameD("/D");
-
- BOOST_CHECK_EQUAL(cs.size(), 0);
- BOOST_CHECK(cs.begin() == cs.end());
-
- cs.insert(*makeData(nameABC));
- BOOST_CHECK_EQUAL(cs.size(), 1);
- BOOST_CHECK(cs.begin() != cs.end());
- BOOST_CHECK(cs.begin()->getName() == nameABC);
- BOOST_CHECK((*cs.begin()).getName() == nameABC);
-
- auto i = cs.begin();
- auto j = cs.begin();
- BOOST_CHECK(++i == cs.end());
- BOOST_CHECK(j++ == cs.begin());
- BOOST_CHECK(j == cs.end());
-
- cs.insert(*makeData(nameA));
- cs.insert(*makeData(nameAB));
- cs.insert(*makeData(nameD));
-
- std::set<Name> expected = {nameA, nameAB, nameABC, nameD};
- std::set<Name> actual;
- for (const auto& csEntry : cs) {
- actual.insert(csEntry.getName());
- }
- BOOST_CHECK_EQUAL_COLLECTIONS(actual.begin(), actual.end(), expected.begin(), expected.end());
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TableCs
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/table/dead-nonce-list.cpp b/NFD/tests/daemon/table/dead-nonce-list.cpp
deleted file mode 100644
index 970d537..0000000
--- a/NFD/tests/daemon/table/dead-nonce-list.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/dead-nonce-list.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/limited-io.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(TableDeadNonceList, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
- Name nameA("ndn:/A");
- Name nameB("ndn:/B");
- const uint32_t nonce1 = 0x53b4eaa8;
- const uint32_t nonce2 = 0x1f46372b;
-
- DeadNonceList dnl;
- BOOST_CHECK_EQUAL(dnl.size(), 0);
- BOOST_CHECK_EQUAL(dnl.has(nameA, nonce1), false);
-
- dnl.add(nameA, nonce1);
- BOOST_CHECK_EQUAL(dnl.size(), 1);
- BOOST_CHECK_EQUAL(dnl.has(nameA, nonce1), true);
- BOOST_CHECK_EQUAL(dnl.has(nameA, nonce2), false);
- BOOST_CHECK_EQUAL(dnl.has(nameB, nonce1), false);
-}
-
-BOOST_AUTO_TEST_CASE(MinLifetime)
-{
- BOOST_CHECK_THROW(DeadNonceList dnl(time::milliseconds::zero()), std::invalid_argument);
-}
-
-/// A Fixture that periodically inserts Nonces
-class PeriodicalInsertionFixture : public BaseFixture
-{
-protected:
- PeriodicalInsertionFixture()
- : dnl(LIFETIME)
- , name("ndn:/N")
- , addNonceBatch(0)
- , addNonceInterval(LIFETIME / DeadNonceList::EXPECTED_MARK_COUNT)
- {
- this->addNonce();
- }
-
- ~PeriodicalInsertionFixture()
- {
- scheduler::cancel(addNonceEvent);
- }
-
- void
- setRate(size_t nNoncesPerLifetime)
- {
- addNonceBatch = nNoncesPerLifetime / DeadNonceList::EXPECTED_MARK_COUNT;
- }
-
- void
- addNonce()
- {
- for (size_t i = 0; i < addNonceBatch; ++i) {
- dnl.add(name, ++lastNonce);
- }
-
- scheduler::cancel(addNonceEvent); // avoid double schedules
- if (addNonceInterval > time::nanoseconds::zero()) {
- addNonceEvent = scheduler::schedule(addNonceInterval,
- bind(&PeriodicalInsertionFixture::addNonce, this));
- }
- }
-
-protected:
- static const time::nanoseconds LIFETIME;
- DeadNonceList dnl;
- Name name;
- uint32_t lastNonce;
- size_t addNonceBatch;
- time::nanoseconds addNonceInterval;
- scheduler::EventId addNonceEvent;
-};
-const time::nanoseconds PeriodicalInsertionFixture::LIFETIME = time::milliseconds(200);
-
-BOOST_FIXTURE_TEST_CASE(Lifetime, PeriodicalInsertionFixture)
-{
- BOOST_CHECK_EQUAL(dnl.getLifetime(), LIFETIME);
-
- LimitedIo limitedIo;
-
- const int RATE = DeadNonceList::INITIAL_CAPACITY / 2;
- this->setRate(RATE);
- limitedIo.defer(LIFETIME * 10);
-
- Name nameC("ndn:/C");
- const uint32_t nonceC = 0x25390656;
- BOOST_CHECK_EQUAL(dnl.has(nameC, nonceC), false);
- dnl.add(nameC, nonceC);
- BOOST_CHECK_EQUAL(dnl.has(nameC, nonceC), true);
-
- limitedIo.defer(LIFETIME / 2); // -50%, entry should exist
- BOOST_CHECK_EQUAL(dnl.has(nameC, nonceC), true);
-
- limitedIo.defer(LIFETIME); // +50%, entry should be gone
- BOOST_CHECK_EQUAL(dnl.has(nameC, nonceC), false);
-}
-
-BOOST_FIXTURE_TEST_CASE(CapacityDown, PeriodicalInsertionFixture)
-{
- LimitedIo limitedIo;
-
- ssize_t cap0 = dnl.m_capacity;
-
- const int RATE = DeadNonceList::INITIAL_CAPACITY / 3;
- this->setRate(RATE);
- limitedIo.defer(LIFETIME * 10);
-
- ssize_t cap1 = dnl.m_capacity;
- BOOST_CHECK_LT(std::abs(cap1 - RATE), std::abs(cap0 - RATE));
-}
-
-BOOST_FIXTURE_TEST_CASE(CapacityUp, PeriodicalInsertionFixture)
-{
- LimitedIo limitedIo;
-
- ssize_t cap0 = dnl.m_capacity;
-
- const int RATE = DeadNonceList::INITIAL_CAPACITY * 3;
- this->setRate(RATE);
- limitedIo.defer(LIFETIME * 10);
-
- ssize_t cap1 = dnl.m_capacity;
- BOOST_CHECK_LT(std::abs(cap1 - RATE), std::abs(cap0 - RATE));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/table/fib.cpp b/NFD/tests/daemon/table/fib.cpp
deleted file mode 100644
index d75088b..0000000
--- a/NFD/tests/daemon/table/fib.cpp
+++ /dev/null
@@ -1,436 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/fib.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(TableFib, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Entry)
-{
- Name prefix("ndn:/pxWhfFza");
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
-
- fib::Entry entry(prefix);
- BOOST_CHECK_EQUAL(entry.getPrefix(), prefix);
-
- const fib::NextHopList& nexthops1 = entry.getNextHops();
- // []
- BOOST_CHECK_EQUAL(nexthops1.size(), 0);
-
- entry.addNextHop(face1, 20);
- const fib::NextHopList& nexthops2 = entry.getNextHops();
- // [(face1,20)]
- BOOST_CHECK_EQUAL(nexthops2.size(), 1);
- BOOST_CHECK_EQUAL(nexthops2.begin()->getFace(), face1);
- BOOST_CHECK_EQUAL(nexthops2.begin()->getCost(), 20);
-
- entry.addNextHop(face1, 30);
- const fib::NextHopList& nexthops3 = entry.getNextHops();
- // [(face1,30)]
- BOOST_CHECK_EQUAL(nexthops3.size(), 1);
- BOOST_CHECK_EQUAL(nexthops3.begin()->getFace(), face1);
- BOOST_CHECK_EQUAL(nexthops3.begin()->getCost(), 30);
-
- entry.addNextHop(face2, 40);
- const fib::NextHopList& nexthops4 = entry.getNextHops();
- // [(face1,30), (face2,40)]
- BOOST_CHECK_EQUAL(nexthops4.size(), 2);
- int i = -1;
- for (fib::NextHopList::const_iterator it = nexthops4.begin();
- it != nexthops4.end(); ++it) {
- ++i;
- switch (i) {
- case 0 :
- BOOST_CHECK_EQUAL(it->getFace(), face1);
- BOOST_CHECK_EQUAL(it->getCost(), 30);
- break;
- case 1 :
- BOOST_CHECK_EQUAL(it->getFace(), face2);
- BOOST_CHECK_EQUAL(it->getCost(), 40);
- break;
- }
- }
-
- entry.addNextHop(face2, 10);
- const fib::NextHopList& nexthops5 = entry.getNextHops();
- // [(face2,10), (face1,30)]
- BOOST_CHECK_EQUAL(nexthops5.size(), 2);
- i = -1;
- for (fib::NextHopList::const_iterator it = nexthops5.begin();
- it != nexthops5.end(); ++it) {
- ++i;
- switch (i) {
- case 0 :
- BOOST_CHECK_EQUAL(it->getFace(), face2);
- BOOST_CHECK_EQUAL(it->getCost(), 10);
- break;
- case 1 :
- BOOST_CHECK_EQUAL(it->getFace(), face1);
- BOOST_CHECK_EQUAL(it->getCost(), 30);
- break;
- }
- }
-
- entry.removeNextHop(face1);
- const fib::NextHopList& nexthops6 = entry.getNextHops();
- // [(face2,10)]
- BOOST_CHECK_EQUAL(nexthops6.size(), 1);
- BOOST_CHECK_EQUAL(nexthops6.begin()->getFace(), face2);
- BOOST_CHECK_EQUAL(nexthops6.begin()->getCost(), 10);
-
- entry.removeNextHop(face1);
- const fib::NextHopList& nexthops7 = entry.getNextHops();
- // [(face2,10)]
- BOOST_CHECK_EQUAL(nexthops7.size(), 1);
- BOOST_CHECK_EQUAL(nexthops7.begin()->getFace(), face2);
- BOOST_CHECK_EQUAL(nexthops7.begin()->getCost(), 10);
-
- entry.removeNextHop(face2);
- const fib::NextHopList& nexthops8 = entry.getNextHops();
- // []
- BOOST_CHECK_EQUAL(nexthops8.size(), 0);
-
- entry.removeNextHop(face2);
- const fib::NextHopList& nexthops9 = entry.getNextHops();
- // []
- BOOST_CHECK_EQUAL(nexthops9.size(), 0);
-}
-
-BOOST_AUTO_TEST_CASE(Insert_LongestPrefixMatch)
-{
- Name nameEmpty;
- Name nameA ("ndn:/A");
- Name nameAB ("ndn:/A/B");
- Name nameABC ("ndn:/A/B/C");
- Name nameABCD("ndn:/A/B/C/D");
- Name nameE ("ndn:/E");
-
- std::pair<shared_ptr<fib::Entry>, bool> insertRes;
- shared_ptr<fib::Entry> entry;
-
- NameTree nameTree;
- Fib fib(nameTree);
- // []
- BOOST_CHECK_EQUAL(fib.size(), 0);
-
- entry = fib.findLongestPrefixMatch(nameA);
- BOOST_REQUIRE(static_cast<bool>(entry)); // the empty entry
-
- insertRes = fib.insert(nameEmpty);
- BOOST_CHECK_EQUAL(insertRes.second, true);
- BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameEmpty);
- // ['/']
- BOOST_CHECK_EQUAL(fib.size(), 1);
-
- entry = fib.findLongestPrefixMatch(nameA);
- BOOST_REQUIRE(static_cast<bool>(entry));
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
-
- insertRes = fib.insert(nameA);
- BOOST_CHECK_EQUAL(insertRes.second, true);
- BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameA);
- // ['/', '/A']
- BOOST_CHECK_EQUAL(fib.size(), 2);
-
- insertRes = fib.insert(nameA);
- BOOST_CHECK_EQUAL(insertRes.second, false);
- BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameA);
- // ['/', '/A']
- BOOST_CHECK_EQUAL(fib.size(), 2);
-
- entry = fib.findLongestPrefixMatch(nameA);
- BOOST_REQUIRE(static_cast<bool>(entry));
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
-
- entry = fib.findLongestPrefixMatch(nameABCD);
- BOOST_REQUIRE(static_cast<bool>(entry));
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
-
- insertRes = fib.insert(nameABC);
- BOOST_CHECK_EQUAL(insertRes.second, true);
- BOOST_CHECK_EQUAL(insertRes.first->getPrefix(), nameABC);
- // ['/', '/A', '/A/B/C']
- BOOST_CHECK_EQUAL(fib.size(), 3);
-
- entry = fib.findLongestPrefixMatch(nameA);
- BOOST_REQUIRE(static_cast<bool>(entry));
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
-
- entry = fib.findLongestPrefixMatch(nameAB);
- BOOST_REQUIRE(static_cast<bool>(entry));
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
-
- entry = fib.findLongestPrefixMatch(nameABCD);
- BOOST_REQUIRE(static_cast<bool>(entry));
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameABC);
-
- entry = fib.findLongestPrefixMatch(nameE);
- BOOST_REQUIRE(static_cast<bool>(entry));
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
-}
-
-BOOST_AUTO_TEST_CASE(RemoveNextHopFromAllEntries)
-{
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
- Name nameEmpty("ndn:/");
- Name nameA("ndn:/A");
- Name nameB("ndn:/B");
-
- std::pair<shared_ptr<fib::Entry>, bool> insertRes;
- shared_ptr<fib::Entry> entry;
-
- NameTree nameTree;
- Fib fib(nameTree);
- // {}
-
- insertRes = fib.insert(nameA);
- insertRes.first->addNextHop(face1, 0);
- insertRes.first->addNextHop(face2, 0);
- // {'/A':[1,2]}
-
- insertRes = fib.insert(nameB);
- insertRes.first->addNextHop(face1, 0);
- // {'/A':[1,2], '/B':[1]}
- BOOST_CHECK_EQUAL(fib.size(), 2);
-
- insertRes = fib.insert("/C");
- insertRes.first->addNextHop(face2, 1);
- // {'/A':[1,2], '/B':[1], '/C':[2]}
- BOOST_CHECK_EQUAL(fib.size(), 3);
-
- insertRes = fib.insert("/B/1");
- insertRes.first->addNextHop(face1, 0);
- // {'/A':[1,2], '/B':[1], '/B/1':[1], '/C':[2]}
- BOOST_CHECK_EQUAL(fib.size(), 4);
-
- insertRes = fib.insert("/B/1/2");
- insertRes.first->addNextHop(face1, 0);
- // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/C':[2]}
- BOOST_CHECK_EQUAL(fib.size(), 5);
-
- insertRes = fib.insert("/B/1/2/3");
- insertRes.first->addNextHop(face1, 0);
- // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/B/1/3':[1], '/C':[2]}
- BOOST_CHECK_EQUAL(fib.size(), 6);
-
- insertRes = fib.insert("/B/1/2/3/4");
- insertRes.first->addNextHop(face1, 0);
- // {'/A':[1,2], '/B':[1], '/B/1':[1], '/B/1/2':[1], '/B/1/2/3':[1], '/B/1/2/3/4':[1], '/C':[2]}
- BOOST_CHECK_EQUAL(fib.size(), 7);
-
- /////////////
-
- fib.removeNextHopFromAllEntries(face1);
- // {'/A':[2], '/C':[2]}
- BOOST_CHECK_EQUAL(fib.size(), 2);
-
- entry = fib.findLongestPrefixMatch(nameA);
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameA);
- const fib::NextHopList& nexthopsA = entry->getNextHops();
- BOOST_CHECK_EQUAL(nexthopsA.size(), 1);
- BOOST_CHECK_EQUAL(nexthopsA.begin()->getFace(), face2);
-
- entry = fib.findLongestPrefixMatch(nameB);
- BOOST_CHECK_EQUAL(entry->getPrefix(), nameEmpty);
-}
-
-BOOST_AUTO_TEST_CASE(RemoveNextHopFromManyEntries)
-{
- NameTree nameTree(16);
- Fib fib(nameTree);
- shared_ptr<Face> face1 = make_shared<DummyFace>();
-
- for (uint64_t i = 0; i < 300; ++i) {
- shared_ptr<fib::Entry> entry = fib.insert(Name("/P").appendVersion(i)).first;
- entry->addNextHop(face1, 0);
- }
- BOOST_CHECK_EQUAL(fib.size(), 300);
-
- fib.removeNextHopFromAllEntries(face1);
- BOOST_CHECK_EQUAL(fib.size(), 0);
-}
-
-void
-validateFindExactMatch(const Fib& fib, const Name& target)
-{
- shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
- if (static_cast<bool>(entry))
- {
- BOOST_CHECK_EQUAL(entry->getPrefix(), target);
- }
- else
- {
- BOOST_FAIL("No entry found for " << target);
- }
-}
-
-void
-validateNoExactMatch(const Fib& fib, const Name& target)
-{
- shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
- if (static_cast<bool>(entry))
- {
- BOOST_FAIL("Found unexpected entry for " << target);
- }
-}
-
-BOOST_AUTO_TEST_CASE(FindExactMatch)
-{
- NameTree nameTree;
- Fib fib(nameTree);
- fib.insert("/A");
- fib.insert("/A/B");
- fib.insert("/A/B/C");
-
- validateFindExactMatch(fib, "/A");
- validateFindExactMatch(fib, "/A/B");
- validateFindExactMatch(fib, "/A/B/C");
- validateNoExactMatch(fib, "/");
-
- validateNoExactMatch(fib, "/does/not/exist");
-
- NameTree gapNameTree;
- Fib gapFib(nameTree);
- fib.insert("/X");
- fib.insert("/X/Y/Z");
-
- validateNoExactMatch(gapFib, "/X/Y");
-
- NameTree emptyNameTree;
- Fib emptyFib(emptyNameTree);
- validateNoExactMatch(emptyFib, "/nothing/here");
-}
-
-void
-validateErase(Fib& fib, const Name& target)
-{
- fib.erase(target);
-
- shared_ptr<fib::Entry> entry = fib.findExactMatch(target);
- if (static_cast<bool>(entry))
- {
- BOOST_FAIL("Found \"removed\" entry for " << target);
- }
-}
-
-BOOST_AUTO_TEST_CASE(Erase)
-{
- NameTree emptyNameTree;
- Fib emptyFib(emptyNameTree);
-
- emptyFib.erase("/does/not/exist"); // crash test
-
- validateErase(emptyFib, "/");
-
- emptyFib.erase("/still/does/not/exist"); // crash test
-
- NameTree nameTree;
- Fib fib(nameTree);
- fib.insert("/");
- fib.insert("/A");
- fib.insert("/A/B");
- fib.insert("/A/B/C");
-
- // check if we remove the right thing and leave
- // everything else alone
-
- validateErase(fib, "/A/B");
- validateFindExactMatch(fib, "/A");
- validateFindExactMatch(fib, "/A/B/C");
- validateFindExactMatch(fib, "/");
-
- validateErase(fib, "/A/B/C");
- validateFindExactMatch(fib, "/A");
- validateFindExactMatch(fib, "/");
-
- validateErase(fib, "/A");
- validateFindExactMatch(fib, "/");
-
- validateErase(fib, "/");
- validateNoExactMatch(fib, "/");
-
- NameTree gapNameTree;
- Fib gapFib(gapNameTree);
- gapFib.insert("/X");
- gapFib.insert("/X/Y/Z");
-
- gapFib.erase("/X/Y"); //should do nothing
- validateFindExactMatch(gapFib, "/X");
- validateFindExactMatch(gapFib, "/X/Y/Z");
-}
-
-BOOST_AUTO_TEST_CASE(EraseNameTreeEntry)
-{
- NameTree nameTree;
- Fib fib(nameTree);
- size_t nNameTreeEntriesBefore = nameTree.size();
-
- fib.insert("ndn:/A/B/C");
- fib.erase("ndn:/A/B/C");
- BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
-}
-
-BOOST_AUTO_TEST_CASE(Iterator)
-{
- NameTree nameTree;
- Fib fib(nameTree);
- Name nameA("/A");
- Name nameAB("/A/B");
- Name nameABC("/A/B/C");
- Name nameRoot("/");
-
- fib.insert(nameA);
- fib.insert(nameAB);
- fib.insert(nameABC);
- fib.insert(nameRoot);
-
- std::set<Name> expected;
- expected.insert(nameA);
- expected.insert(nameAB);
- expected.insert(nameABC);
- expected.insert(nameRoot);
-
- for (Fib::const_iterator it = fib.begin(); it != fib.end(); it++)
- {
- bool isInSet = expected.find(it->getPrefix()) != expected.end();
- BOOST_CHECK(isInSet);
- expected.erase(it->getPrefix());
- }
-
- BOOST_CHECK_EQUAL(expected.size(), 0);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/table/measurements-accessor.cpp b/NFD/tests/daemon/table/measurements-accessor.cpp
deleted file mode 100644
index 8668368..0000000
--- a/NFD/tests/daemon/table/measurements-accessor.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/measurements-accessor.hpp"
-#include "fw/strategy.hpp"
-
-#include "tests/test-common.hpp"
-#include "../fw/dummy-strategy.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(TableMeasurementsAccessor, BaseFixture)
-
-class MeasurementsAccessorTestStrategy : public DummyStrategy
-{
-public:
- MeasurementsAccessorTestStrategy(Forwarder& forwarder, const Name& name)
- : DummyStrategy(forwarder, name)
- {
- }
-
- virtual
- ~MeasurementsAccessorTestStrategy()
- {
- }
-
-public: // accessors
- MeasurementsAccessor&
- getMeasurements_accessor()
- {
- return this->getMeasurements();
- }
-};
-
-BOOST_AUTO_TEST_CASE(Access)
-{
- Forwarder forwarder;
-
- auto strategy1 = make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy1");
- auto strategy2 = make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy2");
-
- Name nameRoot("ndn:/");
- Name nameA ("ndn:/A");
- Name nameAB ("ndn:/A/B");
- Name nameABC ("ndn:/A/B/C");
- Name nameAD ("ndn:/A/D");
-
- StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
- strategyChoice.install(strategy1);
- strategyChoice.install(strategy2);
- strategyChoice.insert(nameRoot, strategy1->getName());
- strategyChoice.insert(nameA , strategy2->getName());
- strategyChoice.insert(nameAB , strategy1->getName());
-
- MeasurementsAccessor& accessor1 = strategy1->getMeasurements_accessor();
- MeasurementsAccessor& accessor2 = strategy2->getMeasurements_accessor();
-
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameRoot)), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameA )), false);
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameAB )), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameABC )), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameAD )), false);
-
- shared_ptr<measurements::Entry> entryRoot = forwarder.getMeasurements().get(nameRoot);
- BOOST_CHECK_NO_THROW(accessor1.getParent(*entryRoot));
-
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameRoot)), false);
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameA )), true);
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameAB )), false);
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameABC )), false);
- BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameAD )), true);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/table/measurements.cpp b/NFD/tests/daemon/table/measurements.cpp
deleted file mode 100644
index 63254bd..0000000
--- a/NFD/tests/daemon/table/measurements.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/measurements.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/limited-io.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(TableMeasurements, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Get_Parent)
-{
- NameTree nameTree;
- Measurements measurements(nameTree);
-
- Name name0;
- Name nameA ("ndn:/A");
- Name nameAB("ndn:/A/B");
-
- shared_ptr<measurements::Entry> entryAB = measurements.get(nameAB);
- BOOST_REQUIRE(entryAB != nullptr);
- BOOST_CHECK_EQUAL(entryAB->getName(), nameAB);
-
- shared_ptr<measurements::Entry> entry0 = measurements.get(name0);
- BOOST_REQUIRE(entry0 != nullptr);
-
- shared_ptr<measurements::Entry> entryA = measurements.getParent(*entryAB);
- BOOST_REQUIRE(entryA != nullptr);
- BOOST_CHECK_EQUAL(entryA->getName(), nameA);
-
- shared_ptr<measurements::Entry> entry0c = measurements.getParent(*entryA);
- BOOST_CHECK_EQUAL(entry0, entry0c);
-}
-
-BOOST_FIXTURE_TEST_CASE(Lifetime, UnitTestTimeFixture)
-{
- NameTree nameTree;
- Measurements measurements(nameTree);
- Name nameA("ndn:/A");
- Name nameB("ndn:/B");
- Name nameC("ndn:/C");
-
- BOOST_CHECK_EQUAL(measurements.size(), 0);
-
- shared_ptr<measurements::Entry> entryA = measurements.get(nameA);
- shared_ptr<measurements::Entry> entryB = measurements.get(nameB);
- shared_ptr<measurements::Entry> entryC = measurements.get(nameC);
- BOOST_CHECK_EQUAL(measurements.size(), 3);
-
- const time::nanoseconds EXTEND_A = time::seconds(2);
- const time::nanoseconds CHECK1 = time::seconds(3);
- const time::nanoseconds CHECK2 = time::seconds(5);
- const time::nanoseconds EXTEND_C = time::seconds(6);
- const time::nanoseconds CHECK3 = time::seconds(7);
- BOOST_ASSERT(EXTEND_A < CHECK1);
- BOOST_ASSERT(CHECK1 < Measurements::getInitialLifetime());
- BOOST_ASSERT(Measurements::getInitialLifetime() < CHECK2);
- BOOST_ASSERT(CHECK2 < EXTEND_C);
- BOOST_ASSERT(EXTEND_C < CHECK3);
-
- measurements.extendLifetime(*entryA, EXTEND_A);
- measurements.extendLifetime(*entryC, EXTEND_C);
- // remaining lifetime:
- // A = initial lifetime, because it's extended by less duration
- // B = initial lifetime
- // C = EXTEND_C
- entryA.reset();
- entryB.reset();
- entryC.reset();
-
- this->advanceClocks(time::milliseconds(100), CHECK1);
- BOOST_CHECK(measurements.findExactMatch(nameA) != nullptr);
- BOOST_CHECK(measurements.findExactMatch(nameB) != nullptr);
- BOOST_CHECK(measurements.findExactMatch(nameC) != nullptr);
- BOOST_CHECK_EQUAL(measurements.size(), 3);
-
- this->advanceClocks(time::milliseconds(100), CHECK2 - CHECK1);
- BOOST_CHECK(measurements.findExactMatch(nameA) == nullptr);
- BOOST_CHECK(measurements.findExactMatch(nameB) == nullptr);
- BOOST_CHECK(measurements.findExactMatch(nameC) != nullptr);
- BOOST_CHECK_EQUAL(measurements.size(), 1);
-
- this->advanceClocks(time::milliseconds(100), CHECK3 - CHECK2);
- BOOST_CHECK(measurements.findExactMatch(nameA) == nullptr);
- BOOST_CHECK(measurements.findExactMatch(nameB) == nullptr);
- BOOST_CHECK(measurements.findExactMatch(nameC) == nullptr);
- BOOST_CHECK_EQUAL(measurements.size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(EraseNameTreeEntry, UnitTestTimeFixture)
-{
- NameTree nameTree;
- Measurements measurements(nameTree);
- size_t nNameTreeEntriesBefore = nameTree.size();
-
- shared_ptr<measurements::Entry> entry = measurements.get("/A");
- this->advanceClocks(Measurements::getInitialLifetime() + time::milliseconds(10));
- BOOST_CHECK_EQUAL(measurements.size(), 0);
- BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/table/name-tree.cpp b/NFD/tests/daemon/table/name-tree.cpp
deleted file mode 100644
index 9790596..0000000
--- a/NFD/tests/daemon/table/name-tree.cpp
+++ /dev/null
@@ -1,591 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/name-tree.hpp"
-#include <unordered_set>
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-using name_tree::Entry;
-
-BOOST_FIXTURE_TEST_SUITE(TableNameTree, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Hash)
-{
- Name root("/");
- root.wireEncode();
- size_t hashValue = name_tree::computeHash(root);
- BOOST_CHECK_EQUAL(hashValue, static_cast<size_t>(0));
-
- Name prefix("/nohello/world/ndn/research");
- prefix.wireEncode();
- std::vector<size_t> hashSet = name_tree::computeHashSet(prefix);
- BOOST_CHECK_EQUAL(hashSet.size(), prefix.size() + 1);
-}
-
-BOOST_AUTO_TEST_CASE(Entry)
-{
- Name prefix("ndn:/named-data/research/abc/def/ghi");
-
- shared_ptr<name_tree::Entry> npe = make_shared<name_tree::Entry>(prefix);
- BOOST_CHECK_EQUAL(npe->getPrefix(), prefix);
-
- // examine all the get methods
-
- size_t hash = npe->getHash();
- BOOST_CHECK_EQUAL(hash, static_cast<size_t>(0));
-
- shared_ptr<name_tree::Entry> parent = npe->getParent();
- BOOST_CHECK(!static_cast<bool>(parent));
-
- std::vector<shared_ptr<name_tree::Entry> >& childList = npe->getChildren();
- BOOST_CHECK_EQUAL(childList.size(), static_cast<size_t>(0));
-
- shared_ptr<fib::Entry> fib = npe->getFibEntry();
- BOOST_CHECK(!static_cast<bool>(fib));
-
- const std::vector< shared_ptr<pit::Entry> >& pitList = npe->getPitEntries();
- BOOST_CHECK_EQUAL(pitList.size(), static_cast<size_t>(0));
-
- // examine all the set method
-
- npe->setHash(static_cast<size_t>(12345));
- BOOST_CHECK_EQUAL(npe->getHash(), static_cast<size_t>(12345));
-
- Name parentName("ndn:/named-data/research/abc/def");
- parent = make_shared<name_tree::Entry>(parentName);
- npe->setParent(parent);
- BOOST_CHECK_EQUAL(npe->getParent(), parent);
-
- // Insert FIB
-
- shared_ptr<fib::Entry> fibEntry(new fib::Entry(prefix));
- shared_ptr<fib::Entry> fibEntryParent(new fib::Entry(parentName));
-
- npe->setFibEntry(fibEntry);
- BOOST_CHECK_EQUAL(npe->getFibEntry(), fibEntry);
-
- npe->setFibEntry(shared_ptr<fib::Entry>());
- BOOST_CHECK(!static_cast<bool>(npe->getFibEntry()));
-
- // Insert a PIT
-
- shared_ptr<pit::Entry> pitEntry(make_shared<pit::Entry>(*makeInterest(prefix)));
- shared_ptr<pit::Entry> pitEntry2(make_shared<pit::Entry>(*makeInterest(parentName)));
-
- npe->insertPitEntry(pitEntry);
- BOOST_CHECK_EQUAL(npe->getPitEntries().size(), 1);
-
- npe->insertPitEntry(pitEntry2);
- BOOST_CHECK_EQUAL(npe->getPitEntries().size(), 2);
-
- npe->erasePitEntry(pitEntry);
- BOOST_CHECK_EQUAL(npe->getPitEntries().size(), 1);
-
- npe->erasePitEntry(pitEntry2);
- BOOST_CHECK_EQUAL(npe->getPitEntries().size(), 0);
-}
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
- size_t nBuckets = 16;
- NameTree nt(nBuckets);
-
- BOOST_CHECK_EQUAL(nt.size(), 0);
- BOOST_CHECK_EQUAL(nt.getNBuckets(), nBuckets);
-
- Name nameABC("ndn:/a/b/c");
- shared_ptr<name_tree::Entry> npeABC = nt.lookup(nameABC);
- BOOST_CHECK_EQUAL(nt.size(), 4);
-
- Name nameABD("/a/b/d");
- shared_ptr<name_tree::Entry> npeABD = nt.lookup(nameABD);
- BOOST_CHECK_EQUAL(nt.size(), 5);
-
- Name nameAE("/a/e/");
- shared_ptr<name_tree::Entry> npeAE = nt.lookup(nameAE);
- BOOST_CHECK_EQUAL(nt.size(), 6);
-
- Name nameF("/f");
- shared_ptr<name_tree::Entry> npeF = nt.lookup(nameF);
- BOOST_CHECK_EQUAL(nt.size(), 7);
-
- // validate lookup() and findExactMatch()
-
- Name nameAB ("/a/b");
- BOOST_CHECK_EQUAL(npeABC->getParent(), nt.findExactMatch(nameAB));
- BOOST_CHECK_EQUAL(npeABD->getParent(), nt.findExactMatch(nameAB));
-
- Name nameA ("/a");
- BOOST_CHECK_EQUAL(npeAE->getParent(), nt.findExactMatch(nameA));
-
- Name nameRoot ("/");
- BOOST_CHECK_EQUAL(npeF->getParent(), nt.findExactMatch(nameRoot));
- BOOST_CHECK_EQUAL(nt.size(), 7);
-
- Name name0("/does/not/exist");
- shared_ptr<name_tree::Entry> npe0 = nt.findExactMatch(name0);
- BOOST_CHECK(!static_cast<bool>(npe0));
-
-
- // Longest Prefix Matching
- shared_ptr<name_tree::Entry> temp;
- Name nameABCLPM("/a/b/c/def/asdf/nlf");
- temp = nt.findLongestPrefixMatch(nameABCLPM);
- BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameABC));
-
- Name nameABDLPM("/a/b/d/def/asdf/nlf");
- temp = nt.findLongestPrefixMatch(nameABDLPM);
- BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameABD));
-
- Name nameABLPM("/a/b/hello/world");
- temp = nt.findLongestPrefixMatch(nameABLPM);
- BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameAB));
-
- Name nameAELPM("/a/e/hello/world");
- temp = nt.findLongestPrefixMatch(nameAELPM);
- BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameAE));
-
- Name nameALPM("/a/hello/world");
- temp = nt.findLongestPrefixMatch(nameALPM);
- BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameA));
-
- Name nameFLPM("/f/hello/world");
- temp = nt.findLongestPrefixMatch(nameFLPM);
- BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameF));
-
- Name nameRootLPM("/does_not_exist");
- temp = nt.findLongestPrefixMatch(nameRootLPM);
- BOOST_CHECK_EQUAL(temp, nt.findExactMatch(nameRoot));
-
- bool eraseResult = false;
- temp = nt.findExactMatch(nameABC);
- if (static_cast<bool>(temp))
- eraseResult = nt.
- eraseEntryIfEmpty(temp);
- BOOST_CHECK_EQUAL(nt.size(), 6);
- BOOST_CHECK(!static_cast<bool>(nt.findExactMatch(nameABC)));
- BOOST_CHECK_EQUAL(eraseResult, true);
-
- eraseResult = false;
- temp = nt.findExactMatch(nameABCLPM);
- if (static_cast<bool>(temp))
- eraseResult = nt.
- eraseEntryIfEmpty(temp);
- BOOST_CHECK(!static_cast<bool>(temp));
- BOOST_CHECK_EQUAL(nt.size(), 6);
- BOOST_CHECK_EQUAL(eraseResult, false);
-
- // nt.dump(std::cout);
-
- nt.lookup(nameABC);
- BOOST_CHECK_EQUAL(nt.size(), 7);
-
- eraseResult = false;
- temp = nt.findExactMatch(nameABC);
- if (static_cast<bool>(temp))
- eraseResult = nt.
- eraseEntryIfEmpty(temp);
- BOOST_CHECK_EQUAL(nt.size(), 6);
- BOOST_CHECK_EQUAL(eraseResult, true);
- BOOST_CHECK(!static_cast<bool>(nt.findExactMatch(nameABC)));
-
- BOOST_CHECK_EQUAL(nt.getNBuckets(), 16);
-
- // should resize now
- Name nameABCD("a/b/c/d");
- nt.lookup(nameABCD);
- Name nameABCDE("a/b/c/d/e");
- nt.lookup(nameABCDE);
- BOOST_CHECK_EQUAL(nt.size(), 9);
- BOOST_CHECK_EQUAL(nt.getNBuckets(), 32);
-
- // try to erase /a/b/c, should return false
- temp = nt.findExactMatch(nameABC);
- BOOST_CHECK_EQUAL(temp->getPrefix(), nameABC);
- eraseResult = nt.
- eraseEntryIfEmpty(temp);
- BOOST_CHECK_EQUAL(eraseResult, false);
- temp = nt.findExactMatch(nameABC);
- BOOST_CHECK_EQUAL(temp->getPrefix(), nameABC);
-
- temp = nt.findExactMatch(nameABD);
- if (static_cast<bool>(temp))
- nt.
- eraseEntryIfEmpty(temp);
- BOOST_CHECK_EQUAL(nt.size(), 8);
-}
-
-/** \brief verify a NameTree enumeration contains expected entries
- *
- * Example:
- * \code{.cpp}
- * auto& enumerable = ...;
- * EnumerationVerifier(enumerable)
- * .expect("/A")
- * .expect("/B")
- * .end();
- * // enumerable must have /A /B and nothing else to pass the test.
- * \endcode
- */
-class EnumerationVerifier : noncopyable
-{
-public:
- template<typename Enumerable>
- EnumerationVerifier(Enumerable&& enumerable)
- {
- for (const name_tree::Entry& entry : enumerable) {
- const Name& name = entry.getPrefix();
- BOOST_CHECK_MESSAGE(m_names.insert(name).second, "duplicate Name " << name);
- }
- }
-
- EnumerationVerifier&
- expect(const Name& name)
- {
- BOOST_CHECK_MESSAGE(m_names.erase(name) == 1, "missing Name " << name);
- return *this;
- }
-
- void
- end()
- {
- BOOST_CHECK_MESSAGE(m_names.empty(), "excess Names including " << *m_names.begin());
- }
-
-private:
- std::unordered_set<Name> m_names;
-};
-
-class EnumerationFixture : public BaseFixture
-{
-protected:
- EnumerationFixture()
- : nt(N_BUCKETS)
- {
- BOOST_CHECK_EQUAL(nt.size(), 0);
- BOOST_CHECK_EQUAL(nt.getNBuckets(), N_BUCKETS);
- }
-
- void
- insertAbAc()
- {
- nt.lookup("/a/b");
- nt.lookup("/a/c");
- BOOST_CHECK_EQUAL(nt.size(), 4);
- // /, /a, /a/b, /a/c
- }
-
- void
- insertAb1Ab2Ac1Ac2()
- {
- nt.lookup("/a/b/1");
- nt.lookup("/a/b/2");
- nt.lookup("/a/c/1");
- nt.lookup("/a/c/2");
- BOOST_CHECK_EQUAL(nt.size(), 8);
- // /, /a, /a/b, /a/b/1, /a/b/2, /a/c, /a/c/1, /a/c/2
- }
-
-protected:
- static const size_t N_BUCKETS = 16;
- NameTree nt;
-};
-const size_t EnumerationFixture::N_BUCKETS;
-
-BOOST_FIXTURE_TEST_CASE(IteratorFullEnumerate, EnumerationFixture)
-{
- nt.lookup("/a/b/c");
- BOOST_CHECK_EQUAL(nt.size(), 4);
-
- nt.lookup("/a/b/d");
- BOOST_CHECK_EQUAL(nt.size(), 5);
-
- nt.lookup("/a/e");
- BOOST_CHECK_EQUAL(nt.size(), 6);
-
- nt.lookup("/f");
- BOOST_CHECK_EQUAL(nt.size(), 7);
-
- nt.lookup("/");
- BOOST_CHECK_EQUAL(nt.size(), 7);
-
- auto&& enumerable = nt.fullEnumerate();
- EnumerationVerifier(enumerable)
- .expect("/")
- .expect("/a")
- .expect("/a/b")
- .expect("/a/b/c")
- .expect("/a/b/d")
- .expect("/a/e")
- .expect("/f")
- .end();
-}
-
-BOOST_FIXTURE_TEST_SUITE(IteratorPartialEnumerate, EnumerationFixture)
-
-BOOST_AUTO_TEST_CASE(Empty)
-{
- auto&& enumerable = nt.partialEnumerate("/a");
-
- EnumerationVerifier(enumerable)
- .end();
-}
-
-BOOST_AUTO_TEST_CASE(NotIn)
-{
- this->insertAbAc();
-
- // Enumerate on some name that is not in nameTree
- Name name0("/0");
- auto&& enumerable = nt.partialEnumerate("/0");
-
- EnumerationVerifier(enumerable)
- .end();
-}
-
-BOOST_AUTO_TEST_CASE(OnlyA)
-{
- this->insertAbAc();
-
- // Accept "root" nameA only
- auto&& enumerable = nt.partialEnumerate("/a", [] (const name_tree::Entry& entry) {
- return std::make_pair(entry.getPrefix() == "/a", true);
- });
-
- EnumerationVerifier(enumerable)
- .expect("/a")
- .end();
-}
-
-BOOST_AUTO_TEST_CASE(ExceptA)
-{
- this->insertAbAc();
-
- // Accept anything except "root" nameA
- auto&& enumerable = nt.partialEnumerate("/a", [] (const name_tree::Entry& entry) {
- return std::make_pair(entry.getPrefix() != "/a", true);
- });
-
- EnumerationVerifier(enumerable)
- .expect("/a/b")
- .expect("/a/c")
- .end();
-}
-
-BOOST_AUTO_TEST_CASE(NoNameANoSubTreeAB)
-{
- this->insertAb1Ab2Ac1Ac2();
-
- // No NameA
- // No SubTree from NameAB
- auto&& enumerable = nt.partialEnumerate("/a", [] (const name_tree::Entry& entry) {
- return std::make_pair(entry.getPrefix() != "/a", entry.getPrefix() != "/a/b");
- });
-
- EnumerationVerifier(enumerable)
- .expect("/a/b")
- .expect("/a/c")
- .expect("/a/c/1")
- .expect("/a/c/2")
- .end();
-}
-
-BOOST_AUTO_TEST_CASE(NoNameANoSubTreeAC)
-{
- this->insertAb1Ab2Ac1Ac2();
-
- // No NameA
- // No SubTree from NameAC
- auto&& enumerable = nt.partialEnumerate("/a", [] (const name_tree::Entry& entry) {
- return std::make_pair(entry.getPrefix() != "/a", entry.getPrefix() != "/a/c");
- });
-
- EnumerationVerifier(enumerable)
- .expect("/a/b")
- .expect("/a/b/1")
- .expect("/a/b/2")
- .expect("/a/c")
- .end();
-}
-
-BOOST_AUTO_TEST_CASE(NoSubTreeA)
-{
- this->insertAb1Ab2Ac1Ac2();
-
- // No Subtree from NameA
- auto&& enumerable = nt.partialEnumerate("/a", [] (const name_tree::Entry& entry) {
- return std::make_pair(true, entry.getPrefix() != "/a");
- });
-
- EnumerationVerifier(enumerable)
- .expect("/a")
- .end();
-}
-
-BOOST_AUTO_TEST_CASE(Example)
-{
- // Example
- // /
- // /A
- // /A/B x
- // /A/B/C
- // /A/D x
- // /E
- // /F
-
- nt.lookup("/A");
- nt.lookup("/A/B");
- nt.lookup("/A/B/C");
- nt.lookup("/A/D");
- nt.lookup("/E");
- nt.lookup("/F");
-
- auto&& enumerable = nt.partialEnumerate("/A",
- [] (const name_tree::Entry& entry) -> std::pair<bool, bool> {
- bool visitEntry = false;
- bool visitChildren = false;
-
- Name name = entry.getPrefix();
-
- if (name == "/" || name == "/A/B" || name == "/A/B/C" || name == "/A/D") {
- visitEntry = true;
- }
-
- if (name == "/" || name == "/A" || name == "/F") {
- visitChildren = true;
- }
-
- return {visitEntry, visitChildren};
- });
-
- EnumerationVerifier(enumerable)
- .expect("/A/B")
- .expect("/A/D")
- .end();
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-BOOST_FIXTURE_TEST_CASE(IteratorFindAllMatches, EnumerationFixture)
-{
- nt.lookup("/a/b/c/d/e/f");
- nt.lookup("/a/a/c");
- nt.lookup("/a/a/d/1");
- nt.lookup("/a/a/d/2");
- BOOST_CHECK_EQUAL(nt.size(), 12);
-
- auto&& allMatches = nt.findAllMatches("/a/b/c/d/e");
-
- EnumerationVerifier(allMatches)
- .expect("/")
- .expect("/a")
- .expect("/a/b")
- .expect("/a/b/c")
- .expect("/a/b/c/d")
- .expect("/a/b/c/d/e")
- .end();
-}
-
-BOOST_AUTO_TEST_CASE(HashTableResizeShrink)
-{
- size_t nBuckets = 16;
- NameTree nameTree(nBuckets);
-
- Name prefix("/a/b/c/d/e/f/g/h"); // requires 9 buckets
-
- shared_ptr<name_tree::Entry> entry = nameTree.lookup(prefix);
- BOOST_CHECK_EQUAL(nameTree.size(), 9);
- BOOST_CHECK_EQUAL(nameTree.getNBuckets(), 32);
-
- nameTree.eraseEntryIfEmpty(entry);
- BOOST_CHECK_EQUAL(nameTree.size(), 0);
- BOOST_CHECK_EQUAL(nameTree.getNBuckets(), 16);
-}
-
-// .lookup should not invalidate iterator
-BOOST_AUTO_TEST_CASE(SurvivedIteratorAfterLookup)
-{
- NameTree nt;
- nt.lookup("/A/B/C");
- nt.lookup("/E");
-
- Name nameB("/A/B");
- std::set<Name> seenNames;
- for (NameTree::const_iterator it = nt.begin(); it != nt.end(); ++it) {
- BOOST_CHECK(seenNames.insert(it->getPrefix()).second);
- if (it->getPrefix() == nameB) {
- nt.lookup("/D");
- }
- }
-
- BOOST_CHECK_EQUAL(seenNames.count("/"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/A"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/A/B"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/A/B/C"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/E"), 1);
-
- seenNames.erase("/D"); // /D may or may not appear
- BOOST_CHECK(seenNames.size() == 5);
-}
-
-// .eraseEntryIfEmpty should not invalidate iterator
-BOOST_AUTO_TEST_CASE(SurvivedIteratorAfterErase)
-{
- NameTree nt;
- nt.lookup("/A/B/C");
- nt.lookup("/A/D/E");
- nt.lookup("/A/F/G");
- nt.lookup("/H");
-
- Name nameD("/A/D");
- std::set<Name> seenNames;
- for (NameTree::const_iterator it = nt.begin(); it != nt.end(); ++it) {
- BOOST_CHECK(seenNames.insert(it->getPrefix()).second);
- if (it->getPrefix() == nameD) {
- nt.eraseEntryIfEmpty(nt.findExactMatch("/A/F/G")); // /A/F/G and /A/F are erased
- }
- }
-
- BOOST_CHECK_EQUAL(seenNames.count("/"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/A"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/A/B"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/A/B/C"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/A/D"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/A/D/E"), 1);
- BOOST_CHECK_EQUAL(seenNames.count("/H"), 1);
-
- seenNames.erase("/A/F"); // /A/F may or may not appear
- seenNames.erase("/A/F/G"); // /A/F/G may or may not appear
- BOOST_CHECK(seenNames.size() == 7);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/table/pit.cpp b/NFD/tests/daemon/table/pit.cpp
deleted file mode 100644
index cabbab9..0000000
--- a/NFD/tests/daemon/table/pit.cpp
+++ /dev/null
@@ -1,498 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/pit.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(TablePit, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(EntryInOutRecords)
-{
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
- Name name("ndn:/KuYfjtRq");
- shared_ptr<Interest> interest = makeInterest(name);
- shared_ptr<Interest> interest1 = makeInterest(name);
- interest1->setInterestLifetime(time::milliseconds(2528));
- interest1->setNonce(25559);
- shared_ptr<Interest> interest2 = makeInterest(name);
- interest2->setInterestLifetime(time::milliseconds(6464));
- interest2->setNonce(19004);
- shared_ptr<Interest> interest3 = makeInterest(name);
- interest3->setInterestLifetime(time::milliseconds(3585));
- interest3->setNonce(24216);
- shared_ptr<Interest> interest4 = makeInterest(name);
- interest4->setInterestLifetime(time::milliseconds(8795));
- interest4->setNonce(17365);
-
- pit::Entry entry(*interest);
-
- BOOST_CHECK_EQUAL(entry.getInterest().getName(), name);
- BOOST_CHECK_EQUAL(entry.getName(), name);
-
- const pit::InRecordCollection& inRecords1 = entry.getInRecords();
- BOOST_CHECK_EQUAL(inRecords1.size(), 0);
- const pit::OutRecordCollection& outRecords1 = entry.getOutRecords();
- BOOST_CHECK_EQUAL(outRecords1.size(), 0);
-
- // insert InRecord
- time::steady_clock::TimePoint before1 = time::steady_clock::now();
- pit::InRecordCollection::iterator in1 =
- entry.insertOrUpdateInRecord(face1, *interest1);
- time::steady_clock::TimePoint after1 = time::steady_clock::now();
- const pit::InRecordCollection& inRecords2 = entry.getInRecords();
- BOOST_CHECK_EQUAL(inRecords2.size(), 1);
- BOOST_CHECK(in1 == inRecords2.begin());
- BOOST_CHECK_EQUAL(in1->getFace(), face1);
- BOOST_CHECK_EQUAL(in1->getLastNonce(), interest1->getNonce());
- BOOST_CHECK_GE(in1->getLastRenewed(), before1);
- BOOST_CHECK_LE(in1->getLastRenewed(), after1);
- BOOST_CHECK_LE(in1->getExpiry() - in1->getLastRenewed()
- - interest1->getInterestLifetime(),
- (after1 - before1));
- BOOST_CHECK(in1 == entry.getInRecord(*face1));
-
- // insert OutRecord
- time::steady_clock::TimePoint before2 = time::steady_clock::now();
- pit::OutRecordCollection::iterator out1 =
- entry.insertOrUpdateOutRecord(face1, *interest1);
- time::steady_clock::TimePoint after2 = time::steady_clock::now();
- const pit::OutRecordCollection& outRecords2 = entry.getOutRecords();
- BOOST_CHECK_EQUAL(outRecords2.size(), 1);
- BOOST_CHECK(out1 == outRecords2.begin());
- BOOST_CHECK_EQUAL(out1->getFace(), face1);
- BOOST_CHECK_EQUAL(out1->getLastNonce(), interest1->getNonce());
- BOOST_CHECK_GE(out1->getLastRenewed(), before2);
- BOOST_CHECK_LE(out1->getLastRenewed(), after2);
- BOOST_CHECK_LE(out1->getExpiry() - out1->getLastRenewed()
- - interest1->getInterestLifetime(),
- (after2 - before2));
- BOOST_CHECK(out1 == entry.getOutRecord(*face1));
-
- // update InRecord
- time::steady_clock::TimePoint before3 = time::steady_clock::now();
- pit::InRecordCollection::iterator in2 =
- entry.insertOrUpdateInRecord(face1, *interest2);
- time::steady_clock::TimePoint after3 = time::steady_clock::now();
- const pit::InRecordCollection& inRecords3 = entry.getInRecords();
- BOOST_CHECK_EQUAL(inRecords3.size(), 1);
- BOOST_CHECK(in2 == inRecords3.begin());
- BOOST_CHECK_EQUAL(in2->getFace(), face1);
- BOOST_CHECK_EQUAL(in2->getLastNonce(), interest2->getNonce());
- BOOST_CHECK_LE(in2->getExpiry() - in2->getLastRenewed()
- - interest2->getInterestLifetime(),
- (after3 - before3));
-
- // insert another InRecord
- pit::InRecordCollection::iterator in3 =
- entry.insertOrUpdateInRecord(face2, *interest3);
- const pit::InRecordCollection& inRecords4 = entry.getInRecords();
- BOOST_CHECK_EQUAL(inRecords4.size(), 2);
- BOOST_CHECK_EQUAL(in3->getFace(), face2);
-
- // get InRecord
- pit::InRecordCollection::const_iterator in4 = entry.getInRecord(*face1);
- BOOST_REQUIRE(in4 != entry.getInRecords().end());
- BOOST_CHECK_EQUAL(in4->getFace(), face1);
-
- // delete all InRecords
- entry.deleteInRecords();
- const pit::InRecordCollection& inRecords5 = entry.getInRecords();
- BOOST_CHECK_EQUAL(inRecords5.size(), 0);
- BOOST_CHECK(entry.getInRecord(*face1) == entry.getInRecords().end());
-
- // insert another OutRecord
- pit::OutRecordCollection::iterator out2 =
- entry.insertOrUpdateOutRecord(face2, *interest4);
- const pit::OutRecordCollection& outRecords3 = entry.getOutRecords();
- BOOST_CHECK_EQUAL(outRecords3.size(), 2);
- BOOST_CHECK_EQUAL(out2->getFace(), face2);
-
- // get OutRecord
- pit::OutRecordCollection::const_iterator out3 = entry.getOutRecord(*face1);
- BOOST_REQUIRE(out3 != entry.getOutRecords().end());
- BOOST_CHECK_EQUAL(out3->getFace(), face1);
-
- // delete OutRecord
- entry.deleteOutRecord(*face2);
- const pit::OutRecordCollection& outRecords4 = entry.getOutRecords();
- BOOST_REQUIRE_EQUAL(outRecords4.size(), 1);
- BOOST_CHECK_EQUAL(outRecords4.begin()->getFace(), face1);
- BOOST_CHECK(entry.getOutRecord(*face2) == entry.getOutRecords().end());
-}
-
-BOOST_AUTO_TEST_CASE(EntryNonce)
-{
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
-
- shared_ptr<Interest> interest = makeInterest("ndn:/qtCQ7I1c");
- interest->setNonce(25559);
-
- pit::Entry entry0(*interest);
- BOOST_CHECK_EQUAL(entry0.findNonce(25559, *face1), pit::DUPLICATE_NONCE_NONE);
- BOOST_CHECK_EQUAL(entry0.findNonce(25559, *face2), pit::DUPLICATE_NONCE_NONE);
- BOOST_CHECK_EQUAL(entry0.findNonce(19004, *face1), pit::DUPLICATE_NONCE_NONE);
- BOOST_CHECK_EQUAL(entry0.findNonce(19004, *face2), pit::DUPLICATE_NONCE_NONE);
-
- pit::Entry entry1(*interest);
- entry1.insertOrUpdateInRecord(face1, *interest);
- BOOST_CHECK_EQUAL(entry1.findNonce(25559, *face1), pit::DUPLICATE_NONCE_IN_SAME);
- BOOST_CHECK_EQUAL(entry1.findNonce(25559, *face2), pit::DUPLICATE_NONCE_IN_OTHER);
- BOOST_CHECK_EQUAL(entry1.findNonce(19004, *face1), pit::DUPLICATE_NONCE_NONE);
- BOOST_CHECK_EQUAL(entry1.findNonce(19004, *face2), pit::DUPLICATE_NONCE_NONE);
-
- pit::Entry entry2(*interest);
- entry2.insertOrUpdateOutRecord(face1, *interest);
- BOOST_CHECK_EQUAL(entry2.findNonce(25559, *face1), pit::DUPLICATE_NONCE_OUT_SAME);
- BOOST_CHECK_EQUAL(entry2.findNonce(25559, *face2), pit::DUPLICATE_NONCE_OUT_OTHER);
- BOOST_CHECK_EQUAL(entry2.findNonce(19004, *face1), pit::DUPLICATE_NONCE_NONE);
- BOOST_CHECK_EQUAL(entry2.findNonce(19004, *face2), pit::DUPLICATE_NONCE_NONE);
-
- pit::Entry entry3(*interest);
- entry3.insertOrUpdateInRecord(face1, *interest);
- entry3.insertOrUpdateOutRecord(face1, *interest);
- BOOST_CHECK_EQUAL(entry3.findNonce(25559, *face1),
- pit::DUPLICATE_NONCE_IN_SAME | pit::DUPLICATE_NONCE_OUT_SAME);
- BOOST_CHECK_EQUAL(entry3.findNonce(25559, *face2),
- pit::DUPLICATE_NONCE_IN_OTHER | pit::DUPLICATE_NONCE_OUT_OTHER);
- BOOST_CHECK_EQUAL(entry3.findNonce(19004, *face1), pit::DUPLICATE_NONCE_NONE);
- BOOST_CHECK_EQUAL(entry3.findNonce(19004, *face2), pit::DUPLICATE_NONCE_NONE);
-
- pit::Entry entry4(*interest);
- entry4.insertOrUpdateInRecord(face1, *interest);
- entry4.insertOrUpdateInRecord(face2, *interest);
- BOOST_CHECK_EQUAL(entry4.findNonce(25559, *face1),
- pit::DUPLICATE_NONCE_IN_SAME | pit::DUPLICATE_NONCE_IN_OTHER);
- BOOST_CHECK_EQUAL(entry4.findNonce(25559, *face2),
- pit::DUPLICATE_NONCE_IN_SAME | pit::DUPLICATE_NONCE_IN_OTHER);
- BOOST_CHECK_EQUAL(entry4.findNonce(19004, *face1), pit::DUPLICATE_NONCE_NONE);
- BOOST_CHECK_EQUAL(entry4.findNonce(19004, *face2), pit::DUPLICATE_NONCE_NONE);
-
- pit::Entry entry5(*interest);
- entry5.insertOrUpdateOutRecord(face1, *interest);
- entry5.insertOrUpdateOutRecord(face2, *interest);
- BOOST_CHECK_EQUAL(entry5.findNonce(25559, *face1),
- pit::DUPLICATE_NONCE_OUT_SAME | pit::DUPLICATE_NONCE_OUT_OTHER);
- BOOST_CHECK_EQUAL(entry5.findNonce(25559, *face2),
- pit::DUPLICATE_NONCE_OUT_SAME | pit::DUPLICATE_NONCE_OUT_OTHER);
- BOOST_CHECK_EQUAL(entry5.findNonce(19004, *face1), pit::DUPLICATE_NONCE_NONE);
- BOOST_CHECK_EQUAL(entry5.findNonce(19004, *face2), pit::DUPLICATE_NONCE_NONE);
-}
-
-BOOST_AUTO_TEST_CASE(EntryLifetime)
-{
- shared_ptr<Interest> interest = makeInterest("ndn:/7oIEurbgy6");
- // library uses -1 to indicate unset lifetime
- BOOST_ASSERT(interest->getInterestLifetime() < time::milliseconds::zero());
-
- shared_ptr<Face> face = make_shared<DummyFace>();
- pit::Entry entry(*interest);
-
- pit::InRecordCollection::iterator inIt = entry.insertOrUpdateInRecord(face, *interest);
- BOOST_CHECK_GT(inIt->getExpiry(), time::steady_clock::now());
-
- pit::OutRecordCollection::iterator outIt = entry.insertOrUpdateOutRecord(face, *interest);
- BOOST_CHECK_GT(outIt->getExpiry(), time::steady_clock::now());
-}
-
-BOOST_AUTO_TEST_CASE(EntryCanForwardTo)
-{
- shared_ptr<Interest> interest = makeInterest("ndn:/WDsuBLIMG");
- pit::Entry entry(*interest);
-
- shared_ptr<Face> face1 = make_shared<DummyFace>();
- shared_ptr<Face> face2 = make_shared<DummyFace>();
-
- entry.insertOrUpdateInRecord(face1, *interest);
- BOOST_CHECK_EQUAL(entry.canForwardTo(*face1), false);
- BOOST_CHECK_EQUAL(entry.canForwardTo(*face2), true);
-
- entry.insertOrUpdateInRecord(face2, *interest);
- BOOST_CHECK_EQUAL(entry.canForwardTo(*face1), true);
- BOOST_CHECK_EQUAL(entry.canForwardTo(*face2), true);
-
- entry.insertOrUpdateOutRecord(face1, *interest);
- BOOST_CHECK_EQUAL(entry.canForwardTo(*face1), false);
- BOOST_CHECK_EQUAL(entry.canForwardTo(*face2), true);
-}
-
-BOOST_AUTO_TEST_CASE(Insert)
-{
- Name name1("ndn:/5vzBNnMst");
- Name name2("ndn:/igSGfEIM62");
- Exclude exclude1;
- exclude1.excludeOne(Name::Component("u26p47oep"));
- Exclude exclude2;
- exclude2.excludeBefore(Name::Component("u26p47oep"));
- ndn::KeyLocator keyLocator1("ndn:/sGAE3peMHA");
- ndn::KeyLocator keyLocator2("ndn:/nIJH6pr4");
-
- NameTree nameTree(16);
- Pit pit(nameTree);
- BOOST_CHECK_EQUAL(pit.size(), 0);
- std::pair<shared_ptr<pit::Entry>, bool> insertResult;
-
- // base
- shared_ptr<Interest> interestA = make_shared<Interest>(name1);
- insertResult = pit.insert(*interestA);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 1);
-
- // A+MinSuffixComponents
- shared_ptr<Interest> interestB = make_shared<Interest>(*interestA);
- interestB->setMinSuffixComponents(2);
- insertResult = pit.insert(*interestB);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 2);
-
- // A+MaxSuffixComponents
- shared_ptr<Interest> interestC = make_shared<Interest>(*interestA);
- interestC->setMaxSuffixComponents(4);
- insertResult = pit.insert(*interestC);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 3);
-
- // A+KeyLocator1
- shared_ptr<Interest> interestD = make_shared<Interest>(*interestA);
- interestD->setPublisherPublicKeyLocator(keyLocator1);
- insertResult = pit.insert(*interestD);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 4);
-
- // A+KeyLocator2
- shared_ptr<Interest> interestE = make_shared<Interest>(*interestA);
- interestE->setPublisherPublicKeyLocator(keyLocator2);
- insertResult = pit.insert(*interestE);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 5);
-
- // A+Exclude1
- shared_ptr<Interest> interestF = make_shared<Interest>(*interestA);
- interestF->setExclude(exclude1);
- insertResult = pit.insert(*interestF);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 6);
-
- // A+Exclude2
- shared_ptr<Interest> interestG = make_shared<Interest>(*interestA);
- interestG->setExclude(exclude2);
- insertResult = pit.insert(*interestG);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 7);
-
- // A+ChildSelector0
- shared_ptr<Interest> interestH = make_shared<Interest>(*interestA);
- interestH->setChildSelector(0);
- insertResult = pit.insert(*interestH);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 8);
-
- // A+ChildSelector1
- shared_ptr<Interest> interestI = make_shared<Interest>(*interestA);
- interestI->setChildSelector(1);
- insertResult = pit.insert(*interestI);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 9);
-
- // A+MustBeFresh
- shared_ptr<Interest> interestJ = make_shared<Interest>(*interestA);
- interestJ->setMustBeFresh(true);
- insertResult = pit.insert(*interestJ);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 10);
-
- // A+InterestLifetime
- shared_ptr<Interest> interestK = make_shared<Interest>(*interestA);
- interestK->setInterestLifetime(time::milliseconds(1000));
- insertResult = pit.insert(*interestK);
- BOOST_CHECK_EQUAL(insertResult.second, false);// only guiders differ
- BOOST_CHECK_EQUAL(pit.size(), 10);
-
- // A+Nonce
- shared_ptr<Interest> interestL = make_shared<Interest>(*interestA);
- interestL->setNonce(2192);
- insertResult = pit.insert(*interestL);
- BOOST_CHECK_EQUAL(insertResult.second, false);// only guiders differ
- BOOST_CHECK_EQUAL(pit.size(), 10);
-
- // different Name+Exclude1
- shared_ptr<Interest> interestM = make_shared<Interest>(name2);
- interestM->setExclude(exclude1);
- insertResult = pit.insert(*interestM);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 11);
-}
-
-BOOST_AUTO_TEST_CASE(Erase)
-{
- shared_ptr<Interest> interest = makeInterest("/z88Admz6A2");
-
- NameTree nameTree(16);
- Pit pit(nameTree);
-
- std::pair<shared_ptr<pit::Entry>, bool> insertResult;
-
- BOOST_CHECK_EQUAL(pit.size(), 0);
-
- insertResult = pit.insert(*interest);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 1);
-
- insertResult = pit.insert(*interest);
- BOOST_CHECK_EQUAL(insertResult.second, false);
- BOOST_CHECK_EQUAL(pit.size(), 1);
-
- pit.erase(insertResult.first);
- BOOST_CHECK_EQUAL(pit.size(), 0);
-
- insertResult = pit.insert(*interest);
- BOOST_CHECK_EQUAL(insertResult.second, true);
- BOOST_CHECK_EQUAL(pit.size(), 1);
-
-}
-
-BOOST_AUTO_TEST_CASE(EraseNameTreeEntry)
-{
- NameTree nameTree;
- Pit pit(nameTree);
- size_t nNameTreeEntriesBefore = nameTree.size();
-
- shared_ptr<Interest> interest = makeInterest("/37xWVvQ2K");
- shared_ptr<pit::Entry> entry = pit.insert(*interest).first;
- pit.erase(entry);
- BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
-}
-
-BOOST_AUTO_TEST_CASE(FindAllDataMatches)
-{
- Name nameA ("ndn:/A");
- Name nameAB ("ndn:/A/B");
- Name nameABC ("ndn:/A/B/C");
- Name nameABCD("ndn:/A/B/C/D");
- Name nameD ("ndn:/D");
-
- shared_ptr<Interest> interestA = makeInterest(nameA );
- shared_ptr<Interest> interestABC = makeInterest(nameABC);
- shared_ptr<Interest> interestD = makeInterest(nameD );
-
- NameTree nameTree(16);
- Pit pit(nameTree);
- int count = 0;
-
- BOOST_CHECK_EQUAL(pit.size(), 0);
-
- pit.insert(*interestA );
- pit.insert(*interestABC);
- pit.insert(*interestD );
-
- nameTree.lookup(nameABCD); // make sure /A/B/C/D is in nameTree
-
- BOOST_CHECK_EQUAL(pit.size(), 3);
-
- shared_ptr<Data> data = makeData(nameABCD);
-
- pit::DataMatchResult matches = pit.findAllDataMatches(*data);
-
- bool hasA = false;
- bool hasAB = false;
- bool hasABC = false;
- bool hasD = false;
-
- for (const shared_ptr<pit::Entry>& entry : matches) {
- ++count;
-
- if (entry->getName().equals(nameA ))
- hasA = true;
-
- if (entry->getName().equals(nameAB))
- hasAB = true;
-
- if (entry->getName().equals(nameABC))
- hasABC = true;
-
- if (entry->getName().equals(nameD))
- hasD = true;
- }
- BOOST_CHECK_EQUAL(hasA , true);
- BOOST_CHECK_EQUAL(hasAB , false);
- BOOST_CHECK_EQUAL(hasABC, true);
- BOOST_CHECK_EQUAL(hasD , false);
-
- BOOST_CHECK_EQUAL(count, 2);
-
-}
-
-BOOST_AUTO_TEST_CASE(Iterator)
-{
- NameTree nameTree(16);
- Pit pit(nameTree);
-
- shared_ptr<Interest> interestA = makeInterest("/A");
- shared_ptr<Interest> interestABC1 = makeInterest("/A/B/C");
- shared_ptr<Interest> interestABC2 = makeInterest("/A/B/C");
- interestABC2->setSelectors(ndn::Selectors().setMinSuffixComponents(10));
- shared_ptr<Interest> interestD = makeInterest("/D");
-
- BOOST_CHECK_EQUAL(pit.size(), 0);
- BOOST_CHECK(pit.begin() == pit.end());
-
- pit.insert(*interestABC1);
- BOOST_CHECK_EQUAL(pit.size(), 1);
- BOOST_CHECK(pit.begin() != pit.end());
- BOOST_CHECK(pit.begin()->getInterest() == *interestABC1);
- BOOST_CHECK((*pit.begin()).getInterest() == *interestABC1);
-
- auto i = pit.begin();
- auto j = pit.begin();
- BOOST_CHECK(++i == pit.end());
- BOOST_CHECK(j++ == pit.begin());
- BOOST_CHECK(j == pit.end());
-
- pit.insert(*interestA);
- pit.insert(*interestABC2);
- pit.insert(*interestD);
-
- std::set<const Interest*> expected = {&*interestA, &*interestABC1, &*interestABC2, &*interestD};
- std::set<const Interest*> actual;
- for (const auto& pitEntry : pit) {
- actual.insert(&pitEntry.getInterest());
- }
- BOOST_CHECK(actual == expected);
- for (auto actualIt = actual.begin(), expectedIt = expected.begin();
- actualIt != actual.end() && expectedIt != expected.end(); ++actualIt, ++expectedIt) {
- BOOST_CHECK_EQUAL(**actualIt, **expectedIt);
- }
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/table/strategy-choice.cpp b/NFD/tests/daemon/table/strategy-choice.cpp
deleted file mode 100644
index 494c76b..0000000
--- a/NFD/tests/daemon/table/strategy-choice.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/strategy-choice.hpp"
-#include "tests/daemon/fw/dummy-strategy.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(TableStrategyChoice, BaseFixture)
-
-using fw::Strategy;
-
-BOOST_AUTO_TEST_CASE(Get)
-{
- Forwarder forwarder;
- Name nameP("ndn:/strategy/P");
- shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
-
- StrategyChoice& table = forwarder.getStrategyChoice();
-
- // install
- BOOST_CHECK_EQUAL(table.install(strategyP), true);
-
- BOOST_CHECK(table.insert("ndn:/", nameP));
- // { '/'=>P }
-
- auto getRoot = table.get("ndn:/");
- BOOST_CHECK_EQUAL(getRoot.first, true);
- BOOST_CHECK_EQUAL(getRoot.second, nameP);
-
- auto getA = table.get("ndn:/A");
- BOOST_CHECK_EQUAL(getA.first, false);
-}
-
-BOOST_AUTO_TEST_CASE(Effective)
-{
- Forwarder forwarder;
- Name nameP("ndn:/strategy/P");
- Name nameQ("ndn:/strategy/Q");
- Name nameZ("ndn:/strategy/Z");
- shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
- shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
-
- StrategyChoice& table = forwarder.getStrategyChoice();
-
- // install
- BOOST_CHECK_EQUAL(table.install(strategyP), true);
- BOOST_CHECK_EQUAL(table.install(strategyQ), true);
- BOOST_CHECK_EQUAL(table.install(strategyQ), false);
-
- BOOST_CHECK(table.insert("ndn:/", nameP));
- // { '/'=>P }
-
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
-
- BOOST_CHECK(table.insert("ndn:/A/B", nameP));
- // { '/'=>P, '/A/B'=>P }
-
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
- // same instance
- BOOST_CHECK_EQUAL(&table.findEffectiveStrategy("ndn:/"), strategyP.get());
- BOOST_CHECK_EQUAL(&table.findEffectiveStrategy("ndn:/A"), strategyP.get());
- BOOST_CHECK_EQUAL(&table.findEffectiveStrategy("ndn:/A/B"), strategyP.get());
-
- table.erase("ndn:/A"); // no effect
- // { '/'=>P, '/A/B'=>P }
-
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
-
- BOOST_CHECK(table.insert("ndn:/A", nameQ));
- // { '/'=>P, '/A/B'=>P, '/A'=>Q }
-
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A") .getName(), nameQ);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
-
- table.erase("ndn:/A/B");
- // { '/'=>P, '/A'=>Q }
-
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A") .getName(), nameQ);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameQ);
-
- BOOST_CHECK(!table.insert("ndn:/", nameZ)); // non existent strategy
-
- BOOST_CHECK(table.insert("ndn:/", nameQ));
- BOOST_CHECK(table.insert("ndn:/A", nameP));
- // { '/'=>Q, '/A'=>P }
-
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/") .getName(), nameQ);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A") .getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/D") .getName(), nameQ);
-}
-
-//XXX BOOST_CONCEPT_ASSERT((ForwardIterator<std::vector<int>::iterator>))
-// is also failing. There might be a problem with ForwardIterator concept checking.
-//BOOST_CONCEPT_ASSERT((ForwardIterator<StrategyChoice::const_iterator>));
-
-BOOST_AUTO_TEST_CASE(Enumerate)
-{
-
- Forwarder forwarder;
- Name nameP("ndn:/strategy/P");
- Name nameQ("ndn:/strategy/Q");
- shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
- shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
-
- StrategyChoice& table = forwarder.getStrategyChoice();
- table.install(strategyP);
- table.install(strategyQ);
-
- table.insert("ndn:/", nameP);
- table.insert("ndn:/A/B", nameQ);
- table.insert("ndn:/A/B/C", nameP);
- table.insert("ndn:/D", nameP);
- table.insert("ndn:/E", nameQ);
-
- BOOST_CHECK_EQUAL(table.size(), 5);
-
- std::map<Name, Name> map; // namespace=>strategyName
- for (StrategyChoice::const_iterator it = table.begin(); it != table.end(); ++it) {
- map[it->getPrefix()] = it->getStrategyName();
- }
- BOOST_CHECK_EQUAL(map.size(), 5);
- BOOST_CHECK_EQUAL(map["ndn:/"], nameP);
- BOOST_CHECK_EQUAL(map["ndn:/A/B"], nameQ);
- BOOST_CHECK_EQUAL(map["ndn:/A/B/C"], nameP);
- BOOST_CHECK_EQUAL(map["ndn:/D"], nameP);
- BOOST_CHECK_EQUAL(map["ndn:/E"], nameQ);
- BOOST_CHECK_EQUAL(map.size(), 5);
-}
-
-class PStrategyInfo : public fw::StrategyInfo
-{
-public:
- static constexpr int
- getTypeId()
- {
- return 10;
- }
-};
-
-BOOST_AUTO_TEST_CASE(ClearStrategyInfo)
-{
- Forwarder forwarder;
- Name nameP("ndn:/strategy/P");
- Name nameQ("ndn:/strategy/Q");
- shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
- shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
-
- StrategyChoice& table = forwarder.getStrategyChoice();
- Measurements& measurements = forwarder.getMeasurements();
-
- // install
- table.install(strategyP);
- table.install(strategyQ);
-
- BOOST_CHECK(table.insert("ndn:/", nameP));
- // { '/'=>P }
- measurements.get("ndn:/") ->getOrCreateStrategyInfo<PStrategyInfo>();
- measurements.get("ndn:/A") ->getOrCreateStrategyInfo<PStrategyInfo>();
- measurements.get("ndn:/A/B") ->getOrCreateStrategyInfo<PStrategyInfo>();
- measurements.get("ndn:/A/C") ->getOrCreateStrategyInfo<PStrategyInfo>();
-
- BOOST_CHECK(table.insert("ndn:/A/B", nameP));
- // { '/'=>P, '/A/B'=>P }
- BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/") ->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/A") ->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/A/B")->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/A/C")->getStrategyInfo<PStrategyInfo>()));
-
- BOOST_CHECK(table.insert("ndn:/A", nameQ));
- // { '/'=>P, '/A/B'=>P, '/A'=>Q }
- BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/") ->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A") ->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/A/B")->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A/C")->getStrategyInfo<PStrategyInfo>()));
-
- table.erase("ndn:/A/B");
- // { '/'=>P, '/A'=>Q }
- BOOST_CHECK( static_cast<bool>(measurements.get("ndn:/") ->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A") ->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A/B")->getStrategyInfo<PStrategyInfo>()));
- BOOST_CHECK(!static_cast<bool>(measurements.get("ndn:/A/C")->getStrategyInfo<PStrategyInfo>()));
-}
-
-BOOST_AUTO_TEST_CASE(EraseNameTreeEntry)
-{
- Forwarder forwarder;
- NameTree& nameTree = forwarder.getNameTree();
- StrategyChoice& table = forwarder.getStrategyChoice();
-
- Name nameP("ndn:/strategy/P");
- Name nameQ("ndn:/strategy/Q");
- shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
- shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
- table.install(strategyP);
- table.install(strategyQ);
-
- table.insert("ndn:/", nameP);
-
- size_t nNameTreeEntriesBefore = nameTree.size();
-
- table.insert("ndn:/A/B", nameQ);
- table.erase("ndn:/A/B");
- BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
-}
-
-BOOST_AUTO_TEST_CASE(Versioning)
-{
- Forwarder forwarder;
- Name nameP("ndn:/strategy/P");
- Name nameP1("ndn:/strategy/P/%FD%01");
- Name nameP2("ndn:/strategy/P/%FD%02");
- Name name3("ndn:/%FD%03");
- Name name4("ndn:/%FD%04");
- Name nameQ("ndn:/strategy/Q");
- Name nameQ5("ndn:/strategy/Q/%FD%05");
- shared_ptr<Strategy> strategyP1 = make_shared<DummyStrategy>(ref(forwarder), nameP1);
- shared_ptr<Strategy> strategyP2 = make_shared<DummyStrategy>(ref(forwarder), nameP2);
- shared_ptr<Strategy> strategy3 = make_shared<DummyStrategy>(ref(forwarder), name3);
- shared_ptr<Strategy> strategy4 = make_shared<DummyStrategy>(ref(forwarder), name4);
- shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
- shared_ptr<Strategy> strategyQ5 = make_shared<DummyStrategy>(ref(forwarder), nameQ5);
-
- StrategyChoice& table = forwarder.getStrategyChoice();
-
- // install
- BOOST_CHECK_EQUAL(table.install(strategyP1), true);
- BOOST_CHECK_EQUAL(table.install(strategyP1), false);
- BOOST_CHECK_EQUAL(table.hasStrategy(nameP, false), true);
- BOOST_CHECK_EQUAL(table.hasStrategy(nameP, true), false);
- BOOST_CHECK_EQUAL(table.hasStrategy(nameP1, true), true);
-
- BOOST_CHECK_EQUAL(table.install(strategyP2), true);
- BOOST_CHECK_EQUAL(table.install(strategy3), true);
- BOOST_CHECK_EQUAL(table.install(strategy4), true);
- BOOST_CHECK_EQUAL(table.install(strategyQ), true);
- BOOST_CHECK_EQUAL(table.install(strategyQ5), true);
-
- BOOST_CHECK(table.insert("ndn:/", nameQ));
- // exact match, { '/'=>Q }
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameQ);
-
- BOOST_CHECK(table.insert("ndn:/", nameQ));
- BOOST_CHECK(table.insert("ndn:/", nameP));
- // { '/'=>P2 }
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameP2);
-
- BOOST_CHECK(table.insert("ndn:/", nameQ));
- BOOST_CHECK(table.insert("ndn:/", nameP1));
- // { '/'=>P1 }
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameP1);
-
- BOOST_CHECK(table.insert("ndn:/", nameQ));
- BOOST_CHECK(table.insert("ndn:/", nameP2));
- // { '/'=>P2 }
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameP2);
-
- BOOST_CHECK(table.insert("ndn:/", nameQ));
- BOOST_CHECK(! table.insert("ndn:/", "ndn:/strategy/A"));
- // not installed
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameQ);
-
- BOOST_CHECK(table.insert("ndn:/", nameQ));
- BOOST_CHECK(! table.insert("ndn:/", "ndn:/strategy/Z"));
- // not installed
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameQ);
-
- BOOST_CHECK(table.insert("ndn:/", nameP1));
- BOOST_CHECK(table.insert("ndn:/", "ndn:/"));
- // match one component longer only, { '/'=>4 }
- BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), name4);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/daemon/table/strategy-info-host.cpp b/NFD/tests/daemon/table/strategy-info-host.cpp
deleted file mode 100644
index 5c0c14f..0000000
--- a/NFD/tests/daemon/table/strategy-info-host.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/strategy-info-host.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-using fw::StrategyInfo;
-
-static int g_DummyStrategyInfo_count = 0;
-
-class DummyStrategyInfo : public StrategyInfo
-{
-public:
- static constexpr int
- getTypeId()
- {
- return 1;
- }
-
- DummyStrategyInfo(int id)
- : m_id(id)
- {
- ++g_DummyStrategyInfo_count;
- }
-
- virtual
- ~DummyStrategyInfo()
- {
- --g_DummyStrategyInfo_count;
- }
-
- int m_id;
-};
-
-class DummyStrategyInfo2 : public StrategyInfo
-{
-public:
- static constexpr int
- getTypeId()
- {
- return 2;
- }
-
- DummyStrategyInfo2(int id)
- : m_id(id)
- {
- }
-
- int m_id;
-};
-
-BOOST_FIXTURE_TEST_SUITE(TableStrategyInfoHost, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(SetGetClear)
-{
- StrategyInfoHost host;
-
- BOOST_CHECK(host.getStrategyInfo<DummyStrategyInfo>() == nullptr);
-
- g_DummyStrategyInfo_count = 0;
-
- shared_ptr<DummyStrategyInfo> info = make_shared<DummyStrategyInfo>(7591);
- host.setStrategyInfo(info);
- BOOST_REQUIRE(host.getStrategyInfo<DummyStrategyInfo>() != nullptr);
- BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 7591);
-
- info.reset(); // unlink local reference
- // host should still have a reference to info
- BOOST_REQUIRE(host.getStrategyInfo<DummyStrategyInfo>() != nullptr);
- BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 7591);
-
- host.clearStrategyInfo();
- BOOST_CHECK(host.getStrategyInfo<DummyStrategyInfo>() == nullptr);
- BOOST_CHECK_EQUAL(g_DummyStrategyInfo_count, 0);
-}
-
-BOOST_AUTO_TEST_CASE(Create)
-{
- StrategyInfoHost host;
-
- host.getOrCreateStrategyInfo<DummyStrategyInfo>(3503);
- BOOST_REQUIRE(host.getStrategyInfo<DummyStrategyInfo>() != nullptr);
- BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 3503);
-
- host.getOrCreateStrategyInfo<DummyStrategyInfo>(1032);
- BOOST_REQUIRE(host.getStrategyInfo<DummyStrategyInfo>() != nullptr);
- BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 3503);
-
- host.setStrategyInfo<DummyStrategyInfo>(nullptr);
- host.getOrCreateStrategyInfo<DummyStrategyInfo>(9956);
- BOOST_REQUIRE(host.getStrategyInfo<DummyStrategyInfo>() != nullptr);
- BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 9956);
-}
-
-BOOST_AUTO_TEST_CASE(Types)
-{
- StrategyInfoHost host;
-
- host.getOrCreateStrategyInfo<DummyStrategyInfo>(8063);
- BOOST_REQUIRE(host.getStrategyInfo<DummyStrategyInfo>() != nullptr);
- BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 8063);
-
- host.getOrCreateStrategyInfo<DummyStrategyInfo2>(2871);
- BOOST_REQUIRE(host.getStrategyInfo<DummyStrategyInfo2>() != nullptr);
- BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo2>()->m_id, 2871);
-
- BOOST_REQUIRE(host.getStrategyInfo<DummyStrategyInfo>() != nullptr);
- BOOST_CHECK_EQUAL(host.getStrategyInfo<DummyStrategyInfo>()->m_id, 8063);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/global-configuration.cpp b/NFD/tests/global-configuration.cpp
deleted file mode 100644
index 2b4ce9d..0000000
--- a/NFD/tests/global-configuration.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "test-common.hpp"
-#include "core/logger.hpp"
-#include "core/config-file.hpp"
-
-#include <boost/filesystem.hpp>
-
-namespace nfd {
-namespace tests {
-
-class GlobalConfigurationFixture
-{
-public:
- GlobalConfigurationFixture()
- {
- const std::string filename = "unit-tests.conf";
- if (boost::filesystem::exists(filename))
- {
- ConfigFile config;
- LoggerFactory::getInstance().setConfigFile(config);
-
- config.parse(filename, false);
- }
- }
-};
-
-BOOST_GLOBAL_FIXTURE(GlobalConfigurationFixture)
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/identity-management-fixture.cpp b/NFD/tests/identity-management-fixture.cpp
deleted file mode 100644
index c668f54..0000000
--- a/NFD/tests/identity-management-fixture.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2014 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "identity-management-fixture.hpp"
-
-namespace nfd {
-namespace tests {
-
-IdentityManagementFixture::IdentityManagementFixture()
- : m_keyChain("sqlite3", "file")
-{
-}
-
-IdentityManagementFixture::~IdentityManagementFixture()
-{
- for (auto&& id : m_identities) {
- m_keyChain.deleteIdentity(id);
- }
-}
-
-bool
-IdentityManagementFixture::addIdentity(const ndn::Name& identity, const ndn::KeyParams& params)
-{
- try {
- m_keyChain.createIdentity(identity, params);
- m_identities.push_back(identity);
- return true;
- }
- catch (std::runtime_error&) {
- return false;
- }
-}
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/identity-management-fixture.hpp b/NFD/tests/identity-management-fixture.hpp
deleted file mode 100644
index 265c3bc..0000000
--- a/NFD/tests/identity-management-fixture.hpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2014 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "tests/test-common.hpp"
-#include <ndn-cxx/security/key-chain.hpp>
-#include <vector>
-
-#include "boost-test.hpp"
-
-namespace nfd {
-namespace tests {
-
-/**
- * @brief IdentityManagementFixture is a test suite level fixture.
- *
- * Test cases in the suite can use this fixture to create identities.
- * Identities added via addIdentity method are automatically deleted
- * during test teardown.
- */
-class IdentityManagementFixture : public nfd::tests::BaseFixture
-{
-public:
- IdentityManagementFixture();
-
- ~IdentityManagementFixture();
-
- // @brief add identity, return true if succeed.
- bool
- addIdentity(const ndn::Name& identity,
- const ndn::KeyParams& params = ndn::KeyChain::DEFAULT_KEY_PARAMS);
-
-protected:
- ndn::KeyChain m_keyChain;
- std::vector<ndn::Name> m_identities;
-};
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/limited-io.cpp b/NFD/tests/limited-io.cpp
deleted file mode 100644
index 4bfd802..0000000
--- a/NFD/tests/limited-io.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "limited-io.hpp"
-#include "core/logger.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("LimitedIo");
-
-const int LimitedIo::UNLIMITED_OPS = std::numeric_limits<int>::max();
-const time::nanoseconds LimitedIo::UNLIMITED_TIME = time::nanoseconds::min();
-
-LimitedIo::LimitedIo()
- : m_uttf(nullptr)
- , m_isRunning(false)
- , m_nOpsRemaining(0)
-{
-}
-
-LimitedIo::LimitedIo(UnitTestTimeFixture* uttf)
- : m_uttf(uttf)
- , m_isRunning(false)
- , m_nOpsRemaining(0)
-{
-}
-
-LimitedIo::StopReason
-LimitedIo::run(int nOpsLimit, const time::nanoseconds& timeLimit, const time::nanoseconds& tick)
-{
- BOOST_ASSERT(!m_isRunning);
-
- if (nOpsLimit <= 0) {
- return EXCEED_OPS;
- }
-
- m_isRunning = true;
-
- m_reason = NO_WORK;
- m_nOpsRemaining = nOpsLimit;
- if (timeLimit >= time::nanoseconds::zero()) {
- m_timeout = scheduler::schedule(timeLimit, bind(&LimitedIo::afterTimeout, this));
- }
-
- try {
- if (m_uttf == nullptr) {
- getGlobalIoService().run();
- }
- else {
- // timeLimit is enforced by afterTimeout
- m_uttf->advanceClocks(tick, time::nanoseconds::max());
- }
- }
- catch (StopException&) {
- }
- catch (std::exception& ex) {
- m_reason = EXCEPTION;
- NFD_LOG_ERROR("g_io.run() exception: " << ex.what());
- m_lastException = ex;
- }
-
- getGlobalIoService().reset();
- scheduler::cancel(m_timeout);
- m_isRunning = false;
- return m_reason;
-}
-
-void
-LimitedIo::afterOp()
-{
- if (!m_isRunning) {
- // Do not proceed further if .afterOp() is invoked out of .run(),
- return;
- }
-
- --m_nOpsRemaining;
- if (m_nOpsRemaining <= 0) {
- m_reason = EXCEED_OPS;
- getGlobalIoService().stop();
- if (m_uttf != nullptr) {
- throw StopException();
- }
- }
-}
-
-void
-LimitedIo::afterTimeout()
-{
- m_reason = EXCEED_TIME;
- getGlobalIoService().stop();
- if (m_uttf != nullptr) {
- throw StopException();
- }
-}
-
-const std::exception&
-LimitedIo::getLastException() const
-{
- return m_lastException;
-}
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/limited-io.hpp b/NFD/tests/limited-io.hpp
deleted file mode 100644
index ee358b0..0000000
--- a/NFD/tests/limited-io.hpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_LIMITED_IO_HPP
-#define NFD_TESTS_LIMITED_IO_HPP
-
-#include "test-common.hpp"
-#include "core/global-io.hpp"
-#include "core/scheduler.hpp"
-
-namespace nfd {
-namespace tests {
-
-/** \brief provides IO operations limit and/or time limit for unit testing
- */
-class LimitedIo : noncopyable
-{
-public:
- LimitedIo();
-
- /** \brief construct with UnitTestTimeFixture
- */
- LimitedIo(UnitTestTimeFixture* uttf);
-
- /// indicates why .run returns
- enum StopReason
- {
- /// g_io.run() returns normally because there's no work to do
- NO_WORK,
- /// .afterOp() has been invoked nOpsLimit times
- EXCEED_OPS,
- /// nTimeLimit has elapsed
- EXCEED_TIME,
- /// an exception is thrown
- EXCEPTION
- };
-
- /** \brief g_io.run() with operation count and/or time limit
- * \param nOpsLimit operation count limit, pass UNLIMITED_OPS for no limit
- * \param timeLimit time limit, pass UNLIMITED_TIME for no limit
- * \param tick if this LimitedIo is constructed with UnitTestTimeFixture,
- * this is passed to .advanceClocks(), otherwise ignored
- */
- StopReason
- run(int nOpsLimit, const time::nanoseconds& timeLimit,
- const time::nanoseconds& tick = time::milliseconds(1));
-
- /// count an operation
- void
- afterOp();
-
- const std::exception&
- getLastException() const;
-
- /** \brief defer for specified duration
- *
- * equivalent to .run(UNLIMITED_OPS, d)
- */
- void
- defer(const time::nanoseconds& d)
- {
- this->run(UNLIMITED_OPS, d);
- }
-
-private:
- /** \brief an exception to stop IO operation
- */
- class StopException
- {
- };
-
- void
- afterTimeout();
-
-public:
- static const int UNLIMITED_OPS;
- static const time::nanoseconds UNLIMITED_TIME;
-
-private:
- UnitTestTimeFixture* m_uttf;
- bool m_isRunning;
- int m_nOpsRemaining;
- EventId m_timeout;
- StopReason m_reason;
- std::exception m_lastException;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_LIMITED_IO_HPP
diff --git a/NFD/tests/main.cpp b/NFD/tests/main.cpp
deleted file mode 100644
index 2733634..0000000
--- a/NFD/tests/main.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#define BOOST_TEST_MAIN 1
-#define BOOST_TEST_DYN_LINK 1
-
-#include "boost-test.hpp"
diff --git a/NFD/tests/other/cs-smoketest.cpp b/NFD/tests/other/cs-smoketest.cpp
deleted file mode 100644
index 1fc97c9..0000000
--- a/NFD/tests/other/cs-smoketest.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "table/cs.hpp"
-#include "table/cs-entry.hpp"
-#include <ndn-cxx/security/key-chain.hpp>
-
-namespace nfd {
-namespace cs_smoketest {
-
-static void
-runStressTest()
-{
- shared_ptr<Data> dataWorkload[70000];
- shared_ptr<Interest> interestWorkload[70000];
-
- ndn::SignatureSha256WithRsa fakeSignature;
- fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
- reinterpret_cast<const uint8_t*>(0), 0));
-
- // 182 MB in memory
- for (int i = 0; i < 70000; i++) {
- Name name("/stress/test");
- name.appendNumber(i % 4);
- name.appendNumber(i);
-
- shared_ptr<Interest> interest = make_shared<Interest>(name);
- interestWorkload[i] = interest;
-
- shared_ptr<Data> data = make_shared<Data>(name);
- data->setSignature(fakeSignature);
- dataWorkload[i] = data;
- }
-
- time::duration<double, boost::nano> previousResult(0);
-
- for (size_t nInsertions = 1000; nInsertions < 10000000; nInsertions *= 2) {
- Cs cs;
- srand(time::toUnixTimestamp(time::system_clock::now()).count());
-
- time::steady_clock::TimePoint startTime = time::steady_clock::now();
-
- size_t workloadCounter = 0;
- for (size_t i = 0; i < nInsertions; i++) {
- if (workloadCounter > 69999)
- workloadCounter = 0;
-
- cs.find(*interestWorkload[workloadCounter]);
- Data& data = *dataWorkload[workloadCounter];
- data.setName(data.getName()); // reset data.m_fullName
- data.wireEncode();
- cs.insert(data);
-
- workloadCounter++;
- }
-
- time::steady_clock::TimePoint endTime = time::steady_clock::now();
-
- time::duration<double, boost::nano> runDuration = endTime - startTime;
- time::duration<double, boost::nano> perOperationTime = runDuration / nInsertions;
-
- std::cout << "nItem = " << nInsertions << std::endl;
- std::cout << "Total running time = "
- << time::duration_cast<time::duration<double> >(runDuration)
- << std::endl;
- std::cout << "Average per-operation time = "
- << time::duration_cast<time::duration<double, boost::micro> >(perOperationTime)
- << std::endl;
-
- if (previousResult > time::nanoseconds(1))
- std::cout << "Change compared to the previous: "
- << (100.0 * perOperationTime / previousResult) << "%" << std::endl;
-
- std::cout << "\n=================================\n" << std::endl;
-
- previousResult = perOperationTime;
- }
-}
-
-} // namespace cs_smoketest
-} // namespace nfd
-
-int
-main(int argc, char** argv)
-{
- nfd::cs_smoketest::runStressTest();
-
- return 0;
-}
diff --git a/NFD/tests/other/wscript b/NFD/tests/other/wscript
deleted file mode 100644
index 69aa2bb..0000000
--- a/NFD/tests/other/wscript
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-"""
-Copyright (c) 2014 Regents of the University of California,
- Arizona Board of Regents,
- Colorado State University,
- University Pierre & Marie Curie, Sorbonne University,
- Washington University in St. Louis,
- Beijing Institute of Technology
-
-This file is part of NFD (Named Data Networking Forwarding Daemon).
-See AUTHORS.md for complete list of NFD authors and contributors.
-
-NFD is free software: you can redistribute it and/or modify it under the terms
-of the GNU General Public License as published by the Free Software Foundation,
-either version 3 of the License, or (at your option) any later version.
-
-NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
-"""
-
-top = '../..'
-
-def build(bld):
- bld.program(target="../../cs-smoketest",
- source="cs-smoketest.cpp",
- use='daemon-objects',
- install_path=None,
- )
diff --git a/NFD/tests/rib/fib-updates-common.hpp b/NFD/tests/rib/fib-updates-common.hpp
deleted file mode 100644
index c8c0af4..0000000
--- a/NFD/tests/rib/fib-updates-common.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-inline FaceEntry
-createFaceEntry(uint64_t faceId, uint64_t origin, uint64_t cost, uint64_t flags)
-{
- FaceEntry temp;
- temp.faceId = faceId;
- temp.origin = origin;
- temp.cost = cost;
- temp.flags = flags;
-
- return temp;
-}
-
-inline bool
-compareNameFaceIdCostAction(const shared_ptr<const FibUpdate>& lhs,
- const shared_ptr<const FibUpdate>& rhs)
-{
- if (lhs->name < rhs->name)
- {
- return true;
- }
- else if (lhs->name == rhs->name)
- {
- if (lhs->faceId < rhs->faceId)
- {
- return true;
- }
- else if (lhs->faceId == rhs->faceId)
- {
- if (lhs->cost < rhs->cost)
- {
- return true;
- }
- else if (lhs->cost == rhs->cost)
- {
- return lhs->action < rhs->action;
- }
- }
- }
-
- return false;
-}
-
-class FibUpdatesFixture : public nfd::tests::BaseFixture
-{
-public:
- void
- insertFaceEntry(const Name& name, uint64_t faceId, uint64_t origin, uint64_t cost, uint64_t flags)
- {
- rib::FaceEntry faceEntry;
- faceEntry.faceId = faceId;
- faceEntry.origin = origin;
- faceEntry.cost = cost;
- faceEntry.flags = flags;
-
- rib.insert(name, faceEntry);
- }
-
- void
- eraseFaceEntry(const Name& name, uint64_t faceId, uint64_t origin)
- {
- rib::FaceEntry faceEntry;
- faceEntry.faceId = faceId;
- faceEntry.origin = origin;
-
- rib.erase(name, faceEntry);
- }
-
-
- Rib::FibUpdateList
- getSortedFibUpdates()
- {
- Rib::FibUpdateList updates = rib.getFibUpdates();
- updates.sort(&compareNameFaceIdCostAction);
- return updates;
- }
-
-public:
- rib::Rib rib;
-};
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/fib-updates-erase-face.cpp b/NFD/tests/rib/fib-updates-erase-face.cpp
deleted file mode 100644
index e56c0d3..0000000
--- a/NFD/tests/rib/fib-updates-erase-face.cpp
+++ /dev/null
@@ -1,396 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib.hpp"
-
-#include "tests/test-common.hpp"
-#include "fib-updates-common.hpp"
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FibUpdates, FibUpdatesFixture)
-
-BOOST_AUTO_TEST_SUITE(EraseFace)
-
-BOOST_AUTO_TEST_CASE(WithInheritedFace_Root)
-{
- insertFaceEntry("/", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 2, 0, 75, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 1 updates: 1 to remove face 1 from /
- eraseFaceEntry("/", 1, 0);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(WithInheritedFace)
-{
- insertFaceEntry("/a", 5, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 5, 255, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 20, 0);
- insertFaceEntry("/a/b", 3, 0, 5, 0);
-
- // /a should have face 5 with cost 10; /a/b should have face 3 with cost 5 and
- // face 5 with cost 10
- eraseFaceEntry("/a", 5, 255);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 1 to remove face 3 from /a/b and one to remove inherited face.
- eraseFaceEntry("/a/b", 3, 0);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 3);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(MultipleFaces)
-{
- insertFaceEntry("/a", 5, 0, 10, 0);
- insertFaceEntry("/a", 5, 255, 5, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 1 updates: 1 to update cost to 10 for /a
- eraseFaceEntry("/a", 5, 255);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 5);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(NoFlags_NoCaptureChange_NoCaptureOnRoute)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 1 updates: 1 to update cost for /a
- eraseFaceEntry("/a", 1, 128);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(MakeRibEmpty)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 1 updates: 1 to remove face from /
- eraseFaceEntry("/", 1, 0);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(NoFlags_NoCaptureChange_CaptureOnRoute)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 1 updates: 1 to remove face from /a
- eraseFaceEntry("/a", 1, 128);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(BothFlags_NoCaptureChange_CaptureOnRoute)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
- ndn::nfd::ROUTE_FLAG_CAPTURE));
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 1 to remove face1 from /a and
- // 1 to remove face1 to /a/b
- eraseFaceEntry("/a", 1, 128);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(BothFlags_CaptureChange_NoCaptureOnRoute)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
- ndn::nfd::ROUTE_FLAG_CAPTURE));
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 1 to add face1 to /a and
- // 1 to add face1 to /a/b
- eraseFaceEntry("/a", 1, 128);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(ChildInherit_NoCaptureChange_NoCaptureOnRoute)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 2 to add face1 to /a and /a/b
- eraseFaceEntry("/a", 1, 128);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(ChildInherit_NoCaptureChange_CaptureOnRoute)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 2 to remove face 1 from /a and /a/b
- eraseFaceEntry("/a", 1, 128);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(Capture_CaptureChange_NoCaptureOnRoute)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 1 to update cost on /a and
- // 1 to add face1 to /a/b
- eraseFaceEntry("/a", 1 ,128);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(Capture_NoCaptureChange_CaptureOnRoute)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 1 updates: 1 to remove face from /a
- eraseFaceEntry("/a", 1, 128);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(EraseFaceById)
-{
- insertFaceEntry("/", 1, 0, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 100, 0);
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 4 updates: 4 to remove face ID 1 from /, /a, /a/b, and /a/c
- rib.erase(1);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 4);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/c");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // EraseFace
-
-BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/fib-updates-new-face.cpp b/NFD/tests/rib/fib-updates-new-face.cpp
deleted file mode 100644
index b8e7d69..0000000
--- a/NFD/tests/rib/fib-updates-new-face.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib.hpp"
-
-#include "tests/test-common.hpp"
-#include "fib-updates-common.hpp"
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FibUpdates, FibUpdatesFixture)
-
-BOOST_AUTO_TEST_SUITE(NewFace)
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
- // should generate 1 update
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- Rib::FibUpdateList updates = rib.getFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
-
- BOOST_CHECK_EQUAL((*update)->name, "/");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- // Clear any updates generated from previous insertions
- rib.clearFibUpdates();
-
- // should generate 2 updates
- insertFaceEntry("/a", 2, 0, 50, 0);
-
- updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 2);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // should generate 2 updates
- insertFaceEntry("/a/b", 3, 0, 10, 0);
-
- updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 3);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(UpdateOnLowerCostNoChildInherit)
-{
- insertFaceEntry("/", 1, 0, 50, 0);
-
- // Clear any updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 0 updates
- insertFaceEntry("/", 1, 128, 75, 0);
-
- BOOST_CHECK_EQUAL(rib.getFibUpdates().size(), 0);
-}
-
-BOOST_AUTO_TEST_CASE(UpdateOnLowerCostOnly)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: to update cost for face 1 on / and /a
- insertFaceEntry("/", 1, 0, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 25);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 25);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 0 updates
- insertFaceEntry("/", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- BOOST_CHECK_EQUAL(rib.getFibUpdates().size(), 0);
-}
-
-BOOST_AUTO_TEST_CASE(NoCaptureChangeWithoutChildInherit)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 1 update: 1 to add face 5 to /a
- insertFaceEntry("/a", 5, 128, 50, 0);
-
- const Rib::FibUpdateList& updates = rib.getFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
-
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 5);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(NoCaptureChangeWithChildInherit)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: one for the inserted face and
- // one to add face to /a/b
- insertFaceEntry("/a", 4, 128, 5, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 4);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 4);
- BOOST_CHECK_EQUAL((*update)->cost, 5);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(CaptureTurnedOnWithoutChildInherit)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 3 updates:
- // - one for the inserted face for /a and
- // - two to remove face1 from /a/b and /a/c
- insertFaceEntry("/a", 1, 128, 50, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 3);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/c");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(CaptureTurnedOnWithChildInherit)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates:
- // - one for the inserted face for /a and
- // - one to update /a/b with the new cost
- insertFaceEntry("/a", 1, 128, 50, (ndn::nfd::ROUTE_FLAG_CAPTURE |
- ndn::nfd::ROUTE_FLAG_CHILD_INHERIT));
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 3);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // NewFace
-
-BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/fib-updates-new-namespace.cpp b/NFD/tests/rib/fib-updates-new-namespace.cpp
deleted file mode 100644
index e409c51..0000000
--- a/NFD/tests/rib/fib-updates-new-namespace.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib.hpp"
-
-#include "tests/test-common.hpp"
-#include "fib-updates-common.hpp"
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FibUpdates, FibUpdatesFixture)
-
-BOOST_AUTO_TEST_SUITE(NewNamespace)
-
-BOOST_AUTO_TEST_CASE(NoFlags)
-{
- // No flags, empty RIB, should generate 1 update for the inserted face
- insertFaceEntry("/a/b", 1, 0, 10, 0);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- // Reset RIB
- eraseFaceEntry("/a/b", 1, 0);
- rib.clearFibUpdates();
-
- // Parent with child inherit flag
- insertFaceEntry("/a", 2, 0, 70, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 3, 0, 30, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 3 updates, 1 for the inserted face and 2 from inheritance
- insertFaceEntry("/a/b", 1, 0, 10, 0);
-
- updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 3);
-
- update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 2);
- BOOST_CHECK_EQUAL((*update)->cost, 70);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 3);
- BOOST_CHECK_EQUAL((*update)->cost, 30);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(BothFlags)
-{
- // Empty RIB, should generate 1 update for the inserted face
- insertFaceEntry("/a", 1, 0, 10, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
- ndn::nfd::ROUTE_FLAG_CAPTURE));
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- // Reset RIB
- eraseFaceEntry("/a", 1, 0);
- rib.clearFibUpdates();
-
- insertFaceEntry("/", 2, 0, 70, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 30, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 3 updates, 1 for the inserted face, 1 to add the face to the child,
- // and 1 to remove the previously inherited entry
- insertFaceEntry("/a", 1, 0, 10, (ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
- ndn::nfd::ROUTE_FLAG_CAPTURE));
-
- updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 3);
-
- update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 2);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(ChildInherit)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 2, 0, 10, 0);
- insertFaceEntry("/a/c", 3, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 1 for the inserted face and 1 to add the face to "/a/b"
- insertFaceEntry("/a", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(Capture)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 2, 0, 10, 0);
- insertFaceEntry("/a/c", 3, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 1 for the inserted face and
- // 1 to remove inherited face from "/a/b"
- insertFaceEntry("/a", 1, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // NewNamespace
-
-BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/fib-updates-update-face.cpp b/NFD/tests/rib/fib-updates-update-face.cpp
deleted file mode 100644
index 13f5e21..0000000
--- a/NFD/tests/rib/fib-updates-update-face.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib.hpp"
-
-#include "tests/test-common.hpp"
-#include "fib-updates-common.hpp"
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(FibUpdates, FibUpdatesFixture)
-
-BOOST_AUTO_TEST_SUITE(UpdateFace)
-
-BOOST_AUTO_TEST_CASE(TurnOffChildInheritLowerCost)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/", 1, 128, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 1 to update the cost of / face 1 to 50 and
- // 1 to update the cost of /a face 1 to 50
- insertFaceEntry("/", 1, 128, 75, 0);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(UpdateOnLowerCostOnly)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/", 1, 128, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 0 updates
- insertFaceEntry("/", 1, 128, 75, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates
- insertFaceEntry("/", 1, 128, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 25);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 25);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(NoChangeInCost)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 0 updates
- insertFaceEntry("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 0);
-}
-
-BOOST_AUTO_TEST_CASE(ChangeCost)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Should generate 2 updates: 1 to add face2 with new cost to /a and
- // 1 to add face2 with new cost to /a/b
- insertFaceEntry("/a", 2, 0, 300, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 2);
- BOOST_CHECK_EQUAL((*update)->cost, 300);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 2);
- BOOST_CHECK_EQUAL((*update)->cost, 300);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(TurnOnChildInherit)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Turn on child inherit flag for the entry in /a
- // Should generate 1 updates: 1 to add face to /a/b
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 2);
- BOOST_CHECK_EQUAL((*update)->cost, 10);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(TurnOffChildInherit)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 1, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a/b", 2, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 25, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Turn off child inherit flag for the entry in /a
- // Should generate 1 update: 1 to add face1 to /a/b
- insertFaceEntry("/a", 1, 0, 100, 0);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 1);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(TurnOnCapture)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, 0);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 10, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Turn on capture flag for the entry in /a
- // Should generate 2 updates: 1 to remove face1 from /a and
- // 1 to remove face1 from /a/b
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::REMOVE_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_CASE(TurnOffCapture)
-{
- insertFaceEntry("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
- insertFaceEntry("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE);
- insertFaceEntry("/a/b", 3, 0, 10, 0);
- insertFaceEntry("/a/c", 1, 0, 10, 0);
-
- // Clear updates generated from previous insertions
- rib.clearFibUpdates();
-
- // Turn off capture flag for the entry in /a
- // Should generate 2 updates: 1 to add face1 to /a and
- // 1 to add face1 to /a/b
- insertFaceEntry("/a", 2, 0, 10, 0);
-
- Rib::FibUpdateList updates = getSortedFibUpdates();
- BOOST_REQUIRE_EQUAL(updates.size(), 2);
-
- Rib::FibUpdateList::const_iterator update = updates.begin();
- BOOST_CHECK_EQUAL((*update)->name, "/a");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-
- ++update;
- BOOST_CHECK_EQUAL((*update)->name, "/a/b");
- BOOST_CHECK_EQUAL((*update)->faceId, 1);
- BOOST_CHECK_EQUAL((*update)->cost, 50);
- BOOST_CHECK_EQUAL((*update)->action, FibUpdate::ADD_NEXTHOP);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // UpdateFace
-
-BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/remote-registrator.cpp b/NFD/tests/rib/remote-registrator.cpp
deleted file mode 100644
index c0ef540..0000000
--- a/NFD/tests/rib/remote-registrator.cpp
+++ /dev/null
@@ -1,520 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/remote-registrator.hpp"
-
-#include "tests/limited-io.hpp"
-#include "tests/identity-management-fixture.hpp"
-#include <ndn-cxx/util/dummy-client-face.hpp>
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-class RemoteRegistratorFixture : public nfd::tests::IdentityManagementFixture
- , public nfd::tests::UnitTestTimeFixture
-{
-public:
- RemoteRegistratorFixture()
- : face(ndn::util::makeDummyClientFace(getGlobalIoService()))
- , controller(make_shared<ndn::nfd::Controller>(std::ref(*face), m_keyChain))
- , remoteRegistrator(make_shared<RemoteRegistrator>(std::ref(*controller),
- m_keyChain,
- rib))
- , COMMAND_PREFIX("/localhop/nfd/rib")
- , REGISTER_VERB("register")
- , UNREGISTER_VERB("unregister")
- {
- readConfig();
-
- remoteRegistrator->enable();
-
- advanceClocks(time::milliseconds(1));
- face->sentInterests.clear();
- }
-
- void
- readConfig(bool isSetRetry = false)
- {
- ConfigFile config;
- config.addSectionHandler("remote_register",
- bind(&RemoteRegistrator::loadConfig, remoteRegistrator, _1));
-
-
- if (isSetRetry)
- {
- const std::string CONFIG_STRING =
- "remote_register\n"
- "{\n"
- " cost 15\n"
- " timeout 1000\n"
- " retry 1\n"
- " refresh_interval 5\n"
- "}";
-
- config.parse(CONFIG_STRING, true, "test-remote-register");
- }
- else
- {
- const std::string CONFIG_STRING =
- "remote_register\n"
- "{\n"
- " cost 15\n"
- " timeout 100000\n"
- " retry 0\n"
- " refresh_interval 5\n"
- "}";
-
- config.parse(CONFIG_STRING, true, "test-remote-register");
- }
- }
-
- void
- waitForTimeout()
- {
- advanceClocks(time::milliseconds(100), time::seconds(1));
- }
-
- void
- insertEntryWithIdentity(Name identity,
- name::Component appName = DEFAULT_APP_NAME,
- uint64_t faceId = 0)
- {
- BOOST_CHECK_EQUAL(addIdentity(identity), true);
-
- FaceEntry faceEntry;
- faceEntry.faceId = faceId;
-
- rib.insert(identity.append(appName), faceEntry);
-
- advanceClocks(time::milliseconds(1));
- }
-
- void
- insertEntryWithoutIdentity(Name identity,
- name::Component appName = DEFAULT_APP_NAME,
- uint64_t faceId = 0)
- {
- FaceEntry faceEntry;
- faceEntry.faceId = faceId;
-
- rib.insert(identity.append(appName), faceEntry);
-
- advanceClocks(time::milliseconds(1));
- }
-
- void
- eraseEntryWithIdentity(Name identity,
- name::Component appName = DEFAULT_APP_NAME,
- uint64_t faceId = 0)
- {
- BOOST_CHECK_EQUAL(addIdentity(identity), true);
-
- FaceEntry faceEntry;
- faceEntry.faceId = faceId;
-
- rib.erase(identity.append(appName), faceEntry);
-
- advanceClocks(time::milliseconds(1));
- }
-
- void
- eraseEntryWithoutIdentity(Name identity,
- name::Component appName = DEFAULT_APP_NAME,
- uint64_t faceId = 0)
- {
- FaceEntry faceEntry;
- faceEntry.faceId = faceId;
-
- rib.erase(identity.append(appName), faceEntry);
-
- advanceClocks(time::milliseconds(1));
- }
-
- void
- eraseFace(uint64_t faceId)
- {
- rib.erase(faceId);
-
- advanceClocks(time::milliseconds(1));
- }
-
- void
- connectToHub()
- {
- rib.insert(COMMAND_PREFIX, FaceEntry());
-
- advanceClocks(time::milliseconds(1));
- }
-
- void
- disconnectToHub()
- {
- rib.erase(COMMAND_PREFIX, FaceEntry());
-
- advanceClocks(time::milliseconds(1));
- }
-
- void
- extractParameters(Interest& interest, Name::Component& verb,
- ndn::nfd::ControlParameters& extractedParameters)
- {
- const Name& name = interest.getName();
- verb = name[COMMAND_PREFIX.size()];
- const Name::Component& parameterComponent = name[COMMAND_PREFIX.size() + 1];
-
- Block rawParameters = parameterComponent.blockFromValue();
- extractedParameters.wireDecode(rawParameters);
- }
-
-public:
- Rib rib;
- shared_ptr<ndn::util::DummyClientFace> face;
- shared_ptr<ndn::nfd::Controller> controller;
- shared_ptr<RemoteRegistrator> remoteRegistrator;
-
- const Name COMMAND_PREFIX;
- const name::Component REGISTER_VERB;
- const name::Component UNREGISTER_VERB;
-
- static const name::Component DEFAULT_APP_NAME;
-};
-
-const name::Component RemoteRegistratorFixture::DEFAULT_APP_NAME("app");
-
-BOOST_FIXTURE_TEST_SUITE(RemoteRegistrator, RemoteRegistratorFixture)
-
-BOOST_FIXTURE_TEST_CASE(AutoTest, RemoteRegistratorFixture)
-{
- BOOST_REQUIRE_EQUAL(1, 1);
-}
-
-BOOST_FIXTURE_TEST_CASE(RegisterWithoutConnection, RemoteRegistratorFixture)
-{
- insertEntryWithIdentity("/remote/register");
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(RegisterWithoutIdentity, RemoteRegistratorFixture)
-{
- connectToHub();
-
- insertEntryWithoutIdentity("/remote/register");
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(RegisterWithHubPrefix, RemoteRegistratorFixture)
-{
- connectToHub();
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(RegisterWithLocalPrefix, RemoteRegistratorFixture)
-{
- connectToHub();
-
- insertEntryWithIdentity("/localhost/prefix");
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(RegisterBasic, RemoteRegistratorFixture)
-{
- connectToHub();
-
- Name identity("/remote/register");
- insertEntryWithIdentity(identity);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
-
- Interest& request = face->sentInterests[0];
-
- ndn::nfd::ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, REGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), identity);
-}
-
-BOOST_FIXTURE_TEST_CASE(RegisterAdvanced, RemoteRegistratorFixture)
-{
- connectToHub();
-
- Name identity("/remote/register");
- Name identityAddRib("/remote/register/rib");
- insertEntryWithIdentity(identityAddRib);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
-
- Interest& request = face->sentInterests[0];
-
- ndn::nfd::ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, REGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), identity);
-}
-
-BOOST_FIXTURE_TEST_CASE(RegisterWithRedundantCallback, RemoteRegistratorFixture)
-{
- remoteRegistrator->enable();
-
- connectToHub();
-
- Name identity("/remote/register");
- insertEntryWithIdentity(identity);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
-
- Interest& request = face->sentInterests[0];
-
- ndn::nfd::ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, REGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), identity);
-}
-
-BOOST_FIXTURE_TEST_CASE(RegisterRetry, RemoteRegistratorFixture)
-{
- // setRetry
- readConfig(true);
-
- connectToHub();
-
- Name identity("/remote/register");
- insertEntryWithIdentity(identity);
-
- waitForTimeout();
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 2);
-
- Interest& requestFirst = face->sentInterests[0];
- Interest& requestSecond = face->sentInterests[1];
-
- ndn::nfd::ControlParameters extractedParametersFirst, extractedParametersSecond;
- Name::Component verbFirst, verbSecond;
- extractParameters(requestFirst, verbFirst, extractedParametersFirst);
- extractParameters(requestSecond, verbSecond, extractedParametersSecond);
-
- BOOST_CHECK_EQUAL(verbFirst, REGISTER_VERB);
- BOOST_CHECK_EQUAL(verbSecond, REGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParametersFirst.getName(), identity);
- BOOST_CHECK_EQUAL(extractedParametersSecond.getName(), identity);
-}
-
-BOOST_FIXTURE_TEST_CASE(UnregisterWithoutInsert, RemoteRegistratorFixture)
-{
- connectToHub();
-
- eraseEntryWithIdentity("/remote/register");
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(UnregisterWithoutConnection, RemoteRegistratorFixture)
-{
- connectToHub();
-
- disconnectToHub();
-
- Name indentity("/remote/register");
- remoteRegistrator->m_regEntries.insert(
- nfd::rib::RemoteRegistrator::RegisteredEntry(indentity, EventId()));
-
- eraseEntryWithIdentity(indentity);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(UnregisterWithoutSuccessfullRegistration,
- RemoteRegistratorFixture)
-{
- connectToHub();
-
- Name identity("/remote/register");
-
- insertEntryWithIdentity(identity);
-
- eraseEntryWithIdentity(identity);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
-
- Interest& request = face->sentInterests[0];
-
- ndn::nfd::ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, REGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), identity);
-}
-
-BOOST_FIXTURE_TEST_CASE(UnregisterBasic, RemoteRegistratorFixture)
-{
- connectToHub();
-
- Name identity("/remote/register");
-
- insertEntryWithIdentity(identity);
-
- EventId event;
-
- remoteRegistrator->m_regEntries.insert(
- nfd::rib::RemoteRegistrator::RegisteredEntry(identity, event));
-
- eraseEntryWithIdentity(identity);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 2);
-
- Interest& request = face->sentInterests[1];
-
- ndn::nfd::ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, UNREGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), identity);
-}
-
-BOOST_FIXTURE_TEST_CASE(UnregisterAdvanced, RemoteRegistratorFixture)
-{
- connectToHub();
-
- Name identityShort("/remote/register");
- Name identityLong("/remote/register/long");
-
- EventId eventShort;
- EventId eventLong;
-
- insertEntryWithIdentity(identityShort, name::Component("appA"));
-
- remoteRegistrator->m_regEntries.insert(
- nfd::rib::RemoteRegistrator::RegisteredEntry(identityShort,
- eventShort));
-
- insertEntryWithIdentity(identityShort, name::Component("appB"));
-
- insertEntryWithIdentity(identityLong);
-
- remoteRegistrator->m_regEntries.insert(
- nfd::rib::RemoteRegistrator::RegisteredEntry(identityLong,
- eventLong));
-
- // two registration commands are generated for identityShort and identityLong
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 2);
-
- eraseEntryWithIdentity(identityShort, name::Component("appA"));
-
- // no unregistration command is generated as appB also exists
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 2);
-
- eraseEntryWithIdentity(identityShort, name::Component("appB"));
-
- // one unregistration command is generated for identityShort
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 3);
-
- Interest& request = face->sentInterests[2];
-
- ndn::nfd::ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, UNREGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), identityShort);
-}
-
-BOOST_FIXTURE_TEST_CASE(EraseFace, RemoteRegistratorFixture)
-{
- connectToHub();
-
- Name identity("/remote/register");
- uint64_t faceId = 517;
-
- insertEntryWithIdentity(identity, DEFAULT_APP_NAME, faceId);
-
- EventId event;
-
- remoteRegistrator->m_regEntries.insert(
- nfd::rib::RemoteRegistrator::RegisteredEntry(identity, event));
-
- eraseFace(faceId);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 2);
-
- Interest& request = face->sentInterests[1];
-
- ndn::nfd::ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, UNREGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), identity);
-}
-
-BOOST_FIXTURE_TEST_CASE(RebuildConnection, RemoteRegistratorFixture)
-{
- connectToHub();
-
- Name identity("/remote/register");
-
- insertEntryWithIdentity(identity);
-
- EventId event;
-
- remoteRegistrator->m_regEntries.insert(
- nfd::rib::RemoteRegistrator::RegisteredEntry(identity, event));
-
- disconnectToHub();
-
- connectToHub();
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 2);
-
- Interest& request1 = face->sentInterests[0];
- Interest& request2 = face->sentInterests[1];
-
- ndn::nfd::ControlParameters extractedParameters1, extractedParameters2;
- Name::Component verb1, verb2;
- extractParameters(request1, verb1, extractedParameters1);
- extractParameters(request2, verb2, extractedParameters2);
-
- BOOST_CHECK_EQUAL(verb1, REGISTER_VERB);
- BOOST_CHECK_EQUAL(verb2, REGISTER_VERB);
- BOOST_CHECK_EQUAL(extractedParameters1.getName(),
- extractedParameters2.getName());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/rib-manager.cpp b/NFD/tests/rib/rib-manager.cpp
deleted file mode 100644
index 39a4a5d..0000000
--- a/NFD/tests/rib/rib-manager.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib-manager.hpp"
-#include <ndn-cxx/management/nfd-face-status.hpp>
-#include "rib/rib-status-publisher-common.hpp"
-
-#include "tests/test-common.hpp"
-#include "tests/limited-io.hpp"
-#include <ndn-cxx/util/dummy-client-face.hpp>
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-class RibManagerFixture : public nfd::tests::BaseFixture
-{
-public:
- RibManagerFixture()
- : COMMAND_PREFIX("/localhost/nfd/rib")
- , ADD_NEXTHOP_VERB("add-nexthop")
- , REMOVE_NEXTHOP_VERB("remove-nexthop")
- {
- face = ndn::util::makeDummyClientFace();
-
- manager = make_shared<RibManager>(ndn::ref(*face));
- manager->registerWithNfd();
-
- face->processEvents(time::milliseconds(1));
- face->sentInterests.clear();
- }
-
- ~RibManagerFixture()
- {
- manager.reset();
- face.reset();
- }
-
- void extractParameters(Interest& interest, Name::Component& verb,
- ControlParameters& extractedParameters)
- {
- const Name& name = interest.getName();
- verb = name[COMMAND_PREFIX.size()];
- const Name::Component& parameterComponent = name[COMMAND_PREFIX.size() + 1];
-
- Block rawParameters = parameterComponent.blockFromValue();
- extractedParameters.wireDecode(rawParameters);
- }
-
- void receiveCommandInterest(Name& name, ControlParameters& parameters)
- {
- receiveCommandInterest(name.append(parameters.wireEncode()));
- }
-
- void receiveCommandInterest(const Name& name)
- {
- Interest command(name);
-
- face->receive(command);
- face->processEvents(time::milliseconds(1));
- }
-
-public:
- shared_ptr<RibManager> manager;
- shared_ptr<ndn::util::DummyClientFace> face;
-
- const Name COMMAND_PREFIX;
- const Name::Component ADD_NEXTHOP_VERB;
- const Name::Component REMOVE_NEXTHOP_VERB;
-};
-
-class AuthorizedRibManager : public RibManagerFixture
-{
-public:
- AuthorizedRibManager()
- {
- ConfigFile config;
- manager->setConfigFile(config);
-
- const std::string CONFIG_STRING =
- "rib\n"
- "{\n"
- " localhost_security\n"
- " {\n"
- " trust-anchor\n"
- " {\n"
- " type any\n"
- " }\n"
- " }"
- "}";
-
- config.parse(CONFIG_STRING, true, "test-rib");
- }
-};
-
-typedef RibManagerFixture UnauthorizedRibManager;
-
-BOOST_FIXTURE_TEST_SUITE(RibManager, RibManagerFixture)
-
-BOOST_FIXTURE_TEST_CASE(ShortName, AuthorizedRibManager)
-{
- Name commandName("/localhost/nfd/rib");
- receiveCommandInterest(commandName);
- // TODO verify error response
-}
-
-BOOST_FIXTURE_TEST_CASE(Basic, AuthorizedRibManager)
-{
- ControlParameters parameters;
- parameters
- .setName("/hello")
- .setFaceId(1)
- .setCost(10)
- .setFlags(0)
- .setOrigin(128)
- .setExpirationPeriod(ndn::time::milliseconds::max());
-
- Name commandName("/localhost/nfd/rib/register");
-
- receiveCommandInterest(commandName, parameters);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
-}
-
-BOOST_FIXTURE_TEST_CASE(Register, AuthorizedRibManager)
-{
- ControlParameters parameters;
- parameters
- .setName("/hello")
- .setFaceId(1)
- .setCost(10)
- .setFlags(0)
- .setOrigin(128)
- .setExpirationPeriod(ndn::time::milliseconds::max());
-
- Name commandName("/localhost/nfd/rib/register");
-
- receiveCommandInterest(commandName, parameters);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
-
- Interest& request = face->sentInterests[0];
-
- ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, ADD_NEXTHOP_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), parameters.getName());
- BOOST_CHECK_EQUAL(extractedParameters.getFaceId(), parameters.getFaceId());
- BOOST_CHECK_EQUAL(extractedParameters.getCost(), parameters.getCost());
-}
-
-BOOST_FIXTURE_TEST_CASE(Unregister, AuthorizedRibManager)
-{
- ControlParameters addParameters;
- addParameters
- .setName("/hello")
- .setFaceId(1)
- .setCost(10)
- .setFlags(0)
- .setOrigin(128)
- .setExpirationPeriod(ndn::time::milliseconds::max());
-
- Name registerName("/localhost/nfd/rib/register");
-
- receiveCommandInterest(registerName, addParameters);
- face->sentInterests.clear();
-
- ControlParameters removeParameters;
- removeParameters
- .setName("/hello")
- .setFaceId(1)
- .setOrigin(128);
-
- Name unregisterName("/localhost/nfd/rib/unregister");
-
- receiveCommandInterest(unregisterName, removeParameters);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 1);
-
- Interest& request = face->sentInterests[0];
-
- ControlParameters extractedParameters;
- Name::Component verb;
- extractParameters(request, verb, extractedParameters);
-
- BOOST_CHECK_EQUAL(verb, REMOVE_NEXTHOP_VERB);
- BOOST_CHECK_EQUAL(extractedParameters.getName(), removeParameters.getName());
- BOOST_CHECK_EQUAL(extractedParameters.getFaceId(), removeParameters.getFaceId());
-}
-
-BOOST_FIXTURE_TEST_CASE(UnauthorizedCommand, UnauthorizedRibManager)
-{
- ControlParameters parameters;
- parameters
- .setName("/hello")
- .setFaceId(1)
- .setCost(10)
- .setFlags(0)
- .setOrigin(128)
- .setExpirationPeriod(ndn::time::milliseconds::max());
-
- Name commandName("/localhost/nfd/rib/register");
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-
- receiveCommandInterest(commandName, parameters);
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-}
-
-BOOST_FIXTURE_TEST_CASE(RibStatusRequest, AuthorizedRibManager)
-{
- FaceEntry entry;
- Name name("/");
- entry.faceId = 1;
- entry.origin = 128;
- entry.cost = 32;
- entry.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
-
- ControlParameters parameters;
- parameters
- .setName(name)
- .setFaceId(entry.faceId)
- .setOrigin(entry.origin)
- .setCost(entry.cost)
- .setFlags(entry.flags)
- .setExpirationPeriod(ndn::time::milliseconds::max());
-
- Name commandName("/localhost/nfd/rib/register");
-
- BOOST_REQUIRE_EQUAL(face->sentInterests.size(), 0);
-
- receiveCommandInterest(commandName, parameters);
- face->sentInterests.clear();
- face->sentDatas.clear();
-
- face->receive(Interest("/localhost/nfd/rib/list"));
- face->processEvents(time::milliseconds(1));
-
- BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
- RibStatusPublisherFixture::decodeRibEntryBlock(face->sentDatas[0], name, entry);
-}
-
-BOOST_FIXTURE_TEST_CASE(CancelExpirationEvent, AuthorizedRibManager)
-{
- // Register face
- ControlParameters addParameters;
- addParameters
- .setName("/expire")
- .setFaceId(1)
- .setCost(10)
- .setFlags(0)
- .setOrigin(128)
- .setExpirationPeriod(ndn::time::milliseconds(500));
-
- Name registerName("/localhost/nfd/rib/register");
-
- receiveCommandInterest(registerName, addParameters);
- face->sentInterests.clear();
-
- // Unregister face
- ControlParameters removeParameters;
- removeParameters
- .setName("/expire")
- .setFaceId(1)
- .setOrigin(128);
-
- Name unregisterName("/localhost/nfd/rib/unregister");
-
- receiveCommandInterest(unregisterName, removeParameters);
-
- // Reregister face
- Name reRegisterName("/localhost/nfd/rib/register");
- addParameters.setExpirationPeriod(ndn::time::milliseconds::max());
- receiveCommandInterest(reRegisterName, addParameters);
-
- nfd::tests::LimitedIo limitedIo;
- limitedIo.run(nfd::tests::LimitedIo::UNLIMITED_OPS, time::seconds(1));
-
- BOOST_REQUIRE_EQUAL(manager->m_managedRib.size(), 1);
-}
-
-BOOST_FIXTURE_TEST_CASE(RemoveInvalidFaces, AuthorizedRibManager)
-{
- // Register valid face
- ControlParameters validParameters;
- validParameters
- .setName("/test")
- .setFaceId(1);
-
- Name validName("/localhost/nfd/rib/register");
- receiveCommandInterest(validName, validParameters);
-
- // Register invalid face
- ControlParameters invalidParameters;
- invalidParameters
- .setName("/test")
- .setFaceId(2);
-
- Name invalidName("/localhost/nfd/rib/register");
- receiveCommandInterest(invalidName, invalidParameters);
-
- BOOST_REQUIRE_EQUAL(manager->m_managedRib.size(), 2);
-
- // Receive status with only faceId: 1
- ndn::nfd::FaceStatus status;
- status.setFaceId(1);
-
- shared_ptr<Data> data = nfd::tests::makeData("/localhost/nfd/faces/list");
- data->setContent(status.wireEncode());
-
- shared_ptr<ndn::OBufferStream> buffer = make_shared<ndn::OBufferStream>();
- buffer->write(reinterpret_cast<const char*>(data->getContent().value()),
- data->getContent().value_size());
-
- manager->removeInvalidFaces(buffer);
-
- // Run scheduler
- nfd::tests::LimitedIo limitedIo;
- limitedIo.run(nfd::tests::LimitedIo::UNLIMITED_OPS, time::seconds(1));
-
- BOOST_REQUIRE_EQUAL(manager->m_managedRib.size(), 1);
-
- Rib::const_iterator it = manager->m_managedRib.find("/test");
- BOOST_REQUIRE(it != manager->m_managedRib.end());
-
- shared_ptr<RibEntry> entry = it->second;
- BOOST_CHECK_EQUAL(entry->hasFaceId(1), true);
- BOOST_CHECK_EQUAL(entry->hasFaceId(2), false);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/rib-status-publisher-common.hpp b/NFD/tests/rib/rib-status-publisher-common.hpp
deleted file mode 100644
index 58ccd68..0000000
--- a/NFD/tests/rib/rib-status-publisher-common.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef RIB_TESTS_UNIT_TESTS_RIB_STATUS_PUBLISHER_COMMON_HPP
-#define RIB_TESTS_UNIT_TESTS_RIB_STATUS_PUBLISHER_COMMON_HPP
-
-#include "rib/rib-status-publisher.hpp"
-
-#include "tests/test-common.hpp"
-#include "rib/rib.hpp"
-
-#include <ndn-cxx/management/nfd-control-parameters.hpp>
-#include <ndn-cxx/management/nfd-rib-entry.hpp>
-#include <ndn-cxx/encoding/tlv.hpp>
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-using ndn::nfd::ControlParameters;
-
-class RibStatusPublisherFixture : public nfd::tests::BaseFixture
-{
-public:
- static void
- validateRibEntry(const Block& block, const Name& referenceName, const FaceEntry& referenceFace)
- {
- ndn::nfd::RibEntry entry;
- BOOST_REQUIRE_NO_THROW(entry.wireDecode(block));
-
- BOOST_CHECK_EQUAL(entry.getName(), referenceName);
-
- std::list<ndn::nfd::Route> routes = entry.getRoutes();
-
- std::list<ndn::nfd::Route>::iterator it = routes.begin();
- BOOST_CHECK_EQUAL(it->getFaceId(), referenceFace.faceId);
- BOOST_CHECK_EQUAL(it->getOrigin(), referenceFace.origin);
- BOOST_CHECK_EQUAL(it->getCost(), referenceFace.cost);
- BOOST_CHECK_EQUAL(it->getFlags(), referenceFace.flags);
- }
-
- static void
- decodeRibEntryBlock(const Data& data, const Name& referenceName, const FaceEntry& referenceFace)
- {
- ndn::EncodingBuffer buffer;
-
- Block payload = data.getContent();
-
- buffer.appendByteArray(payload.value(), payload.value_size());
- buffer.prependVarNumber(buffer.size());
- buffer.prependVarNumber(tlv::Content);
-
- ndn::Block parser(buffer.buf(), buffer.size());
- parser.parse();
-
- Block::element_const_iterator i = parser.elements_begin();
-
- if (i->type() != ndn::tlv::nfd::RibEntry) {
- BOOST_FAIL("expected RibEntry, got type #" << i->type());
- }
- else {
- validateRibEntry(*i, referenceName, referenceFace);
- }
- }
-};
-
-#endif // RIB_TESTS_UNIT_TESTS_RIB_STATUS_PUBLISHER_COMMON_HPP
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/rib-status-publisher.cpp b/NFD/tests/rib/rib-status-publisher.cpp
deleted file mode 100644
index b1414cc..0000000
--- a/NFD/tests/rib/rib-status-publisher.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib-status-publisher.hpp"
-#include "rib-status-publisher-common.hpp"
-
-#include "tests/test-common.hpp"
-#include <ndn-cxx/util/dummy-client-face.hpp>
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(RibStatusPublisherSuite, RibStatusPublisherFixture)
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
- Rib rib;
-
- FaceEntry entry;
- Name name("/");
- entry.faceId = 1;
- entry.origin = 128;
- entry.cost = 32;
- entry.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
- rib.insert(name, entry);
-
- ndn::KeyChain keyChain;
- shared_ptr<ndn::util::DummyClientFace> face = ndn::util::makeDummyClientFace();
- RibStatusPublisher publisher(rib, *face, "/localhost/nfd/rib/list", keyChain);
-
- publisher.publish();
- face->processEvents(time::milliseconds(1));
-
- BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
- decodeRibEntryBlock(face->sentDatas[0], name, entry);
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/rib/rib.cpp b/NFD/tests/rib/rib.cpp
deleted file mode 100644
index 3226e57..0000000
--- a/NFD/tests/rib/rib.cpp
+++ /dev/null
@@ -1,335 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "rib/rib.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace rib {
-namespace tests {
-
-BOOST_FIXTURE_TEST_SUITE(Rib, nfd::tests::BaseFixture)
-
-BOOST_AUTO_TEST_CASE(RibEntry)
-{
- rib::RibEntry entry;
-
- rib::FaceEntry face1;
- face1.faceId = 1;
- face1.origin = 0;
-
- entry.insertFace(face1);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 1);
-
- FaceEntry face2;
- face2.faceId = 1;
- face2.origin = 128;
-
- entry.insertFace(face2);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 2);
-
- entry.eraseFace(face1);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 1);
-
- BOOST_CHECK(entry.findFace(face1) == entry.getFaces().end());
- BOOST_CHECK(entry.findFace(face2) != entry.getFaces().end());
-
- entry.insertFace(face2);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 1);
-
- entry.eraseFace(face1);
- BOOST_CHECK_EQUAL(entry.getFaces().size(), 1);
- BOOST_CHECK(entry.findFace(face2) != entry.getFaces().end());
-}
-
-BOOST_AUTO_TEST_CASE(Parent)
-{
- rib::Rib rib;
-
- FaceEntry root;
- Name name1("/");
- root.faceId = 1;
- root.origin = 20;
- rib.insert(name1, root);
-
- FaceEntry entry1;
- Name name2("/hello");
- entry1.faceId = 2;
- entry1.origin = 20;
- rib.insert(name2, entry1);
-
- FaceEntry entry2;
- Name name3("/hello/world");
- entry2.faceId = 3;
- entry2.origin = 20;
- rib.insert(name3, entry2);
-
- shared_ptr<rib::RibEntry> ribEntry = rib.findParent(name3);
- BOOST_REQUIRE(static_cast<bool>(ribEntry));
- BOOST_CHECK_EQUAL(ribEntry->getFaces().front().faceId, 2);
-
- ribEntry = rib.findParent(name2);
- BOOST_REQUIRE(static_cast<bool>(ribEntry));
- BOOST_CHECK_EQUAL(ribEntry->getFaces().front().faceId, 1);
-
- FaceEntry entry3;
- Name name4("/hello/test/foo/bar");
- entry2.faceId = 3;
- entry2.origin = 20;
- rib.insert(name4, entry3);
-
- ribEntry = rib.findParent(name4);
- BOOST_CHECK(ribEntry != shared_ptr<rib::RibEntry>());
- BOOST_CHECK(ribEntry->getFaces().front().faceId == 2);
-}
-
-BOOST_AUTO_TEST_CASE(Children)
-{
- rib::Rib rib;
-
- FaceEntry entry1;
- Name name1("/");
- entry1.faceId = 1;
- entry1.origin = 20;
- rib.insert(name1, entry1);
-
- FaceEntry entry2;
- Name name2("/hello/world");
- entry2.faceId = 2;
- entry2.origin = 20;
- rib.insert(name2, entry2);
-
- FaceEntry entry3;
- Name name3("/hello/test/foo/bar");
- entry3.faceId = 3;
- entry3.origin = 20;
- rib.insert(name3, entry3);
-
- BOOST_CHECK_EQUAL((rib.find(name1)->second)->getChildren().size(), 2);
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getChildren().size(), 0);
- BOOST_CHECK_EQUAL((rib.find(name3)->second)->getChildren().size(), 0);
-
- FaceEntry entry4;
- Name name4("/hello");
- entry4.faceId = 4;
- entry4.origin = 20;
- rib.insert(name4, entry4);
-
- BOOST_CHECK_EQUAL((rib.find(name1)->second)->getChildren().size(), 1);
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getChildren().size(), 0);
- BOOST_CHECK_EQUAL((rib.find(name3)->second)->getChildren().size(), 0);
- BOOST_CHECK_EQUAL((rib.find(name4)->second)->getChildren().size(), 2);
-
- BOOST_CHECK_EQUAL((rib.find(name1)->second)->getChildren().front()->getName(), "/hello");
- BOOST_CHECK_EQUAL((rib.find(name4)->second)->getParent()->getName(), "/");
-
- BOOST_REQUIRE(static_cast<bool>((rib.find(name2)->second)->getParent()));
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getParent()->getName(), name4);
- BOOST_REQUIRE(static_cast<bool>((rib.find(name3)->second)->getParent()));
- BOOST_CHECK_EQUAL((rib.find(name3)->second)->getParent()->getName(), name4);
-}
-
-BOOST_AUTO_TEST_CASE(EraseFace)
-{
- rib::Rib rib;
-
- FaceEntry entry1;
- Name name1("/");
- entry1.faceId = 1;
- entry1.origin = 20;
- rib.insert(name1, entry1);
-
- FaceEntry entry2;
- Name name2("/hello/world");
- entry2.faceId = 2;
- entry2.origin = 20;
- rib.insert(name2, entry2);
-
- FaceEntry entry3;
- Name name3("/hello/world");
- entry3.faceId = 1;
- entry3.origin = 20;
- rib.insert(name3, entry3);
-
- FaceEntry entry4;
- Name name4("/not/inserted");
- entry4.faceId = 1;
- entry4.origin = 20;
-
- rib.erase(name4, entry4);
- rib.erase(name1, entry1);
-
- BOOST_CHECK(rib.find(name1) == rib.end());
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().size(), 2);
-
- rib.erase(name2, entry2);
-
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().size(), 1);
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().front().faceId, 1);
-
- rib.erase(name3, entry3);
-
- BOOST_CHECK(rib.find(name2) == rib.end());
-
- rib.erase(name4, entry4);
-}
-
-BOOST_AUTO_TEST_CASE(EraseRibEntry)
-{
- rib::Rib rib;
-
- FaceEntry entry1;
- Name name1("/");
- entry1.faceId = 1;
- entry1.origin = 20;
- rib.insert(name1, entry1);
-
- FaceEntry entry2;
- Name name2("/hello");
- entry2.faceId = 2;
- entry2.origin = 20;
- rib.insert(name2, entry2);
-
- FaceEntry entry3;
- Name name3("/hello/world");
- entry3.faceId = 1;
- entry3.origin = 20;
- rib.insert(name3, entry3);
-
- shared_ptr<rib::RibEntry> ribEntry1 = rib.find(name1)->second;
- shared_ptr<rib::RibEntry> ribEntry2 = rib.find(name2)->second;
- shared_ptr<rib::RibEntry> ribEntry3 = rib.find(name3)->second;
-
- BOOST_CHECK(ribEntry1->getChildren().front() == ribEntry2);
- BOOST_CHECK(ribEntry3->getParent() == ribEntry2);
-
- rib.erase(name2, entry2);
- BOOST_CHECK(ribEntry1->getChildren().front() == ribEntry3);
- BOOST_CHECK(ribEntry3->getParent() == ribEntry1);
-}
-
-BOOST_AUTO_TEST_CASE(EraseByFaceId)
-{
- rib::Rib rib;
-
- FaceEntry entry1;
- Name name1("/");
- entry1.faceId = 1;
- entry1.origin = 20;
- rib.insert(name1, entry1);
-
- FaceEntry entry2;
- Name name2("/hello/world");
- entry2.faceId = 2;
- entry2.origin = 20;
- rib.insert(name2, entry2);
-
- FaceEntry entry3;
- Name name3("/hello/world");
- entry3.faceId = 1;
- entry3.origin = 20;
- rib.insert(name3, entry3);
-
- rib.erase(1);
- BOOST_CHECK(rib.find(name1) == rib.end());
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().size(), 1);
-
- rib.erase(3);
- BOOST_CHECK_EQUAL((rib.find(name2)->second)->getFaces().size(), 1);
-
- rib.erase(2);
- BOOST_CHECK(rib.find(name2) == rib.end());
-
- rib.erase(3);
-}
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
- rib::Rib rib;
-
- FaceEntry entry1;
- Name name1("/hello/world");
- entry1.faceId = 1;
- entry1.origin = 20;
- entry1.cost = 10;
- entry1.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT | ndn::nfd::ROUTE_FLAG_CAPTURE;
- entry1.expires = time::steady_clock::now() + time::milliseconds(1500);
-
- rib.insert(name1, entry1);
- BOOST_CHECK_EQUAL(rib.size(), 1);
-
- rib.insert(name1, entry1);
- BOOST_CHECK_EQUAL(rib.size(), 1);
-
- FaceEntry entry2;
- Name name2("/hello/world");
- entry2.faceId = 1;
- entry2.origin = 20;
- entry2.cost = 100;
- entry2.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT;
- entry2.expires = time::steady_clock::now() + time::seconds(0);
-
- rib.insert(name2, entry2);
- BOOST_CHECK_EQUAL(rib.size(), 1);
-
- entry2.faceId = 2;
- rib.insert(name2, entry2);
- BOOST_CHECK_EQUAL(rib.size(), 2);
-
- BOOST_CHECK(rib.find(name1)->second->hasFaceId(entry1.faceId));
- BOOST_CHECK(rib.find(name1)->second->hasFaceId(entry2.faceId));
-
- Name name3("/foo/bar");
- rib.insert(name3, entry2);
- BOOST_CHECK_EQUAL(rib.size(), 3);
-
- entry2.origin = 1;
- rib.insert(name3, entry2);
- BOOST_CHECK_EQUAL(rib.size(), 4);
-
- rib.erase(name3, entry2);
- BOOST_CHECK_EQUAL(rib.size(), 3);
-
- Name name4("/hello/world");
- rib.erase(name4, entry2);
- BOOST_CHECK_EQUAL(rib.size(), 3);
-
- entry2.origin = 20;
- rib.erase(name4, entry2);
- BOOST_CHECK_EQUAL(rib.size(), 2);
-
- BOOST_CHECK_EQUAL(rib.find(name2, entry2), static_cast<FaceEntry*>(0));
- BOOST_CHECK_NE(rib.find(name1, entry1), static_cast<FaceEntry*>(0));
-
- rib.erase(name1, entry1);
- BOOST_CHECK_EQUAL(rib.size(), 1);
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace rib
-} // namespace nfd
diff --git a/NFD/tests/test-case.cpp.sample b/NFD/tests/test-case.cpp.sample
deleted file mode 100644
index 560add2..0000000
--- a/NFD/tests/test-case.cpp.sample
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-// #include "unit-under-test.hpp"
-// Unit being tested MUST be included first, to ensure header compiles on its own.
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-// Unit tests SHOULD go inside nfd::tests namespace.
-
-// Test suite SHOULD use BaseFixture or a subclass of it.
-BOOST_FIXTURE_TEST_SUITE(TestSkeleton, BaseFixture)
-
-BOOST_AUTO_TEST_CASE(Test1)
-{
- int i = 0;
- /**
- * For reference of available Boost.Test macros, @see http://www.boost.org/doc/libs/1_55_0/libs/test/doc/html/utf/testing-tools/reference.html
- */
-
- BOOST_REQUIRE_NO_THROW(i = 1);
- BOOST_REQUIRE_EQUAL(i, 1);
-}
-
-// Custom fixture SHOULD derive from BaseFixture.
-class Test2Fixture : protected BaseFixture
-{
-};
-
-BOOST_FIXTURE_TEST_CASE(Test2, Test2Fixture)
-{
- // g_io is a shorthand of getGlobalIoService()
- // resetGlobalIoService() is automatically called after each test case
- g_io.run();
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
diff --git a/NFD/tests/test-common.hpp b/NFD/tests/test-common.hpp
deleted file mode 100644
index 247337d..0000000
--- a/NFD/tests/test-common.hpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_TEST_COMMON_HPP
-#define NFD_TESTS_TEST_COMMON_HPP
-
-#include "boost-test.hpp"
-
-#include "core/global-io.hpp"
-#include "core/logger.hpp"
-
-#include <ndn-cxx/util/time-unit-test-clock.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-
-namespace nfd {
-namespace tests {
-
-/** \brief base test fixture
- *
- * Every test case should be based on this fixture,
- * to have per test case io_service initialization.
- */
-class BaseFixture
-{
-protected:
- BaseFixture()
- : g_io(getGlobalIoService())
- {
- }
-
- ~BaseFixture()
- {
- resetGlobalIoService();
- }
-
-protected:
- /// reference to global io_service
- boost::asio::io_service& g_io;
-};
-
-/** \brief a base test fixture that overrides steady clock and system clock
- */
-class UnitTestTimeFixture : public BaseFixture
-{
-protected:
- UnitTestTimeFixture()
- : steadyClock(make_shared<time::UnitTestSteadyClock>())
- , systemClock(make_shared<time::UnitTestSystemClock>())
- {
- time::setCustomClocks(steadyClock, systemClock);
- }
-
- ~UnitTestTimeFixture()
- {
- time::setCustomClocks(nullptr, nullptr);
- }
-
- /** \brief advance steady and system clocks
- *
- * Clocks are advanced in increments of \p tick for \p nTicks ticks.
- * After each tick, global io_service is polled to process pending I/O events.
- *
- * Exceptions thrown during I/O events are propagated to the caller.
- * Clock advancing would stop in case of an exception.
- */
- void
- advanceClocks(const time::nanoseconds& tick, size_t nTicks = 1)
- {
- BOOST_ASSERT(nTicks >= 0);
-
- this->advanceClocks(tick, tick * nTicks);
- }
-
- /** \brief advance steady and system clocks
- *
- * Clocks are advanced in increments of \p tick for \p total time.
- * The last increment might be shorter than \p tick.
- * After each tick, global io_service is polled to process pending I/O events.
- *
- * Exceptions thrown during I/O events are propagated to the caller.
- * Clock advancing would stop in case of an exception.
- */
- void
- advanceClocks(const time::nanoseconds& tick, const time::nanoseconds& total)
- {
- BOOST_ASSERT(tick > time::nanoseconds::zero());
- BOOST_ASSERT(total >= time::nanoseconds::zero());
-
- time::nanoseconds remaining = total;
- while (remaining > time::nanoseconds::zero()) {
- if (remaining >= tick) {
- steadyClock->advance(tick);
- systemClock->advance(tick);
- remaining -= tick;
- }
- else {
- steadyClock->advance(remaining);
- systemClock->advance(remaining);
- remaining = time::nanoseconds::zero();
- }
-
- if (g_io.stopped())
- g_io.reset();
- g_io.poll();
- }
- }
-
- friend class LimitedIo;
-
-protected:
- shared_ptr<time::UnitTestSteadyClock> steadyClock;
- shared_ptr<time::UnitTestSystemClock> systemClock;
-};
-
-inline shared_ptr<Interest>
-makeInterest(const Name& name)
-{
- return make_shared<Interest>(name);
-}
-
-inline shared_ptr<Data>
-signData(const shared_ptr<Data>& data)
-{
- ndn::SignatureSha256WithRsa fakeSignature;
- fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
- static_cast<const uint8_t*>(nullptr), 0));
- data->setSignature(fakeSignature);
- data->wireEncode();
-
- return data;
-}
-
-inline shared_ptr<Data>
-makeData(const Name& name)
-{
- shared_ptr<Data> data = make_shared<Data>(name);
-
- return signData(data);
-}
-
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_TEST_COMMON_HPP
diff --git a/NFD/tests/wscript b/NFD/tests/wscript
deleted file mode 100644
index c2cc536..0000000
--- a/NFD/tests/wscript
+++ /dev/null
@@ -1,93 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-"""
-Copyright (c) 2014 Regents of the University of California,
- Arizona Board of Regents,
- Colorado State University,
- University Pierre & Marie Curie, Sorbonne University,
- Washington University in St. Louis,
- Beijing Institute of Technology
-
-This file is part of NFD (Named Data Networking Forwarding Daemon).
-See AUTHORS.md for complete list of NFD authors and contributors.
-
-NFD is free software: you can redistribute it and/or modify it under the terms
-of the GNU General Public License as published by the Free Software Foundation,
-either version 3 of the License, or (at your option) any later version.
-
-NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
-"""
-
-top = '..'
-
-def build(bld):
- # Unit tests
- if bld.env['WITH_TESTS']:
- # main()
- unit_test_main = bld(
- target='unit-tests-main',
- name='unit-tests-main',
- features='cxx',
- use='core-objects',
- source='main.cpp',
- )
-
- # common test modules
- unit_test_base = bld(
- target='unit-tests-base',
- name='unit-tests-base',
- features='cxx pch',
- source=bld.path.ant_glob(['*.cpp'], excl='main.cpp'),
- use='core-objects',
- headers='../common.hpp boost-test.hpp',
- )
-
- # core tests
- unit_tests_core = bld.program(
- target='../unit-tests-core',
- features='cxx cxxprogram',
- source=bld.path.ant_glob(['core/**/*.cpp']),
- use='core-objects unit-tests-base unit-tests-main',
- includes='.',
- install_path=None,
- )
-
- # NFD tests
- unit_tests_nfd = bld.program(
- target='../unit-tests-daemon',
- features='cxx cxxprogram',
- source=bld.path.ant_glob(['daemon/**/*.cpp'],
- excl=['daemon/face/ethernet.cpp',
- 'daemon/face/unix-*.cpp',
- 'daemon/face/websocket*.cpp']),
- use='daemon-objects unit-tests-base unit-tests-main',
- includes='.',
- install_path=None,
- )
-
- if bld.env['HAVE_LIBPCAP']:
- unit_tests_nfd.source += bld.path.ant_glob('daemon/face/ethernet.cpp')
-
- if bld.env['HAVE_UNIX_SOCKETS']:
- unit_tests_nfd.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
-
- if bld.env['HAVE_WEBSOCKET']:
- unit_tests_nfd.source += bld.path.ant_glob('daemon/face/websocket*.cpp')
-
- unit_tests_rib = bld.program(
- target='../unit-tests-rib',
- features='cxx cxxprogram',
- source=bld.path.ant_glob(['rib/**/*.cpp']),
- use='rib-objects unit-tests-base unit-tests-main',
- includes='.',
- install_path=None,
- )
-
- # Other tests (e.g., stress tests that can be enabled even if unit tests are disabled)
- if bld.env['WITH_TESTS'] or bld.env['WITH_OTHER_TESTS']:
- bld.recurse("other")
diff --git a/NFD/tools/ndn-autoconfig-server.cpp b/NFD/tools/ndn-autoconfig-server.cpp
deleted file mode 100644
index 1a01061..0000000
--- a/NFD/tools/ndn-autoconfig-server.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014 Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "version.hpp"
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-
-namespace ndn {
-
-const static Name AUTOCONFIG_PREFIX = "/localhop/ndn-autoconf";
-const static Name LOCALHOP_HUB = "/localhop/ndn-autoconf/hub";
-const static Name LOCALHOP_ROUTABLE_PREFIXES = "/localhop/ndn-autoconf/routable-prefixes";
-
-static void
-usage(const char* programName)
-{
- std::cout << "Usage:\n" << programName << " [-h] [-V] [-p prefix] [-p prefix] ... Uri \n"
- << " -h - print usage and exit\n"
- << " -V - print version number and exit\n"
- << " -p prefix - the local prefix of the hub\n"
- << "\n"
- << " Uri - a FaceMgmt URI\n"
- << std::endl;
-}
-
-class PrefixCollection : noncopyable
-{
-public:
- bool
- empty() const
- {
- return m_prefixes.empty();
- }
-
- void
- add(const Name& prefix)
- {
- m_prefixes.push_back(prefix);
- }
-
- template<bool T>
- size_t
- wireEncode(EncodingImpl<T>& encoder) const
- {
- size_t totalLength = 0;
-
- for (std::vector<Name>::const_reverse_iterator i = m_prefixes.rbegin();
- i != m_prefixes.rend(); ++i) {
- totalLength += i->wireEncode(encoder);
- }
-
- totalLength += encoder.prependVarNumber(totalLength);
- totalLength += encoder.prependVarNumber(tlv::Content);
- return totalLength;
- }
-
- Block
- wireEncode() const
- {
- Block block;
-
- EncodingEstimator estimator;
- size_t estimatedSize = wireEncode(estimator);
-
- EncodingBuffer buffer(estimatedSize);
- wireEncode(buffer);
-
- return buffer.block();
- }
-
-private:
- std::vector<Name> m_prefixes;
-};
-
-class NdnAutoconfigServer : noncopyable
-{
-public:
- NdnAutoconfigServer(const std::string& hubFaceUri, const PrefixCollection& routablePrefixes)
- {
- KeyChain m_keyChain;
-
- // pre-create hub Data
- m_hubData = make_shared<Data>(Name(LOCALHOP_HUB).appendVersion());
- m_hubData->setFreshnessPeriod(time::hours(1)); // 1 hour
- m_hubData->setContent(dataBlock(tlv::nfd::Uri,
- reinterpret_cast<const uint8_t*>(hubFaceUri.c_str()),
- hubFaceUri.size()));
- m_keyChain.sign(*m_hubData);
-
- // pre-create routable prefix Data
- if (!routablePrefixes.empty()) {
- m_routablePrefixesData = make_shared<Data>(Name(LOCALHOP_ROUTABLE_PREFIXES).appendVersion());
- m_routablePrefixesData->setContent(routablePrefixes.wireEncode());
- m_routablePrefixesData->setFreshnessPeriod(time::seconds(5)); // 5s
- m_keyChain.sign(*m_routablePrefixesData);
- }
- }
-
- void
- onHubInterest(const Name& name, const Interest& interest)
- {
- m_face.put(*m_hubData);
- }
-
- void
- onRoutablePrefixesInterest(const Name& name, const Interest& interest)
- {
- m_face.put(*m_routablePrefixesData);
- }
-
- void
- onRegisterFailed(const Name& prefix, const std::string& reason)
- {
- std::cerr << "ERROR: Failed to register prefix in local hub's daemon (" <<
- reason << ")" << std::endl;
- m_face.shutdown();
- }
-
- void
- afterPrefixRegistered()
- {
- BOOST_ASSERT(AUTOCONFIG_PREFIX.isPrefixOf(LOCALHOP_HUB));
- m_face.setInterestFilter(LOCALHOP_HUB,
- bind(&NdnAutoconfigServer::onHubInterest, this, _1, _2));
-
- if (static_cast<bool>(m_routablePrefixesData)) {
- BOOST_ASSERT(AUTOCONFIG_PREFIX.isPrefixOf(LOCALHOP_ROUTABLE_PREFIXES));
- m_face.setInterestFilter(LOCALHOP_ROUTABLE_PREFIXES,
- bind(&NdnAutoconfigServer::onRoutablePrefixesInterest,
- this, _1, _2));
- }
- }
-
- void
- run()
- {
- m_face.registerPrefix(AUTOCONFIG_PREFIX,
- bind(&NdnAutoconfigServer::afterPrefixRegistered, this),
- bind(&NdnAutoconfigServer::onRegisterFailed, this, _1, _2));
-
- m_face.processEvents();
- }
-
-private:
- Face m_face;
-
- shared_ptr<Data> m_hubData;
- shared_ptr<Data> m_routablePrefixesData;
-};
-
-int
-main(int argc, char** argv)
-{
- const char* programName = argv[0];
-
- PrefixCollection routablePrefixes;
-
- int opt;
- while ((opt = getopt(argc, argv, "hVp:")) != -1) {
- switch (opt) {
- case 'h':
- usage(programName);
- return 0;
- case 'V':
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- case 'p':
- routablePrefixes.add(Name(optarg));
- break;
- default:
- usage(programName);
- return 1;
- }
- }
-
- if (argc != optind + 1) {
- usage(programName);
- return 1;
- }
-
- std::string hubFaceUri = argv[optind];
- NdnAutoconfigServer instance(hubFaceUri, routablePrefixes);
-
- try {
- instance.run();
- }
- catch (const std::exception& error) {
- std::cerr << "ERROR: " << error.what() << std::endl;
- return 1;
- }
- return 0;
-}
-
-} // namespace ndn
-
-int
-main(int argc, char** argv)
-{
- return ndn::main(argc, argv);
-}
diff --git a/NFD/tools/ndn-autoconfig.cpp b/NFD/tools/ndn-autoconfig.cpp
deleted file mode 100644
index fdd8ba9..0000000
--- a/NFD/tools/ndn-autoconfig.cpp
+++ /dev/null
@@ -1,530 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "version.hpp"
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/management/nfd-controller.hpp>
-#include <ndn-cxx/management/nfd-face-status.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/encoding/buffer-stream.hpp>
-#include <ndn-cxx/util/face-uri.hpp>
-
-#include <boost/lexical_cast.hpp>
-#include <boost/noncopyable.hpp>
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#ifdef __APPLE__
-#include <arpa/nameser_compat.h>
-#endif
-
-namespace ndn {
-namespace tools {
-
-static const Name LOCALHOP_HUB_DISCOVERY_PREFIX = "/localhop/ndn-autoconf/hub";
-
-void
-usage(const char* programName)
-{
- std::cout << "Usage:\n" << programName << " [-h] [-V]\n"
- << " -h - print usage and exit\n"
- << " -V - print version number and exit\n"
- << std::endl;
-}
-
-class NdnAutoconfig : boost::noncopyable
-{
-public:
- union QueryAnswer
- {
- HEADER header;
- uint8_t buf[NS_PACKETSZ];
- };
-
- class Error : public std::runtime_error
- {
- public:
- explicit
- Error(const std::string& what)
- : std::runtime_error(what)
- {
- }
- };
-
- explicit
- NdnAutoconfig()
- : m_controller(m_face, m_keyChain)
- {
- }
-
- void
- run()
- {
- m_face.processEvents();
- }
-
- void
- fetchSegments(const Data& data, const shared_ptr<OBufferStream>& buffer,
- void (NdnAutoconfig::*onDone)(const shared_ptr<OBufferStream>&))
- {
- buffer->write(reinterpret_cast<const char*>(data.getContent().value()),
- data.getContent().value_size());
-
- uint64_t currentSegment = data.getName().get(-1).toSegment();
-
- const name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
- if (finalBlockId.empty() ||
- finalBlockId.toSegment() > currentSegment)
- {
- m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment+1),
- ndn::bind(&NdnAutoconfig::fetchSegments, this, _2, buffer, onDone),
- ndn::bind(&NdnAutoconfig::discoverHubStage2, this, "Timeout"));
- }
- else
- {
- return (this->*onDone)(buffer);
- }
- }
-
- void
- discoverHubStage1()
- {
- shared_ptr<OBufferStream> buffer = make_shared<OBufferStream>();
-
- Interest interest("/localhost/nfd/faces/list");
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
-
- m_face.expressInterest(interest,
- ndn::bind(&NdnAutoconfig::fetchSegments, this, _2, buffer,
- &NdnAutoconfig::discoverHubStage1_registerHubDiscoveryPrefix),
- ndn::bind(&NdnAutoconfig::discoverHubStage2, this, "Timeout"));
- }
-
- void
- discoverHubStage1_registerHubDiscoveryPrefix(const shared_ptr<OBufferStream>& buffer)
- {
- ConstBufferPtr buf = buffer->buf();
- std::vector<uint64_t> multicastFaces;
-
- size_t offset = 0;
- while (offset < buf->size())
- {
- Block block;
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- nfd::FaceStatus faceStatus(block);
-
- ndn::util::FaceUri uri(faceStatus.getRemoteUri());
- if (uri.getScheme() == "udp4") {
- namespace ip = boost::asio::ip;
- boost::system::error_code ec;
- ip::address address = ip::address::from_string(uri.getHost(), ec);
-
- if (!ec && address.is_multicast()) {
- multicastFaces.push_back(faceStatus.getFaceId());
- }
- else
- continue;
- }
- }
-
- if (multicastFaces.empty()) {
- discoverHubStage2("No multicast faces available, skipping stage 1");
- }
- else {
- shared_ptr<nfd::Controller> controller = make_shared<nfd::Controller>(ref(m_face));
- shared_ptr<std::pair<size_t, size_t> > nRegistrations =
- make_shared<std::pair<size_t, size_t> >(0, 0);
-
- nfd::ControlParameters parameters;
- parameters
- .setName(LOCALHOP_HUB_DISCOVERY_PREFIX)
- .setCost(1)
- .setExpirationPeriod(time::seconds(30));
-
- nRegistrations->first = multicastFaces.size();
-
- for (std::vector<uint64_t>::iterator i = multicastFaces.begin();
- i != multicastFaces.end(); ++i) {
- parameters.setFaceId(*i);
-
- controller->start<nfd::RibRegisterCommand>(parameters,
- bind(&NdnAutoconfig::discoverHubStage1_onRegisterSuccess,
- this, controller, nRegistrations),
- bind(&NdnAutoconfig::discoverHubStage1_onRegisterFailure,
- this, _1, _2, controller, nRegistrations));
- }
- }
- }
-
- void
- discoverHubStage1_onRegisterSuccess(const shared_ptr<nfd::Controller>& controller,
- const shared_ptr<std::pair<size_t, size_t> >& nRegistrations)
- {
- nRegistrations->second++;
-
- if (nRegistrations->first == nRegistrations->second) {
- discoverHubStage1_setStrategy(controller);
- }
- }
-
- void
- discoverHubStage1_onRegisterFailure(uint32_t code, const std::string& error,
- const shared_ptr<nfd::Controller>& controller,
- const shared_ptr<std::pair<size_t, size_t> >& nRegistrations)
- {
- std::cerr << "ERROR: " << error << " (code: " << code << ")" << std::endl;
- nRegistrations->first--;
-
- if (nRegistrations->first == nRegistrations->second) {
- if (nRegistrations->first > 0) {
- discoverHubStage1_setStrategy(controller);
- } else {
- discoverHubStage2("Failed to register " + LOCALHOP_HUB_DISCOVERY_PREFIX.toUri() +
- " for all multicast faces");
- }
- }
- }
-
- void
- discoverHubStage1_setStrategy(const shared_ptr<nfd::Controller>& controller)
- {
- nfd::ControlParameters parameters;
- parameters
- .setName(LOCALHOP_HUB_DISCOVERY_PREFIX)
- .setStrategy("/localhost/nfd/strategy/broadcast");
-
- controller->start<nfd::StrategyChoiceSetCommand>(parameters,
- bind(&NdnAutoconfig::discoverHubStage1_onSetStrategySuccess,
- this, controller),
- bind(&NdnAutoconfig::discoverHubStage1_onSetStrategyFailure,
- this, _2, controller));
- }
-
- void
- discoverHubStage1_onSetStrategySuccess(const shared_ptr<nfd::Controller>& controller)
- {
- discoverHubStage1_requestHubData();
- }
-
- void
- discoverHubStage1_onSetStrategyFailure(const std::string& error,
- const shared_ptr<nfd::Controller>& controller)
- {
- discoverHubStage2("Failed to set broadcast strategy for " +
- LOCALHOP_HUB_DISCOVERY_PREFIX.toUri() + " namespace (" + error + ")");
- }
-
- // Start to look for a hub (NDN hub discovery first stage)
- void
- discoverHubStage1_requestHubData()
- {
- Interest interest(LOCALHOP_HUB_DISCOVERY_PREFIX);
- interest.setInterestLifetime(time::milliseconds(4000)); // 4 seconds
- interest.setMustBeFresh(true);
-
- std::cerr << "Stage 1: Trying multicast discovery..." << std::endl;
- m_face.expressInterest(interest,
- bind(&NdnAutoconfig::onDiscoverHubStage1Success, this, _1, _2),
- bind(&NdnAutoconfig::discoverHubStage2, this, "Timeout"));
- }
-
- // First stage OnData Callback
- void
- onDiscoverHubStage1Success(const Interest& interest, Data& data)
- {
- const Block& content = data.getContent();
- content.parse();
-
- // Get Uri
- Block::element_const_iterator blockValue = content.find(tlv::nfd::Uri);
- if (blockValue == content.elements_end())
- {
- discoverHubStage2("Incorrect reply to stage1");
- return;
- }
- std::string faceMgmtUri(reinterpret_cast<const char*>(blockValue->value()),
- blockValue->value_size());
- connectToHub(faceMgmtUri);
- }
-
- // First stage OnTimeout callback - start 2nd stage
- void
- discoverHubStage2(const std::string& message)
- {
- std::cerr << message << std::endl;
- std::cerr << "Stage 2: Trying DNS query with default suffix..." << std::endl;
-
- _res.retry = 2;
- _res.ndots = 10;
-
- QueryAnswer queryAnswer;
-
- int answerSize = res_search("_ndn._udp",
- ns_c_in,
- ns_t_srv,
- queryAnswer.buf,
- sizeof(queryAnswer));
-
- // 2nd stage failed - move on to the third stage
- if (answerSize < 0)
- {
- discoverHubStage3("Failed to find NDN router using default suffix DNS query");
- }
- else
- {
- bool isParsed = parseHostAndConnectToHub(queryAnswer, answerSize);
- if (isParsed == false)
- {
- // Failed to parse DNS response, try stage 3
- discoverHubStage3("Failed to parse DNS response");
- }
- }
- }
-
- // Second stage OnTimeout callback
- void
- discoverHubStage3(const std::string& message)
- {
- std::cerr << message << std::endl;
- std::cerr << "Stage 3: Trying to find home router..." << std::endl;
-
- KeyChain keyChain;
- Name identity = keyChain.getDefaultIdentity();
- std::string serverName = "_ndn._udp.";
-
- for (Name::const_reverse_iterator i = identity.rbegin(); i != identity.rend(); i++)
- {
- serverName.append(i->toUri());
- serverName.append(".");
- }
- serverName += "_homehub._autoconf.named-data.net";
- std::cerr << "Stage3: About to query for a home router: " << serverName << std::endl;
-
- QueryAnswer queryAnswer;
-
- int answerSize = res_query(serverName.c_str(),
- ns_c_in,
- ns_t_srv,
- queryAnswer.buf,
- sizeof(queryAnswer));
-
-
- // 3rd stage failed - abort
- if (answerSize < 0)
- {
- std::cerr << "Failed to find a home router" << std::endl;
- std::cerr << "exit" << std::endl;
- }
- else
- {
- bool isParsed = parseHostAndConnectToHub(queryAnswer, answerSize);
- if (isParsed == false)
- {
- // Failed to parse DNS response
- throw Error("Failed to parse DNS response");
- }
- }
-
- }
-
- void
- connectToHub(const std::string& uri)
- {
- std::cerr << "about to connect to: " << uri << std::endl;
-
- m_controller.start<nfd::FaceCreateCommand>(
- nfd::ControlParameters()
- .setUri(uri),
- bind(&NdnAutoconfig::onHubConnectSuccess, this, _1),
- bind(&NdnAutoconfig::onHubConnectError, this, _1, _2)
- );
- }
-
- void
- onHubConnectSuccess(const nfd::ControlParameters& resp)
- {
- std::cerr << "Successfully created face: " << resp << std::endl;
-
- // Register a prefix in RIB
- static const Name TESTBED_PREFIX("/ndn");
- m_controller.start<nfd::RibRegisterCommand>(
- nfd::ControlParameters()
- .setName(TESTBED_PREFIX)
- .setFaceId(resp.getFaceId())
- .setOrigin(nfd::ROUTE_ORIGIN_AUTOCONF)
- .setCost(100)
- .setExpirationPeriod(time::milliseconds::max()),
- bind(&NdnAutoconfig::onPrefixRegistrationSuccess, this, _1),
- bind(&NdnAutoconfig::onPrefixRegistrationError, this, _1, _2));
- }
-
- void
- onHubConnectError(uint32_t code, const std::string& error)
- {
- std::ostringstream os;
- os << "Failed to create face: " << error << " (code: " << code << ")";
- throw Error(os.str());
- }
-
-
- bool parseHostAndConnectToHub(QueryAnswer& queryAnswer, int answerSize)
- {
- // The references of the next classes are:
- // http://www.diablotin.com/librairie/networking/dnsbind/ch14_02.htm
- // https://gist.github.com/mologie/6027597
-
- struct rechdr
- {
- uint16_t type;
- uint16_t iclass;
- uint32_t ttl;
- uint16_t length;
- };
-
- struct srv_t
- {
- uint16_t priority;
- uint16_t weight;
- uint16_t port;
- uint8_t* target;
- };
-
- if (ntohs(queryAnswer.header.ancount) == 0)
- {
- std::cerr << "No records found\n" << std::endl;
- return false;
- }
-
- uint8_t* blob = queryAnswer.buf + NS_HFIXEDSZ;
-
- blob += dn_skipname(blob, queryAnswer.buf + answerSize) + NS_QFIXEDSZ;
-
- for (int i = 0; i < ntohs(queryAnswer.header.ancount); i++)
- {
- char srvName[NS_MAXDNAME];
- int serverNameSize = dn_expand(queryAnswer.buf, // message pointer
- queryAnswer.buf + answerSize, // end of message
- blob, // compressed server name
- srvName, // expanded server name
- NS_MAXDNAME);
- if (serverNameSize < 0)
- {
- return false;
- }
-
- srv_t* server = reinterpret_cast<srv_t*>(&blob[sizeof(rechdr)]);
- uint16_t convertedPort = be16toh(server->port);
-
- blob += serverNameSize + NS_HFIXEDSZ + NS_QFIXEDSZ;
-
- char hostName[NS_MAXDNAME];
- int hostNameSize = dn_expand(queryAnswer.buf, // message pointer
- queryAnswer.buf + answerSize, // end of message
- blob, // compressed host name
- hostName, // expanded host name
- NS_MAXDNAME);
- if (hostNameSize < 0)
- {
- return false;
- }
-
- std::string uri = "udp://";
- uri.append(hostName);
- uri.append(":");
- uri.append(boost::lexical_cast<std::string>(convertedPort));
-
- connectToHub(uri);
- return true;
- }
-
- return false;
- }
-
- void
- onPrefixRegistrationSuccess(const nfd::ControlParameters& commandSuccessResult)
- {
- std::cerr << "Successful in name registration: " << commandSuccessResult << std::endl;
- }
-
- void
- onPrefixRegistrationError(uint32_t code, const std::string& error)
- {
- std::ostringstream os;
- os << "Failed in name registration, " << error << " (code: " << code << ")";
- throw Error(os.str());
- }
-
-private:
- Face m_face;
- KeyChain m_keyChain;
- nfd::Controller m_controller;
-};
-
-} // namespace tools
-} // namespace ndn
-
-int
-main(int argc, char** argv)
-{
- int opt;
- const char* programName = argv[0];
-
- while ((opt = getopt(argc, argv, "hV")) != -1) {
- switch (opt) {
- case 'h':
- ndn::tools::usage(programName);
- return 0;
- case 'V':
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- }
- }
-
- try {
- ndn::tools::NdnAutoconfig autoConfigInstance;
-
- autoConfigInstance.discoverHubStage1();
- autoConfigInstance.run();
- }
- catch (const std::exception& error) {
- std::cerr << "ERROR: " << error.what() << std::endl;
- return 1;
- }
- return 0;
-}
diff --git a/NFD/tools/ndn-tlv-peek.cpp b/NFD/tools/ndn-tlv-peek.cpp
deleted file mode 100644
index 5460096..0000000
--- a/NFD/tools/ndn-tlv-peek.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- *
- * @author Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
- */
-
-#include "version.hpp"
-
-#include <boost/noncopyable.hpp>
-
-#include <ndn-cxx/face.hpp>
-
-namespace ndntlvpeek {
-
-class NdnTlvPeek : boost::noncopyable
-{
-public:
- explicit
- NdnTlvPeek(char* programName)
- : m_programName(programName)
- , m_mustBeFresh(false)
- , m_isChildSelectorRightmost(false)
- , m_minSuffixComponents(-1)
- , m_maxSuffixComponents(-1)
- , m_interestLifetime(-1)
- , m_isPayloadOnlySet(false)
- , m_timeout(-1)
- , m_prefixName("")
- , m_isDataReceived(false)
- {
- }
-
- void
- usage()
- {
- std::cout << "\n Usage:\n " << m_programName << " "
- "[-f] [-r] [-m min] [-M max] [-l lifetime] [-p] [-w timeout] ndn:/name\n"
- " Get one data item matching the name prefix and write it to stdout\n"
- " [-f] - set MustBeFresh\n"
- " [-r] - set ChildSelector to select rightmost child\n"
- " [-m min] - set MinSuffixComponents\n"
- " [-M max] - set MaxSuffixComponents\n"
- " [-l lifetime] - set InterestLifetime in time::milliseconds\n"
- " [-p] - print payload only, not full packet\n"
- " [-w timeout] - set Timeout in time::milliseconds\n"
- " [-h] - print help and exit\n"
- " [-V] - print version and exit\n"
- "\n";
- exit(1);
- }
-
- void
- setMustBeFresh()
- {
- m_mustBeFresh = true;
- }
-
- void
- setRightmostChildSelector()
- {
- m_isChildSelectorRightmost = true;
- }
-
- void
- setMinSuffixComponents(int minSuffixComponents)
- {
- if (minSuffixComponents < 0)
- usage();
- m_minSuffixComponents = minSuffixComponents;
- }
-
- void
- setMaxSuffixComponents(int maxSuffixComponents)
- {
- if (maxSuffixComponents < 0)
- usage();
- m_maxSuffixComponents = maxSuffixComponents;
- }
-
- void
- setInterestLifetime(int interestLifetime)
- {
- if (interestLifetime < 0)
- usage();
- m_interestLifetime = ndn::time::milliseconds(interestLifetime);
- }
-
- void
- setPayloadOnly()
- {
- m_isPayloadOnlySet = true;
- }
-
- void
- setTimeout(int timeout)
- {
- if (timeout < 0)
- usage();
- m_timeout = ndn::time::milliseconds(timeout);
- }
-
- void
- setPrefixName(char* prefixName)
- {
- m_prefixName = prefixName;
- if (m_prefixName.length() == 0)
- usage();
- }
-
- ndn::time::milliseconds
- getDefaultInterestLifetime()
- {
- return ndn::time::seconds(4);
- }
-
- ndn::Interest
- createInterestPacket()
- {
- ndn::Name interestName(m_prefixName);
- ndn::Interest interestPacket(interestName);
- if (m_mustBeFresh)
- interestPacket.setMustBeFresh(true);
- if (m_isChildSelectorRightmost)
- interestPacket.setChildSelector(1);
- if (m_minSuffixComponents >= 0)
- interestPacket.setMinSuffixComponents(m_minSuffixComponents);
- if (m_maxSuffixComponents >= 0)
- interestPacket.setMaxSuffixComponents(m_maxSuffixComponents);
- if (m_interestLifetime < ndn::time::milliseconds::zero())
- interestPacket.setInterestLifetime(getDefaultInterestLifetime());
- else
- interestPacket.setInterestLifetime(m_interestLifetime);
- return interestPacket;
- }
-
- void
- onData(const ndn::Interest& interest, ndn::Data& data)
- {
- m_isDataReceived = true;
- if (m_isPayloadOnlySet)
- {
- const ndn::Block& block = data.getContent();
- std::cout.write(reinterpret_cast<const char*>(block.value()), block.value_size());
- }
- else
- {
- const ndn::Block& block = data.wireEncode();
- std::cout.write(reinterpret_cast<const char*>(block.wire()), block.size());
- }
- }
-
- void
- onTimeout(const ndn::Interest& interest)
- {
- }
-
- void
- run()
- {
- try
- {
- m_face.expressInterest(createInterestPacket(),
- bind(&NdnTlvPeek::onData, this, _1, _2),
- bind(&NdnTlvPeek::onTimeout, this, _1));
- if (m_timeout < ndn::time::milliseconds::zero())
- {
- if (m_interestLifetime < ndn::time::milliseconds::zero())
- m_face.processEvents(getDefaultInterestLifetime());
- else
- m_face.processEvents(m_interestLifetime);
- }
- else
- m_face.processEvents(m_timeout);
- }
- catch (std::exception& e)
- {
- std::cerr << "ERROR: " << e.what() << "\n" << std::endl;
- exit(1);
- }
- }
-
- bool
- isDataReceived() const
- {
- return m_isDataReceived;
- }
-
-private:
-
- std::string m_programName;
- bool m_mustBeFresh;
- bool m_isChildSelectorRightmost;
- int m_minSuffixComponents;
- int m_maxSuffixComponents;
- ndn::time::milliseconds m_interestLifetime;
- bool m_isPayloadOnlySet;
- ndn::time::milliseconds m_timeout;
- std::string m_prefixName;
- bool m_isDataReceived;
- ndn::Face m_face;
-};
-
-}
-
-int
-main(int argc, char* argv[])
-{
- ndntlvpeek::NdnTlvPeek ndnTlvPeek(argv[0]);
- int option;
- while ((option = getopt(argc, argv, "hfrm:M:l:pw:V")) != -1) {
- switch (option) {
- case 'h':
- ndnTlvPeek.usage();
- break;
- case 'f':
- ndnTlvPeek.setMustBeFresh();
- break;
- case 'r':
- ndnTlvPeek.setRightmostChildSelector();
- break;
- case 'm':
- ndnTlvPeek.setMinSuffixComponents(atoi(optarg));
- break;
- case 'M':
- ndnTlvPeek.setMaxSuffixComponents(atoi(optarg));
- break;
- case 'l':
- ndnTlvPeek.setInterestLifetime(atoi(optarg));
- break;
- case 'p':
- ndnTlvPeek.setPayloadOnly();
- break;
- case 'w':
- ndnTlvPeek.setTimeout(atoi(optarg));
- break;
- case 'V':
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- default:
- ndnTlvPeek.usage();
- break;
- }
- }
-
- argc -= optind;
- argv += optind;
-
- if (argv[0] == 0)
- ndnTlvPeek.usage();
-
- ndnTlvPeek.setPrefixName(argv[0]);
- ndnTlvPeek.run();
-
- if (ndnTlvPeek.isDataReceived())
- return 0;
- else
- return 1;
-}
diff --git a/NFD/tools/ndn-tlv-poke.cpp b/NFD/tools/ndn-tlv-poke.cpp
deleted file mode 100644
index 45db702..0000000
--- a/NFD/tools/ndn-tlv-poke.cpp
+++ /dev/null
@@ -1,277 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- *
- * @author Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
- */
-
-#include "version.hpp"
-
-#include <boost/noncopyable.hpp>
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-
-namespace ndntlvpoke {
-
-class NdnTlvPoke : boost::noncopyable
-{
-public:
- explicit
- NdnTlvPoke(char* programName)
- : m_programName(programName)
- , m_isForceDataSet(false)
- , m_isUseDigestSha256Set(false)
- , m_isLastAsFinalBlockIdSet(false)
- , m_freshnessPeriod(-1)
- , m_timeout(-1)
- , m_isDataSent(false)
- {
- }
-
- void
- usage()
- {
- std::cout << "\n Usage:\n " << m_programName << " "
- "[-f] [-D] [-i identity] [-F] [-x freshness] [-w timeout] ndn:/name\n"
- " Reads payload from stdin and sends it to local NDN forwarder as a "
- "single Data packet\n"
- " [-f] - force, send Data without waiting for Interest\n"
- " [-D] - use DigestSha256 signing method instead of "
- "SignatureSha256WithRsa\n"
- " [-i identity] - set identity to be used for signing\n"
- " [-F] - set FinalBlockId to the last component of Name\n"
- " [-x] - set FreshnessPeriod in time::milliseconds\n"
- " [-w timeout] - set Timeout in time::milliseconds\n"
- " [-h] - print help and exit\n"
- " [-V] - print version and exit\n"
- "\n";
- exit(1);
- }
-
- void
- setForceData()
- {
- m_isForceDataSet = true;
- }
-
- void
- setUseDigestSha256()
- {
- m_isUseDigestSha256Set = true;
- }
-
- void
- setIdentityName(char* identityName)
- {
- m_identityName = ndn::make_shared<ndn::Name>(identityName);
- }
-
- void
- setLastAsFinalBlockId()
- {
- m_isLastAsFinalBlockIdSet = true;
- }
-
- void
- setFreshnessPeriod(int freshnessPeriod)
- {
- if (freshnessPeriod < 0)
- usage();
- m_freshnessPeriod = ndn::time::milliseconds(freshnessPeriod);
- }
-
- void
- setTimeout(int timeout)
- {
- if (timeout < 0)
- usage();
- m_timeout = ndn::time::milliseconds(timeout);
- }
-
- void
- setPrefixName(char* prefixName)
- {
- m_prefixName = ndn::Name(prefixName);
- }
-
- ndn::time::milliseconds
- getDefaultTimeout()
- {
- return ndn::time::seconds(10);
- }
-
- ndn::Data
- createDataPacket()
- {
- ndn::Data dataPacket(m_prefixName);
- std::stringstream payloadStream;
- payloadStream << std::cin.rdbuf();
- std::string payload = payloadStream.str();
- dataPacket.setContent(reinterpret_cast<const uint8_t*>(payload.c_str()), payload.length());
- if (m_freshnessPeriod >= ndn::time::milliseconds::zero())
- dataPacket.setFreshnessPeriod(m_freshnessPeriod);
- if (m_isLastAsFinalBlockIdSet)
- {
- if (!m_prefixName.empty())
- dataPacket.setFinalBlockId(m_prefixName.get(-1));
- else
- {
- std::cerr << "Name Provided Has 0 Components" << std::endl;
- exit(1);
- }
- }
- if (m_isUseDigestSha256Set)
- m_keyChain.signWithSha256(dataPacket);
- else
- {
- if (!static_cast<bool>(m_identityName))
- m_keyChain.sign(dataPacket);
- else
- m_keyChain.signByIdentity(dataPacket, *m_identityName);
- }
- return dataPacket;
- }
-
- void
- onInterest(const ndn::Name& name,
- const ndn::Interest& interest,
- const ndn::Data& dataPacket)
- {
- m_face.put(dataPacket);
- m_isDataSent = true;
- m_face.shutdown();
- }
-
- void
- onRegisterFailed(const ndn::Name& prefix, const std::string& reason)
- {
- std::cerr << "Prefix Registration Failure." << std::endl;
- std::cerr << "Reason = " << reason << std::endl;
- }
-
- void
- run()
- {
- try
- {
- ndn::Data dataPacket = createDataPacket();
- if (m_isForceDataSet)
- {
- m_face.put(dataPacket);
- m_isDataSent = true;
- }
- else
- {
- m_face.setInterestFilter(m_prefixName,
- bind(&NdnTlvPoke::onInterest, this, _1, _2, dataPacket),
- ndn::RegisterPrefixSuccessCallback(),
- bind(&NdnTlvPoke::onRegisterFailed, this, _1, _2));
- }
- if (m_timeout < ndn::time::milliseconds::zero())
- m_face.processEvents(getDefaultTimeout());
- else
- m_face.processEvents(m_timeout);
- }
- catch (std::exception& e)
- {
- std::cerr << "ERROR: " << e.what() << "\n" << std::endl;
- exit(1);
- }
- }
-
- bool
- isDataSent() const
- {
- return m_isDataSent;
- }
-
-private:
-
- ndn::KeyChain m_keyChain;
- std::string m_programName;
- bool m_isForceDataSet;
- bool m_isUseDigestSha256Set;
- ndn::shared_ptr<ndn::Name> m_identityName;
- bool m_isLastAsFinalBlockIdSet;
- ndn::time::milliseconds m_freshnessPeriod;
- ndn::time::milliseconds m_timeout;
- ndn::Name m_prefixName;
- bool m_isDataSent;
- ndn::Face m_face;
-
-};
-
-}
-
-int
-main(int argc, char* argv[])
-{
- int option;
- ndntlvpoke::NdnTlvPoke ndnTlvPoke(argv[0]);
- while ((option = getopt(argc, argv, "hfDi:Fx:w:V")) != -1) {
- switch (option) {
- case 'h':
- ndnTlvPoke.usage();
- break;
- case 'f':
- ndnTlvPoke.setForceData();
- break;
- case 'D':
- ndnTlvPoke.setUseDigestSha256();
- break;
- case 'i':
- ndnTlvPoke.setIdentityName(optarg);
- break;
- case 'F':
- ndnTlvPoke.setLastAsFinalBlockId();
- break;
- case 'x':
- ndnTlvPoke.setFreshnessPeriod(atoi(optarg));
- break;
- case 'w':
- ndnTlvPoke.setTimeout(atoi(optarg));
- break;
- case 'V':
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- default:
- ndnTlvPoke.usage();
- break;
- }
- }
-
- argc -= optind;
- argv += optind;
-
- if (argv[0] == 0)
- ndnTlvPoke.usage();
-
- ndnTlvPoke.setPrefixName(argv[0]);
- ndnTlvPoke.run();
-
- if (ndnTlvPoke.isDataSent())
- return 0;
- else
- return 1;
-}
diff --git a/NFD/tools/nfd-autoreg.cpp b/NFD/tools/nfd-autoreg.cpp
deleted file mode 100644
index 0ad6841..0000000
--- a/NFD/tools/nfd-autoreg.cpp
+++ /dev/null
@@ -1,400 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/name.hpp>
-
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/util/face-uri.hpp>
-#include <ndn-cxx/management/nfd-controller.hpp>
-#include <ndn-cxx/management/nfd-face-monitor.hpp>
-#include <ndn-cxx/management/nfd-face-status.hpp>
-#include <ndn-cxx/encoding/buffer-stream.hpp>
-
-#include <boost/program_options/options_description.hpp>
-#include <boost/program_options/variables_map.hpp>
-#include <boost/program_options/parsers.hpp>
-
-#include "version.hpp"
-#include "core/network.hpp"
-
-using namespace ndn::nfd;
-using ndn::Face;
-using ndn::KeyChain;
-using ndn::nfd::FaceEventNotification;
-using ndn::util::FaceUri;
-using ::nfd::Network;
-
-namespace ndn {
-namespace nfd_autoreg {
-
-namespace po = boost::program_options;
-
-class AutoregServer : boost::noncopyable
-{
-public:
- AutoregServer()
- : m_controller(m_face, m_keyChain)
- , m_faceMonitor(m_face)
- , m_cost(255)
- {
- }
-
- void
- onRegisterCommandSuccess(uint64_t faceId, const Name& prefix)
- {
- std::cerr << "SUCCEED: register " << prefix << " on face " << faceId << std::endl;
- }
-
- void
- onRegisterCommandFailure(uint64_t faceId, const Name& prefix,
- uint32_t code, const std::string& reason)
- {
- std::cerr << "FAILED: register " << prefix << " on face " << faceId
- << " (code: " << code << ", reason: " << reason << ")" << std::endl;
- }
-
- /**
- * \return true if uri has schema allowed to do auto-registrations
- */
- bool
- hasAllowedSchema(const FaceUri& uri)
- {
- const std::string& scheme = uri.getScheme();
- return (scheme == "udp4" || scheme == "tcp4" ||
- scheme == "udp6" || scheme == "tcp6");
- }
-
- /**
- * \return true if address is blacklisted
- */
- bool
- isBlacklisted(const boost::asio::ip::address& address)
- {
- for (std::vector<Network>::const_iterator network = m_blackList.begin();
- network != m_blackList.end();
- ++network)
- {
- if (network->doesContain(address))
- return true;
- }
-
- return false;
- }
-
- /**
- * \return true if address is whitelisted
- */
- bool
- isWhitelisted(const boost::asio::ip::address& address)
- {
- for (std::vector<Network>::const_iterator network = m_whiteList.begin();
- network != m_whiteList.end();
- ++network)
- {
- if (network->doesContain(address))
- return true;
- }
-
- return false;
- }
-
- void
- registerPrefixesForFace(uint64_t faceId,
- const std::vector<ndn::Name>& prefixes)
- {
- for (std::vector<ndn::Name>::const_iterator prefix = prefixes.begin();
- prefix != prefixes.end();
- ++prefix)
- {
- m_controller.start<RibRegisterCommand>(
- ControlParameters()
- .setName(*prefix)
- .setFaceId(faceId)
- .setOrigin(ROUTE_ORIGIN_AUTOREG)
- .setCost(m_cost)
- .setExpirationPeriod(time::milliseconds::max()),
- bind(&AutoregServer::onRegisterCommandSuccess, this, faceId, *prefix),
- bind(&AutoregServer::onRegisterCommandFailure, this, faceId, *prefix, _1, _2));
- }
- }
-
- void
- registerPrefixesIfNeeded(uint64_t faceId, const FaceUri& uri, FacePersistency facePersistency)
- {
- if (hasAllowedSchema(uri)) {
- boost::system::error_code ec;
- boost::asio::ip::address address = boost::asio::ip::address::from_string(uri.getHost(), ec);
-
- if (!address.is_multicast()) {
- // register all-face prefixes
- registerPrefixesForFace(faceId, m_allFacesPrefixes);
-
- // register autoreg prefixes if new face is on-demand and not blacklisted and whitelisted
- if (facePersistency == FACE_PERSISTENCY_ON_DEMAND &&
- !isBlacklisted(address) && isWhitelisted(address)) {
- registerPrefixesForFace(faceId, m_autoregPrefixes);
- }
- }
- }
- }
-
- void
- onNotification(const FaceEventNotification& notification)
- {
- if (notification.getKind() == FACE_EVENT_CREATED &&
- notification.getFaceScope() != FACE_SCOPE_LOCAL)
- {
- std::cerr << "PROCESSING: " << notification << std::endl;
-
- registerPrefixesIfNeeded(notification.getFaceId(), FaceUri(notification.getRemoteUri()),
- notification.getFacePersistency());
- }
- else
- {
- std::cerr << "IGNORED: " << notification << std::endl;
- }
- }
-
-
- void
- signalHandler()
- {
- m_face.shutdown();
- }
-
-
- void
- usage(std::ostream& os,
- const po::options_description& optionDesciption,
- const char* programName)
- {
- os << "Usage:\n"
- << " " << programName << " --prefix=</autoreg/prefix> [--prefix=/another/prefix] ...\n"
- << "\n";
- os << optionDesciption;
- }
-
- void
- startProcessing()
- {
- std::cerr << "AUTOREG prefixes: " << std::endl;
- for (std::vector<ndn::Name>::const_iterator prefix = m_autoregPrefixes.begin();
- prefix != m_autoregPrefixes.end();
- ++prefix)
- {
- std::cout << " " << *prefix << std::endl;
- }
- std::cerr << "ALL-FACES-AUTOREG prefixes: " << std::endl;
- for (std::vector<ndn::Name>::const_iterator prefix = m_allFacesPrefixes.begin();
- prefix != m_allFacesPrefixes.end();
- ++prefix)
- {
- std::cout << " " << *prefix << std::endl;
- }
-
- if (!m_blackList.empty())
- {
- std::cerr << "Blacklisted networks: " << std::endl;
- for (std::vector<Network>::const_iterator network = m_blackList.begin();
- network != m_blackList.end();
- ++network)
- {
- std::cout << " " << *network << std::endl;
- }
- }
-
- std::cerr << "Whitelisted networks: " << std::endl;
- for (std::vector<Network>::const_iterator network = m_whiteList.begin();
- network != m_whiteList.end();
- ++network)
- {
- std::cout << " " << *network << std::endl;
- }
-
- m_faceMonitor.onNotification += bind(&AutoregServer::onNotification, this, _1);
- m_faceMonitor.start();
-
- boost::asio::signal_set signalSet(m_face.getIoService(), SIGINT, SIGTERM);
- signalSet.async_wait(bind(&AutoregServer::signalHandler, this));
-
- m_face.processEvents();
- }
-
-
- void
- fetchFaceStatusSegments(const Data& data, const shared_ptr<ndn::OBufferStream>& buffer)
- {
- buffer->write(reinterpret_cast<const char*>(data.getContent().value()),
- data.getContent().value_size());
-
- uint64_t currentSegment = data.getName().get(-1).toSegment();
-
- const name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
- if (finalBlockId.empty() || finalBlockId.toSegment() > currentSegment) {
- m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment + 1),
- bind(&AutoregServer::fetchFaceStatusSegments, this, _2, buffer),
- ndn::OnTimeout());
- }
- else {
- return processFaceStatusDataset(buffer);
- }
- }
-
- void
- startFetchingFaceStatusDataset()
- {
- shared_ptr<ndn::OBufferStream> buffer = make_shared<ndn::OBufferStream>();
-
- Interest interest("/localhost/nfd/faces/list");
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
-
- m_face.expressInterest(interest,
- bind(&AutoregServer::fetchFaceStatusSegments, this, _2, buffer),
- ndn::OnTimeout());
- }
-
- void
- processFaceStatusDataset(const shared_ptr<ndn::OBufferStream>& buffer)
- {
- ndn::ConstBufferPtr buf = buffer->buf();
- std::vector<uint64_t> multicastFaces;
-
- size_t offset = 0;
- while (offset < buf->size())
- {
- Block block;
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- nfd::FaceStatus faceStatus(block);
- registerPrefixesIfNeeded(faceStatus.getFaceId(), FaceUri(faceStatus.getRemoteUri()),
- faceStatus.getFacePersistency());
- }
- }
-
- int
- main(int argc, char* argv[])
- {
- po::options_description optionDesciption;
- optionDesciption.add_options()
- ("help,h", "produce help message")
- ("prefix,i", po::value<std::vector<ndn::Name> >(&m_autoregPrefixes)->composing(),
- "prefix that should be automatically registered when new a remote non-local face is "
- "established")
- ("all-faces-prefix,a", po::value<std::vector<ndn::Name> >(&m_allFacesPrefixes)->composing(),
- "prefix that should be automatically registered for all TCP and UDP non-local faces "
- "(blacklists and whitelists do not apply to this prefix)")
- ("cost,c", po::value<uint64_t>(&m_cost)->default_value(255),
- "FIB cost which should be assigned to autoreg nexthops")
- ("whitelist,w", po::value<std::vector<Network> >(&m_whiteList)->composing(),
- "Whitelisted network, e.g., 192.168.2.0/24 or ::1/128")
- ("blacklist,b", po::value<std::vector<Network> >(&m_blackList)->composing(),
- "Blacklisted network, e.g., 192.168.2.32/30 or ::1/128")
- ("version,V", "show version and exit")
- ;
-
- po::variables_map options;
- try
- {
- po::store(po::command_line_parser(argc, argv).options(optionDesciption).run(), options);
- po::notify(options);
- }
- catch (std::exception& e)
- {
- std::cerr << "ERROR: " << e.what() << std::endl << std::endl;
- usage(std::cerr, optionDesciption, argv[0]);
- return 1;
- }
-
- if (options.count("help"))
- {
- usage(std::cout, optionDesciption, argv[0]);
- return 0;
- }
-
- if (options.count("version"))
- {
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- }
-
- if (m_autoregPrefixes.empty() && m_allFacesPrefixes.empty())
- {
- std::cerr << "ERROR: at least one --prefix or --all-faces-prefix must be specified"
- << std::endl << std::endl;
- usage(std::cerr, optionDesciption, argv[0]);
- return 2;
- }
-
- if (m_whiteList.empty())
- {
- // Allow everything
- m_whiteList.push_back(Network::getMaxRangeV4());
- m_whiteList.push_back(Network::getMaxRangeV6());
- }
-
- try
- {
- startFetchingFaceStatusDataset();
- startProcessing();
- }
- catch (std::exception& e)
- {
- std::cerr << "ERROR: " << e.what() << std::endl;
- return 2;
- }
-
- return 0;
- }
-
-private:
- Face m_face;
- KeyChain m_keyChain;
- Controller m_controller;
- FaceMonitor m_faceMonitor;
- std::vector<ndn::Name> m_autoregPrefixes;
- std::vector<ndn::Name> m_allFacesPrefixes;
- uint64_t m_cost;
- std::vector<Network> m_whiteList;
- std::vector<Network> m_blackList;
-};
-
-} // namespace nfd_autoreg
-} // namespace ndn
-
-int
-main(int argc, char* argv[])
-{
- ndn::nfd_autoreg::AutoregServer server;
- return server.main(argc, argv);
-}
diff --git a/NFD/tools/nfd-start.sh b/NFD/tools/nfd-start.sh
deleted file mode 100755
index 4df12d7..0000000
--- a/NFD/tools/nfd-start.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!@BASH@
-
-VERSION="@VERSION@"
-
-case "$1" in
- -h)
- echo Usage
- echo $0
- echo " Start NFD and RIB Management daemon"
- exit 0
- ;;
- -V)
- echo $VERSION
- exit 0
- ;;
- "") ;; # do nothing
- *)
- echo "Unrecognized option $1"
- exit 1
- ;;
-esac
-
-hasProcess() {
- local processName=$1
-
- if pgrep -x $processName >/dev/null
- then
- echo $processName
- fi
-}
-
-hasNFD=$(hasProcess nfd)
-hasNRD=$(hasProcess nrd)
-
-if [[ -n $hasNFD$hasNRD ]]
-then
- echo 'NFD or NRD is already running...'
- exit 1
-fi
-
-if ! ndnsec-get-default &>/dev/null
-then
- ndnsec-keygen /localhost/operator | ndnsec-install-cert -
-fi
-
-if ! sudo true
-then
- echo 'Unable to obtain superuser privilege'
- exit 2
-fi
-
-sudo nfd &
-sleep 2
-nrd &
-sleep 2
diff --git a/NFD/tools/nfd-status-http-server-files/nfd-status.xsl b/NFD/tools/nfd-status-http-server-files/nfd-status.xsl
deleted file mode 100644
index 76c7004..0000000
--- a/NFD/tools/nfd-status-http-server-files/nfd-status.xsl
+++ /dev/null
@@ -1,346 +0,0 @@
-<xsl:stylesheet version="1.0"
-xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-xmlns:nfd="ndn:/localhost/nfd/status/1">
-<xsl:output method="html" encoding="utf-8" indent="yes" />
-
-<xsl:template match="/">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
- <html>
- <head>
- <title>NFD Status</title>
- <link rel="stylesheet" type="text/css" href="style.css" />
- </head>
- <body>
- <header>
- <h1>NFD Status</h1>
- </header>
- <article>
- <div id="content">
- <xsl:apply-templates/>
- </div>
- </article>
- <footer>
- <xsl:variable name="version">
- <xsl:apply-templates select="nfd:nfdStatus/nfd:generalStatus/nfd:version"/>
- </xsl:variable>
- <span class="grey">Powered by </span><a target="_blank" href="http://named-data.net/doc/NFD/{$version}/"><span class="green">NFD version <xsl:value-of select="$version"/></span></a><span class="grey">.</span>
- </footer>
- </body>
- </html>
-</xsl:template>
-
-
-<xsl:template name="formatDate">
- <xsl:param name="date" />
- <xsl:value-of select="substring($date, 0, 11)"/> <xsl:value-of select="substring($date, 12, 8)"/>
-</xsl:template>
-
-<xsl:template name="formatDuration">
- <xsl:param name="duration" />
- <xsl:variable name="seconds"><xsl:value-of select="substring($duration, 3, string-length($duration)-3)" /></xsl:variable>
- <xsl:variable name="days"><xsl:value-of select="floor($seconds div 86400)" /></xsl:variable>
- <xsl:variable name="hours"><xsl:value-of select="floor($seconds div 3600)" /></xsl:variable>
- <xsl:variable name="minutes"><xsl:value-of select="floor($seconds div 60)" /></xsl:variable>
- <xsl:choose>
- <xsl:when test="$days = 1">
- <xsl:value-of select="$days"/> day
- </xsl:when>
- <xsl:when test="$days > 1">
- <xsl:value-of select="$days"/> days
- </xsl:when>
- <xsl:when test="$hours = 1">
- <xsl:value-of select="$hours"/> hour
- </xsl:when>
- <xsl:when test="$hours > 1">
- <xsl:value-of select="$hours"/> hours
- </xsl:when>
- <xsl:when test="$minutes = 1">
- <xsl:value-of select="$minutes"/> minute
- </xsl:when>
- <xsl:when test="$minutes > 1">
- <xsl:value-of select="$minutes"/> minutes
- </xsl:when>
- <xsl:when test="$seconds = 1">
- <xsl:value-of select="$seconds"/> second
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$seconds"/> seconds
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="nfd:generalStatus">
- <h2>General NFD status</h2>
- <table class="item-list">
- <thead>
- <tr>
- <th>NFD ID</th>
- <th>Version</th>
- <th>Start time</th>
- <th>Current time</th>
- <th>Uptime</th>
- <th>NameTree Entries</th>
- <th>FIB entries</th>
- <th>PIT entries</th>
- <th>Measurements entries</th>
- <th>CS entries</th>
- <th>In Interests</th>
- <th>Out Interests</th>
- <th>In Data</th>
- <th>Out Data</th>
- </tr>
- </thead>
- <tbody>
- <tr class="center">
- <td><xsl:apply-templates select="nfd:nfdId"/></td>
- <td><xsl:value-of select="nfd:version"/></td>
- <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:startTime" /></xsl:call-template></td>
- <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:currentTime" /></xsl:call-template></td>
- <td><xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:uptime" /></xsl:call-template></td>
- <td><xsl:value-of select="nfd:nNameTreeEntries"/></td>
- <td><xsl:value-of select="nfd:nFibEntries"/></td>
- <td><xsl:value-of select="nfd:nPitEntries"/></td>
- <td><xsl:value-of select="nfd:nMeasurementsEntries"/></td>
- <td><xsl:value-of select="nfd:nCsEntries"/></td>
- <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
- <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
- <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td>
- <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td>
- </tr>
- </tbody>
- </table>
-</xsl:template>
-
-<xsl:template match="nfd:channels">
- <h2>Channels</h2>
- <table class="item-list">
- <thead>
- <tr>
- <th>Channel URI</th>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="nfd:channel">
- <xsl:variable name="style">
- <xsl:choose>
- <xsl:when test="position() mod 2 = 1">
- <xsl:text>odd</xsl:text>
- </xsl:when>
- <xsl:otherwise>even</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <tr class="{$style}">
- <td><xsl:value-of select="nfd:localUri"/></td>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
-</xsl:template>
-
-<xsl:template match="nfd:faces">
- <h2>Faces</h2>
- <table class="item-list">
- <thead>
- <tr>
- <th>Face ID</th>
- <th>Remote URI</th>
- <th>Local URI</th>
- <th>Scope</th>
- <th>Persistency</th>
- <th>LinkType</th>
- <th>Expires in</th>
- <th>In Interests</th>
- <th>In Data</th>
- <th>In Bytes</th>
- <th>Out Interests</th>
- <th>Out Data</th>
- <th>Out Bytes</th>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="nfd:face">
- <xsl:variable name="style">
- <xsl:choose>
- <xsl:when test="position() mod 2 = 1">
- <xsl:text>odd</xsl:text>
- </xsl:when>
- <xsl:otherwise>even</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <tr class="{$style}">
- <td><xsl:value-of select="nfd:faceId"/></td>
- <td><xsl:value-of select="nfd:remoteUri"/></td>
- <td><xsl:value-of select="nfd:localUri"/></td>
- <td><xsl:value-of select="nfd:faceScope"/></td>
- <td><xsl:value-of select="nfd:facePersistency"/></td>
- <td><xsl:value-of select="nfd:linkType"/></td>
- <td>
- <xsl:choose>
- <xsl:when test="nfd:expirationPeriod">
- <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- Never
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
- <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nDatas"/></td>
- <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td>
- <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
- <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nDatas"/></td>
- <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
-</xsl:template>
-
-<xsl:template match="nfd:fib">
- <h2>FIB</h2>
- <table class="item-list">
- <thead>
- <tr>
- <th width="20%">Prefix</th>
- <th>NextHops</th>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="nfd:fibEntry">
- <xsl:variable name="style">
- <xsl:choose>
- <xsl:when test="position() mod 2 = 1">
- <xsl:text>odd</xsl:text>
- </xsl:when>
- <xsl:otherwise>even</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <tr class="{$style}">
- <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
- <td>
- <table class="item-sublist">
- <tr>
- <th>FaceId</th>
- <xsl:for-each select="nfd:nextHops/nfd:nextHop">
- <td><xsl:value-of select="nfd:faceId"/></td>
- </xsl:for-each>
- </tr>
- <tr>
- <th>Cost</th>
- <xsl:for-each select="nfd:nextHops/nfd:nextHop">
- <td><xsl:value-of select="nfd:cost"/></td>
- </xsl:for-each>
- </tr>
- </table>
- </td>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
-</xsl:template>
-
-<xsl:template match="nfd:rib">
- <h2>RIB</h2>
- <table class="item-list">
- <thead>
- <tr>
- <th width="20%">Prefix</th>
- <th>Routes</th>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="nfd:ribEntry">
- <xsl:variable name="style">
- <xsl:choose>
- <xsl:when test="position() mod 2 = 1">
- <xsl:text>odd</xsl:text>
- </xsl:when>
- <xsl:otherwise>even</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <tr class="{$style}">
- <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
- <td>
- <table class="item-sublist">
- <tr>
- <th>FaceId</th>
- <xsl:for-each select="nfd:routes/nfd:route">
- <td><xsl:value-of select="nfd:faceId"/></td>
- </xsl:for-each>
- </tr>
- <tr>
- <th>Origin</th>
- <xsl:for-each select="nfd:routes/nfd:route">
- <td><xsl:value-of select="nfd:origin"/></td>
- </xsl:for-each>
- </tr>
- <tr>
- <th>Cost</th>
- <xsl:for-each select="nfd:routes/nfd:route">
- <td><xsl:value-of select="nfd:cost"/></td>
- </xsl:for-each>
- </tr>
- <tr>
- <th>ChildInherit</th>
- <xsl:for-each select="nfd:routes/nfd:route">
- <td>
- <xsl:if test="nfd:flags/nfd:childInherit">
- Y
- </xsl:if>
- </td>
- </xsl:for-each>
- </tr>
- <tr>
- <th>RibCapture</th>
- <xsl:for-each select="nfd:routes/nfd:route">
- <td>
- <xsl:if test="nfd:flags/nfd:ribCapture">
- Y
- </xsl:if>
- </td>
- </xsl:for-each>
- </tr>
- <tr>
- <th>Expires in</th>
- <xsl:for-each select="nfd:routes/nfd:route">
- <td>
- <xsl:choose>
- <xsl:when test="nfd:expirationPeriod">
- <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- Never
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </xsl:for-each>
- </tr>
- </table>
- </td>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
-</xsl:template>
-
-<xsl:template match="nfd:strategyChoices">
- <h2>Strategy Choices</h2>
- <table class="item-list">
- <thead>
- <tr>
- <th width="20%">Namespace</th>
- <th>Strategy Name</th>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="nfd:strategyChoice">
- <tr>
- <td><xsl:value-of select="nfd:namespace"/></td>
- <td><xsl:value-of select="nfd:strategy/nfd:name"/></td>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/NFD/tools/nfd-status-http-server-files/reset.css b/NFD/tools/nfd-status-http-server-files/reset.css
deleted file mode 100644
index 0af7c26..0000000
--- a/NFD/tools/nfd-status-http-server-files/reset.css
+++ /dev/null
@@ -1,207 +0,0 @@
-/* `XHTML, HTML4, HTML5 Reset
-----------------------------------------------------------------------------------------------------*/
-
-a,
-abbr,
-acronym,
-address,
-applet,
-article,
-aside,
-audio,
-b,
-big,
-blockquote,
-body,
-canvas,
-caption,
-center,
-cite,
-code,
-dd,
-del,
-details,
-dfn,
-dialog,
-div,
-dl,
-dt,
-em,
-embed,
-fieldset,
-figcaption,
-figure,
-font,
-footer,
-form,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-header,
-hgroup,
-hr,
-html,
-i,
-iframe,
-img,
-ins,
-kbd,
-label,
-legend,
-li,
-mark,
-menu,
-meter,
-nav,
-object,
-ol,
-output,
-p,
-pre,
-progress,
-q,
-rp,
-rt,
-ruby,
-s,
-samp,
-section,
-small,
-span,
-strike,
-strong,
-sub,
-summary,
-sup,
-table,
-tbody,
-td,
-tfoot,
-th,
-thead,
-time,
-tr,
-tt,
-u,
-ul,
-var,
-video,
-xmp {
- border: 0;
- margin: 0;
- padding: 0;
- font-size: 100%;
-}
-
-html,
-body {
- height: 100%;
-}
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-menu,
-nav,
-section {
-/*
- Override the default (display: inline) for
- browsers that do not recognize HTML5 tags.
-
- IE8 (and lower) requires a shiv:
- http://ejohn.org/blog/html5-shiv
-*/
- display: block;
-}
-
-b,
-strong {
-/*
- Makes browsers agree.
- IE + Opera = font-weight: bold.
- Gecko + WebKit = font-weight: bolder.
-*/
- font-weight: bold;
-}
-
-img {
- color: transparent;
- font-size: 0;
- vertical-align: middle;
-/*
- For IE.
- http://css-tricks.com/ie-fix-bicubic-scaling-for-images
-*/
- -ms-interpolation-mode: bicubic;
-}
-
-li {
-/*
- For IE6 + IE7:
-
- "display: list-item" keeps bullets from
- disappearing if hasLayout is triggered.
-*/
- display: list-item;
- list-style: none;
-}
-
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-th,
-td,
-caption {
- font-weight: normal;
- vertical-align: top;
- text-align: left;
-}
-
-q {
- quotes: none;
-}
-
-q:before,
-q:after {
- content: '';
- content: none;
-}
-
-sub,
-sup,
-small {
- font-size: 75%;
-}
-
-sub,
-sup {
- line-height: 0;
- position: relative;
- vertical-align: baseline;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-sup {
- top: -0.5em;
-}
-
-svg {
-/*
- For IE9. Without, occasionally draws shapes
- outside the boundaries of <svg> rectangle.
-*/
- overflow: hidden;
-}
\ No newline at end of file
diff --git a/NFD/tools/nfd-status-http-server-files/robots.txt b/NFD/tools/nfd-status-http-server-files/robots.txt
deleted file mode 100644
index 1f53798..0000000
--- a/NFD/tools/nfd-status-http-server-files/robots.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-User-agent: *
-Disallow: /
diff --git a/NFD/tools/nfd-status-http-server-files/style.css b/NFD/tools/nfd-status-http-server-files/style.css
deleted file mode 100644
index 176da83..0000000
--- a/NFD/tools/nfd-status-http-server-files/style.css
+++ /dev/null
@@ -1,183 +0,0 @@
-@import 'reset.css';
-@import 'text.css';
-
-@charset "utf-8";
-
-body {
- background-color: #ffffff;
- color: #000000;
- font-family: sans-serif;
-}
-
-li {
- margin: 0;
-}
-
-header, nav, article, footer, address {
- display: block;
-}
-
-header {
- margin: 20px;
- width: 90%;
-}
-
-header h1 {
- height: 50px;
- padding-left: 55px;
- padding-top: 6px;
-}
-
-article {
- margin: 20px auto 20px;
- width: 90%;
- padding-bottom: 20px;
-}
-
-footer {
- margin: 20px auto 0;
- width: 90%;
-
- padding-bottom: 2px;
- text-align: right;
-
- position: fixed;
- font-height: 10px;
- bottom: 0;
- left: 5%;
-}
-
-h1 {
- font-family: sans-serif;
-}
-
-h3 {
- font-family: sans-serif;
-}
-
-h5 {
- font-family: sans-serif;
- color: #727272;
-}
-
-/* MISC */
-.grey {
- color: #727272;
- font-weight: 200;
-}
-
-.green {
- color: #2D9A65;
- font-weight: 200;
-}
-
-.red {
- color: red;
- font-weight: 200;
- font-size: 2.4em;
-}
-
-.hidden {
- display: none;
-}
-
-/* */
-.item-list
-{
- border-radius: 6px;
-
- margin-top: 10px;
- margin-bottom: 10px;
- font-family: sans-serif;
- width: 100%;
- text-align: left;
-}
-
-.item-list th
-{
- font-weight: normal;
- padding: 8px;
- background: #EAF4EF;
- border-top: 1px solid #99CCB2;
- color: #727272;
- text-align: left;
-}
-
-.item-list th.border-left {
-}
-
-.item-list td
-{
- padding: 2px;
- border-bottom: 1px solid #fff;
- color: #000;
- border-top: 1px solid transparent;
-}
-
-.item-sublist
-{
- border-collapse:collapse;
- border:1px solid gray;
-
- padding: 4px;
- font-family: sans-serif;
- text-align: center;
- margin-bottom: 0;
-}
-
-.item-sublist th
-{
- background-color: transparent;
- font-weight: bold;
- padding: 4px;
- text-align: center;
-
- border-collapse:collapse;
- border:1px solid gray;
-}
-
-.item-sublist th.border-left {
-}
-
-.item-sublist td
-{
- border-collapse:collapse;
- border:1px solid gray;
-
- padding: 2px;
- color: #000;
- text-align: center;
- min-width: 20px;
-}
-
-
-tr.center td
-{
- text-align: center;
-}
-
-.border-left {
- border-left: 1px solid #99CCB2;
-}
-
-.border-right {
- border-right: 1px solid #99CCB2;
-}
-
-tfoot {
- border-bottom: 2px solid #99CCB2;
- background: #EAF4EF;
-}
-
-.item-list tfoot td {
- padding: 0;
-}
-
-.odd {
- background-color: #eeeeee;
-}
-
-.highlighted {
- background-color: #cccccc;
- cursor: pointer;
-}
diff --git a/NFD/tools/nfd-status-http-server-files/text.css b/NFD/tools/nfd-status-http-server-files/text.css
deleted file mode 100644
index b115a70..0000000
--- a/NFD/tools/nfd-status-http-server-files/text.css
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- 960 Grid System ~ Text CSS.
- Learn more ~ http://960.gs/
-
- Licensed under GPL and MIT.
-*/
-
-/* `Basic HTML
-----------------------------------------------------------------------------------------------------*/
-
-body {
- font: 13px Arial, Helvetica, sans-serif;
-}
-
-hr {
- border: 0 #ccc solid;
- border-top-width: 1px;
- clear: both;
- height: 0;
-}
-
-/* `Headings
-----------------------------------------------------------------------------------------------------*/
-
-h1 {
- font-size: 2.4em;
-}
-
-h2 {
- font-size: 1.8em;
-}
-
-h3 {
- font-size: 1.4em;
-}
-
-/* h1 { */
-/* font-size: 25px; */
-/* } */
-
-/* h2 { */
-/* font-size: 23px; */
-/* } */
-
-/* h3 { */
-/* font-size: 21px; */
-/* } */
-
-h4 {
- font-size: 19px;
-}
-
-h5 {
- font-size: 17px;
-}
-
-h6 {
- font-size: 15px;
-}
-
-/* `Spacing
-----------------------------------------------------------------------------------------------------*/
-
-/* ol { */
-/* list-style: decimal; */
-/* } */
-
-/* ul { */
-/* list-style: disc; */
-/* } */
-
-/* li { */
-/* margin-left: 30px; */
-/* } */
-
-p,
-dl,
-hr,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-ol,
-ul,
-pre,
-table,
-address,
-fieldset,
-figure {
- margin-bottom: 10px;
-}
-
-pre {
- /* padding: 0px 24px; */
- white-space: pre-wrap;
- background-color: #F9F9F9;
- border: 1px dashed #2F6FAB;
- color: black;
- padding: 1em;
- font-size: 13px;
-}
-code {
- font-family: Consolas, Monaco, Andale Mono, monospace;
-}
\ No newline at end of file
diff --git a/NFD/tools/nfd-status-http-server.py b/NFD/tools/nfd-status-http-server.py
deleted file mode 100755
index 3d34d73..0000000
--- a/NFD/tools/nfd-status-http-server.py
+++ /dev/null
@@ -1,199 +0,0 @@
-#!/usr/bin/env python2.7
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-"""
-Copyright (c) 2014 Regents of the University of California,
- Arizona Board of Regents,
- Colorado State University,
- University Pierre & Marie Curie, Sorbonne University,
- Washington University in St. Louis,
- Beijing Institute of Technology
-
-This file is part of NFD (Named Data Networking Forwarding Daemon).
-See AUTHORS.md for complete list of NFD authors and contributors.
-
-NFD is free software: you can redistribute it and/or modify it under the terms
-of the GNU General Public License as published by the Free Software Foundation,
-either version 3 of the License, or (at your option) any later version.
-
-NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
-"""
-
-from BaseHTTPServer import HTTPServer
-from SimpleHTTPServer import SimpleHTTPRequestHandler
-from SocketServer import ThreadingMixIn
-import sys
-import subprocess
-import StringIO
-import urlparse
-import logging
-import cgi
-import argparse
-import socket
-import os
-
-
-class StatusHandler(SimpleHTTPRequestHandler):
- """ The handler class to handle requests."""
- def do_GET(self):
- # get the url info to decide how to respond
- parsedPath = urlparse.urlparse(self.path)
- if parsedPath.path == "/":
- # get current nfd status, and use it as result message
- (res, resultMessage) = self.getNfdStatus()
- self.send_response(200)
- if res == 0:
- self.send_header("Content-type", "text/xml; charset=UTF-8")
- else:
- self.send_header("Content-type", "text/html; charset=UTF-8")
-
- self.end_headers()
- self.wfile.write(resultMessage)
- elif parsedPath.path == "/robots.txt" and self.server.robots == True:
- resultMessage = ""
- self.send_response(200)
- self.send_header("Content-type", "text/plain")
- self.end_headers()
- self.wfile.write(resultMessage)
- else:
- SimpleHTTPRequestHandler.do_GET(self)
-
- def log_message(self, format, *args):
- if self.server.verbose:
- logging.info("%s - %s\n" % (self.address_string(),
- format % args))
-
- def getNfdStatus(self):
- """
- This function is to call nfd-status command
- to get xml format output
- """
- sp = subprocess.Popen(['nfd-status', '-x'], stdout=subprocess.PIPE, close_fds=True)
- output = sp.communicate()[0]
- if sp.returncode == 0:
- # add the xml-stylesheet processing instruction after the 1st '>' symbol
- newLineIndex = output.index('>') + 1
- resultStr = output[:newLineIndex]\
- + "<?xml-stylesheet type=\"text/xsl\" href=\"nfd-status.xsl\"?>"\
- + output[newLineIndex:]
- return (sp.returncode, resultStr)
- else:
- htmlStr = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional'\
- + '//EN" "http://www.w3.org/TR/html4/loose.dtd">\n'\
- + '<html><head><title>NFD status</title>'\
- + '<meta http-equiv="Content-type" content="text/html;'\
- + 'charset=UTF-8"></head>\n<body>'
- # return connection error code
- htmlStr = htmlStr + "<p>Cannot connect to NFD,"\
- + " Code = " + str(sp.returncode) + "</p>\n"
- htmlStr = htmlStr + "</body></html>"
- return (sp.returncode, htmlStr)
-
-class ThreadHttpServer(ThreadingMixIn, HTTPServer):
- """ Handle requests using threads """
- def __init__(self, server, handler, verbose=False, robots=False):
- serverAddr = server[0]
- # socket.AF_UNSPEC is not supported, check whether it is v6 or v4
- ipType = self.getIpType(serverAddr)
- if ipType == socket.AF_INET6:
- self.address_family = socket.AF_INET6
- elif ipType == socket.AF_INET:
- self.address_family == socket.AF_INET
- else:
- logging.error("The input IP address is neither IPv6 nor IPv4")
- sys.exit(2)
-
- try:
- HTTPServer.__init__(self, server, handler)
- except Exception as e:
- logging.error(str(e))
- sys.exit(2)
- self.verbose = verbose
- self.robots = robots
-
- def getIpType(self, ipAddr):
- """ Get ipAddr's address type """
- # if ipAddr is an IPv6 addr, return AF_INET6
- try:
- socket.inet_pton(socket.AF_INET6, ipAddr)
- return socket.AF_INET6
- except socket.error:
- pass
- # if ipAddr is an IPv4 addr return AF_INET, if not, return None
- try:
- socket.inet_pton(socket.AF_INET, ipAddr)
- return socket.AF_INET
- except socket.error:
- return None
-
-
-# main function to start
-def httpServer():
- parser = argparse.ArgumentParser()
- parser.add_argument("-p", type=int, metavar="port number",
- help="Specify the HTTP server port number, default is 8080.",
- dest="port", default=8080)
- # if address is not specified, use 127.0.0.1
- parser.add_argument("-a", default="127.0.0.1", metavar="IP address", dest="addr",
- help="Specify the HTTP server IP address.")
- parser.add_argument("-r", default=False, dest="robots", action="store_true",
- help="Enable HTTP robots to crawl; disabled by default.")
- parser.add_argument("-f", default="@DATAROOTDIR@/ndn", metavar="Server Directory", dest="serverDir",
- help="Specify the working directory of nfd-status-http-server, default is @DATAROOTDIR@/ndn.")
- parser.add_argument("-v", default=False, dest="verbose", action="store_true",
- help="Verbose mode.")
- parser.add_argument("--version", default=False, dest="version", action="store_true",
- help="Show version and exit")
-
- args = vars(parser.parse_args())
-
- if args['version']:
- print "@VERSION@"
- return
-
- localPort = args["port"]
- localAddr = args["addr"]
- verbose = args["verbose"]
- robots = args["robots"]
- serverDirectory = args["serverDir"]
-
- os.chdir(serverDirectory)
-
- # setting log message format
- logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s',
- level=logging.INFO)
-
- # if port is invalid, exit
- if localPort <= 0 or localPort > 65535:
- logging.error("Specified port number is invalid")
- sys.exit(2)
-
- httpd = ThreadHttpServer((localAddr, localPort), StatusHandler,
- verbose, robots)
- httpServerAddr = ""
- if httpd.address_family == socket.AF_INET6:
- httpServerAddr = "http://[%s]:%s" % (httpd.server_address[0],
- httpd.server_address[1])
- else:
- httpServerAddr = "http://%s:%s" % (httpd.server_address[0],
- httpd.server_address[1])
-
- logging.info("Server started - at %s" % httpServerAddr)
-
- try:
- httpd.serve_forever()
- except KeyboardInterrupt:
- pass
-
- httpd.server_close()
-
- logging.info("Server stopped")
-
-
-if __name__ == '__main__':
- httpServer()
diff --git a/NFD/tools/nfd-status.cpp b/NFD/tools/nfd-status.cpp
deleted file mode 100644
index 42a35be..0000000
--- a/NFD/tools/nfd-status.cpp
+++ /dev/null
@@ -1,925 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- *
- * @author Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
- */
-
-#include "version.hpp"
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/name.hpp>
-#include <ndn-cxx/interest.hpp>
-#include <ndn-cxx/encoding/buffer-stream.hpp>
-
-#include <ndn-cxx/management/nfd-forwarder-status.hpp>
-#include <ndn-cxx/management/nfd-channel-status.hpp>
-#include <ndn-cxx/management/nfd-face-status.hpp>
-#include <ndn-cxx/management/nfd-fib-entry.hpp>
-#include <ndn-cxx/management/nfd-rib-entry.hpp>
-#include <ndn-cxx/management/nfd-strategy-choice.hpp>
-
-#include <boost/algorithm/string/replace.hpp>
-#include <list>
-
-namespace ndn {
-
-class NfdStatus
-{
-public:
- explicit
- NfdStatus(char* toolName)
- : m_toolName(toolName)
- , m_needVersionRetrieval(false)
- , m_needChannelStatusRetrieval(false)
- , m_needFaceStatusRetrieval(false)
- , m_needFibEnumerationRetrieval(false)
- , m_needRibStatusRetrieval(false)
- , m_needStrategyChoiceRetrieval(false)
- , m_isOutputXml(false)
- {
- }
-
- void
- usage()
- {
- std::cout << "Usage: \n " << m_toolName << " [options]\n\n"
- "Show NFD version and status information\n\n"
- "Options:\n"
- " [-h] - print this help message\n"
- " [-v] - retrieve version information\n"
- " [-c] - retrieve channel status information\n"
- " [-f] - retrieve face status information\n"
- " [-b] - retrieve FIB information\n"
- " [-r] - retrieve RIB information\n"
- " [-s] - retrieve configured strategy choice for NDN namespaces\n"
- " [-x] - output NFD status information in XML format\n"
- "\n"
- " [-V] - show version information of nfd-status and exit\n"
- "\n"
- "If no options are provided, all information is retrieved.\n"
- "If -x is provided, other options(-v, -c, etc.) are ignored, and all information is printed in XML format.\n"
- ;
- }
-
- void
- enableVersionRetrieval()
- {
- m_needVersionRetrieval = true;
- }
-
- void
- enableChannelStatusRetrieval()
- {
- m_needChannelStatusRetrieval = true;
- }
-
- void
- enableFaceStatusRetrieval()
- {
- m_needFaceStatusRetrieval = true;
- }
-
- void
- enableFibEnumerationRetrieval()
- {
- m_needFibEnumerationRetrieval = true;
- }
-
- void
- enableStrategyChoiceRetrieval()
- {
- m_needStrategyChoiceRetrieval = true;
- }
-
- void
- enableRibStatusRetrieval()
- {
- m_needRibStatusRetrieval = true;
- }
-
- void
- enableXmlOutput()
- {
- m_isOutputXml = true;
- }
-
- void
- onTimeout()
- {
- std::cerr << "Request timed out" << std::endl;
-
- runNextStep();
- }
-
- void
- fetchSegments(const Data& data, void (NfdStatus::*onDone)())
- {
- m_buffer->write((const char*)data.getContent().value(),
- data.getContent().value_size());
-
- uint64_t currentSegment = data.getName().get(-1).toSegment();
-
- const name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
- if (finalBlockId.empty() ||
- finalBlockId.toSegment() > currentSegment)
- {
- m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment+1),
- bind(&NfdStatus::fetchSegments, this, _2, onDone),
- bind(&NfdStatus::onTimeout, this));
- }
- else
- {
- return (this->*onDone)();
- }
- }
-
- void
- escapeSpecialCharacters(std::string *data)
- {
- using boost::algorithm::replace_all;
- replace_all(*data, "&", "&");
- replace_all(*data, "\"", """);
- replace_all(*data, "\'", "'");
- replace_all(*data, "<", "<");
- replace_all(*data, ">", ">");
- }
-
- //////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////////
-
- void
- fetchVersionInformation()
- {
- Interest interest("/localhost/nfd/status");
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
- m_face.expressInterest(
- interest,
- bind(&NfdStatus::afterFetchedVersionInformation, this, _2),
- bind(&NfdStatus::onTimeout, this));
- }
-
- void
- afterFetchedVersionInformation(const Data& data)
- {
- nfd::ForwarderStatus status(data.getContent());
- std::string nfdId;
- if (data.getSignature().hasKeyLocator())
- {
- const ndn::KeyLocator& locator = data.getSignature().getKeyLocator();
- if (locator.getType() == KeyLocator::KeyLocator_Name)
- nfdId = locator.getName().toUri();
- //todo: KeyDigest supporting
- }
-
- if (m_isOutputXml)
- {
- std::cout << "<generalStatus>";
- std::cout << "<nfdId>"
- << nfdId << "</nfdId>";
- std::cout << "<version>"
- << status.getNfdVersion() << "</version>";
- std::cout << "<startTime>"
- << time::toString(status.getStartTimestamp(), "%Y-%m-%dT%H:%M:%S%F")
- << "</startTime>";
- std::cout << "<currentTime>"
- << time::toString(status.getCurrentTimestamp(), "%Y-%m-%dT%H:%M:%S%F")
- << "</currentTime>";
- std::cout << "<uptime>PT"
- << time::duration_cast<time::seconds>(status.getCurrentTimestamp()
- - status.getStartTimestamp()).count()
- << "S</uptime>";
- std::cout << "<nNameTreeEntries>" << status.getNNameTreeEntries()
- << "</nNameTreeEntries>";
- std::cout << "<nFibEntries>" << status.getNFibEntries()
- << "</nFibEntries>";
- std::cout << "<nPitEntries>" << status.getNPitEntries()
- << "</nPitEntries>";
- std::cout << "<nMeasurementsEntries>" << status.getNMeasurementsEntries()
- << "</nMeasurementsEntries>";
- std::cout << "<nCsEntries>" << status.getNCsEntries()
- << "</nCsEntries>";
- std::cout << "<packetCounters>";
- std::cout << "<incomingPackets>";
- std::cout << "<nInterests>" << status.getNInInterests()
- << "</nInterests>";
- std::cout << "<nDatas>" << status.getNInDatas()
- << "</nDatas>";
- std::cout << "</incomingPackets>";
- std::cout << "<outgoingPackets>";
- std::cout << "<nInterests>" << status.getNOutInterests()
- << "</nInterests>";
- std::cout << "<nDatas>" << status.getNOutDatas()
- << "</nDatas>";
- std::cout << "</outgoingPackets>";
- std::cout << "</packetCounters>";
- std::cout << "</generalStatus>";
- }
- else
- {
- std::cout << "General NFD status:" << std::endl;
- std::cout << " nfdId="
- << nfdId << std::endl;
- std::cout << " version="
- << status.getNfdVersion() << std::endl;
- std::cout << " startTime="
- << time::toIsoString(status.getStartTimestamp()) << std::endl;
- std::cout << " currentTime="
- << time::toIsoString(status.getCurrentTimestamp()) << std::endl;
- std::cout << " uptime="
- << time::duration_cast<time::seconds>(status.getCurrentTimestamp()
- - status.getStartTimestamp()) << std::endl;
-
- std::cout << " nNameTreeEntries=" << status.getNNameTreeEntries() << std::endl;
- std::cout << " nFibEntries=" << status.getNFibEntries() << std::endl;
- std::cout << " nPitEntries=" << status.getNPitEntries() << std::endl;
- std::cout << " nMeasurementsEntries=" << status.getNMeasurementsEntries() << std::endl;
- std::cout << " nCsEntries=" << status.getNCsEntries() << std::endl;
- std::cout << " nInInterests=" << status.getNInInterests() << std::endl;
- std::cout << " nOutInterests=" << status.getNOutInterests() << std::endl;
- std::cout << " nInDatas=" << status.getNInDatas() << std::endl;
- std::cout << " nOutDatas=" << status.getNOutDatas() << std::endl;
- }
-
- runNextStep();
- }
-
- //////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////////
-
- void
- fetchChannelStatusInformation()
- {
- m_buffer = make_shared<OBufferStream>();
-
- Interest interest("/localhost/nfd/faces/channels");
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
-
- m_face.expressInterest(interest,
- bind(&NfdStatus::fetchSegments, this, _2,
- &NfdStatus::afterFetchedChannelStatusInformation),
- bind(&NfdStatus::onTimeout, this));
- }
-
- void
- afterFetchedChannelStatusInformation()
- {
- ConstBufferPtr buf = m_buffer->buf();
- if (m_isOutputXml)
- {
- std::cout << "<channels>";
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode ChannelStatus TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- nfd::ChannelStatus channelStatus(block);
-
- std::cout << "<channel>";
-
- std::string localUri(channelStatus.getLocalUri());
- escapeSpecialCharacters(&localUri);
- std::cout << "<localUri>" << localUri << "</localUri>";
- std::cout << "</channel>";
- }
- std::cout << "</channels>";
- }
- else
- {
- std::cout << "Channels:" << std::endl;
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode ChannelStatus TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- nfd::ChannelStatus channelStatus(block);
- std::cout << " " << channelStatus.getLocalUri() << std::endl;
- }
- }
-
- runNextStep();
- }
-
- //////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////////
-
- void
- fetchFaceStatusInformation()
- {
- m_buffer = make_shared<OBufferStream>();
-
- Interest interest("/localhost/nfd/faces/list");
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
-
- m_face.expressInterest(interest,
- bind(&NfdStatus::fetchSegments, this, _2,
- &NfdStatus::afterFetchedFaceStatusInformation),
- bind(&NfdStatus::onTimeout, this));
- }
-
- void
- afterFetchedFaceStatusInformation()
- {
- ConstBufferPtr buf = m_buffer->buf();
- if (m_isOutputXml)
- {
- std::cout << "<faces>";
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- nfd::FaceStatus faceStatus(block);
-
- std::cout << "<face>";
- std::cout << "<faceId>" << faceStatus.getFaceId() << "</faceId>";
-
- std::string remoteUri(faceStatus.getRemoteUri());
- escapeSpecialCharacters(&remoteUri);
- std::cout << "<remoteUri>" << remoteUri << "</remoteUri>";
-
- std::string localUri(faceStatus.getLocalUri());
- escapeSpecialCharacters(&localUri);
- std::cout << "<localUri>" << localUri << "</localUri>";
-
- if (faceStatus.hasExpirationPeriod()) {
- std::cout << "<expirationPeriod>PT"
- << time::duration_cast<time::seconds>(faceStatus.getExpirationPeriod())
- .count() << "S"
- << "</expirationPeriod>";
- }
-
- std::cout << "<faceScope>" << faceStatus.getFaceScope()
- << "</faceScope>";
- std::cout << "<facePersistency>" << faceStatus.getFacePersistency()
- << "</facePersistency>";
- std::cout << "<linkType>" << faceStatus.getLinkType()
- << "</linkType>";
-
- std::cout << "<packetCounters>";
- std::cout << "<incomingPackets>";
- std::cout << "<nInterests>" << faceStatus.getNInInterests()
- << "</nInterests>";
- std::cout << "<nDatas>" << faceStatus.getNInDatas()
- << "</nDatas>";
- std::cout << "</incomingPackets>";
- std::cout << "<outgoingPackets>";
- std::cout << "<nInterests>" << faceStatus.getNOutInterests()
- << "</nInterests>";
- std::cout << "<nDatas>" << faceStatus.getNOutDatas()
- << "</nDatas>";
- std::cout << "</outgoingPackets>";
- std::cout << "</packetCounters>";
-
- std::cout << "<byteCounters>";
- std::cout << "<incomingBytes>" << faceStatus.getNInBytes()
- << "</incomingBytes>";
- std::cout << "<outgoingBytes>" << faceStatus.getNOutBytes()
- << "</outgoingBytes>";
- std::cout << "</byteCounters>";
-
- std::cout << "</face>";
- }
- std::cout << "</faces>";
- }
- else
- {
- std::cout << "Faces:" << std::endl;
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode FaceStatus TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- nfd::FaceStatus faceStatus(block);
-
- std::cout << " faceid=" << faceStatus.getFaceId()
- << " remote=" << faceStatus.getRemoteUri()
- << " local=" << faceStatus.getLocalUri();
- if (faceStatus.hasExpirationPeriod()) {
- std::cout << " expires="
- << time::duration_cast<time::seconds>(faceStatus.getExpirationPeriod())
- .count() << "s";
- }
- std::cout << " counters={"
- << "in={" << faceStatus.getNInInterests() << "i "
- << faceStatus.getNInDatas() << "d "
- << faceStatus.getNInBytes() << "B}"
- << " out={" << faceStatus.getNOutInterests() << "i "
- << faceStatus.getNOutDatas() << "d "
- << faceStatus.getNOutBytes() << "B}"
- << "}";
- std::cout << " " << faceStatus.getFaceScope()
- << " " << faceStatus.getFacePersistency()
- << " " << faceStatus.getLinkType();
- std::cout << std::endl;
- }
- }
-
- runNextStep();
- }
-
- //////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////////
-
- void
- fetchFibEnumerationInformation()
- {
- m_buffer = make_shared<OBufferStream>();
-
- Interest interest("/localhost/nfd/fib/list");
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
- m_face.expressInterest(interest,
- bind(&NfdStatus::fetchSegments, this, _2,
- &NfdStatus::afterFetchedFibEnumerationInformation),
- bind(&NfdStatus::onTimeout, this));
- }
-
- void
- afterFetchedFibEnumerationInformation()
- {
- ConstBufferPtr buf = m_buffer->buf();
- if (m_isOutputXml)
- {
- std::cout << "<fib>";
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode FibEntry TLV";
- break;
- }
- offset += block.size();
-
- nfd::FibEntry fibEntry(block);
-
- std::cout << "<fibEntry>";
- std::string prefix(fibEntry.getPrefix().toUri());
- escapeSpecialCharacters(&prefix);
- std::cout << "<prefix>" << prefix << "</prefix>";
- std::cout << "<nextHops>";
- for (std::list<nfd::NextHopRecord>::const_iterator
- nextHop = fibEntry.getNextHopRecords().begin();
- nextHop != fibEntry.getNextHopRecords().end();
- ++nextHop)
- {
- std::cout << "<nextHop>" ;
- std::cout << "<faceId>" << nextHop->getFaceId() << "</faceId>";
- std::cout << "<cost>" << nextHop->getCost() << "</cost>";
- std::cout << "</nextHop>";
- }
- std::cout << "</nextHops>";
- std::cout << "</fibEntry>";
- }
-
- std::cout << "</fib>";
- }
- else
- {
- std::cout << "FIB:" << std::endl;
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode FibEntry TLV" << std::endl;
- break;
- }
- offset += block.size();
-
- nfd::FibEntry fibEntry(block);
-
- std::cout << " " << fibEntry.getPrefix() << " nexthops={";
- for (std::list<nfd::NextHopRecord>::const_iterator
- nextHop = fibEntry.getNextHopRecords().begin();
- nextHop != fibEntry.getNextHopRecords().end();
- ++nextHop)
- {
- if (nextHop != fibEntry.getNextHopRecords().begin())
- std::cout << ", ";
- std::cout << "faceid=" << nextHop->getFaceId()
- << " (cost=" << nextHop->getCost() << ")";
- }
- std::cout << "}" << std::endl;
- }
- }
-
- runNextStep();
- }
-
- //////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////////
-
- void
- fetchStrategyChoiceInformation()
- {
- m_buffer = make_shared<OBufferStream>();
-
- Interest interest("/localhost/nfd/strategy-choice/list");
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
- m_face.expressInterest(interest,
- bind(&NfdStatus::fetchSegments, this, _2,
- &NfdStatus::afterFetchedStrategyChoiceInformationInformation),
- bind(&NfdStatus::onTimeout, this));
- }
-
- void
- afterFetchedStrategyChoiceInformationInformation()
- {
- ConstBufferPtr buf = m_buffer->buf();
- if (m_isOutputXml)
- {
- std::cout << "<strategyChoices>";
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode StrategyChoice TLV";
- break;
- }
- offset += block.size();
-
- nfd::StrategyChoice strategyChoice(block);
-
- std::cout << "<strategyChoice>";
-
- std::string name(strategyChoice.getName().toUri());
- escapeSpecialCharacters(&name);
- std::cout << "<namespace>" << name << "</namespace>";
- std::cout << "<strategy>";
-
- std::string strategy(strategyChoice.getStrategy().toUri());
- escapeSpecialCharacters(&strategy);
-
- std::cout << "<name>" << strategy << "</name>";
- std::cout << "</strategy>";
- std::cout << "</strategyChoice>";
- }
-
- std::cout << "</strategyChoices>";
- }
- else
- {
- std::cout << "Strategy choices:" << std::endl;
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode StrategyChoice TLV" << std::endl;
- break;
- }
- offset += block.size();
-
- nfd::StrategyChoice strategyChoice(block);
-
- std::cout << " " << strategyChoice.getName()
- << " strategy=" << strategyChoice.getStrategy() << std::endl;
- }
- }
-
- runNextStep();
- }
-
- void
- fetchRibStatusInformation()
- {
- m_buffer = make_shared<OBufferStream>();
-
- Interest interest("/localhost/nfd/rib/list");
- interest.setChildSelector(1);
- interest.setMustBeFresh(true);
-
- m_face.expressInterest(interest,
- bind(&NfdStatus::fetchSegments, this, _2,
- &NfdStatus::afterFetchedRibStatusInformation),
- bind(&NfdStatus::onTimeout, this));
- }
-
- void
- afterFetchedRibStatusInformation()
- {
- ConstBufferPtr buf = m_buffer->buf();
- if (m_isOutputXml)
- {
- std::cout << "<rib>";
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode RibEntry TLV";
- break;
- }
- offset += block.size();
-
- nfd::RibEntry ribEntry(block);
-
- std::cout << "<ribEntry>";
- std::string prefix(ribEntry.getName().toUri());
- escapeSpecialCharacters(&prefix);
- std::cout << "<prefix>" << prefix << "</prefix>";
- std::cout << "<routes>";
- for (std::list<nfd::Route>::const_iterator
- nextRoute = ribEntry.begin();
- nextRoute != ribEntry.end();
- ++nextRoute)
- {
- std::cout << "<route>" ;
- std::cout << "<faceId>" << nextRoute->getFaceId() << "</faceId>";
- std::cout << "<origin>" << nextRoute->getOrigin() << "</origin>";
- std::cout << "<cost>" << nextRoute->getCost() << "</cost>";
-
- std::cout << "<flags>";
- if (nextRoute->isChildInherit())
- std::cout << "<childInherit/>";
- if (nextRoute->isRibCapture())
- std::cout << "<ribCapture/>";
- std::cout << "</flags>";
-
- if (!nextRoute->hasInfiniteExpirationPeriod()) {
- std::cout << "<expirationPeriod>PT"
- << time::duration_cast<time::seconds>(nextRoute->getExpirationPeriod())
- .count() << "S"
- << "</expirationPeriod>";
- }
- std::cout << "</route>";
- }
- std::cout << "</routes>";
- std::cout << "</ribEntry>";
- }
-
- std::cout << "</rib>";
- }
- else
- {
- std::cout << "RIB:" << std::endl;
-
- Block block;
- size_t offset = 0;
- while (offset < buf->size())
- {
- bool ok = Block::fromBuffer(buf, offset, block);
- if (!ok)
- {
- std::cerr << "ERROR: cannot decode RibEntry TLV" << std::endl;
- break;
- }
-
- offset += block.size();
-
- nfd::RibEntry ribEntry(block);
-
- std::cout << " " << ribEntry.getName().toUri() << " route={";
- for (std::list<nfd::Route>::const_iterator
- nextRoute = ribEntry.begin();
- nextRoute != ribEntry.end();
- ++nextRoute)
- {
- if (nextRoute != ribEntry.begin())
- std::cout << ", ";
- std::cout << "faceid=" << nextRoute->getFaceId()
- << " (origin=" << nextRoute->getOrigin()
- << " cost=" << nextRoute->getCost();
- if (!nextRoute->hasInfiniteExpirationPeriod()) {
- std::cout << " expires="
- << time::duration_cast<time::seconds>(nextRoute->getExpirationPeriod())
- .count() << "s";
- }
-
- if (nextRoute->isChildInherit())
- std::cout << " ChildInherit";
- if (nextRoute->isRibCapture())
- std::cout << " RibCapture";
-
- std::cout << ")";
- }
- std::cout << "}" << std::endl;
- }
- }
-
- runNextStep();
- }
-
-
- void
- fetchInformation()
- {
- if (m_isOutputXml ||
- (!m_needVersionRetrieval &&
- !m_needChannelStatusRetrieval &&
- !m_needFaceStatusRetrieval &&
- !m_needFibEnumerationRetrieval &&
- !m_needRibStatusRetrieval &&
- !m_needStrategyChoiceRetrieval))
- {
- enableVersionRetrieval();
- enableChannelStatusRetrieval();
- enableFaceStatusRetrieval();
- enableFibEnumerationRetrieval();
- enableRibStatusRetrieval();
- enableStrategyChoiceRetrieval();
- }
-
- if (m_isOutputXml)
- m_fetchSteps.push_back(bind(&NfdStatus::printXmlHeader, this));
-
- if (m_needVersionRetrieval)
- m_fetchSteps.push_back(bind(&NfdStatus::fetchVersionInformation, this));
-
- if (m_needChannelStatusRetrieval)
- m_fetchSteps.push_back(bind(&NfdStatus::fetchChannelStatusInformation, this));
-
- if (m_needFaceStatusRetrieval)
- m_fetchSteps.push_back(bind(&NfdStatus::fetchFaceStatusInformation, this));
-
- if (m_needFibEnumerationRetrieval)
- m_fetchSteps.push_back(bind(&NfdStatus::fetchFibEnumerationInformation, this));
-
- if (m_needRibStatusRetrieval)
- m_fetchSteps.push_back(bind(&NfdStatus::fetchRibStatusInformation, this));
-
- if (m_needStrategyChoiceRetrieval)
- m_fetchSteps.push_back(bind(&NfdStatus::fetchStrategyChoiceInformation, this));
-
- if (m_isOutputXml)
- m_fetchSteps.push_back(bind(&NfdStatus::printXmlFooter, this));
-
- runNextStep();
- m_face.processEvents();
- }
-
-private:
- void
- printXmlHeader()
- {
- std::cout << "<?xml version=\"1.0\"?>";
- std::cout << "<nfdStatus xmlns=\"ndn:/localhost/nfd/status/1\">";
-
- runNextStep();
- }
-
- void
- printXmlFooter()
- {
- std::cout << "</nfdStatus>";
-
- runNextStep();
- }
-
- void
- runNextStep()
- {
- if (m_fetchSteps.empty())
- return;
-
- function<void()> nextStep = m_fetchSteps.front();
- m_fetchSteps.pop_front();
- nextStep();
- }
-
-private:
- std::string m_toolName;
- bool m_needVersionRetrieval;
- bool m_needChannelStatusRetrieval;
- bool m_needFaceStatusRetrieval;
- bool m_needFibEnumerationRetrieval;
- bool m_needRibStatusRetrieval;
- bool m_needStrategyChoiceRetrieval;
- bool m_isOutputXml;
- Face m_face;
-
- shared_ptr<OBufferStream> m_buffer;
-
- std::deque<function<void()> > m_fetchSteps;
-};
-
-}
-
-int main(int argc, char* argv[])
-{
- int option;
- ndn::NfdStatus nfdStatus(argv[0]);
-
- while ((option = getopt(argc, argv, "hvcfbrsxV")) != -1) {
- switch (option) {
- case 'h':
- nfdStatus.usage();
- return 0;
- case 'v':
- nfdStatus.enableVersionRetrieval();
- break;
- case 'c':
- nfdStatus.enableChannelStatusRetrieval();
- break;
- case 'f':
- nfdStatus.enableFaceStatusRetrieval();
- break;
- case 'b':
- nfdStatus.enableFibEnumerationRetrieval();
- break;
- case 'r':
- nfdStatus.enableRibStatusRetrieval();
- break;
- case 's':
- nfdStatus.enableStrategyChoiceRetrieval();
- break;
- case 'x':
- nfdStatus.enableXmlOutput();
- break;
- case 'V':
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- default:
- nfdStatus.usage();
- return 1;
- }
- }
-
- try {
- nfdStatus.fetchInformation();
- }
- catch (std::exception& e) {
- std::cerr << "ERROR: " << e.what() << std::endl;
- return 2;
- }
-
- return 0;
-}
diff --git a/NFD/tools/nfd-stop.sh b/NFD/tools/nfd-stop.sh
deleted file mode 100755
index ed55929..0000000
--- a/NFD/tools/nfd-stop.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!@BASH@
-
-VERSION="@VERSION@"
-
-case "$1" in
- -h)
- echo Usage
- echo $0
- echo " Stop NFD and RIB Management daemon"
- exit 0
- ;;
- -V)
- echo $VERSION
- exit 0
- ;;
- "") ;; # do nothing
- *)
- echo "Unrecognized option $1"
- exit 1
- ;;
-esac
-
-sudo killall nrd
-sudo killall nfd
diff --git a/NFD/tools/nfdc.cpp b/NFD/tools/nfdc.cpp
deleted file mode 100644
index dcb228c..0000000
--- a/NFD/tools/nfdc.cpp
+++ /dev/null
@@ -1,619 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "nfdc.hpp"
-#include "version.hpp"
-
-#include <boost/lexical_cast.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/algorithm/string/regex_find_format.hpp>
-#include <boost/regex.hpp>
-
-#include <ndn-cxx/management/nfd-face-query-filter.hpp>
-#include <ndn-cxx/management/nfd-face-status.hpp>
-#include <ndn-cxx/util/segment-fetcher.hpp>
-
-void
-usage(const char* programName)
-{
- std::cout << "Usage:\n" << programName << " [-h] [-V] COMMAND [<Command Options>]\n"
- " -h print usage and exit\n"
- " -V print version and exit\n"
- "\n"
- " COMMAND can be one of the following:\n"
- " register [-I] [-C] [-c cost] [-e expiration time] [-o origin] name <faceId | faceUri>\n"
- " register name to the given faceId or faceUri\n"
- " -I: unset CHILD_INHERIT flag\n"
- " -C: set CAPTURE flag\n"
- " -c: specify cost (default 0)\n"
- " -e: specify expiration time in ms\n"
- " (by default the entry remains in FIB for the lifetime of the associated face)\n"
- " -o: specify origin\n"
- " 0 for Local producer applications, 128 for NLSR, 255(default) for static routes\n"
- " unregister [-o origin] name <faceId | faceUri>\n"
- " unregister name from the given faceId\n"
- " create <faceUri> \n"
- " Create a face in one of the following formats:\n"
- " UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]\n"
- " TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>] \n"
- " destroy <faceId | faceUri> \n"
- " Destroy a face\n"
- " set-strategy <name> <strategy> \n"
- " Set the strategy for a namespace \n"
- " unset-strategy <name> \n"
- " Unset the strategy for a namespace \n"
- " add-nexthop [-c <cost>] <name> <faceId | faceUri>\n"
- " Add a nexthop to a FIB entry\n"
- " -c: specify cost (default 0)\n"
- " remove-nexthop <name> <faceId | faceUri> \n"
- " Remove a nexthop from a FIB entry\n"
- << std::endl;
-}
-
-namespace nfdc {
-
-using std::bind;
-
-const ndn::time::milliseconds Nfdc::DEFAULT_EXPIRATION_PERIOD = ndn::time::milliseconds::max();
-const uint64_t Nfdc::DEFAULT_COST = 0;
-
-Nfdc::FaceIdFetcher::FaceIdFetcher(ndn::Face& face,
- Controller& controller,
- bool allowCreate,
- const SuccessCallback& onSucceed,
- const FailureCallback& onFail)
- : m_face(face)
- , m_controller(controller)
- , m_allowCreate(allowCreate)
- , m_onSucceed(onSucceed)
- , m_onFail(onFail)
-{
-}
-
-void
-Nfdc::FaceIdFetcher::start(ndn::Face& face,
- Controller& controller,
- const std::string& input,
- bool allowCreate,
- const SuccessCallback& onSucceed,
- const FailureCallback& onFail)
-{
- // 1. Try parse input as FaceId, if input is FaceId, succeed with parsed FaceId
- // 2. Try parse input as FaceUri, if input is not FaceUri, fail
- // 3. Canonize faceUri
- // 4. If canonization fails, fail
- // 5. Query for face
- // 6. If query succeeds and finds a face, succeed with found FaceId
- // 7. Create face
- // 8. If face creation succeeds, succeed with created FaceId
- // 9. Fail
-
- boost::regex e("^[a-z0-9]+\\:.*");
- if (!boost::regex_match(input, e)) {
- try
- {
- u_int32_t faceId = boost::lexical_cast<uint32_t>(input);
- onSucceed(faceId);
- return;
- }
- catch (boost::bad_lexical_cast&)
- {
- onFail("No valid faceId or faceUri is provided");
- return;
- }
- }
- else {
- ndn::util::FaceUri faceUri;
- if (!faceUri.parse(input)) {
- onFail("FaceUri parse failed");
- return;
- }
-
- auto fetcher = new FaceIdFetcher(std::ref(face), std::ref(controller),
- allowCreate, onSucceed, onFail);
-
- fetcher->startGetFaceId(faceUri);
- }
-}
-
-void
-Nfdc::FaceIdFetcher::startGetFaceId(const ndn::util::FaceUri& faceUri)
-{
- faceUri.canonize(bind(&FaceIdFetcher::onCanonizeSuccess, this, _1),
- bind(&FaceIdFetcher::onCanonizeFailure, this, _1),
- m_face.getIoService(), ndn::time::seconds(4));
-}
-
-void
-Nfdc::FaceIdFetcher::onCanonizeSuccess(const ndn::util::FaceUri& canonicalUri)
-{
- ndn::Name queryName("/localhost/nfd/faces/query");
- ndn::nfd::FaceQueryFilter queryFilter;
- queryFilter.setRemoteUri(canonicalUri.toString());
- queryName.append(queryFilter.wireEncode());
-
- ndn::Interest interestPacket(queryName);
- interestPacket.setMustBeFresh(true);
- interestPacket.setInterestLifetime(ndn::time::milliseconds(4000));
- auto interest = std::make_shared<ndn::Interest>(interestPacket);
-
- ndn::util::SegmentFetcher::fetch(m_face, *interest,
- ndn::util::DontVerifySegment(),
- bind(&FaceIdFetcher::onQuerySuccess,
- this, _1, canonicalUri),
- bind(&FaceIdFetcher::onQueryFailure,
- this, _1, canonicalUri));
-}
-
-void
-Nfdc::FaceIdFetcher::onCanonizeFailure(const std::string& reason)
-{
- fail("Canonize faceUri failed : " + reason);
-}
-
-void
-Nfdc::FaceIdFetcher::onQuerySuccess(const ndn::ConstBufferPtr& data,
- const ndn::util::FaceUri& canonicalUri)
-{
- size_t offset = 0;
- ndn::Block block;
- bool ok = ndn::Block::fromBuffer(data, offset, block);
-
- if (!ok) {
- if (m_allowCreate) {
- startFaceCreate(canonicalUri);
- }
- else {
- fail("Fail to find faceId");
- }
- }
- else {
- try {
- FaceStatus status(block);
- succeed(status.getFaceId());
- }
- catch (const ndn::tlv::Error& e) {
- std::string errorMessage(e.what());
- fail("ERROR: " + errorMessage);
- }
- }
-}
-
-void
-Nfdc::FaceIdFetcher::onQueryFailure(uint32_t errorCode,
- const ndn::util::FaceUri& canonicalUri)
-{
- std::stringstream ss;
- ss << "Cannot fetch data (code " << errorCode << ")";
- fail(ss.str());
-}
-
-void
-Nfdc::FaceIdFetcher::onFaceCreateError(uint32_t code,
- const std::string& error,
- const std::string& message)
-{
- std::stringstream ss;
- ss << message << " : " << error << " (code " << code << ")";
- fail(ss.str());
-}
-
-void
-Nfdc::FaceIdFetcher::startFaceCreate(const ndn::util::FaceUri& canonicalUri)
-{
- ControlParameters parameters;
- parameters.setUri(canonicalUri.toString());
-
- m_controller.start<FaceCreateCommand>(parameters,
- [this] (const ControlParameters& result) {
- succeed(result.getFaceId());
- },
- bind(&FaceIdFetcher::onFaceCreateError, this, _1, _2,
- "Face creation failed"));
-}
-
-void
-Nfdc::FaceIdFetcher::succeed(uint32_t faceId)
-{
- m_onSucceed(faceId);
- delete this;
-}
-
-void
-Nfdc::FaceIdFetcher::fail(const std::string& reason)
-{
- m_onFail(reason);
- delete this;
-}
-
-Nfdc::Nfdc(ndn::Face& face)
- : m_flags(ROUTE_FLAG_CHILD_INHERIT)
- , m_cost(DEFAULT_COST)
- , m_origin(ROUTE_ORIGIN_STATIC)
- , m_expires(DEFAULT_EXPIRATION_PERIOD)
- , m_face(face)
- , m_controller(face, m_keyChain)
- , m_ioService(face.getIoService())
-{
-}
-
-Nfdc::~Nfdc()
-{
-}
-
-bool
-Nfdc::dispatch(const std::string& command)
-{
- if (command == "add-nexthop") {
- if (m_nOptions != 2)
- return false;
- fibAddNextHop();
- }
- else if (command == "remove-nexthop") {
- if (m_nOptions != 2)
- return false;
- fibRemoveNextHop();
- }
- else if (command == "register") {
- if (m_nOptions != 2)
- return false;
- ribRegisterPrefix();
- }
- else if (command == "unregister") {
- if (m_nOptions != 2)
- return false;
- ribUnregisterPrefix();
- }
- else if (command == "create") {
- if (m_nOptions != 1)
- return false;
- faceCreate();
- }
- else if (command == "destroy") {
- if (m_nOptions != 1)
- return false;
- faceDestroy();
- }
- else if (command == "set-strategy") {
- if (m_nOptions != 2)
- return false;
- strategyChoiceSet();
- }
- else if (command == "unset-strategy") {
- if (m_nOptions != 1)
- return false;
- strategyChoiceUnset();
- }
- else
- usage(m_programName);
-
- return true;
-}
-
-void
-Nfdc::fibAddNextHop()
-{
- m_name = m_commandLineArguments[0];
- const std::string& faceName = m_commandLineArguments[1];
-
- FaceIdFetcher::start(m_face, m_controller, faceName, true,
- [this] (const uint32_t faceId) {
- ControlParameters parameters;
- parameters
- .setName(m_name)
- .setCost(m_cost)
- .setFaceId(faceId);
-
- m_controller
- .start<FibAddNextHopCommand>(parameters,
- bind(&Nfdc::onSuccess, this, _1,
- "Nexthop insertion succeeded"),
- bind(&Nfdc::onError, this, _1, _2,
- "Nexthop insertion failed"));
- },
- bind(&Nfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-Nfdc::fibRemoveNextHop()
-{
- m_name = m_commandLineArguments[0];
- const std::string& faceName = m_commandLineArguments[1];
-
- FaceIdFetcher::start(m_face, m_controller, faceName, false,
- [this] (const uint32_t faceId) {
- ControlParameters parameters;
- parameters
- .setName(m_name)
- .setFaceId(faceId);
-
- m_controller
- .start<FibRemoveNextHopCommand>(parameters,
- bind(&Nfdc::onSuccess, this, _1,
- "Nexthop removal succeeded"),
- bind(&Nfdc::onError, this, _1, _2,
- "Nexthop removal failed"));
- },
- bind(&Nfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-Nfdc::ribRegisterPrefix()
-{
- m_name = m_commandLineArguments[0];
- const std::string& faceName = m_commandLineArguments[1];
-
- FaceIdFetcher::start(m_face, m_controller, faceName, true,
- [this] (const uint32_t faceId) {
- ControlParameters parameters;
- parameters
- .setName(m_name)
- .setCost(m_cost)
- .setFlags(m_flags)
- .setOrigin(m_origin)
- .setFaceId(faceId);
-
- if (m_expires != DEFAULT_EXPIRATION_PERIOD)
- parameters.setExpirationPeriod(m_expires);
-
- m_controller
- .start<RibRegisterCommand>(parameters,
- bind(&Nfdc::onSuccess, this, _1,
- "Successful in name registration"),
- bind(&Nfdc::onError, this, _1, _2,
- "Failed in name registration"));
- },
- bind(&Nfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-Nfdc::ribUnregisterPrefix()
-{
- m_name = m_commandLineArguments[0];
- const std::string& faceName = m_commandLineArguments[1];
-
- FaceIdFetcher::start(m_face, m_controller, faceName, false,
- [this] (const uint32_t faceId) {
- ControlParameters parameters;
- parameters
- .setName(m_name)
- .setFaceId(faceId)
- .setOrigin(m_origin);
-
- m_controller
- .start<RibUnregisterCommand>(parameters,
- bind(&Nfdc::onSuccess, this, _1,
- "Successful in unregistering name"),
- bind(&Nfdc::onError, this, _1, _2,
- "Failed in unregistering name"));
- },
- bind(&Nfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-Nfdc::onCanonizeFailure(const std::string& reason)
-{
- std::cerr << reason << std::endl;
-}
-
-void
-Nfdc::onObtainFaceIdFailure(const std::string& message)
-{
- std::cerr << "Obtain faceId failure: " << message << std::endl;
-}
-
-void
-Nfdc::faceCreate()
-{
- boost::regex e("^[a-z0-9]+\\:.*");
- if (!boost::regex_match(m_commandLineArguments[0], e))
- throw Error("invalid uri format");
-
- ndn::util::FaceUri faceUri;
- faceUri.parse(m_commandLineArguments[0]);
-
- faceUri.canonize(bind(&Nfdc::startFaceCreate, this, _1),
- bind(&Nfdc::onCanonizeFailure, this, _1),
- m_ioService, ndn::time::seconds(4));
-}
-
-void
-Nfdc::startFaceCreate(const ndn::util::FaceUri& canonicalUri)
-{
- ControlParameters parameters;
- parameters.setUri(canonicalUri.toString());
-
- m_controller.start<FaceCreateCommand>(parameters,
- bind(&Nfdc::onSuccess, this, _1,
- "Face creation succeeded"),
- bind(&Nfdc::onError, this, _1, _2,
- "Face creation failed"));
-}
-
-void
-Nfdc::faceDestroy()
-{
- ControlParameters parameters;
- const std::string& faceName = m_commandLineArguments[0];
-
- FaceIdFetcher::start(m_face, m_controller, faceName, false,
- [this] (const uint32_t faceId) {
- ControlParameters faceParameters;
- faceParameters.setFaceId(faceId);
-
- m_controller.start<FaceDestroyCommand>(faceParameters,
- bind(&Nfdc::onSuccess, this, _1,
- "Face destroy succeeded"),
- bind(&Nfdc::onError, this, _1, _2,
- "Face destroy failed"));
- },
- bind(&Nfdc::onObtainFaceIdFailure, this, _1));
-}
-
-void
-Nfdc::strategyChoiceSet()
-{
- const std::string& name = m_commandLineArguments[0];
- const std::string& strategy = m_commandLineArguments[1];
-
- ControlParameters parameters;
- parameters
- .setName(name)
- .setStrategy(strategy);
-
- m_controller.start<StrategyChoiceSetCommand>(parameters,
- bind(&Nfdc::onSuccess, this, _1,
- "Successfully set strategy choice"),
- bind(&Nfdc::onError, this, _1, _2,
- "Failed to set strategy choice"));
-}
-
-void
-Nfdc::strategyChoiceUnset()
-{
- const std::string& name = m_commandLineArguments[0];
-
- ControlParameters parameters;
- parameters.setName(name);
-
- m_controller.start<StrategyChoiceUnsetCommand>(parameters,
- bind(&Nfdc::onSuccess, this, _1,
- "Successfully unset strategy choice"),
- bind(&Nfdc::onError, this, _1, _2,
- "Failed to unset strategy choice"));
-}
-
-void
-Nfdc::onSuccess(const ControlParameters& commandSuccessResult, const std::string& message)
-{
- std::cout << message << ": " << commandSuccessResult << std::endl;
-}
-
-void
-Nfdc::onError(uint32_t code, const std::string& error, const std::string& message)
-{
- std::ostringstream os;
- os << message << ": " << error << " (code: " << code << ")";
- throw Error(os.str());
-}
-
-} // namespace nfdc
-
-int
-main(int argc, char** argv)
-{
- ndn::Face face;
- nfdc::Nfdc p(face);
-
- p.m_programName = argv[0];
-
- if (argc < 2) {
- usage(p.m_programName);
- return 0;
- }
-
- if (!strcmp(argv[1], "-h")) {
- usage(p.m_programName);
- return 0;
- }
-
- if (!strcmp(argv[1], "-V")) {
- std::cout << NFD_VERSION_BUILD_STRING << std::endl;
- return 0;
- }
-
- ::optind = 2; //start reading options from 2nd argument i.e. Command
- int opt;
- while ((opt = ::getopt(argc, argv, "ICc:e:o:")) != -1) {
- switch (opt) {
- case 'I':
- p.m_flags = p.m_flags & ~(nfdc::ROUTE_FLAG_CHILD_INHERIT);
- break;
-
- case 'C':
- p.m_flags = p.m_flags | nfdc::ROUTE_FLAG_CAPTURE;
- break;
-
- case 'c':
- try {
- p.m_cost = boost::lexical_cast<uint64_t>(::optarg);
- }
- catch (boost::bad_lexical_cast&) {
- std::cerr << "Error: cost must be in unsigned integer format" << std::endl;
- return 1;
- }
- break;
-
- case 'e':
- uint64_t expires;
- try {
- expires = boost::lexical_cast<uint64_t>(::optarg);
- }
- catch (boost::bad_lexical_cast&) {
- std::cerr << "Error: expiration time must be in unsigned integer format" << std::endl;
- return 1;
- }
- p.m_expires = ndn::time::milliseconds(expires);
- break;
-
- case 'o':
- try {
- p.m_origin = boost::lexical_cast<uint64_t>(::optarg);
- }
- catch (boost::bad_lexical_cast&) {
- std::cerr << "Error: origin must be in unsigned integer format" << std::endl;
- return 1;
- }
- break;
-
- default:
- usage(p.m_programName);
- return 1;
- }
- }
-
- if (argc == ::optind) {
- usage(p.m_programName);
- return 1;
- }
-
- try {
- p.m_commandLineArguments = argv + ::optind;
- p.m_nOptions = argc - ::optind;
-
- //argv[1] points to the command, so pass it to the dispatch
- bool isOk = p.dispatch(argv[1]);
- if (!isOk) {
- usage(p.m_programName);
- return 1;
- }
- face.processEvents();
- }
- catch (const std::exception& e) {
- std::cerr << "ERROR: " << e.what() << std::endl;
- return 2;
- }
- return 0;
-}
diff --git a/NFD/tools/nfdc.hpp b/NFD/tools/nfdc.hpp
deleted file mode 100644
index f8895b5..0000000
--- a/NFD/tools/nfdc.hpp
+++ /dev/null
@@ -1,257 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TOOLS_NFDC_HPP
-#define NFD_TOOLS_NFDC_HPP
-
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/util/time.hpp>
-#include <ndn-cxx/management/nfd-controller.hpp>
-#include <ndn-cxx/util/face-uri.hpp>
-#include <memory>
-
-namespace nfdc {
-
-using namespace ndn::nfd;
-
-class Nfdc : boost::noncopyable
-{
-public:
-
- static const ndn::time::milliseconds DEFAULT_EXPIRATION_PERIOD;
- static const uint64_t DEFAULT_COST;
-
- class Error : public std::runtime_error
- {
- public:
- explicit
- Error(const std::string& what)
- : std::runtime_error(what)
- {
- }
- };
-
- class FaceIdFetcher
- {
- public:
- typedef std::function<void(uint32_t)> SuccessCallback;
- typedef std::function<void(const std::string&)> FailureCallback;
-
- /** \brief obtain FaceId from input
- * \param face Reference to the Face that should be used to fetch data
- * \param controller Reference to the controller that should be used to sign the Interest
- * \param input User input, either FaceId or FaceUri
- * \param allowCreate Whether creating face is allowed
- * \param onSucceed Callback to be fired when faceId is obtained
- * \param onFail Callback to be fired when an error occurs
- */
- static void
- start(ndn::Face& face,
- Controller& controller,
- const std::string& input,
- bool allowCreate,
- const SuccessCallback& onSucceed,
- const FailureCallback& onFail);
-
- private:
- FaceIdFetcher(ndn::Face& face,
- Controller& controller,
- bool allowCreate,
- const SuccessCallback& onSucceed,
- const FailureCallback& onFail);
-
- void
- onQuerySuccess(const ndn::ConstBufferPtr& data,
- const ndn::util::FaceUri& canonicalUri);
-
- void
- onQueryFailure(uint32_t errorCode,
- const ndn::util::FaceUri& canonicalUri);
-
- void
- onCanonizeSuccess(const ndn::util::FaceUri& canonicalUri);
-
- void
- onCanonizeFailure(const std::string& reason);
-
- void
- startGetFaceId(const ndn::util::FaceUri& faceUri);
-
- void
- startFaceCreate(const ndn::util::FaceUri& canonicalUri);
-
- void
- onFaceCreateError(uint32_t code,
- const std::string& error,
- const std::string& message);
-
- void
- succeed(uint32_t faceId);
-
- void
- fail(const std::string& reason);
-
- private:
- ndn::Face& m_face;
- Controller& m_controller;
- bool m_allowCreate;
- SuccessCallback m_onSucceed;
- FailureCallback m_onFail;
- };
-
- explicit
- Nfdc(ndn::Face& face);
-
- ~Nfdc();
-
- bool
- dispatch(const std::string& cmd);
-
- /**
- * \brief Adds a nexthop to a FIB entry
- *
- * If the FIB entry does not exist, it is inserted automatically
- *
- * cmd format:
- * [-c cost] name faceId|faceUri
- *
- */
- void
- fibAddNextHop();
-
- /**
- * \brief Removes a nexthop from an existing FIB entry
- *
- * If the last nexthop record in a FIB entry is removed, the FIB entry is also deleted
- *
- * cmd format:
- * name faceId
- *
- */
- void
- fibRemoveNextHop();
-
- /**
- * \brief Registers name to the given faceId or faceUri
- *
- * cmd format:
- * [-I] [-C] [-c cost] name faceId|faceUri
- */
- void
- ribRegisterPrefix();
-
- /**
- * \brief Unregisters name from the given faceId/faceUri
- *
- * cmd format:
- * name faceId/faceUri
- */
- void
- ribUnregisterPrefix();
-
- /**
- * \brief Creates new face
- *
- * This command allows creation of UDP unicast and TCP faces only
- *
- * cmd format:
- * uri
- *
- */
- void
- faceCreate();
-
- /**
- * \brief Destroys face
- *
- * cmd format:
- * faceId|faceUri
- *
- */
- void
- faceDestroy();
-
- /**
- * \brief Sets the strategy for a namespace
- *
- * cmd format:
- * name strategy
- *
- */
- void
- strategyChoiceSet();
-
- /**
- * \brief Unset the strategy for a namespace
- *
- * cmd format:
- * name strategy
- *
- */
- void
- strategyChoiceUnset();
-
-private:
-
- void
- onSuccess(const ControlParameters& commandSuccessResult,
- const std::string& message);
-
- void
- onError(uint32_t code, const std::string& error, const std::string& message);
-
- void
- onCanonizeFailure(const std::string& reason);
-
- void
- startFaceCreate(const ndn::util::FaceUri& canonicalUri);
-
- void
- onObtainFaceIdFailure(const std::string& message);
-
-public:
- const char* m_programName;
-
- // command parameters without leading 'cmd' component
- const char* const* m_commandLineArguments;
- int m_nOptions;
- uint64_t m_flags;
- uint64_t m_cost;
- uint64_t m_faceId;
- uint64_t m_origin;
- ndn::time::milliseconds m_expires;
- std::string m_name;
-
-private:
- ndn::KeyChain m_keyChain;
- ndn::Face& m_face;
- Controller m_controller;
- boost::asio::io_service& m_ioService;
-};
-
-} // namespace nfdc
-
-#endif // NFD_TOOLS_NFDC_HPP
diff --git a/NFD/unit-tests.conf.sample b/NFD/unit-tests.conf.sample
deleted file mode 100644
index d75c19c..0000000
--- a/NFD/unit-tests.conf.sample
+++ /dev/null
@@ -1,31 +0,0 @@
-log
-{
- ; default_level specifies the logging level for modules
- ; that are not explicitly named. All debugging levels
- ; listed above the selected value are enabled.
- ;
- ; Valid values:
- ;
- ; NONE ; no messages
- ; ERROR ; error messages
- ; WARN ; warning messages
- ; INFO ; informational messages (default)
- ; DEBUG ; debugging messages
- ; TRACE ; trace messages (most verbose)
- ; ALL ; all messages
-
- ; default_level INFO
-
- ; You may override default_level by assigning a logging level
- ; to the desired module name. Module names can be found in two ways:
- ;
- ; Run:
- ; nfd --modules
- ;
- ; Or look for NFD_LOG_INIT(<module name>) statements in .cpp files
- ;
- ; Example module-level settings:
- ;
- ; FibManager DEBUG
- ; Forwarder INFO
-}
\ No newline at end of file
diff --git a/NFD/version.hpp.in b/NFD/version.hpp.in
deleted file mode 100644
index 13027d4..0000000
--- a/NFD/version.hpp.in
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_VERSION_HPP
-#define NFD_VERSION_HPP
-
-namespace nfd {
-
-/** NFD version follows Semantic Versioning 2.0.0 specification
- * http://semver.org/
- */
-
-// To change version number, modify VERSION variable in top-level wscript.
-
-/** \brief NFD version represented as an integer
- *
- * MAJOR*1000000 + MINOR*1000 + PATCH
- */
-#define NFD_VERSION @VERSION@
-
-/** \brief NFD version represented as a string
- *
- * MAJOR.MINOR.PATCH
- */
-#define NFD_VERSION_STRING "@VERSION_STRING@"
-
-/** \brief NFD version string, including git commit information, if NFD is build from
- * specific git commit
- *
- * NFD_VERSION_BUILD_STRING is obtained using the following command (`NFD-` prefix is
- * afterwards removed):
- *
- * `git describe --match 'NFD-*'`
- *
- * When NFD is built not from git, NFD_VERSION_BUILD_STRING equals NFD_VERSION_STRING
- *
- * MAJOR.MINOR.PATCH(-release-candidate-tag)(-(number-of-commits-since-tag)-COMMIT-HASH)
- *
- * Example, 0.1.0-rc1-1-g5c86570
- */
-#define NFD_VERSION_BUILD_STRING "@VERSION_BUILD@"
-
-/// MAJOR version
-#define NFD_VERSION_MAJOR @VERSION_MAJOR@
-/// MINOR version
-#define NFD_VERSION_MINOR @VERSION_MINOR@
-/// PATCH version
-#define NFD_VERSION_PATCH @VERSION_PATCH@
-
-} // namespace nfd
-
-#endif // NFD_VERSION_HPP
diff --git a/NFD/waf b/NFD/waf
deleted file mode 100755
index ef9df38..0000000
--- a/NFD/waf
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/env python
-# encoding: ISO8859-1
-# Thomas Nagy, 2005-2014
-
-"""
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-"""
-
-import os, sys, inspect
-
-VERSION="1.8.2"
-REVISION="a01aa13963437a19e5d8748cf2afd71b"
-INSTALL=''
-C1='#/'
-C2='#.'
-C3='#)'
-cwd = os.getcwd()
-join = os.path.join
-
-
-WAF='waf'
-def b(x):
- return x
-if sys.hexversion>0x300000f:
- WAF='waf3'
- def b(x):
- return x.encode()
-
-def err(m):
- print(('\033[91mError: %s\033[0m' % m))
- sys.exit(1)
-
-def unpack_wafdir(dir, src):
- f = open(src,'rb')
- c = 'corrupt archive (%d)'
- while 1:
- line = f.readline()
- if not line: err('run waf-light from a folder containing waflib')
- if line == b('#==>\n'):
- txt = f.readline()
- if not txt: err(c % 1)
- if f.readline() != b('#<==\n'): err(c % 2)
- break
- if not txt: err(c % 3)
- txt = txt[1:-1].replace(b(C1), b('\n')).replace(b(C2), b('\r')).replace(b(C3), b('\x00'))
-
- import shutil, tarfile
- try: shutil.rmtree(dir)
- except OSError: pass
- try:
- for x in ('Tools', 'extras'):
- os.makedirs(join(dir, 'waflib', x))
- except OSError:
- err("Cannot unpack waf lib into %s\nMove waf in a writable directory" % dir)
-
- os.chdir(dir)
- tmp = 't.bz2'
- t = open(tmp,'wb')
- try: t.write(txt)
- finally: t.close()
-
- try:
- t = tarfile.open(tmp)
- except:
- try:
- os.system('bunzip2 t.bz2')
- t = tarfile.open('t')
- tmp = 't'
- except:
- os.chdir(cwd)
- try: shutil.rmtree(dir)
- except OSError: pass
- err("Waf cannot be unpacked, check that bzip2 support is present")
-
- try:
- for x in t: t.extract(x)
- finally:
- t.close()
-
- for x in ('Tools', 'extras'):
- os.chmod(join('waflib',x), 493)
-
- if sys.hexversion<0x300000f:
- sys.path = [join(dir, 'waflib')] + sys.path
- import fixpy2
- fixpy2.fixdir(dir)
-
- os.remove(tmp)
- os.chdir(cwd)
-
- try: dir = unicode(dir, 'mbcs')
- except: pass
- try:
- from ctypes import windll
- windll.kernel32.SetFileAttributesW(dir, 2)
- except:
- pass
-
-def test(dir):
- try:
- os.stat(join(dir, 'waflib'))
- return os.path.abspath(dir)
- except OSError:
- pass
-
-def find_lib():
- src = os.path.abspath(inspect.getfile(inspect.getmodule(err)))
- base, name = os.path.split(src)
-
- #devs use $WAFDIR
- w=test(os.environ.get('WAFDIR', ''))
- if w: return w
-
- #waf-light
- if name.endswith('waf-light'):
- w = test(base)
- if w: return w
- err('waf-light requires waflib -> export WAFDIR=/folder')
-
- dirname = '%s-%s-%s' % (WAF, VERSION, REVISION)
- for i in (INSTALL,'/usr','/usr/local','/opt'):
- w = test(i + '/lib/' + dirname)
- if w: return w
-
- #waf-local
- dir = join(base, (sys.platform != 'win32' and '.' or '') + dirname)
- w = test(dir)
- if w: return w
-
- #unpack
- unpack_wafdir(dir, src)
- return dir
-
-wafdir = find_lib()
-sys.path.insert(0, wafdir)
-
-if __name__ == '__main__':
-
- from waflib import Scripting
- Scripting.waf_entry_point(cwd, VERSION, wafdir)
-
-#==>
-#BZh91AY&SYÉLt"ïÿÿÿ¼@ÿÿÿÿÿÿÿÿÿÿÿ¢¦x#)!2Xaé\÷x¬#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)#)/ºúÕ=[Ý{{Òá¯Z»må˳]9yo3ÏZÝ»½õ÷SÒû5Km»¶÷×£ß4àÖLÕsª_^/^Ü&.ëm}+Üe#):z{·¡íªì÷ºìUg:vÚi>{××ÍÞçÁï>jWlúûí÷Æ»·}Ýw½öpôYÛÆÞÚîÇ>ï¯m¼Øv,¶uÈ#)#)#.#)#)yì#)Él#È(MÛÞÂÀYÆ`Ë'F]Ûg¹î¡ ¶\ê¶#.Bí©¡I#)×Cvf(ªR]íÒOcATQZÉI#.7 mËmªéíÜ<z÷½[vÎìê¬d¶hÒMyU,j¦zS/ݽ{wß};}ÛºÜ{|û^ÖY}k¼íó7Zö³Nì»[Vónßb¾÷s¯WÛ¶hä#)R¦Æ¨#/¢{$QÜ»¯3Æ#)¡{w³%¶dk{Û½Ûp $UPÞg»][i½º'¹ÚíÎÞðÉÞ·[½n÷ÝæÛ·ÎßYUH:lVÖíÔ×mòÝom;gps³:ÉßõOkl®õãxß{Ü÷ÚµÞÞõXZcÊÜצ¼J@#/U&ûÞ<5õöó½=P®Û½Ão³¾òv}{Öw\ç{ÛÞíu=鯽ï5>÷w³×¾ÖiÛ{ºgº»Þì}ëÜoJíâ®yíÅv;·ëÛ6÷¼jöª´¥¼u¶Îí¾ªBn7nï}Ís³ïï]{çÝÙïI^ÞÎ>ÙãåÛ4¸·Ý£]´wvÙ]Ëî6½ç]½wÓ0zOó{ÌöoÛtÜÓP¡P Øwf²i»r¶#/¹u´çFæù=öò<ºUó½çÛÒ¥8¬Á¥¶ÆJ¾,¶Þ|sß4PSß\èT#)ÞÍîå}ÝÞw¾>ûÛ\àxï¾îñ{D½Ø[®ºÓïmµowbn£#/6Ï^»µÙɫɽ¾ïuWÑ_{®ó>öñ2}ëáôÕëï®ïW¯Q×»Ð=öo©_}»°zµ»j[}híîç½÷}öíÝ.·ºÜ÷[Çw®u·´ßl6µçw9á{[NOrÙµäﶪÒ6önæPO¬Ó,ë}x>& ÓCê¼5[´ØÕ÷ló{ÞÁð¢@iñ#.:ù¦}s{¸>ÊvçNÞösÓÅ[q«ßmn÷w½ÙõõióÎ7½'ßX}÷»A·\¥Ë)¥¢ûío}bù÷Tõ½Å)õ¡î¶Èè)¥³%Ú³Þó»°6Nîw¬i¼û[ï¼à2BÍT+g!÷°ãåÓ·¬vîw4=.s¥soºYÝÖÝé½´(ªH½vâv·*Ù÷ìçÓݬ«¯s{¬®ûÙïww¯¾õÞ;_ëßN¥_z·fçÞÚ÷n©N;ÞÝäS½ÓªÕé^¾Þ2Ýv{ÞíÉ÷ûìKQm\¯#½zÝäÝêø´%4B#) #)#) É£@#)&L&¦©£O(PÓMSÐÔi)'¦5£M©é=!§¨hz¡ê#)#)#)#)#) #)"b2#jTü§µSÍÒêizFÔòS ¨#)È#)#)Iê ªj~Tª=¥6§¦¡§©£Ò#)#)#)#)#)=@#)#)#)#) ¦M#)M`M&OLQ²iP#)#)#)&¢ #@&4 éSõOh¦ÔeêÕz¦ÒP#)#)#)Ð#)#)û|Ûú¶ÛWtI?³wV5sZÍßom©»%£á¶Ôå)) Z$¢#){V@åöüòÎX?æì¿eB?8ý0LØã©.$
5dÆÅ3doç÷Aÿ´Rù¤ :]XA#)»/¾_ÝsE¾M̺Ôq·ª¥Ò8æÈó+¹I0zË|-8Þ]YÔÁt>±q/eBJµJÄâqQa³[à;Æöu8@!ÿÄð¿äÈx±!4
(ÒDa*¨¥"CJÌJ@Ä"*® ÞI#)iD(ÞE(#¢UHû! °¤ª8¤#/AÔ )æUÛ%P`ÌJC3LHÈ
Í£fh)©±2RÅ-¤¨je,P4$&©Q´DJ¢l¡lJÌ L)A±¤hÅI)iª$%5$`Ê"F¶T,liblPRJ)¤HÄÓ6-SU¦ª¥$ÖX$j6¥«³4¦©,fª%M±1³TTI5ÌHÍhÔlf(Ñd´Z)J¤lb`
LM6(`)°L f*d%²@KÉdI)%%6)2AQ)Iµ j1¨l,L(¢%iDÆ,LTlM¢e¤4²4T¢f¤*iM$Â@¦ÄjK#.Dl&**"#/ɦl`MIE$dBDÌÍ I31³)¡,b$"HJa I4ÒÐbL,¥0lÚ#M"¢¤J3A¤IRÍ,¥K$Ù¦Q 5,RY±£+$ÌI"À3c,¨È*#/Y1´YCd£24IKZlÊc$jL
2RÍFÊL ¢QdA%() FHi¤H45¤Z¬34&aJBI²E²E£I2I(J,4`",E#.6k1RXÐJl2¥1 #.
¦MRÆ,ÔؤÊ,ÒbJÙ$
TbSLh Å&M)&a²l2d*#)k$ÊÄÃh,%!K&Qi ÉL¤eÁi)TÙ¬mLdJHѱ¤¬LhÂHaQ¤2@KÑ´jR1EbKI¢ ,!Y#)Z4eFi#.U-m ¤ª(É© k%ÊHÚ)&1¬4HÓLÓM¢ÔÈÆͱ(Щ²ÊFh¡K_ѲVÈK(ÉMbÖÅ¢£BfTDÓlTÆ¥ªb(lX4¤IÌld1¢¡¡5EMdÈleE¡bdÌjZY¨°ÌÊj³FY©¥°Ö4ÙDTe*±MZM¤+6V³RRÃm1Bb´i©Q%¦QDe¢±¶f²UfjV*J6ØÚ6%CDB¨¤*#.±ª5ÔÖ!5E´Ñ¥QH&Ã5(ÚF£dhƤ,jLÚµV±aÆË"eMdIaI3j¥¨¦ÌÔÒ¦kJ¥dJÛJJM©¦ÔÙlR#.lÖfd²ÅÁ©-¥´²ZFÄ@`i±¤£HQ°D1mÉ0)µRD¢Å2ÆÒMh4Â
eDX¤cBi¢)ÊlÐÆ CbÅ!R³RXmdË,Ì!#/RÉ ±QFÆÄdh42S1³¤¬iÍFMlËP)¢±DE")´d,Í¢Å4"¢4H¦`´)e ÂHJFS`ÉlBÒ$f¥¨Ò©#.Òl¤Ê,ÑV(Ì(I$ÙI4%£)3H5lme6V*16)4Ô,É¢¦[R2e-%%²$K1 Ó(ÑD#.ed¥LDÔh¬FØMEF6ÄVL2LÑ%&h¦#)6)"±`Û-4T£Y3#.%,Èl
hѰѨFË#/ÐDEd¶*c()5JQ5cXÊfhB¢¤i
IDÑY¶©2j,Q+%¡¥4±¥%4IRÉ*JR£VÄ¥"%+e%²i*,m¶f)l¦²¨i&lI±aB"ÅLÉC4`ÚLL±"Õ(0Kf"j6¢ØªHB¡c@FÊj£iX©#)ÐbL"MZPQiMRIQ[ÆÖf+%¬È#/ÑlÅ(#4cfI 4`ͱhØ¥6ÚJh±É¨¨6Ë-FÑX±kI¶¥³d4²±*Z)*¦¤Ò²£E(LYR¢ÒVM¤Û%dÕM¥3(²mEIFF¶Û54f¡²X*eEF° Z#.&¥³VLS*ÑDUѶŢÛhÚ¡MkjDÙH6cÊÂÊQdTEÌlII"!jMb̵L|>ó~i¯éyÛÇð{ßÍ\«E½fý;i6N£#ý¿òþÞS´W d]j¢$LLY¢ÒEpÿ«ýT|#.¥)°T\AÈúgQlÿ©ö+Û=i÷é8ÈnT-²Q¥U¥uI¦éDn#/·ÿ5_Ͼ!kÒîÿFÃû>û®ÃüëI2hÌäDL³¶»Yb"< #.¶nà]uø^Ì?v§;q0¶ã?¨
NéÇX;£QLC§6íéTf¥5Fª2Ù$¤©·_Bðjck´ðb¡Ø£Â¢5 UwCkJÉTe0ÀÙ¤J5äØ2¨
*(Ä´ÊÍh¥P5W³Ñü½Jô·³ÍÍFÉk1Q$âQb-ÀFiw.u@(þó«ÝçlËÙ¹I¼ëÅ4â" ÿïCýª0+1j¢AÄ6.ZÑ1íÃxÑ#.-WÇýº4=þÂv#/
µÚ*6P
²P§t+üsãLãPºÑí}[ï ÿi<;ð:N¤¥!V&CSMõlJ=i¦äâ+kqeÿ7ñgH\Zp»PD(aB1¼Üó®ît]Ææå&¤ÊDUCBWÂyChJ;sÑ§Ó ¡ì(*H#(k=?#/\nÔØ28¸o}up#§²®ó@ñkñÛ^éé{®¥·³PhmØ£Ö21ðùÞÞHê4|:EZ9`ÜZ©R²ä 7n\w]uÓEA½ê·w÷/«H(¡ä%³[5¸NDÅ~uKꢱü+LySÿ5éeÿB©6J®YÆ*%¡x¨ÈI+ù1ϳ iuÔÎ%É
VQøUkÛrú#/ç÷EÏèñéìâ£Ær2?f_C<á²B8ãzçÿR¹5NÆ¡ßÆdÏ>5~ıqC¡.çíí}ËPÎo¢÷Ìå!³Pö`rÆw¸C:¥ÓÖèÛAÙÙW0´d;Ò×¢ÆÑX»0¬MÖ/RPX%ç¥ãèü1F*'Mh³f ØÒÆçµS+áîß¿ZÄ#.KHíÿ!¾ëØc$4Ù&27åúí221ÀÍì¢aÍ×e/)Qì´½ÅFv¤8ÆäÈÈY[i¯ÙÒcB'ë!î.êm+Ç3,Ås]He ¡»¬ªJ]§<0=¨ÿ³wîÄê71)¬$LÀÅ¢Ñ`Æ# Rzrå}_?·ª¶±¡[ByÖ '
-%$"K<P4«µËcIÌ2ø3\Ï%²aj#/Î,³$©±6ØÀî5#CÅ TX]Q4£¶ôõæþ¢è),ùPöÍåDå¡DJÚÍéjõ(µïï´ò76êoº
4£ÜîÅq¤Þ¨.´BÒ$¸àPj{)²#¿¦kJlÍFd@îª-¥Q4í»¿,ªJgoeYRLHÀ]ë²áͺ$cb}¤e|¦x<C%¨÷b#.²µ¶eL5|HÙæᶺk#/ÓÙÖDVxvT<YQâµôáF$Nú¦ûª_
QÑ}ÎS3»{ÚG½W'²¬äéZ
WµÍòÂ?ÁVS:иí»áW'h#.lÌMZÆÕåPý¤óڦì!aç7?Òú_}ÓGúzô¾m.¨l8ã]Y?ÇÒ¹3L4ÃÉ Xm½§"úr±5¸uìFÀ*Ð!¡ÈiZ¬mØ\¤<ad¶AëÙÙY.ÞðÁx#/åÄÈq0ÝM6á¯GÊCay¯õ'h L~²XG=ñö«>^3ßa·ÊÌT;ïLq»óÆV1^75&}U4B?->Ó36T ¿sª#!slÏdª¤?¦Bü<ªô©«(uÉ=Ròx6£WÍüIFY¨è_ÚnõÐh¸ùyϳwkÇ'~jKOWáÇY/(yå
ÂHÎl4cxf|%£>ïÎìË[mâg
ª¦nìeÕDî©H/ÃÝVûÚ¾6Ý$µEX¹ñycüõÎ`æÕ.9=}T
Ì¡LÆR
Ö¿
ú´£GÐp\¥dFz}yp2f({¥Oì8kÏ|zm¼!ý¸iÒ#.4ÞþüY4P¹ãs]#/<oµÁ*>ík¯0ãU¶&#/jb<}L¹yò©¨È ´ã\\¢;mãÛ3FSj´Bþÿ×ý92±|pÆ8¡Kj¹æËõwÅù´IGAAH¬ÂäûÔëPsçFÔú?Ó¡ÑÙÑc Óó:ß(õ&#.êë&s!檨MFT¹¥M϶*¢u!;®¡Â>xÃIj²<n+t6=Ýè± 0aZho/3S%»Îø¶PýÓ0ðJmb¢iSvÁwnÄ4ønîþû}¯HÕE×évCf8&gKUßtÍúãdÔ¤æHÄFÜñy½:#ÌËâÝë»by±Á
"nÞ4Aoå.^&z´Ñi¦4?eÿ)³üPÇP(uÅ#.ÄÑòµXÜöTWX¯«_2ÏÉÿ)có{ !Zè\G7®pckçká³+|ÓgÞ«$lõ#.Ù¸¸jÉÄ<Ókªbð{5÷E|¡¶:ñÖðÁµù2ÈÑù:qøQʦ QШ|¸[:8txSíÌU5ú:ô«ÙýJ,å¥y÷ Gz°ü$lÏv»àiÕ ¦$EüÛáO¾¦÷QbêÀA¤nI q1ð=éèü§Þ(T:pIG<}/\±5áÖÔûxãòoi_¤Ãæ{÷¹©F0lÅÖ1ÓuDÏëe5iUB5âÑkÙl8ÉQýÕ{çÌtÅ<6Ðg#<gZ·HßyùJØtéjA;3bìÄÀ() ^ʪ0ófp4(ǹ<w/¹w||¥;¸Æ.e¿Ã®ÎÞÜÄÌr²í£¦6mê±!Âò
©Æ»éRAv¦ÿ½g
ií©< æiaRòXDHw!ÿróÖ"ɺ<Ù/ázwÉ;oÂ)àòÓï¢Ã
æ}5¬Ò¥YQaàG£PEbY¿yê?¦2
q<Á÷$¥ûç[¦t@"xÑ#)x±üHªÊßL¿¨Â®·+o~AlÔl¾ü6þRdSÕûEËü%§äÊ4$!£y¨¤g ìz ÿì¹zowtK¹ ÃR(Î:EÚéú\*;ÕI'˯,ÓS4!7#Ï6b®,Áf®xlU%jòkÒSÂéݾ#.sW¥z©" ¦Ì<tsÒâä£ò½¡ÒúÂ6=4A}_QÝFï¿ÞxÓWtã6L'&çUñö2Ü÷Ìz£(ÝÁ'\£7g^¯öÍÐW`s^ï#/íýQvúúÀÆpóÆA«åýEêªù~[«=^áÕneø¾aÚÔ.?#×}$çÃ~ aJkH§®^ä￱øשÀìès»¿¼ê¼«=?}U½CdòDöTÓêåGÄY ç£T~{¨]Úk¿ Z8¿tµ¯N2[ªº4nz^oßÿbmÙ¨&i£lÜñ©³oÜ Å÷u3ýÃfèóéA@ÕòJQ!«»Ä8e6'Íà¬BPzvþîß®XãÊO@ÇDÐÁÇ8×ñ! +j>ÞÞºv2xñÁd&Cçì°³#.$7ùÔÖôzÖ³ã9Z¹#/ë;ëLGÁ½g&B6È[)ÒÄú¸úïçi"zös lÍ"8ÈÚîglÁ®={r¬øHÐ<×ç¦#«=
#â8mÓDDm´¶Òùõ¨¸#.öð³··¦}:Rn`P°þ®Mh:¸uÞà§mÀ~#/cõkú÷=cåïÿ ,s5¥TÔV¯3Å#3Ò±*(â&zQqdUAL¡ªéüjϣݤ â`¨ÁéÉÕ§vö=&·«} 1wd¿[&\2¦/Íé1È߶Ï#/uµÚÜ#ï¤bÓGáôÂÉTSææzPC¹ÿ#)ìUoü5úñ
½¹®\¨vÑÚ%ËPöùÑGªQÄب%û9×Ä´¥öÊçãMbüÙ$6Ñ(üiÝ!7 OZü¡î<ÊÌÖÖV(bVõBøRÊùm~uÂò? ÏW5¨ÖOVcµwÙçQYÆlck ÍðËWÜçl¿§"½ofÚE`Ùf-±dÉGåj}½U&<*YÁ¯QiJÝRx7=×>6¼Ýx4 À¶#/å5âçM?~äß$Þ#ÔÁÉTãÇ.}T¯'rÅ8¸ÃAôx@Pè¸s®wábìm (¶ÀB#0[²óMÌ&0]ÄCµ£¡G£ÍÕªÆF>ä5ß3Qýyã#/³¢vT¡ÕTÚÒcùeld/g²Êba¢vbYíáAöí#/öpyÜm,r2óÝTúĵ¬V¹¬mÕË?XfÝÙ4ÃTÚ#.}ù)qSA}ZQZï§éÂYì|ùÀë'®ÈF>öJz5z÷[R°*¨¶]Ê>§=kX¢hÐè²V-<M`T¢i¦¤ :5 ÓEðÅe ©(R¨(¢7WRõn©*JR¯<\®FVi¢ `%1ª²Ëúû»=1£¤)ôw|ü +îNjµÑuÂIyÓ¤Ý$«VßuU f%fv!Ë¥ºï»íffYÝ4¼í$awÄø³zMq3Iìßöüÿ4IÎ[Ö»5Ñùj×ãÓ».ß:§°ïæm_{®h¤µ
±É¿ÆVE½¹<íÔÉÝL1¤Î¬½Ùhm[¶#/9º)l¤J¢j
Ý$nMD»dYdoM£_=ßîvæ#)x~ÝX«WY!8ÊÞ¶úWZ) ñ˶ÓoRõèEOYÏ$àóR£ü\_Ü¿®WüWê¤:?ªZ
ê6Lñ±£Ï¬hƵ;4L÷á-?¢s×*r¾ªÓTbuúëÔ¬¿/1Â|Ý&Ëgí¤(ÆG#.ßf}Mê»%®\Ü×G«3·ÌU¾¬;g«û¹Qú·©uôïvڿӹܴ+×¼4&á4SöNºS|Y> Í»¸«#ÛõÌЧt»Í©6»hõuÊ->§Çßø½ÛÇoõöâë̽Z©{EöÃ^³äÈÒm%m¢¢x(6ßH»k@\öKÉ+uý« K<¹·PùYÃöã<çã¶Ìô\0úTå)LïWÖ°ßJø5e
3ävi't:«Êû^w¡¨fo~÷Z(4²á+á¶#)²9eKuoÛ[z³-uð($!ݵ¨?J°ïæIy)Kyê!w6¿AeR(;Cój®G#/dÒ_LY+Óñß\¤;+Øbï¢}eYØñ>ZøÖ@î¥qFZH×ä Ù
KÚ µ9z{ÊТø#/M'cxgcBªAgÆ'Þ×Y¦wå^(#.ÆCäã#.Pk#.Î,$Û]Ðìæ±;4é^jÙ¿Zr¶0luÎ¥²t5ô<VúÐЧér$³ª»øèÝKÝú4G7>õ¥ÑË7Ä̼Lß =·¹ÂuWE²Uï¿KݶxðÛ_£)ùÿ#/ùÕBê8rþOúx$ìéuR¡GK:<HU#ö,µEó_Ù®DÜìc;/D³íªÒç£ð(ÿéY{ºlÝëåÒ|$¤0}1Cúpóû¾Qâ'÷á»KBk :H#.C«ûüÜûíêæJQµRöàùÞsâ½Lgò_m»I8ôÂë.®WlFçù<ZôÆWæO·ûc®7øUaP_2ô¤ÊòSTZG.æxD|Îó(vòî:ë¤Å"ðöC®ïóóxífºiÛé¦ì¬[M
5_YiÛ§ÀèÉ«9L|³Ì6,KϺº´þõ÷a Ôó2I^´Ãf-ͪ«E%
#/¹<w;§·Eæ]ÆÝ/µÃ;gX²$
Mðbrzc©Ô~ÒÇ´°ÒÓFvÈÀ×[Wv+6Ò¬É_§Zìwt̹UT¬°ÆnüÜo%¢§Ô0²nqݺU0µ·µòU*â¥×\u¢ð$þàÇ#²Iû¶Õ¢tK\4ûËoyXo:<ìÔÍùý{³ñG2µ\t¥§Gÿ *Ý'×þå6qÍJBa2m¬c5ÅæGɪÇUÐÅɸ»ÈïüûÄb¹º1Á.¼9Ùï{30]ØÄØl|>éL 0I±¯ü®ÓÖÌNÖ«¤¨üþKwYkS²õsèÞ`u"I¥È¸6ÓËÒl×meQËDvzõz}_U§Wfãh3Ïs»÷}=É´®EhlD ±3¡ËFCc£Ø|b¨háÇ¥UL*ÊÓakÍ[3ö]u¨vÞÒ`ÒUrn!ªLÀßóýõÅÏù^ë®(4h`tÀÈsR>{e;«Îª`1íTjÐE =¯íA!õtVùpqWÛ*ÔÎÞSµiWùù\÷¨HU{®áÃÇJ¤gÜ_É3)$⮯½èJ½ëÕ*úAËërb¤«p EáѸüLHíð×y´'~{c;um»D®Mßø;·ÛTËu±Fìêµy xcnßM=4²]dóù#)ÿm<ä&Bmv6z»óõ9mA
v^®rjQêCÎ ¸ÞþéâMµYPö4?
ãuÒwæÕÆRV7\ÿWÅ<m¿Å^Ï»Æe{ÇäòàÆê³TÙk]³^2yþ$ÿOôÛ#/í}?íiÓ¸û.ÖyxÊæìý^n©dT]1³Eùè[&_Ǫ¬6(hrBäxÙ¡ózñÄ0HÍþßw=³ª£$2HÇæ?È¢öˮҿæçFt¶fÍ2²eC¤ï¨UªGû_l:¡nî÷ÛôVÝ»áBq0{zÔaLt¹Se¿Ãøçé,ÔoT¾Ï óÞWl^ÎÔ@cRÜjKÏdêMmýHvhíÇû}M[5`ÂôçÚ»#>^lÎðÖûfo #)Ü«·»_ÄñðöÀfW1¦!´-8éÏHþg¨25|btx;²ï9¥?§Ö3ðëaÙ4$u^0x>ÐhlËãìgï¹i-¶]¹7åÕxü{þ§H@û|)_.4´'?â
2kÖÃ?=Nñ~96àhê4ÆúESõ]5ÏÞ.Ò=ñþþèá±}Z¬3;ºb~[}íÝ>P4?EÄ[c&´9÷;Q#¦çÒò{iËóý¶qn,.ñ'º#/¥D0ÿ¯#/j{äW¸za«IÅÃÔj-;xÇ40öýùÅj4Ð-DZp¶[êÁ~êÑyE9z¦ótÕv+ÅV¾×úrÿH,ÙÉÌ.¦F4Ï¡o²ºm4Ê#.Ø°MÚóq]sû,Ccèumîäg#âU,z¢éü¹é®ÿcºk\.L!#ú~Ë#.mþK楽cúv]îA¤u&#)íùMÿáño§u¥Ðê5)hXÙÖ#)bE#ÌuLíeD÷"mÎÑoCMK¢¬k!SÇ0öèê}Îef»¨%sÐß;ÀAÁ(Q^y¼=ÝÂo²ºjË'a²aØ÷<wÑÆìzbºFõaöïXΰäC¿v¤Øè$LLÀâÏÀ#.UÑnúaÄÕ´aÔZ¬½åHDË»ûÞÕ¾þvÝ3}Z&6é<74©êUܦÓÀ×DÒn!Y¹"i@IêØsá÷¼õ5ç·nniÝÙÚ¡ÙðÎ7¢¥æX-$KY>sòûÍkÜm'¢ëª4ÄjÐXÎo¬Å)#/Åf3#/-Ƥq1Û4ZÍ6´Ò'N÷ø^¦qðºüü%D!,wÍP%£`°ùã8o°ß§QÆÿ·ûd=ûä$ÜvÜQ`ß>Ü\#. Îb§û^Y;I¤cé8ã°ù#.BÔºË;üíØfÌ°DÌ 2T!3÷·ZÓéyÔ0òÜëßÔ
'gÏê^õÛâ|bôvéCòîZ)63ðÔ¿Wöt3ÆÚí§×ü±qéK¥.`M¹ØEý?:ØL+´s¦ò8êlLhÏZ¦],ÓÔTq~Ñ»bçÎâÔóåÒ+#.æz¶F-ÚåâæoÝxì`ÌõM4?%Â4ªaB<Æòé£×ÏÔÄÜüS§°=,óÈß·6åÂwÏ]ôbôÍ{oN Mc:¶be¦áÈ#.pöÌ(éäkÏÅ4j 49³/;D·Z$:ÈpR)Â2¨ØÓRÂI98h¹·#\åêÄz£ ¥Ub¥çÙô¹Tþ_?±~Û=®®Ó½tccÍÈHâ*½ÁÑÜÛ½º Úë#J»)ÂVäkqZ×±;ïÎæÓ${ôtCúuI©ÔgøêîÜ·×íº8st1øÿ¤Ì5óÞu|=dëEr{^
¹r{o¨!ßTÉÇ_UÆÙ7(® þT¢\¾Éɤ³ÔnöòÞL0Ý5ÝWÈÓFvì9nTX«Åðñôùîtk_~·Û=Ú|8ñCCCJB(±«ÆÚ¤Àx`ÆL>:òÀÍmImª(¸$]JÜËy.a<¹òÎ+#.ß;-%Ú$ÒîqC#/ÔQêRrIþÿåElÀþ"²QùaÀäº#
o"1ë$kÖØEÊb¯=c»c²êýÙªÊÎZ<#/¸´hn`»É«ª#/wCYq¢yóÓóFKn9¦µJ:¸Ø¬'O´c\C¦Lë¦7ñü{d¢ùó$Qßî#/yöõ4Qµ§fv×Tÿë[ã¿®´5q}y¾ÛÀfHÍzø¿Ç.÷÷M$t#/wfqø3ñ¡Ø¸":à1QÁÖmhÌj|o6°eÖh:Yо)ªÐжªqL oZc'0'cÔ¤ê% ØÌ ?1QëU MC¤Ó¢KE ÎUî±ÓL¬/¿ÃZM3ÏéS?v·§àAz°#/(#/00Åkç[x$¨´S65¶¢S%i9Í'Ú#.f ´¦³2C
j]âáè! Z¥{Ócl樺¹ZÒ#¿VáÇl@JÄ㫳íS½Ê¢¼Öå×
zð*¿2ºcv+l¾$ø"¤¬úgÌã^v¶ô|Þ`¹¥\·;7Ë·g몽øõýûÛ
Á¶#/Tðk#y~ZGý®Ä«C¹ÛÚ÷¢ÿ¬¾¯W«NY¢üÝyµfÈ:nê9_Ç3¹º¬fÆFF6164XDVBð=ì³åó¿¶z²n¦+Fª%ºUn]¢ÑÁpÊÃ1LáÏ52ZíT¿åIõÌÅ`(5"ÉÎ$%Çúa¹¬|·çË¢Xû>«å°îDpÚL/Ë1§¨óPÉL78=:Ú¶sê ÚAÐÛÞqOã¤åü;<uZ¶çl»úOÅ1>½s1C8ñ³e °î13wAH¶j*à?»¦Í<#.ãU6üdQ7Ôô3XÇ÷j·cH?³L<1ác¤ëk«înؽµUR!ù2`«_¼úã<5éÚp:Ù姼¡ê°Àå!ЯIº?R1 èÂF¾/R8d[ÝDp}ï»ËázP©ÿy³ªKLÓ´Ó(4íe²*Òè2×%¦ºa¬FÂrVí&cE{O^têivºv#.{¼f¨ÝPél"~2 cHÆ dF¦Z7ÒbÕ0ÊZ#.³#/$ÈMÌ"ÂÈÐ SW,*+)I´ÐÄlã>קffÜW,תWÀé=Ä[ùÍUî×v÷ØñèÆ¿Èè#ÎsD»OGÉùbÑq7"Ã8Õ_fúêð#9´.«ÛËNÌ=Ϫd>?«ìåPÉäm3 7Ô-k5Ét
M#/ìY5¬ß¦}¹AÐ8^Í&ó:Ô¿NTxÿXàÁ¹räC¼öºaaÔ±o#)£±R0Úz¡ð¿â¹º|rÔQQLÉgCö+¦ºvÆ0ùJ#¨¶ãÄÝL{Q)[Éã%k0_¶}}Õ»wJ*øÚIU´hÂdÔï¶%89<®«¥Ö§:¾;>¾8IÝ0mæI)x|S2Î1B55#/³ü/Q1#)òjy!¼ó(LídGu÷YÙ=øÖ3FÙL#.3ãè¯'®ßgùÁo|'hÆ)t:ãKk*RDÐîÔR~G2óÛÁ^ÌÌÖ%jcÂñ;Þ<Þmì9dÄoe+<îìG8ª×ÞÙ}u"¡`ëO,çò½`¥?°ð¢x³éè¾R)c.DýØøaSaÿ«%:ÒöLÅÁ:ñ9÷ëÖÿaÛgܪ`i#)×bÖkã>4q³+Óì¶Y~Q%euc4é´¶=*ΨhNa¥ ²(¦Æsm®m$UѶå¡2l¸m³EYdôÍi(b²P¸î¸%¤]~\sÌ>YÆÓ(@GIÍv1cjíuüÎÆn«);~!Sä|Uqff¤ff#.:ºþ|J4´SP}-Ìyýä¹q'÷sfÝ/-ß±Âøt1Õ=fF'4LÖuÕcZ6Ó|?.æüõµì=:ð;ÒdÝÚíÐnôswº·ËéÍüÕpòójùµo¥rfrØ#õª½;PÿuAéG+5:Ø»#/üèâfY×åÆqµúå Q¹NÉ9Uu:úêà;rIÞ°ò#/G_²xË<ñȬ¸¤ÂB6Ô8ç»/·DLÆûú%,¤â½y&S¦®¼iè½â{ë¼b¤Wäæj>¿&1ÏY Ög4Û³Ï?®©×ò@dЪ¥½;¬«Íó¹¦Å#/¦ôz»;{·h¿ô.®cÃ#)𼿦¿Å\î§gQpa´üWºu[øpüü4Hü§¤î÷³Zþ¾?ÃÉöýÒm:#.=ÇÃÕMô¡Ü½ÍÕ|G±Ü-¨l¤*^Õ´ÓG ðÀîÝåøm¶eå©d2Ó_ÏîÓCrqy+#.ükËhBSNXZ²"Ië¯cÓLè´~Xüo¦»ëOí³¡ÚZ³D!Ódj'ôjÕ窼cÒP'oá(ÞZF@²RF(K¬#?Oò#/¡ÕûCäþ¬Ú2®_¿ý_Ëçåðff#/µZ0; a+K¥Ìv¿8¿Ïº,ù[Ãe9sÿ~¡_Wzû¾»b,*k§kAËRY>
s&$T©bT]Æbi-*6¿SíÖ.A@Á8@äªÿÔ?ö%ÑãÚ`]=ßôd~U`W
¶
\'IÝa-X'ïCgá}nh¬¶(¢´Qfo¤~¶45ålMyÇ®w³ÉÈa¤5êHú,Kövý÷õ÷¾mõÏPHò·ÝnW«÷uÖ×ÜõÔFÚ#,-x=áeeÿV6FЦsBØÚvÂbC]¢"x²ÉØ
w#.ñ0(7Ún?âü6us:ÌÕQ²]G6(Ðm8&ðäjqÙÆеbb%ûÊ3©ëmDÿ¾DL~"RÎç#.PQ¿a(y·Jeß°üîÞæx"R;æÎͳªm À!³LScñ˱ÿpO¦%3¾T}IgÉ=æ¼V¹?[:$?q
ÑAC×ík§¥\ Ûí&1JÌ)$8³¬ÁBúâ
ÃÒUJæñÓ·ë7=ÕÐþ$Ø¿^¸é\H2* è¼Èf7Ñ1ä¥ÈzxÜÿl&©ø?Vc¶%ü°ÂÎ(óÙT¥'Ù
?wì¢ÖOÕa]YÒ9fm!¡ÓAzlP»³ýÖ)§=°:Qïcåhùiïü]öuïô{CçÌùðý¾xþúsÛÄ]GDº%乤X^:~J[øÏÏ_ïúðê;ÉËк×ã}z5Jr«êªÅ÷Sç>"²2ýo§ð¹óçùú-%¢þþæ3²¨é¸îýôéA nìó"³¦õ¼nÏ?aW×YDë¬UB³£>Ý},§ë©Ã¬U¶c~!9ÊõÃã-ÙÛQùâ¥Ém¯ë??®U|q»'yúe©#/Îh7hÙærÂÔ±IØ#*Ù÷aØÊGñgTÐj^3¬>f£ÚÎÎ~].K£Ø£L>{64#)Ô%í3#/NÁðñ2EQ5|&ä~«l«TDsêè¾ÆS¶;ºßVZ½ÛÆÈltjl9§Þ®Y*8èò<ËM:U*â#ÜkÐ}·oåsÓ~#´ôJ ÷)Í#.·qåÔÒ!Òn«øêö¯²ÈRÞ&í³DV±M^½@R}¸´¤j¡¥yÚvãì\ÙÎÂÿ_¥øjÉ¿Nµ¹NÆS¶Æî$ðèã©ËÆôÔ9m&={p#I¯·×O'©G÷ýp\ÖÙ®,7Á°éûª
±pR?¦>,ùÚ]+dWz"¨>Tà"NV_**5Læ,v!c6xØ>É<|>hi§Éʪc:´!<DøÙVgáX3L 4B@a"Úg·÷½}g[Ïä ²sf´Û®Çb¸?Ó¦Eø'nC¸¡$[ì½ç±Ûõ#)È×Ý¡$±@bdu°iÌÂÀ)F"*«Ýíó&ÉáÞhçTF«ýÌ°üðR-C3Íx3þ,ö3lLÅUàØ[%6Û%,@.K÷¾R0@d¤Zç'¶2&1&É6 úºË#/~Tõ¯øpþóû»ø>ú¹ëöy²o³Ö}>À;yíëÉw·Å}¿#.í¿ß¯â¾óç5Ü`÷éÂÌMò5z*¤ªÛ£ý#ÐØgyú¶nÓ¨ÃÇn5ß®¿ÅJ³çÛö½Ê§ý+ÏüiUÇ ~ÿí1Lú#.½ÜÔþü;é§LZ±Ý©ÈÓ)b½ÑC~2Î|Û»þÍÜÇ/Zú5ïü;ú8õrÝöSxâ?\⮯NÝ>~cY¯ÙëÔz4iØ|2ïý±©rowö|=:«M+vTà¾Í^Mï§;z¶_ÊT-DzM§¿ Vèíëvô³súul<7òãÝÑú§ªôI½þ>ز¢»1Ó.çµÅãÛù°Ë³Ç¦Ñý*ѲVØGÉö+ôU×»~Þ©>Ü·×Ê¢ÔÙ«×3A>ÓØ]3èý]%·ùÕUxtïç¯^È×`å²Þ»)æuâ´³FïöÔí¢éUÃCiôYW¦«òeÍÖtm¿MCÌÙ·¾EPñÎ>¢)4Y)K¹çÇ#.»å:o[UkÏÕNû|jÆíÞíZ¿Xüü¾ý·ù/ÙíèòÜ[£=Ú^~#Û\ýØsðçéªÃ¢Ü7{o®[ÄÊ¢KÕà(Þzâ+V/×Îì£T¿Ý;êáÏò¦t"NK·èðk¥4?·ôLÝøFÖz½ËÑßú7¿òÈÓ¡ÕN=F0^l)9yôÙ¿ÑÅÙ§ê=$]§\YçÛ9Å[lê³ «ÿÇã®ïÅaÃ*»ÿÌ4\~<ò«³|·|^{£~Ë×áòùùUVNÝ?ÅÍ ®±ºrò>ßêÓ|Íß?öZ`Wæ³=*e¤ô5éÇÊúýóÕËë×fê#.o/ì÷`å¾£ñmoM<~Üï»_mOúe´ÿ
NÿåöôÕ.GQU¾Ëå2naF /u±µÏöûîÒÉ®sÆâí#.²§¿@wÝ£v;ÏWô·êÓjÑÀé>Sû¿¿íú,#.çëË£nçëç©özýµuø££ÑûJ|ÝH¨Ä¿A#.åÏ7ìþogÕþ_ÝáýÍ'é°t_m£k¦0ôFÓÍ¢KßÔíµ}âE¹9"7ÓÐ?71îø¥EYø§D;"ökÓÔ%a¥ö|úþ@×É÷UÑÞuuëú½|×ò?Çß÷z>ݾîóÕæÞAùäpî<+¦ê÷O´/ÄȮηݣnÍ[>¿·Ôµ!÷t·ÄoÇgu¿ËGQåîñø¬îý}\çgÃóøþâ)ÜzN®öM÷7cc¯oÕk=gðú<8·Ùøÿ5\mËé¯|6Ù«¢ÿ
gÄVkò·öáÕëôt+Ïm;¾ywióì<ýâ©*/hµHvGÚk_»àë^v±»;ø@ÄyùSöʨGë«lQ©¶+?´d; BèúèYäÓ°aݱ¤7"?«x9o»»«¸Þ`ÏåýÕ®mûþûdñÇ)m«î÷×t¿E®±*ßç^aml¾txÿ×Ö5hòvYñÕ¬}=Xý;
Nnv×ì²þ:Ï<3VÇ?ÏmÛ}Õõ¬0&gv.jãu-«â/Ão]ºõX\Ý$°ÒÕܺzê!«µ¬nOUMïغ³å²[Vx%ñí«áΪªzõìïEüøg_89_µ8l¯Ï4§(;yþØ;sEÚ[¢!Rßìæ53F&«fNEÓ£²{I=ÿ¿=
z7{Y_/f¿¿Ý~úªð{C}{BuJÂmVø+£Xh·<UðßðG6]Ý<piY-zéJøÃC/¬ï9\1ØÍnµpõz1ó¾Gír1nÈÌOøïXÕÀÄzâ;Euêý;l>*<îÓq®_-c,#:ë%$
Âýwpû½õÚ-ú85×è1/È·ÛîÙÏ}2ÛyÒgìñÉoóð)²Òþ_ÀfsB¶§`¾ô um£I¹íW-,« -ÕYâ|¿³}¢Ó-NûMùPìî²ë:[âÙ㲩쿾êí®Öç~xÞÎqsU¢=\¥õj|PTe9¦íYýý¶`Wá+úð
øòÕgg½·óüß5,S9×V¹»Ù(§/!xó8ÿ?Ý:nôþ3«åÏÍ¿Út7¼Ð#Îl_§Ûº8Aë\%áû÷ÆJÙ§ý}ùýYö_Ï·m\§òÞËÑHnª7Ãð¬Ë¹t~{³¿Ç×Øg/ foSë°èô$ùó?¶¢Á5 óä`¼þ>¬y±%ûJL²Üî¯ê¯ØÙv{,}k¨|þ«1ÿ?¨$`L/ï/óa]µs#u·!O*ìD<>ýb1£PaX#ia4(*I&ØácPbaDQSR&Ò0a¶rôÖÚÛZÜNK£2-`Òl4É4b,¸ÈȶYEÚ,Y+tÔºéåFºIJxÍ
ü±ýxÄâQ3EFßdD?¥S&Ó¬_oYÜÞ³!¹á%þ9guíS$ÏÓ4Ö]'ßüöµQâq8Òn]ÔEQE"YC äÄSÇCô_$t/=åØp¼X`8hÒ$HGJ²¯n
¡ldcf*Õ#.45v§FÊéÚ( ÿ$8ÉǦ¿ |8Ýôao
YiÕ¿ä+ütøS¥yO éٸ驪yìصëu*Óð®ß&ûu}µg³b_»×æ»?9é\Oâôéû²³iÛSroÕ«¿>ÚU_Íjw=þÚ}¶ãï¥#/°{¦²E ¿©½m&¢HVóKÖ¥ê1kÆyû=ߧô=^ÍZý]HkÙ] ý'_)0ÚÎ÷þ.0Ø`¶}º?/åǧ¯«*¹-·Ôߺ.RyIâ+\AyÑÿo<~/GìÕZåãDR]ßÉôoÞêý¾ñÕl¿M^Þ¿å_U{7nþº¿n¿fYé"v9øÉeÁó|®A©ÚVÿaàcM)IM9üø¹Aúîcé°ñÈË
&¸Á,m+G#.à©.¦¥#hxÊ4F²·#)i³ÜBÃ#ÀlLH0¬r %bs«IµÎÚ.ñ¦Ûw5§Y9##/)Z%¡`È¥M¦ÄÂ¥bi¦¸°lxVZÒ}1òu%{Rop¦ù¦ÌðmÑV#.×#)°u12(8ÛC¡GtqF$Þw§£X>#.#/9QB!Ò0!¦¹D»mÀiJ ³G\Uñ¨vJh à)"¨1£2#.e"æ¥#."N*FÈl©bl8$XµÈÃX0a°i&PNÍÖÂÙ§¶ö`4Á²Æ*«H!SÄH÷bÇÚ¢·fHþÖ(LÔUV¦®Â$Ô(¡Û:Ã#)h K+Rñ#/Ü(qN;pGÃq6µ%M3ME^nÞ1aß°ä})ðØÿs<ëoð\:$^}nöWø×¹¶ì˷˧ýU}]Õ|Íä[ððd·öçç(~+¼w¼í¿è?ø[uåvkõ#.^q®õÖ¬RYÏ-2«ë×Ý«ò¯Û»»íÃflݳG#/ÆõÛ¤¡QüÛÎC~÷×.úJR8·îcʯêµv]ZêQnúT¨P·«]JÎÖtèof']Õ}Iϧq®ÝrO®¯ÙmU#/Úü$å³<nå7ëfÑÇSʦéRçM*#¿/Ä.z\¾KpÁÊÞÀä7ò÷1|Yé#m»d³#/»ô>Ghª^¡¥aùý/?Ìþ}¿Ò¯-Ï»OÑÔ0#.ûÔ´<RgÕ9ïòÝQvYz Ås¿a뤳j'C.|j©¯ØaXÁÌ7·E2pd5RDs&xÉ:ÎõéT¼#EÙ$pâÄÁþ o¾täyg$C¦¥æ%ó·Í.Rèà[]ÉÉÉ=®EÁØîÌyS3AoEpµü=Ýìåÿ?M¯ÁÊN?l~$ 2Ë$èuk\£s1¯YÄÏf#.þ£Dç¯'³áÄÆ7ðmÛf°»WHl{#."9ëû&K'²9Üz57QÊ©{n~V»ùå4ÞjÃV½Á͵8ôlQ=¯RÚ×ÌVÖ>ºoÅöWºqÄx¢nr'ª^>6]õýn9½3¢ TÎìüºÆj¢#.HG©bj%þ+bSöJrT&5TãûD éÃï«Ñîü=V|ýçãô=ï¦?TþmN&aHBh«%#/ßh&4Î ì4õL1 åXjgLclm
õä&fĺb5MXÀDI<ÓcÅì VÜ+ÈÅrLÂÄI]ËA¤T`ÐÊ+Q`|¢E7NÙ´¡®\»ÑÁq ÕyU²Ý@QÛ½`³¶ðù¤#/R:ÊÁ¢Ðà¿3H×-¢VbëL{Dm,âÜð6@«A_#)ÌÉcà´õ¡j¡íéÚvZÊÆ8`Ø8´Ôé¨ Á±D´VJ,±#.6ʵ;RFEÎ #.S54©.m´Z1"q² c/©8LÎQ-#/ó×ÿI°çN.1yÞJÓK±TXÃ-dJV(ZÅJÃ#/ ðÈ<-[s#.>û%f»#.øºp6L©ÓΡÇ!ÑþûþË®3{{Àòç§ÍÆèüõìs#.V±½&tÑ-*ìèu"!AöC²$Oûºº,cH1î=¼:×ä×»]Þ»¸4åª<a+¹/Æ=0ö`~ê/Ð~ÂlåwAm Çó£0EHp¼àÃÓa|*LMj³è^½Øh$¥±0,N×R#N@"G`Æ¡ªOMééθ¯÷vIBN¶5¦¤Ê;t¦ÁÐÍJcÃâĺª4´h¡El$méÚ,]峫mNÝ=~ãUP%Y6DÑszhæÔDJoö~Ü~úéèκþI}]tüÕ_Gu5ãöù<Myxz¿Þ]{CÌBnn¢ûiúmâËÇh$\´ R76:6;nÏöÙã²L(#/R0v*º·bRÐ"kT)c9TinQi7D#!
qUúª&W*-c§KÀÅ[¯eK!¦®.gH²dÄ
9¨µL<LË0,ÊØ0ZÓ:Ò·ÀצzZyCZU`ùoF?Á¤e\ÊßÓæpï;,.ï1u6N½¹ß4iÈÈR§'v\$Þ"hàÃ|PëR+
ñI9±iÆ/&\~º»4_Ä(tN lièÈ(¡v)7dC¨BqÞ¥é9~xG{|µ^ÚiNº´W¨7Îd{!¿ÏåìÄvû^ùÌRýbfÜÞ5³U±±zÌ°ÐpêÕÎQÔ2³MØj#|ÁÅêòzMܪw±oÊNÅ˹p9SÏXí'`ëÞG³ =&Áä¼Ó0Ô¿L¤¿¡Í3ömoWä ©¤#.ÚBvnt\¤Ä´ÖY1ÙѾQ&ÑG#.Bã¼åcë#c#.MãjÆÜ©J÷0̬26ÈÑ!U*°!ªDK(VÍ#.²f:e¹«}nùÎþª¯#.w+_Ç¿9Î Æ#-4ÇA²ÀÛLÕmX¦S¥R ]dÓ×GÂuø"$ÀôR<¦aÆå$iökÞ\Ø¡ha)Û[çLo;Á#/S,f2ᦢ³|ßÀím¼·ÃfLÖ*£7G|¸g0ÂoFbJCâ³"ÔyN¹b4#.2MªNǽ!&hL$$z;u²
óãe`Û_/ïÀ]´íý8ók]M¡+Á¾_(ÖYâI, é¢ßòåPY;]°Ü0¸8-ùF¼!ßpG#qnÍгk=k¤C\#/'"#ª;kSFí|o]a<2EhJî+¯'M:ÞÛg|8,Ò¹ÀMÙ¬97Hyg:b¡Çü1¬Û8MÁ×5K°Ô¢I Ô!¥Ð,^(± ¶C´³nÄbú9%¸µr`j¹¶|,(#.5d àêÎLÒb0 ð(°úqïÆ"])¬± LNµ~6ðõZ\7¨tôMAÓeÆy~^öÛ^Ö'¶ò¹ÇöuæSãè±=í½æF[säå½QÃøl*Ñq|éb6/áï¬Yãqô>&3²G"ñ9_è"»«÷%ô<C ¢vز&´bfÐbî ¹UÜGpVªûÛ©·r©ðøe#/ÀeF1µU|S¶,
Ò1PI@ñúWÒ×Õ¦¬¼eånú¬©#)èB`I{e2mCª5äë7t9Ðæ0@ÓÄrCwÿyvËùCÅ÷§ñÓ½^ôÜ>HOØôv-ðñ1}Npg3/Z¥äµVËSÎB2#¬9Mýí,OyJZq\äíªÁ¢YDaâNm¾ûkÊsÕðãùбk<2C÷¬Ëèáâá@ÚZVÃÅ<»:=ï<4ó65Hk
)^áW±íæó#.uÁ*q²|bLÑ(:?¬\õé0#.àÀÕ¨7R¦z6篫Bc5%&çûܸoº.2tÍØ»·+³J(ì}ÚµªT9ݪ
ã§m¡(º^l},$AîÖ»èËa§-xk185BçÚD£°{ôrÉËcDsqR©k¦*krwd×ËBµR\Ú«¿ù¾çüí=ÿîí´=õCLGñð¶×²Xâe0Oï3¡U1êCÀtÆãÿ{óþ/2}ÞI4Ú±ö7§ÚKì%géW|KÈYu6¶psik#)H9r)&a4:8#EÝ<k)^vb¾×6J£ 7·îêª<þù#.sIÝi\¢W¿½EXwùZüô·&·Þò²\#мީÏ\cJ^©âËM³õ-#.~DsÑÞÊɺIJ_³#)/¦ªT¤æ ãSy,äMc!UË@,S(Ë>ü»(*=KÎUÊ]u¢IÌwC°ú´:PÒÄÅ^j¿~8^]ýÚ¶jl qÇ#.#.çá"tmãØ#.CËà#/êÚYu#ºe§YÎé8`®Mq¿¦)m^ç½ØØ|ï×"üÃWJ³¸÷P¾Ñ2íp®Z=$öàÉ´Ïa*°K;'=ÚD;¼¾.çôi(7úvçx0N<ñ$ºtàä¹d<±%¼|ð8»ûá«;Òy^=ÏÌ8û/sÖþ¼ÿ[uR$%åÉA]ºÌ&b©ò
ódrÙþäl¶ÒVØGä sR ñª-#/[ck8gcò ²ÒrŸ?Tî°zßè:<GÞôwÈ<(
<µdÕè;á?¡«¬yI×6*R´Q¢}IÌ'ªcbü+Çk3·!Ð påÁóÀôT¬µ "¦Ò+^Å)ÊW)<w¢Ó+u¸òi½ÿÃEGIJZÌù¾Ïë]×IÚÏSÚ$øvv{¥ü#/dü5á÷gHÑzëºV!DN¢Ì;xÄ&JÛÔ²ì¹óG©'Azb>]VýÁèJIíÁ^è,àz<¡ØHtfjÆëJ³7ÍÝTÆS=¦M;ô3ÉonÏÄ~7Ý{¬9sÎɦ ä4ÎÓå³+Ùi¬üÓÓ%!âNFÛèÀ»Ã½Á[¢ð)H¡Ììv¾Ï ñ}°Â³þiWÒ6!Ý-°º9ØULP!r<ã¹,£õÃ$ÔÓáXcý²§4¹ei8ìè»h÷©RÂ\T~µpUÅÞpºÂÍ&¨«0v QfºÞdrL=æ)ºµ©síe2mt:pü7\.9ßËmðùk'C|Æ6* %ª»_-bÿä#+ȪÓdû4[}ʲ³å¥wG²Õò ø|t£ÍÛÔØZÆ<g)·Ñq-º¯sp11$Nâ=|¹¹õÖbCoºUëäp)Ätî ¥µ÷²B>G³Túy·$±Qs ð¬ÉE¶vÖM_zw!î2å"] ©gÌà°~é¤$ÅðyJ¦ÚJ8ÊàrPGëf{dVì»''=OÓ·½±äíFZ6&ÇRø3Yùþ£÷Oq#.Å®êæ&¢½^Q'î<ÿVx±°&ýò?jhNâ/ðÕª»DIúv½»dy̸¬a¬ËÞÙ×-vC¹áðà<Ø1ìÓq/ùbôÙmFîÖWnv¾³æ9}ª{¯rµÈ\ØØ°ðáèªWëã¦çÑZ®T2!Çx!;÷N'ÅÊFÕ)¸¼îV
J¢+ãi»}[G¥#MVL;ñqòñùKÛê0ÙhQcË BâÝ®î×wÃvï8³/'/%2G<¿6S6°Cý¬}hÚp®MäLOctIÊ¡s
ÍθÒì¸ÜÇëºpËìøI(K®õ8þOä¹ëíy>»â}uÝtáñd ¤Mþ°\ãïQj)·N$S-Ød f¸LÀÁXs5ÐÙyAÄòÕ~Dã;T»ó>kº5Ê:7QÜi¤MYÕ/8^ê¥o}¨Þïäíå[]u>º3mtW!Ní#.Ç~Â#.Saà¬<ïm(äscÿ*|/+Í¡ÛÄþß¿_3^סuùkÍM!ÀóýÉ»¿kó²öî"ËtÕþåëÄi<SÌ÷Ç^Ïvù¯òDµkÅvE¶ßðM´Ô¡âF½òEç¬{3¹K¶J6ØE¥LØóíÛ\ê0á32>)GµÍEuª?Ü4s®foY={ÏëÄ·FÖõ0MÒ×WËSbG¹3{¿³ÝMST×ÛôÛ]ùÍÇÊlëàö#.©G$p?ÀåÌãÞ=8¯Neùëá/|¢T±Øàóϱ¤º"Yhá®ÈÑq¼zU»Ð÷ìç*J;©s$Süáçâ3¿64M¬fØÁhùÆþ#.¾f)½Ë7ä#O¶3uìÖCpv6øâìÎäQ/6¥¡µq$H¥¤|&z*ʲ#,-.X%fn)æÞ#NÒTüHÙØ8ù§G®5ÖjDé'í.J}ùÛHukdüø»¦øT?Ï|ç ÁQy#/ëÆS2Ê[Áï·#.øK?éý©_Ð|uÔ|HkQÇÍKc¿¥xnªÇuÚÀ¾,À¨/yâlÓ~8C Ø·HY¤äfi_7ò5¦d·Çù¹Ïnç^³®ÚS#/ÇÅ·v"#)ýÒ³ÙÆQñ-ùT^æl)¥¨MÍZ+«áB2çRiS¤9â·MM¯Éö>{pK¦&Ã1Çü´¢©Éü¢I:«¿ö}5]±Ø³Róæ]®éó~âÉ¡¸bJÙ+¬õON){êtx<âjÂÔ+Ô4d7pó4Ük±hÂÖºáÇz
3K«ì)NXKúÊפÔXÑ"
×ÍÔeú9½<ù®3HÕvvèQ[ywPûéû{BºÂùU}k¾9;â«6TS~ÒYa_Ç »_ãýðÛ,Ó´XXøsòñ$MU~WiÓ{V*aȦüÕ[y&²(à®Vs1ÓmªñªßßÊ«ËZÌÞ¹øRÚ¨ñp,*-tôè®%T¤§;ùÊE¾©gÝqMéÅþHÁkÄ\Gw2ºkö¢zù¿IæØø¢e'mÿtç?«^m]><õØ´pàålvÔH´Æ1¨}è{¹ã65XÖU'Ç,nÁ%}ik®2[VZSÊíôÓÀt[ñsº=qDG¢ Ùý^ií·`j®Eøg"Í JI÷#Î\ÀîÝ5%íúçõQ]ÌG]öçsT?ªkÇ~ã9$G¿Î³fKêQáù]~Ö`ÛyùðÊÆ|¬UêƤDSG**wsGf©ñï¦{C:U-®pZQN1Çê7çeB#/M ¢ysgê7k¦©Ö$[ü-æIKç8öÿÙìffyo/2ãÕq«NTK"-Þg<ñ.Õá92Â×k¦äÛ§gÉZ»Ç2¢¿]=%à/O«2¾*û÷Çn?5]ò²È½Ð*K7nkÎÍÜ®±¥Ê/èüa´AÎoÃ϶±õ"W¤¾mÓ:[Ó?_kÕõ¹XõìYEuÜô¼Õï'Ux6þ>¾xç¥öPµ:çùoÒ¥g{ðù»Îr=ûãNÏáÚræL¶#}ÜÑÒ#.]®»ê·ÁÍssánB¡ ¾%áUsx¹ée®&ìy»¢ªåîéå}K Æ¿Ö·¦cªÞ¬öÅñ»^»¥VáËm.)Üd-T¾T¸FßLañÓ|Öyn5xóùûN¹Éï]Üìäûÿ]1Å¿ÓÎ1'g 8<\λfÖ>Owgðkçç¿Íay`~:{ÅspÞHi#/3º7E¿ËÃóY4-jcʳïÖ÷íÄËI]ü5-¼:ó|ôùc}½£ëçá,>ì¼ùò¹ózx
D:hv]ËÉæ¥Éü áw?ZQ¸W=:ôyj=}Î;ïÝõzÖ}÷R5þg¶HI4·¯]W¯m¢î³M欫¯9½8Lé¥×J¢<±¬Ðþű2dsgn[n1*é*ÝÈs§¦Ü¬wéÔ}¸èɤԯD_[Aå·3ïç83=Üüã·§Ö³¸Îwt\¯[p£¯
G*n§ó¯Uz* p ñ«hhÕjÆ5jÎ-×˯#/±^Ô¤<¯£(_t
ç¯E£äÐ\o9Ád|öNº§ÏM
t«K|'#/k¥ëvÛícõ·O tñ?Á·§¢äܪ"WÖg\¦ÕµÕ@pÅWµehÀZ¼b»´td<êeO>#/}þgJÖµ³ØQß×[4G¯}Ã#/$dËôüt¡´Ùà1HRc¤"Õ.iÞÅE¢¾dmº**
$x>|r²ªø]ogàµ#.Áôxõý#.o¿ß}w¯¢®yè¡ä-ÊO#Â5ôD-X|Ua-IêTÑÐiÂz²"Ý*å<Û¥×U³w]d¬Z']#.+,4çÂêêÉèúÏÌ>?wNþaNüùzFëÞ¤Ë$®×ƸÊÇ_èÇmÎÙÓ{û1ÒC°ºg]=²OáFºÃ?Î|TßÉEwÌt£,ªúPªz£ XXÁ;»â,ºj1TRÜúêëdÉÝ`HªæØõg¾3X£ÿGÖwÉÞ*ä¶ÃªÆ\½Ý©é úô¢y{I lt/Ê7ßeãçøâõòÆ»È\¹¯ÎI;Ïr¾[wäÎ÷)JVmÛwÖwMÙÍeÙ1Zí»ßÝÉÓY;ñÖ'TücO§CÖ» Ë|øû¿f£]ú3É]ЩrâÅÇÏÆ!N3íÃÅ^%8PáS#.fIy×ipZ»ÄëXcöæýþ2Óï[ƬèõdÖõijË2â³#.eÑ®<=|!ø×z}Çx³9;u®î_áuÛ³Ôû-Á×À}9m!eåãëYCû½#. [D|Üß%+^ºÁTú¼ÇX¬K»S¦KúºlfSBáT¢ìó7H<±ÊÝKÊí~H¬lýº\ú~QÎ:EF
¼?Íþ#/1yGØMûÙ&ÆÝÐDLõ,SD\@s=¹ñèÜ©l<Ô)&¸qå~ép<eù±ÛÝúü<5õÞâ[[î*®Zºï¬å¢ÚQÇ´±¸ÏO¥XÖx-õ¬§?ON;'渲É[&Åaë«tUejþ3¸¬ö¡Ñãnõz`º§}ô«-5=U«T¿ns²Ôü÷êïíCÖ>Kõ&Åå×(ý÷ßÞÜa_OO|íVîâÝ\¯bËEWó¤]^ç6Úúòvx¾ù;Lp¹7qF
γ²Þ¢L@©ú¼_mtn(ùjv<s,%¢çUtâR¯ vºf¨³ÑÌûeÑã:KFìqåöB¦ÏÊ|Zö +zbw4ò\ek»ÒC*ëUùz§Ï±é÷s-ºÏɳ×ëyjö+ËËÕ@âG¢ÈÝg(ÊJ:3Pîä ©Sõʼ;5]3~¯ÓêûóÎê|¶Ó+ìÙþPÓÝva"Htæ5ú¬f0'æÄCOuÊÕj#/¤¼°Eo7ß+®îì)gIJøÁ§]tÄTþÙ¹?WhÉ÷ü{¾&s°ÉiÊÙÊãK¸ÔÍ5ª{ËMvvßWÑómÖÏ6W»~ÍP÷ôÅ/kNªC'B4h£µÅþzñ¶³{åËâ'Éßîèùx¸+n7溸®i=YNùµx½S&#jæSÎ,nZõãU*µE2uv¥²odÝ[óÄWu|ñ=çé¯U2îº~®Þ¢RçnÎ/}xø_ß[{z=G¯Âtuq|×nº¨ë½Ë;ü0åó\Ñ&sÍßSÍ¿éGN»õ~ã2I±ñÏYªÉÞ·í[%}ÔyÖûâjeT5è!ɽü°¿9ü>Øú¤·¼ÀO®äúPøvô:Ïõ¼·¨TXÙVHBJ!Ú%a#.ÀÞRíAZÞ´×äzãø-,MA2IÖüÏ47 ìlFÛ¢þgÄyf?@eðf}s^.ÝÉê»C-)\W$kl,ÔíÙo[<+<,#/i»¥ï¦5Ëgξ%uFº¯ÝKyUäÈc{ïÇ="òWE´Ëyo§¾¾þ¯~k<>=2täð{oÓëÑ,FC ËߦTÔi,CUÑ_#.Ô«ñÖ|e¿N^¨½¯A5¨k¤ÉÅ4fÚòvm´f4:êîÒ±=Ö½u¬÷HÎO»½oÑ`Åô¶:ébé×tQÇ2ðùOýNìVtÖs:Mè÷>WR«ÓOeA¢Ø'Zí]ßíu¯Q¢JQ».§´bD¤Ô5Tª¬ù>~n`|æsK¥ÖåѬ¼¦|'Fæ¹NµkÜBí¾=Õ>©§NQj+Ã=$ C KúHY:(ðÕ=ëÅ~'Ç^3¾õJsÖè[Áñ$uéüÑéð}S6<òj8>
'
ùçÈUÑEDYµKuN¼}0óov÷SáØVú%Cr<jye©lìZ0¾h´$Õwõöíåëu(KÑs¡Ü:ÜmÈç"ñOzï#.1¦ ùh÷>Ô?¯ñĸ³p^"1Ë®³zû¤rãÉÔõekà]tfм«K Î&a:11ÙkµÂ5k¾%§BO½r©íÙSѵ§4úJ@䧤J:«EÏö@âêð@±¾Ú}®ÑëѲÕïÄÚíOÚKÚNjýk+ë}i¦YÜKKrÓSٷľº2±a¯à±È¥NqqËÓ K¦étãvzº4'to´ÌÉÇ~µñVÖ|¨ Ll|âDf%Ϋ~`÷nëï_BùÏÝN#*9z\$^IÂßC)
Ôô¹uò¬¬nÔ["â´Ììó=þyZivd$ørÇÇå7¤«ÍÒ0ó#/Ç-¢tÝô¢éôfæ lÄÌ/6
@ÙõNRï]!ÓBö½ÁÎxM¨Î´k¶þéÎïׯDþOé±¼&<¢Ëýs¹:lR#)¼¨±ÝïÚomŨ·tSõ"¢àunì).$ô^}ý4Oë-ÒUwÖRì/VL]ßYÓ7tÃ?n¿nvÌPÇC²c%SmøMÃ&¥£kí¹ËÖåXÉ!)$ÏmõgYwÃÓÐ.¼·êQÅùèQZYpíþîoìÄ>ã>Ìn.²ëzÓ5zqLñ£~ÜuV 6ü<±Î^ÏÚG.þ£¨BWTÏ;ð´øµÓº·]VaìwbÕÊ\}9PÖßYÇ
<¾åò0×fsHR/]üÿD²cØñ:ªúÑK|*ÐXlò©8´U§L¾ÚNÛ¬ó»ÕÞÙµ±Ádî`'{ ¤°ßxTz¼'yÎMÈEêSØ bîp¤ÉÈâ°*zî§ðÅö«ý<¨:yïüM¿:q²¶·Ü\Òf¹¥
âW®ÑU8Rw¾¼ñ©®Û¶µmØbJ½öHº§d.9¹¡IÇAkéÔõÄæ´'=¾·ô?F×{û9Þk±4Á2ý1ø}WÝäó4ñ®{g5Ï·vÔÌ&úÞ´~ÓóeøEáÌÑ:Fõy>+~êËmµÛ#1t<Úß#.W*T!¦12=Øþh¼ó[ÔU$ 5ºùÈu/Ïý'H3!hH ?*é#/&jF0À¬ë¬9Ù@Àâ5¸R Xþng3@§"i#/:fõíÉß©ÂOÚôØûΦ ub ÈRTÃIQûåÊ÷ÔfÝü¢5¥qñ|üFñáÎh-¦Êê³*4¦¨R
ð&Ú
KªAûÄÙ³öÎg÷`¦_Üô´ýA1f>ï=&Tí©
Uþ'6¸Æî5Aö?ª<é"¬àÒ*\®GøOMp\
æOõ³74_¦®_hªîNêúErdù=D®Ô>½ÍÙ»¤¿«æøï·ÈÖ>T|ãåøC_'Ýåæ,Àù
®vûXe÷á#.ö¼yZëY¥·'«Eභþ¶«sèßYÑÙTlaO9U>Y½µÏðîàÇ¿°ÏÀ1pq ´A6BESéx>[ñîgcH'êýþüUÒbï"mYánñԤ!;M#/? @ôfÈ<£½uôàsmkÚóp@îñÞsV_Kýýÿ'LRIâìFùW#.ÆþægÓª~¾5Ik¨qF×KSqñº¢ekOÊjªêøH+@<a9Ù¢ }Û¹¦4 h(=Ò9@üçÈ0þhù@òöBykíÒ=ñç9ÉúvòÅCÙæÅâtpxFqyå!û¡ª7¼D·ÑYvÎnAu#)Õ@lbÍE°èjCø D¼zú:aäFÉ0ø@{î¼0Gù¤8Cùõúl¦µôªfd 9×ü{#.¬T2ª³à÷ÙVçåFoªhxTÈïBÒé礰ÀDS{|û®ÁíóðÛ¦úkµÁa#.J*#4«àWµ¤µOJ7ÀW^úâ£7eòÞä5ýºváðcÒ<¸Xhla'ï#îàvxYAu+ÄqþêÍÉAîU³
«§îÛÓ±´ÛLX#)°Â
/#/:Pp[å3õÕ1ß4l!¬¹;¯ïBöª@ÈúXy8ú9º¢û*0,yÍå9¤Ù4AÏ6}à´wF:4&û¯u;ÿá×Ë|lñwúHÃЩJB
£©^yÚ2Ì"J=£æÞ§lÜõ7Þ¦@g_`ÛN¦M^ß½°ãK¶üGÕ cçÂ-7ÄS^Ú£T21!±KS°ÜÃwO%2Ò&NY!5MPRùQØ9Ú+¯L°è?
rЧ£}ò³hÖmÉFuÊ«Kê÷VýÔ¯føîpxÐÑ47ÁMíA7}#UTE*Äá)G7#/¯°õñwA1ºnl1t°LØÉ~~×ü¥åuJ¦®\¹»ññ±°Îy×Ï#.¼ªÏâètþ#/ѳ=¤Á$,PÚVAÆÐWÒ8ÈyÌDù#¹ëïï3í-Ðß!ðïe~tÒ1ËGm÷~þwÙð½»òIË?C¾Ï-#.Õ#/,4¤Y9&.Î8¾Å ìÆó%0zòÆLzö6¢zúüÐ`»>J'rJÇÃ<¹*Àõ}h4Ìy]\ùÍ2eµÁ«ÖùV ¥¬xÖ!µ8ó.:éÃ]H4¸ÏêgU¦Ý']õy7Uv:V`ó¾í5gQÏÓ¹0}9kÈM:ÎÓÛN#)Õs¢WÂMlur×¢·Ç})m»}n_9·A5¦ C×uóiCt¶l¨Ñ3©kõe˨ÌiÈÅ®ü¹¹<â,ì¶XGqVÂLLĦí2zgB߸ªøfm5Øe"(Ó$êsîÆÃ*8Åwn¶Ý#)Æ{þßMå7)ã]Ý«KÜRµø¸ÙU}Ô'L(ý×ÇnÖmhÎgô.tõpWFd*{34ìƺ°Ê¢VO*ô0§ö¬ãJ0êm 2Ùb2M##.³Õݺ»ÕCð>¬fA¥îÆm:8'¼ålLb¿Q;v;±ø»9O¹ûÙ}¢(Oª¬9ÁÕåüÈ`8C%·Ü6@øг-d©Xjµø;åVD§¦Í5¶uêãÃà³À×BäÓjcN¼*#.rÐD¥« es1CÌ&bhضʹo¦Äh¤Çç×~\(v[y°ÎÕ®f`óÏwuÖLCµfRÆeÚ `ûËBÖåË´'gů¨ÌÁ,]õ±¡WQp#/ëo%*7ð¦ÉÀ#.ù(¡4ñ"r1ÙËMx§È}ÊBLU
ÆtXa'9ÀAP¥Õð¬¿]=xâC³M¡Ûs£0#)ÂÈËwiÞ^$chB¹kÃf¨Àn±ªÍ½Ze«Nô¹ÚÄNò0ʼ¸BPÒªËP])ÒP·Ý¥Áµ7×ÚÄbùdIi5:¹K¼£¦!úkÒƱdïvýJ1A¨¬òFpMmsº|¹ø¢$3$9AÄ9$Ìyº¡XÝÆÄæáãi¬køl<ÑÑ~S$p5½ÔýaäðuìtÄ#/¾k2ùõ=Sa{ùÆ0Í7Ýã{ãßÀuCÞé×Ô?'تNÃƨ¿8ðTråRlpêaÇî×LàºlÜÉ{{a·ÒzØA漧r¯3;ø®Ý©6#/¦]\Ñð1mGe5µ ¿$ɲ篾,Ý[ñ±½!Û*®¨9l¥f*¼5ëËÏÝi-Zíh³$6à¹Nfú³ÀØt°-×Ü[Á¢§«`RQE«Pðf§^4¹éüì°â R_q®~b¼%°¿:õÙZ(øÙ±t´·ÆÕÒÖ³uãÌUn¢ÅÝ^1× ZÍ-A¿N55ô»L4ì8Ùä°f]ô:Jzkkv8[o®Æ.%B÷Ö#ªkT¢¥°¦Ó~¿Ó¤5g^[ó8:lʸtØõrdwf9ÊÝëF#/Û¤NHz.Õ$ª45p*¾öÝ#.]òVÚÚÕùZbogø&t^²<ý|xÇ#.¯íSJôeE1JI.9®lp#.Ði,2C¿ìûûQ¤4;§F´|àÅuíVþ'y½8¬è1Oø{"DÏËÛo[ûp-`{:*÷:@ïe·£3-'·&ýH9&ëã}\¨!QR'Ñ|?wþ\Px!ýÇß÷µ9cS{½^Éã}4v¬:«¯¹SoÒàÅÓ¢`xíSvÞ®íÍÐøý÷È~«a&ÀÕbv©còÉ|]ðÃCtÌOÌZìNµÔ~=~é¬gf³BsùïcùWÈd
ý¾òÏkîJ!îî¿1ÇeÌôáXLU!.î(×52ïgj¢lÇAÓ¢*T"jx#."V5ùY/CyË]ÆWÔÚÄÄÁL.è×#.PÜt!÷Të5ʤ³výÇá"¦üè7881`sóq¬¬éóòSﶲ£)É÷¦Æz?=µÍ*¾Ho8 ¡æÄûþTyh7i¦ÐqÌ9ÈgûÏ.E9½&Óêvɲ=*ö.Ä94Ëhßúª$Ä&b¼4|ILúq=³f
ù¿x\êòûc½>bG³ô'Ô!6#)¡9º}Hi±#.ûöÙj#|@Ýö#)Å:Ô¥YÑ#2¬BiþX9|l]baÁ!@òÛä±¥ÈÒ(Xatª P¬\öî%ÁÆvØBº#.qÙ±;*¢9.È V$VO¼ó·Ê¯×÷fûº6üXâËÜìeÎìÚÐ}9CBO R\µ¼¦ù×S/@Zs5ZKê{×Baa2y&!g£ ØêÁ¡ù¿¦·7'õ0ìùhðzGeãèqN°ÒyÝKRlr-<+ÄLÎj¦WPÊ£Êcj£*ß0(ÿ¶x¬êù,êWôÜG[²¤6¾HÀâèË9T3¡´6{\=9rÛ%ìvb²×ÞdÞS`Ä*E)3DÖ±ÕÕm#.Þý/#/Q&¢3+U£m+=3*Ö/V¼3»ÂoÈ;¤tð7ay¼ð«`l
uÎ#/8!sE;M13¡ÑX.6N¬Ì#."åËÞ
ÕCvNá©e
'û.é~57¢tÃ/?¤<èq#»[ܵör±$[»±q`_`ûÚyûN½O÷(_qÞóV{Ü'Fqn¦ák>®) FDûëÉ0^Ú¹kÞê]84l±aQY`I$ðµÀ;FûØ0YEJF()ET,ìÛËY9Ì3k5wær·±è§_Làv¯>NÚWn/d´Ä.ÛL
©¨ç8æ;DÜ ÔìÓJ+Ug#¤«h#.¢s=*B@´;ù)xrBàn©èûØÌ8Á[iÂjÝÃmÇ ^1#.:äP÷¾v:ñÀúm5@æÅ"àÞVal:Æ ×U#.akk´3tè7ìh§sÂHZÉÓ3ï°tBRÚ·è&}ö: ÁBb¨2a1Ö1ÐÁTv *LÅí+s¾ùZ"Uû¬ÎxËðÍyÝ&Ôw{8JóÖx4·y8ÍæÀ>¢8r0P#/(KËTrbU(¤P] L$aKYlbHB¯Ö·1¶Èe°">úæ&$ÑáORw°¦`ºÕ
ïÒòA#.hæòaàóÓ· te*6åjik37yyB:0XÔõw¦L÷³å±9«.©ùéÆ>ý9[Äü\×£ÓØmâü½¹G¡-PÒPL@4«rzIqð/;ä¦)c¾\ÃHqÁ¤ß GÏ¢AWÀÈ¥H,]CpÅ¢&6<Ê°a¦ I5HÅ[öD ÖYäÏSwÈçIB:ÏÐmÆ-0ýxt#©#)àM´`9#/å@
,BR*rAÿ `N(ç¯_QÐVØ»¡¹gid2AªØ!I3¸ùÛ{Òbl=#AD¡Û±'vµ×9¤£2§0å{àë¯
ü¦*ëÅ!ÙJ²
´#.0 צa!¨·=`b«ÕîMÛ°Ûp×xC¯CU¿ÒU=aä%@ @ØfPÃÝïñÛï¿£ÇÀ9*V<ÎÙ~²ðO¿¨k³0¨ºqãZdÀR|£"`ßÎ\yì½&àÄ31 °Õ¦½Ó ³2·3¹è^H¢`Ìf tsf0j,ç/½X¯.äQ÷ÙS(zó'wFP5æ]²õl®[²á=ws¤ÛBZRc)R], ^³cÈ xøæmRÂ
LÐã&mÂY¸aËkXxø¥q#½:64Ï-¬åhG êTÃ_J#)¡$øÑÁ)=|wâ;¬Ð÷z:|gVüÎÎ0îã:q}WØÛtèoíi5È@ÞKê-í±òHª]ä{bÃGÇå HIuÃQ¸ãê³+Ñ£ó4Û#.ÍÏÓ¥´¦Âδ +ºCÒÑåèÛsÑ5v=ú [¦aRÓÝ.À©½0ß?ËÁ¿¤qÆÝ8öæûCþNâ¡Oy¼Ü¶¨è«×)×åÌÝÀ$Ì6A§,C~#/±\@@ìÏBþ·8ËöTçvÄi¥®áó>{xÑ]FÊH·MôyÑ"¯:¸¢#Hï¾¼ç&Ø¢Ü\êÙÅÇÉÓ³ÓF%@$àþÔI¯
@R" N{ü1!Î¥Ê8A:9+b¨è"ν½¼sæ#)«1$«R
!f&¼¤2D´=¡%7y,GµÚCäÉæMP³öÐçvÈ*óúa{¹·¾XìS§p>=Õ¸øfÃ<¤><)Ú$I
P¢aÝ6ðq i¡&BÍÀp}|ô^½½øK)[S£yûþ¸÷UXÉòû¡,Öÿ>:ÎïwçQsâ"ÇZÖ.ó|ôö¾¾
¶Ù;j¨¯q½Jé ¨m»¤I1{«ªÒp8à©ðBÁª¡(Ø%¶w+Ø«îõKf»(á&wÜ)A6¾WgÐïÉ3´Ô¸§âHJÄì¿"zúÔcæ'Kðõòå³ùmïmÄßå6LcÉÌÊÍ>(Õb1]JÒ¨7M!²m~Ñvpøo44qãCM6åKvñ/w±VÆ3Åü<~økj;à8¡¯-ol Ïr_Î`þEâ«ÜSCt4>?P=IÈ_FM!5HªÈÌvéZ&)lÊ«K©Ç]!ç2lE0íÝF0qäæ>µÓv}mgnÚèûÛlxk#.*Ìuðàaï±ïJJb--,àZÌøý°4ºm3³1Ò¼&íØty5·O9´[Âײ°·iÀ¼Ø©ðL̲:ñ%$Äf³yø:Ø!C;5ñ*%§#.»ãvóɦ©ëbÐcpm-ç<s àìb5&ÞªCÁó"hɲsÜÐDwçb0û4óc0e!pÚn)°ClC!½×uß%¼ZE4±hô×U%Jf]^øm_;/Oä.»L¨Ø7q¢ìhÓX¸Ü7¶æ$üâG«Ël:R^ûgC¿úæÓEEèÃíÌÖ
Ø`ÆcÞkÐ@ÜæªüûFMdaáܺpgGó/3`T ùúô*@ºú{QÉ¥
Û!øM.Qy3ÙÏ=c¢Wç~ʦÞYµ¨LlLnÂL,S}Ö]¶û®c5Öö#)@Àáö·#)Å5}]4~;·àû ýr4lx§ ìHJ#.¢ÄQcïíÓØ$Ð&ý?)`ZQÅoÅ¢gÙ£O¡*ÈÞìÜè*LÄÏkßÚª¨wñáé\y9Ð~H ûtȺ#˼ôÇÝååå¥ÔÍPÂñ_)äÅÐ>ÐdÏR6ïcßnÛ[ÒY½ÿzS±û3ôb©½ðuÑóí#)b@ºÓA<8«w«@S#)b±5hö¿·ìÝ!×gÔ§*¤Wù? zGÈR©Vûc´oÓèòêÂ,®°ÐÚÓh½}](lQò_ö°èk2pÆÖIk¿ãL¬òÞ_w»¬kùý¼\éÚf,¹óL4¯ò_>í8k"Ýr0ͽö(f½ò_ùþ¿Ûùÿb_ÎSJÿH§BP
#/ÈgW;'dk¡}òü×WuÕE'ùålºÆ|ÚMAý3$Ã0ßíU M¼þ(l6ù×#)áí~þ·úK`%NØîp¥ÜuvèlOù
úÿ#/ÇaYNgbgÌèýïÃKìä¢ñAü?'±÷ù:AÌ!3sõwsîðëãYÉMxÍ"ÁHcvngôIÙ&B?ïÆFA1%ddP§FS?¿%6¥HWó{ãýw~´Ú$ǬLÍïjßñ»ßL¾8dÏÓ³qØY¢WÙ02>wn¸µÞ6º£GäµNy[q]ÙeZO»ZÊk1f¶£~uÜÛÇØîõµÌd9ÒvèÇF»ú«ú§Þ¬êzåC°ð6Ûåò°qþ8y-²3¦éÐùV-±×¿VÏ&AÙ30GÃÕbFÂ-wEsùO
X¹Ûìu¾$!ãÓi¶º}Á»àã Ðrwr6L¦<ØvìOÌbaëXbUkÅÑóøôû3'úÊëøqÀtäÄ6Æ`°V@aÆÛS#.ÃêOôêèç·ÎVòµ&§2(ùýªËiØ<[C½1ÅK?7óÐK¿ý?¶>0u\|1?¦xmÍÓHlöyïí¿"Ø¾Ì µ¡Ë]ìUƾÈ+¼ªWëñð/? ºÿO?÷VºNmÚâÌÅcês®ÛÜÝüýüǤØo#/ëñ¬½R444XLúD%k0Éu¦Â1<0Äqk0ÏfsÁyÂÏÝøêx@;ï8ÇìÿAJ#.q+61 'SÒ^ßc3#)½oj½ÞÅúdNrtL{XoÄ).Ý@v#.åê¦.ݯÔB*3î'T°µíó~¸|RòyFØ3½>f¬ý\ÚÃC5>vCk`xSǹáww'¨ï
JUW#.}=:¸¾VK©Þzõ¬?·ø[]øÓ5ß³[úXJéÍÆ äøTsS½ô;º?^ÙK÷í)ñÊ*~ü-ôOÎð¢ë|§~,>DZNA43Ì9Û÷ûüÌ?Ïk#.çÒû=|ìcgA\_T©7¨ê¤qÎz%Õe´¥W"C1ü*{*Vz«¤·üzÉg»Õ³Ýë=^¹úu+à粯aôéú¹·"x¸Ì$ï®oGìÕ9Fɪëvv©#.¿{gGî\×ÌÉ.rX¿
ÿãçèÝYÐ^ç³WnRLS¯?'FOK!oÕ&>h:ï`l?÷¿xÉ- ËÌ¿?àåÞaIM;Ó#/È"HW}]uâu>¾[4êð׬+ÊdÈ\Ã7Á®Û,1×®{M¤°(«ù¸
á$ߣ³·Ñ7çÉ3¼_¯=2ìå_u`à}+5Ád§1ä¤C6ªIQÞëªú«ß0æý÷?~L¼>¢+7¿·÷ÌÄô À8¢4®uÝ)D¿Kòa^ÿ«ç l\!#·=½ÄÛ³¶-÷O2¨èÄçÜ]-Þ«®¿ä#)¤oÎL1NêEÒéN rc{|bVãÓñsRÇ"½T¼`Õò0þÑ~¼0¿}è¿f½g©öün1/R=þ\oá¨@oqÓ¬Ï.L+õúÃ/_UÆø_4°¥ØaN áâ1wâ`ËK_Ëä¼çXzïúØÁúuóõÛÞÌ̤ãu\¼7í7MÏB¾¯Õ~¼.÷#Ù§@ÅÌ$Û¾(Ç$y4§Óý7¸èÙ§e¼¸qãX1Jåöf6&ºÍ?3oÚ3KÓ®¬å£Zh&#/ãbý´üc³û¾_Ûüwɽ3Ô ÆïÍ*Ð(㩾8¾*díÕø<kÊËyx×M5üHµSAö+XÍÞ+ÌqTRÑદtéIß%=/úäÒêUQä°NεKþ4¸ËÜÿgI¾M¸ëN#[²&æ?·y òg5/¯8Â<µHþÉéßõ§J³ê,å·gd!gß.(tǶço?]nÉßhU¸åùÂb§0öðÞz=/\×¹1Kû_×êÓzü²ÐÌíâ©R Ez?½ºBH÷âå¿Tt(ZÂ_ëÓUaiåðAèS9§£ÅùC¡¦>ò·s_7í@â:ôY#$<ÕÞggÉÕR/&¶ãüWØÉ÷ãP}Ê«iµ-R'M°Ú,Rîÿ2æ«ÓYû1->}TÂÜqKËÞÉQ{,ðæ%ÂfÊ%LÁéûÝ&á±+9¤~[>
+_óO¿¢Æ3VÚ4?Âÿr:Äryázµí,þèfzuîºLzà}Û>í OdëñD-Üt¾.§½eG<qÄpù:¾¼øé%´hæ)VTæ÷R8[¦3Ã#/rrÍøÄ& ®¸ê=º;¢Sºéõ÷æè*Ý%ùÃÃ?~㼯#¸çgK®n}pW̬ù\ÁäºÎïW1EKyÝ%;òBë×YívN£A
OØ\Èêxñí¡|Áw-EDWN"P[@ÉtwbÏ_<yYie>;LHHB¹vøöñUì/)Ne`´·TFÙÂÒÃnXV[Æ#שàÜÛDc<VýM5)íñèÎ0Ý#)¼®xèz5Cê_·SËá?[J£'NÓ¡0ãZc»<ÛüÙ¬øwáÂRBþ0SQÿSåqW©¾tº÷;µIÛëã+ÈÕOgêöÎZyzüØ^-ûæsˤëë¿aøËOÄôð4^·ÆdnzN~Ëçê§NLT÷Û]ýªq,»ÏDU"ÄÍ=~ÏG¼uyÀ÷¶Ã¿ÅñåGã¼YìF2î¦IqDçɧØÞó°' £ß÷¦>èJ=4uu¤8
rÅr®Í;[Ì ðç÷slÃÛÊѮڢtøÿ$?!çÎsNï»Ìy3ÊÒúö0N·¬'ïæ^RX^¦Ùý8¨1Ñ?EÉûzÃdüpý#.T_OÒ·.L¦u»Î®+ Ù4¹RGÇ£ím3²?ÜGϧÃ@Òâ¥Çú®¿3Ó;öGvËüÑ#/@Öð }9Ö¶/S×zÜ
»éøYf9#qÍ«¹ÑiUJ DÉht¶þX¸¸<ÊééT¾|Îú\kÕÝñõÍÔ¶ß:Ì9àôòkâ|ß+éno¥qº¦ùaüaòØÇm4õ/d"U#TãBvM±=5kh?µàGjÚÆ ð$í6¨hÝ«(Rì5êE»æô`Va~(iñàõ* m¨ïªPö¾)Óa]$QY3}*mN§E¼NЩ®¿TBá!èH(m:úü¿¸Æ·
.ÚA¶Ò³5ígO®1ç®ajQåµÜíý\ÃÔ`¾Wºû¸fùkp'¹ÜÜ¥ Ëç]".Tý.¦$[#fÿB,ÑÓ±3Ö¸kÝpÚNÁöò¬d¢Xwó<õ«iÓ% ãçùláôã¿$z9À»=Gú?Z#.ò½íÁàr¿·ß#/Ì ¶~w #bµ]WD¥´v¡óëTÇKµÇ6wi÷0jȳ»ãl÷\/®¡ÇçñÅV4!F#.Åãz|ûøI·ã9§Ò"ÉTZ!ãP$Êt&®Îü`½eu»lcØLg9xÑ4'C£ò@Z=QÜÓV»öQ¿Ê·fRvÜyã\ÐR¡\gÓ2¡xåq/1d§'ØÅ\ªÈ©è»Ç£Uf7ZRv£¼isJÒîÃ&#/ÜxWJÌ=õâïÏßgÅêÉswwgwÖÂQÛYGÕ¡y2J1FfXI)Lè1¤`MÇÚ¹}åo«²®²pd½Ûûº·Yã¤#/Ð,ÇJÒçø1@4qÌ#/#.r#.j£;àZUÔìCùd^CÑ )Ø/oðJçü³§qW×ø×MÞ
ÆÁâkûúv äZQ)÷øü¦xF³=ty]`¨É2Ä"JÛʬ2vÃ;LÑk^_7{òÀ[30}Uh×ùOom_ÕK~ôô.W!Ó#)²»èé*{£»°È@ÀoýØH·óý?¨·qOI:üi:Î$?ãGþÍöÕ<Xó3TÏ PÇã Gv Ì¿o¼Bb;äÔÊrIûÐû¤TE?s$ 1æÇ<Áß)>®)*¤$̶°õ´A~TQ[åèzÛQ¬RòØH:Ë5¥C#)ÜSD¯Q[!KÉþÏgýæûu¡-7µrE>ù:µÒÜ5cêòÐú;FóFa´+¯´®VÐ2±Î¨Hv_8¢@@«Ë!Ë¥ÖWXtõúÏÕ]á§OÆCwg³D¦á¤ ?¨ny¡µËÎömlGæZ/ÖÁíöãsmôªÈù¾XàýtùûæØÌ*Gíå+Òv·Í)}_³EºNäÕõ#/5j<ôhü)ëEÓ¶vi×í7Õ[*Ap³ô±Ýó°ÏØE1¡ÂbbÈÓ+,bRF[NmîæüÊÒI©Ã#.#.ÿÙ濽ÉÛðú˺xy08DØûÇñj~4óå_Í¥)`d©9UYëÓþ'Éz¬¨5pû¥ØýõÉ(,I?z)óüô"KÈys<ÇÌøbW·ÂºÈhÞ©ô/kܹj1ÑI3})Uî^u{ ºunëd]¤³wÖ1lfdjDQ÷ļ÷~}·é¥;¥ñKNgnã#.Q¹Ø\_;'UMO@é´6>¯:Tn´VQØ·#±°1òùßù|.ôá;îlúÅѾbPwwáª)]^æ½8HTzzg>½u61T*#/§ ñ¨¬¥¥y¿ÄJ¥làHÆCÜ6¡ÓÌB T1XC²°,F(k?ãáÏ&~y*d<ËÆÌQëBk¼úXݬ1²·¯ØoáPëÉ.nâ{ÏÕ½®Á¤]۶ݼ²¾s5¶p±;Èg,]ã|¥~¿6E$#.3çxäáÉ>·ôéÃö£ðZë{n9°è¤Ofì`3¬ßuK¬`Ó/ÍÑ>[xHÞh½ ¡ÜüáÐZþpYòW4ÛJËå³2mtD¤¹ö\®áÊ3]:ÐõfEä#+M¿òeÝ>{<·ÃwnÈjOÚ[ǪÉØ|WGEüæó«AØÛ£äéÛÏ͸ÆÂYJ¦©²vXk®7\ûª åVÊôwY«Ëµæ$%ØËÜîsÍéü¸®¯ø3ÍÍjO]Hx2Ðòí«>뺥qª&ýVmú}ô¡9ÜeÆÓ½iézB^¾Nu.¬/8võGäüÎ^yJã Q?õ{=!íß½7Êv§OÕäýÒxÈ"¨&{zç:xè^«áαìYϼýN¹×ó]5Òï±eóûuX¼DM´5Òüq"WV2>Eýé¨5hy&.3-ÃÉSzgê,G®ÌêèßI:¶ûWjRx'<±Çó#ÓßsåUíÒE{óδ¬eQýü&éÂoèÑÊìàéÛÅ2G×:ÉíLÞHãçFiû5ZÞZgÑ®r#.h9{|Op±Ðk³[éÒji²W¡0uJÓ«MYí¤ùÝ÷D2`x+TÅcÅLü~û5íÚÛÆù\òêðG=ÙÄÊ&ç*Ü÷k¸×+bH¯*JÿØÑ[qNdÁeB¾¯Úæ3=}o\èaSìÌl¶ºVË+jÚªáUÂ_ºQÏ%SjwjÅ®Ó,3öî?ÊNÜ|WÝ<vÌ*}`ñYó·Æ¯3o£Ñu xÃ:tFª;Yü{0@Qå#wSºð÷,çô5T>Nß?DnÕç\n%éÜÛÎÔ´¦îÉ̯áFô¨0UrOÍ8ÒÉkQmÅÈÅéNýºb+¾XY</Õ#.{óÜòF·ªÜTFXU:ô#m`xpsÕ¾õlzmºèãÂ4þÞ§tGt´ZϺp£aùºEçMSN7]°3ÍúkKn=ä}fÍDJKºH르1xRmdÚÅ2Ñ_¿q¦*HâÔ)ªS]7ò~¿¤Ø¯ûOÔk½xöñ5@sW¤ñÜF*ã¿zýö5öÄm§ºÈ¤,¨]K¥éz#/ÜB@N>úpóIÄíÃúÙ©I¼ÓocPÏ#/KnÊÞ¸îq/t¾¿ÜV;Q³ÏmbqÎmN;$ÛQô`ø(s¹¹0F¡$ݬ)õÖz¶+µ3öHoõ§Û n3ø®5½£#ßÓÌÆUhÎÊÂÅ÷ÐQÀø½ggäúʵȾû·æÁTÉ1Ü ôâc¤Õ[ÖþJð7l§º³ÏËêÑjÖV]ÔÏ=0b*k5¨EÇÉì÷XZÅÉ[Í;7b+O/³4Ú5Ðäç%F²¦óhgöàã+uLY"ä¤ê4×жzOEÍíUJºàv>uwÁã§9&Ö)Îà åÎÄx;¤Sº;Í8èk#)°ò_PyõÙiæ¥ipm®ã Ý×IJae¤ðÕÒlL- #/ܲ§}½"ôÖDɵm¤åáÂï¦Xµ~7-·z{I³xw])¸b.y
M0«.º·½öð+ê7Ç}T£WFa©öRîV¶+µêÂ
¯>óñmM;´ÒÄ!»VîXíÏ;êèÙq¨s#.,iaûÿ½:ðûUL~}ÐS]ûVi*Ês»û)ÑÏt`ÖurÏG-jæ4Ù\m}Tý¸_©j&ÕÚÉs!3Ã"âÐFD& K¯!Wøm`á¥
«MxäYJNewøQW²ªBØ?g;°Ú§äEÛtt<wÞépgÑ>48\)6eªÂQ¡ýZMüW#.u6þ®ùJ½; %¸½©-ó5!õ&Lorv#/©&Éo2§X·E¶éÝÄ:gÌÔF>lª¸<[±ìcSuJR6ÉP¼Ç·8ËqGR¹@dNòÏÃÄüòÏßßpçQÍ Í7¬Èws*¾ÈÏ¡¥¾éÛ¨äqø_Úcê}ùÉÉìNTéo,»ANFðê¥$ª7DxµQPÐv©Jà¼ÀbTòªN¢îû6 én¾ÐÛ[üU:ð·£Ê»âº/ÒìïuäèlÇ2Ío¾.ª»¥"EThV!!àp£Ð#«uôÜ»iÈÑÙª~&³H95á®6×Ó"~AÕMÑײ±õ½BYáKÛÂèÞ<ägd¦òå2YãÐRÌaÝ]
:Ï5ïN¡j¼â4&µ6¢+5å*zl:õL»LîÑ]÷H0¼å}kñÓ¶óÏNîÇÖýPØxÆ+#.ÕÎF[AåEpô¬@ûØûqÈ/ÓË<^þmhh7Üë:0QzzyÉÝjNÙèuáì#)_ë»ñÇ(ýÖC®ÊwE¦û&9ôÁ\2¾ÏÒ=ç¿Ë«³C!ï ³]n´¥RcZå«ÛÜÇw^î.Æ_ï¬ÕB;â¢Sþaþû<ξ½Ã&öxqüÅæå_Þ=+È«UD®'~z/¡½iG¡ÃS³t&(Mø
µðÈÒº5åãG#7ÖäÉ£M$Û(_áu-Æ»\Ê%ª¥ÉCêÚäpÖÀ$ T}G5ÈM~)]Ö
à~;L#_»Uý²SðßMë;EùáåÙ-Ó¤Ñn#/1¸MiÙµṲ̀]çÝY#.ñq~X_v¡_»YçRùg#.ëªú1Äe}µ>Y8oÏgÜt9_FT·TôrÒLúìc©1sH²õ~/áÒRP;»Í;dÇg%+¿.7I]üoÌ]=ì þ± |õkÃSÙ£AV<4Ëþ1 ßÜ,ªÆ5qáNó}j»nM´eª×¦[1é6=0MRftYd
*bKôüÛ7~oä>?!ñýc:ØêÁ'ü$¬úDµÁßü^uãA÷#é ûnB½Ýrô³y:ìÉ9ç~è~æówdI©¬ÛJ0+ꢪ+=.)|}£N>pqaq¯[NpI~ìÏ)H\6ótÀ¥>8ê}o*×Åalô==ß¹û<Øxrý¯?¡OgñlmÜÖË"îx<ËFýFcêXãÓ0`VØ×\CHþ§kå¿ð}"ÅçTÿYa¼ÝR÷H`eÉØcc¸ÃÈpc)ÌÑç+¯ý¢]ïêÁá=Ù¿òwýjð_±ô#.ò³%Aa¯ª@éÃçôöñ$ü¯÷Ûa4#)ìæ¯Æê ëb¤;Rz
4Xiw,/ö¿Öjaä8ÿþsË~üw$Ò7Ø@ÅÈ¡þÈÃä#/5ÄÆ©©»`2%~®#)1`ÀÅLZ@2CÙÔñ#ÏW²Í©õ("`ÓiÚy0UîÅõ$÷{P³:É"bv`l þÏÐzGkæAô¾Ju{_ zÌ~/·âÁ~Gçy(#|:£§ø Öbf{ÎC`¹*h1ñÃÿX8*¼yg@ÓüÕÏ*|vÛ¤Dyüß»©äÓÞؾ#¸/ópôüiÌöÅå³pöwë*OK=ñÑV®ÿËOQ`ÄfVw§ÐÁ®
iúZ4ÇA#.k&æa®sHÂuxgï6aÖá¸æü\P¤)#/f©©ÔÍ£A_Ûýgñû¨sý*?<LëF¾WÙ)m;ök//Ùw°^IQ Çè?6áúͦ³0@aJ;YþýÅ;pwä^T('ýH(3¶@ÈÁØÿ#)ÏgØ`'>î¯&¸Ê-b2'vkC ¯`$?BÉHhiaÛ#/ûâO#.C<ªh®*Ç[¿ûÏ Òóyâ}aäMû±1áï©UZvTÂ"ød÷ Ä<@ð Ô7ÛC®1ÜѼÆgá-v±nñyÛ´ÃÉæ¯À褢j9#)s0$ ÈcXv®þñì}&À½´qL#.ÁÒAõ[®"L>!ã±Á<ÀéÄæ9ØÅØc)ÃÚa¶I::ë#/Ó+z'iøAúÈüþßfÙ°KùLËú¾^ͽÞÅ£'àdÚ«ÞdnË¢uñì2QæVì0RRHÔE¶Õþ¶oÈþÄ
KðâT1óÿ,.Éd¬Ò${ZBͱó7ÃÊåMx¤¥ýz®Yùμäk;¬tvb) C©%îàÚeLøÊÏûúñôVY}¬¢Óáiue²Âu§§.LÌC{WßäsÛÆçéòû@ùÙCGÜA±ÒWñ7Ø°nµÞ|çJÏmY²4½"*TnÓ¡:®ì"C
ÈLi§åß9 ¥ÅCÖÍøMìo#.!TQ#§OªãíwaÜI¬mm0ô!ÜáïΤL©ÂÖ¾ã·ÁâuÛ±v~ǵpN¸{qï0ÈCýÇÛâ êã;ÌÏ÷[#.æµ2\uÿ¤ªªz§t¡Oæü®æN6õtEg7né$°ïwË¿ÍìÔa°¾sÃ>ÌðM¦w6NÅ»K2mYºöð3âÅ;õÚxé×CTæQË@Õ'9Ï3RÆMBÈ s£cyü)×Mæ<IIOÖ|§¹*!IGùÌô÷@ Èýïø|üó>£Ë+'çQ'ÍþÆ\`T0¥ÑGÜnãû´P#.ÛÈr¦¾F÷Ýqã:¾bñ´"jîîÃòÙ}ZV¢ÏÜ´ éX²H=ßÍçû¿+újbæEdPjÐMü,í#.ë¹;çÈÄ?ÚxS~3þloRoPä7ã~#/¢àvB¦*ÀKÚOè4áÜ#ÕÖÒ#ÚöF}þçñ$8#aæÇäÎ?§ôÿ³Å¯Ð£»ØHIcBxúë;ûÜ<àw¡è<ÈèC°m°6=¼Ò¨nÎÎ`ý!SØ`9H§:wX>34#.TßêqÛ&3Â$åd ©S@"ùsSrñÎ'.æãäx>^³>Áâ]%ûÑîÞ¢b+«õùîwwq#/ÚÒän`lÚ#.ú8¶Ö¦oP=K2[àövÁ,Å2hB¡{¦&Ì}Ò6Æ,¦àÿ#.!ØB?§¯÷¡(û2ú8@»@W"MܲK4æü95i6uÍwÖs¼WZOzDz=Å®öÓq»ÖWFVì|R°cÓ&ââMqRñ2©eÔÐÏæÑrhm2ènØöfhåj)YD"¦+±à-8R|J7T\v¹Ê´e¤ØBj1±k6ÛPqñáö~$|ò6CH#)þè_Ïû@iÓDþÆvýl§»¸_§3·ÕÕcw[PÏò·×ÜýúY¤ÜϨØ×HOß8ðî¯ÖÈ*ª«t:HIrA6 I'g6ïîcÖÇw±'l²O0¨ý$|}¢×Ð^¢¢5ìêCã»?
þ??.9±ýÙàÚäÚE¯Z+WqåWÑü÷y8ÆpSÍû\qÄ]àõuwtà#.K¼)çÙô"&,Ç`æÌÚ(¸ÝEìÜN®¼²Ò¦.³%#5{on¢Ã¤LÂ1øeXoÔz§ÐtLblÇ@~qróCsP!°pù}þT̨D7Ü¿¹ÐÜÉ#JIC!¡ømÛá£Ãñ@}÷qÃÌÝíåèd×|U*ucùMÃÛv¸ÈB0ùrd_x|`!¬ÛÉ*\¸éôßqÿ&¦üç¨4%!û³ã¿¨Óõ2ùNEG\íËsÝ7)Åà!I$è
.H´#)}BÎ#.Ih~cºX}à×Ö7Þyô#.ÖÄ>A¤Ò$Ìq%¸KæIÜ°Cyö¼#.¥Ùª
Ù÷ÒTÐ6¾Ê#áô?,C·päÌÿà?ü}]ºø{¿.á20ËÊÝǤ#.ÆKí${5">'<sÀûzrÌH»ÓVï¡ÛÌy²©éTkZ ìoHiú°DpDØêø>có÷ê`éCtýMè'çKųÚ[¸g A£Æ°"aIeaý¾!AüooGÈë?Gr{ÓüLÎ5A¿gÔÞüâµê a®ý°GÌÁØ]w>3!´õ"zIt{#)î}Á·¸®C|Aʺ2Õ±óäÍ`Ï1s¤®íØÀT 4ñ\3¡'_¸Èè½-
ì¦ÍAh<©¢#/(b¨¡ä/NFBæ=²{_ÀÁ«ß£Î±<Ï»õò;ï#)8°gà>Í1#$>/|}?!à¡?¤Dµí=ÔÞTµ~Pp÷¤Èú=/é7ZUYßfi&;C|2o·g¥0Þ~G?U§©¬â½goP~cÄ_N´]#/9ü¾ÁvTO©C¿ú5Í[ðTäé#)1Ó÷ý#)ß óq#)nanrð¥¼gxòñõë}Ô.5õµ®É99gòtAmEèè©Ì#)põö`ÃXL3TþéÒyNÿÈ53ÞúìWùÔ}gj1ÑO×d$Ô#.¤!»]H¬j¨3;q«Èkø¿:Mõã$ÕXF%²Ân@¤é#"ô¯NcÁþkLÂÉÍq4©TN9ã#.QC +===ò fzAEQ1!®qãÊñ#&Ë9«#.gt æSÀ×¼9O7íèe `Näoá=7ÝÙû¼¤(Ï«¹ñ=,`ÂD¡ÀýiVÕ.ÕVU]ms]ÍÐèný/°ên@q*ÍFàlÍ3v*´#)õAéèdzö§yì`x£ÜN9z|í}mùêîÖΫå!#)òb3&¤¾k?²Oó0%Sþ[»O÷î]X©Æ, ÃÍ8Ù©LÑåy/WiOSPÏÌ8¬M0·^Íë¤ÞÕÏø7 ²Ã¼¨"Ã3éåâ³MÞDÇ?Ü1wk`ÍaÉ5ÝÉÀc´Äuõ_ä:Î¥O=EM#.DPâÙ+x§æcóîÁ:¶OAèÅ<ÇåÍ[H̬B4XXAÉ·FÉ:_í{n«ÞQù fâ4&sblÈ<ù#ÈõÈÍV3ëCM¹1úlÙÈ1äü#.f1AØrÙis¤8ãæPDfvèÂAA1 4&õ£a¦Ö,WZ´´|ÜF.=CúHcÐvqüqòÐlÀ/2Z8²éd+l±´ Jûäy¢D
GiBN!ÐA8ô?(À< ±D´æ¶'®öEbhj<¦ÿ¯T*c`tKv*âBõ1¥<1ÊCðøè§òùln\(*wä#)á&|ÿo£Y§§ãÅÑØ
=¡à¢&îÌãp¢©K¡z4d>Û8×LEdÊfc/yWÃ×k;µr׸ګÑ*fÕ62L¤i¤Øÿ#)æM¤:}]~ºåÉîß( #.H$Óê¬;Û°éô PdçÔÄÈCõh~c·¥±EZ VÙì=Õ³käÁô:¯CuÃ0¢R$#)ä±UO¶l#.$1½CsÉ"Õ3¹¤àm~ìF\ôÇU6Õ¤fÅd þT\^!à=c<];7£±þôaY¾Hn#/#.«Kk`¸Äjm#)E¤Üð#.´ÍWXûå¥Â{3i¸Ø:¡[$Øî½þ\ÂyùÙ@)\¯´Ö8FäòD¾Yµh£5TÕHBªÇìÿÚæql^ÙÌãuÃAöÎpÆÅÏõðiùú¾IVaèt#.A¡#.¦a$#$Z6ÙEîÏyïü Ðjo½F§O3!une0(ÆKÂ*QA¡ ÚºnP2'wé#.ƨ릡3¯÷Cµ'!L¤C¦ù"$?0(òÇoÏùIúv&"/SÓäçèL@dòãàpe²=aQ¿äþä¯Ë»ûbëÇaÅ=®îO§Pg}ÑÕ4öÚI"\LÉ9¶Ä}ÈRkÖ{ãð6ûBU0Oä`oßñÏèÈhÈ(Ø©ü?~vaÉþ#çÀ3:y]âUÅÞÈQ0ò;pëN@,Í8?àý<ß(o¨Ã?<=ííônkDa%Æ a#2JÅö²%jJÍÈiË¥P¿©ú¡-öÖðôAò=?xaì=cí=G#GÞx#/¸*bÂÒ'»ø°Ó´7v=õ61æâõ^Cû8;òÇgÚ'hB¾GbAú]ÍÀIGB¯¯óh6RMÄ«K#.Ï°È1¤:î¬mLͤ5íÁ(VéHP,!0ÕrC$p<x:,õÙRx`çaËÖ¥ ]x·¬ñºÄQV3&îlxyùtºÃ¿âè¥èÔï#/#/å$»òÐÆ#):dØöp>î[èP²ÉY#.ðrzÔÏjZ¤©GZV
úpï£#/b¼^¿;HÁ£ltwD³e¤Qøþxª¡w¶A! tE¦5s~xuNm£YÌ×úâ?½l²}pîÚÂ"ûçM\Ï CÊS¦©v¦Îk%eQðöîËóöÕèÑæ:/ ûz½Ù2A^-QÈ<#)úv[]z&áCÖ{_G{Ô«ð zßxóTÅ/סåSýÍt¥W= rÂÈ2°{Àì^_¿Ómwjâ><U(ôä¾k°â±Æ¢D¸³iÔC°Ã$ãâ}]@rlÆmÈ#.ÀùðÌ33@¤ªÉtÉaVd9OWC§lóÜñAhã°6 ù¦-)lÃ0c¶1ÍVÞ¾äN1Úy'÷¬_r³ñ#.ÌîûMLz5\»ðH/·c ¼>F=þ¡oêèåÂgòÖ3Q[À¥Ý¿Ô¨fzån,ÄWغ«?¶W òÕ#)ö~Ûèêò±³^Âzø&æV|ýSó©P÷ýúÜÁ¦¬g4_ìûò~Hï)Øç}&Í_¼U=rþk/8ê¥}åS¤ÇÄ-ÎÔ[³v@&)¨®Zô1קçS
®kªÈ¿¨Àïs@¸,cdÑ\T@BÓ§nt~Í°ÇÖ#.L#¨3.èb~é«=ÎãÈcHh<Ï E1?$ùÒ=Glþhd 3 Åõ#.#)ôP÷/ô?8ø\E¡´:}W°õÞ#/x?é¼²|záï&çdÓÙ=5ìØBC3þ~§¼ Ä¿åEo< }¾AQ!e·%Ðìç;&`N¤È{ h4Eø}_#ÙôÖ¶ØE¾¡¦&6ö¦([¼Õ·Ü½W³zúAWi;'p>j^rä!AæóaL7-íci«þTY8"éÏ97Û.ùÆWÕîàü=§üì§éÖS
sOçËMl p|0IÑË îWbV ¨!¢h=±{¨(òÅQñHæaÛ_oÖs âfê³U÷}p2¶nÐX8² D~DÐ@ôûPôDGÈüó¼Z#)]äBek6Þè#)Ä/<k¼9öô9Õìè=LgÃnÑèz¡:ØF×ýï>ÿôwEæUØ~4$êFvbí¬ÁMÓµ
dD÷ýîÍ Ï4Īðg4ÄoÀ¹[»þM«lOoþò#))0]5ß÷êC+Pf#.£NfEPïm8É'V&âÊÿ%&bEa Ö)eÔ3jÓ©ÝÝßp&c»æãæ&'ÔÐî®W[#ó©Áå[*¼jÈqd6'9yÚ_γ1óç$¿ Òc¿ÃõµE<*@±0~Àß>¯4ò~Ä8C'nóy÷вòE2=m½h8ÌmÙ÷[¡Ihy~M³ÔÃ#)_#~Ïeô?§Zû[«ü}QÙÌT¡÷ÏGÐ>%ËÛ£INØáääÀ>è1ÙÅìÖé³AähÅìö4ÃE"I¢ò0Òí¾ ôQþçþ8èè-bÍ^ÜÅ® 5`Öóßï÷ïpÈGï¥Ü5ð¶5Øò1>gÌRe¡0!#)Æqa°aèÖ·¾RNÛSjÐ{=õÉjiûÞëæïRgþñ@Uʺ?#/¯¢±ÚiþÇïíC§ôJa0!3£,¬&ab#.f´ Q@hÑdÞ)_é$7ØÃsLQ0àJjD^JĤh+1T¨Äi´PdAF1RÄ¢S4йô 5éÌ4ÿ±j3å#.Ü+ÿ¤$-ßzxÙº%)A~ø~nñÛvt
þ=ªJÐ1+~k;k#.0ÅÞÝÀ8$0Ü2I1â#.ïº(äZ9&¦Tê4ÄrqUDÁÂM|ä«(;7Æ;/¦ãGÐ8~6åä%-@Ó8¡Ð"ëúpúó7íýØþÅÈQ×æð¡ç&{§l%ÃL××ý<gI]ÿ-éF¿wèñtc;±°øЪ1QÁZoæ!(¦¢´%°4äÔìíì²vÉ[û?jBO\ÊÒLÎü9ÍT¡¨| ]!G"#)*¤vPüVN÷«4e*v±EÈåÚ¡¡ÄÎcÈÅGåÏ¥-+×óáBlEÐÊÒ©PÏßùú&¦ò~ï<òy÷o[D32øÊ:ørT2D°¾}tþd@.ARDsüûl,ZÌéñ7·ÏThdy¤9Xüü¥aG¡ìDù¸ ±¹Z3iÛ¾¿ò¹Â[nV¥ViÄPb4è²b¨ÐÚ0Çîv`â)Vr `÷lv¿¼túWHüC$ÝÓ _LteÃc¹% +Õ×I##mï#.^N#C«ïZAL]§\TòrøéôÉË*fÐ| ¤*é¤EêBÑ,¤7Bâ#é8ÁMoPüämÞ§BÆPl\`\·úÐÖ<Ö¼ ê&iZr úKÙNOðP¿Ó4×ôîÿ4sÞùrߦ!ß\#åöyd©ÚçÛ1ã8òE>fñ¾Æ|´ÃdkûN[×|Ù¶éÍ.¡2Ú#fwGËæ·Ë\ôKضA\ócSä¥ÿOð+h×êf!¦nÍñc«Õýjÿ_-î9>S6#RNç`²,6µÏÂY)jöK`Ãg,O(j+'BB£Í¬Ø&çmþÆ+áÍÖ¨[0ítn¸ïÚFZj?.&õgy±´2i«Ûîª)ѱ¶«m#.h,×8ª®±2+òL²~¨!9øÐË·úõ_ ÿo8Kâæ«£Lé¥û#)Eç9±[1¹ãÐØòÖ¼ÊôÊÃIïíð>Y#Í80Ü_Īk᤾QoÕnîR¢>{>¨Ã¦¼È,Ì·)}¥ù¼ðy?ëÇ`¬xéH5ÕY2¿Øé®ïI¢ÇÜíët¨ÔgRæºÏmÖ]¶×ÏçË]Ö$ªiJÓ`¹¹e*¢éÙ{_á/8k¶R´¶ÃeÙ ÊoÚ/Go3£öçZÊ5ÇLwƱçãwÇI2[i®»¸èâe¡¯;¯#.7£2õRÁ$ÆSÝæýÏ=N4köe´©fÝzÔ!A¢Ò ?%5Æû"I¥M¼Â2WcÓð§=5ZѪ¹lI«´Æ!6Jù6Äa1ÌÓäû£Vr%N/yyS^YÞîq/!0;dC»«æepÕt9s
RG1ëØÆÞyÈgX5<ÇûPÁë9<¿8¼§¯A$!LÓR¢¦hÐjRTÔ}÷KO4ãÓÇ7Uî®\b¦½K ®}ïÚ¡£ó¸Ï.KfáÃB³Fáæµ×wù8X5L§9ú?YèùÀ¿§å³ç¿J4"óO[È|%Ͻâ>ø¦ÐÝ5»ÕÓ;å\ô8Ù/¾î¼í¾ü$øÕf¸ZEç7¿'mͦîÇm6ôoôÅiõ;ãSùtr²îÇ#/ +ü½;Cë&³÷syºãÌ`X©UöcdÛó»Þo¨Õ~aÖ;Y)z\!%! ì\¬ÍÀ1ó»S_Õð°1ÛÇ4PøÖ'&RÄ?c&6®ä2Éé\ÒùW^¾Õ×^iÁ8²ië`h1lH(ñøQ}Ã?×Àÿù¯pûîûïºxÇ 9H¸Çºí¼ØÙ¨°èå<5»ôCúJÞ¦'ê¯k³0j:^@K£öAÖR²@ÍjÜ`ûÇ,béUOàïdÇf;ðÃ$YÑöÎ|Õ
-ÅúqéM¶ÒAãá!Þ_<YÞlÒ#{h9øL1<·è]¡l#©Q]+2FS'È1XMÇM9Ä3¥ËyQ¼Ï´ùèì
Ä dáɤÓFzÐ6,HÀG#ß@S °ì6tfJ©Öï§ù¨ ®#.b´)u-Bív4ò* ȹWPåÄ;H\qÕ9ÁÇÈù`ÃM#)ØÁb3 - áíe|ó~ntþFX²d4·ìüÍæý3-½7iÀÔ8r9KE²jó9ßoËÓ;DÇ7#/ îrtlÎÉK(gWÊôÄvvGá@ãF³ùoù/¦üE¼w0Ó_R¨ü&Kóõ9#«¦ýÑ]xµ ÊÁÙùv±/í¼ÿ«DÆu¡aÆå¿õã¢jYm?W³ì1²²´`ú¿³ë&¦ýýñ©AÀQD3¯ï³|Ïßø¾¯Õùi0ßAɺüj_1úÝâ¶ýÁ&bdÛñ AÃ^à+Zæ/LhE¸ Vj? ^6±(èzù?ÞÃg}Îã´Ä+&F"qòlÏÓi!²#.ö¬ÑÇk¨!àØ=eG]0`nÈh`ßnf¼yQõHx@ oÞ¬"ó8ض¦|É[Op0Ô#.áÔÅø^1ïÁþÓCP##.ŶhoÜtõâÔ£Ö*)dPVà! lYÐäwÿ¸lUUyÕ7$SÄ8aÌ^§<®@Àqíóö2,Í,^ÆgÚ}Zý°Ñí?HCBv`$KZ Úñ<¨ééh¦³Ú÷yâ°NÒGÛ»úÇËçßVñ
föE¶¾Ã>QNê5SfXñþ:?®;¤i0F#u²°ÃAR#)ÃÆ#.@ ZTÈrh ^É1ÙE3¶q2#)àúÓ#.Á§\ì.þis.¸âØaµ`5«±ë6Ìa%( ÐEñ]ín;6JMö£½¹¹õ+×;%Ç×ùçÓÃ\}Ûü^ÚÖ_/nooß:OݪÍuÎ_]l¼}·MJï3Øî¢hüçcz¶rW¤æc¨8dÍÒþiu±¸j£#.õ£RFádA ò¤f¿PÃJñùPIHÅU!#/êýeüVõ3YK¥úÌJ0`Neæa¡1>ï¼üíeTUYjÖyܳùa ªú·2£3HtQ¦Åߣ¾XïßD;Gúçgag uT%¬&¥¡}¿ÊÜ;-®§@éP6ÄLXtY ªöb¶Õ/^)#/y4>¾æB½68FÒr#.5¨4Îbq©%MÈaÿ~¸ÀYM²sx!QYÆ;wÖ&ǼL3{s#)"ÈI¢?q£ì8Ði¦#.?O¾I°÷ý{$qϯieìË()+Û«mðÏÀáq¶Ò+pA1h=¼ðH`x£»Mùg¦ðòè)ºÇþ¿Ñ&Is:ûXÎ?$ÝD0IüCÄ#.!Ì´É´±#^LÓV¥#.¯ÓÝî[6õìx<Ux#.*¡M#/±µ±qSndk1°@¤^[_#/Òwqù7IÛ%¯vPv>¨î²(ãÆtiM:t¯:3&7vÞ;V<$qÅàHñë\]G)ËgMÌÎDbuLßæ6á"ÜÑ)²½8غ±0u"q]Ë÷NàÝìÞC§b1BÓ5kmþÙæxÌľ밨} f£l`â!´j#)có¨·ww}¥Zð,qmf5b#/LÌÀµÈìËE[ø×}¸ã9;dÕCdÚª¨_.¼{¼9:né·Ó^÷7L4ÐijrW/OÔ6oÅÄìÎê{®R &TƹÍiÔÙPHÝ;åÄpM/£¾zè·#Ûíägóöz"T$5ÜíÐéÑPÓì§w+#½#/1hJ£h}û£Pà»És}r"lh@â
¡áÐÚùÈéÒæÔ!31¼´´0°Ô·èë¹s2P^m#.PÃ=¢ÃSF¤Ëz·¨sëÊIô&¸JâÆ9MøïtbP^#/¦$9^Ñâ1/غã»K2÷DÌ2ØóC j)®ÐÜ} t×Æ·ü`¸w¤S0
³ØçÁºm¹¢ÂÜcÂ2Û:KEJìF bhnÍê¼ùûS^ÓZv¼'/N8jöæ9ÂÅ9>ñòÛ}°ðò³mÅ%J#.¼ÜqóεªiSnS-.·HÙ KÄ=O³´dÔ¡Ô§óJÒ%è<¢âYÕêr^£#"0Új;8¯d{NæCðÏMZ=F¨ê4çlt'&¢Ê#/rù<mç+»Ëç>vòcv #bfF|ý¹©%#..f\y.ffeÌÌXÌÆècÌËà-Í>yµS=ÙÒ#/@ânú2ç!1¬X !ßT ^o#/ºdÑWÀïǨxS<äLr9Éåì?²âãßåÔ
½y×>{ä]:é,F`ÑX¢¯Y8ò¥qX~*ºu¶pºó¾"µlÝáÏDΰL.Ó:ÐØjebÆ*Ya2ALät[Ãçcã¥g»L¸»K3ù4AP;o#/U3DÇm½¾Êë»2qÝ(.Î ÅØ.b[Ïá·VgaØ¿#.Òñµé!ÇFjFlf XÀÚ-ê´µâKÜ#/Î
)·Ï¶ùUFÑT±¦XmRðN&ðÚwC.¨¦³²Ä¿óÉ PN³¬åª**ò,gR¼å±qª &â¬$U»ûe¼´FÁÒà×#.!c°èLK
9bcÃ1!=üþ.ôÀ{7~¼òOïX4OoªqX9lÏ4|K3î'áø·« 6ÇÜ m£¦³è#)¹Iáãzc¨iÒºtvðQy/%ò]ØFê4sÒÇË#/eOtÕñD=¦å!48(ÒEtTêѺ+gqØêuÒÙ)ZáFRg?Ûûæ¯AÄEPãXN=÷Xté"¦#/Ý`îU3´0h/ð&N§WLr,d#.qéCCiC'xCi1AÂQÖ.Åøf®é,9PFô2c`ÒÆg·¸-b*þ}#/ ³,YHɹ#)ÆMÇtóN¡ØÎí8ç5u)Í2ØÆó>ß^ÌôƲÚbÍgá`Öð)Ï°Gx£#ôÐÑcÚ1@5ÆÚâÆÆ2dLQ+"©h@ÕÚ:Ül°ÁrÉMVÎ2¢x£$ØîÁXm¹¹MR,Èftö¶ð¸¦©D½ÍM{,k>o@v+r¤S¶Irû²`dSp7iï1â;j]ó;[1õÆÐ;?XïÔfZgPd#)Û>F¡ìÃ9KÐb'Àc÷À[o°wrÄ`²5y¯áòØÆ¡Ï(:_ШR<Î8âFùÉdmº{U¶ÛUV¿?qÙË¡e#Û:öùÓtg Êy3D]v$¹íöbÛN'V1Õ¶Çxy-ÛÚ¯xpi2.ÚÀ1=ÁPZo±oAAap¸%WEÐo÷â4;SÉ3ÐÉ,Ðð@öq5¯->|#/ôó*JvI¢BÙU÷k6ÜÆäÓ?qBhÈ°ä¹Úí*#/éÏÒhé§o®´
Ò·3ÇëÔXº*ÑÔDÈ2ü@º´ÕlÉk£WeÛ#ù#÷ ´®Á ðàÚï}+¥xöfÜðOùd1©ZZùÿó±µyu#)Å©L8WxÚgvmÜ ôI¾ÿ"8||ÌÃ#/&&"2 (ÓI&in!ãÔåQ23¯ýë¸ õÙ] + ¸
J@ør<ßÞ_,AÑäå( L?½äú/ó!àÿ§þ´²Ñä#.Y"0ýùßwÁEosnHc0D ÿ->¯W¿ù')]_«àà{¬Çbäy1åæÆ|iaI¥jM¼îÖRl¥·Ïn¼9ÒpKº¡¾pFjÄQ¦?Ùïk×5´[D¸~Rúì³·³8;CTjÀ]øí{4©ü Oí©6eÁÉ#)pQO.¬#)âxkç_,<4â¾×£6öóÂ'¡ÚóÙ+H{Åüþ,A;8C¨_#.Ñû¸ò"Vô|Ê E@êSÐèù 'ÕbA #)öóª¹þ-E#)ÉLËærÒ¥$KZ_y°Ì[1Í^û¶ñZ"]»iò8ÃÉÀgcÈéD$ÁnÞFHä
ãO&Xûsdï3ªÆhÇ/?°Ä5 $¯x«Àð,ôcðàãÌñÃQÁׯhúè<¨*®Ø#)´L¸{Y¸ÒÌe7Ãò#)7¹ÝÝòBösÛ²àöH@Ð$C #)ü#.ìíDª¿ßAAXGx*À£Üpû`Owz/Âùß;ê`K\ë
Dm¥©DP)ö²¶×ÄëP5°¦1#.ÂAØô#)¯NåÊôúzôèÝÚõ"ñ¼4¢Mõ×o¹z©skéwW+ÙÞy¯;®ºãJÍÝbå>3¯3"¬8#)Ä#.<J&-x8<Bjø÷ãß)3$l(&&¼´¡ô}#)ÆÂȧ×nÂqÿ#. êñcþTU¨ôÂ!=-lÿ.C³ë\(¦ÛNHx%#.2´§hðÏb1-0?9%°Õ8b-]#UI¥¸ú5èÕ¤éÙuÆYòÀ8î2¶íñ,#.ã¬0n¸Gp(Tãv lêfIß?w¼åx}|ûD×T=à`¯õ±÷XAêývaä%òÙ-ø*êÒ)ÀÊG£$6INM#)®¨"¤mX±´qëÀÇbz,b`W½E-©´¡Âó/+Ieæ¦ö#Z?"Mb¬8ý8%sS&ø»Ù¬ü¿llc°õt¦> £k#1ípÞØ[ë#.½%áÛñ8¿zôyø¥={ùzÓ,ô9 ñxÿYáôÈ·MD>í&L0j¤Ì¯vJêÅÅ^Hyüì~?wäA¦2ßOw`wy- èNX¾ÐÙbhÈQùÔÞ鸣@Øâ£ðTîïXãdó³(§´NÒ¯w_s«#/DÂäÿ#KªÅ×¹ùOÇKi¹.k#.43°¦xp¯ÉÝ´ýÐÐÌÓ$8îÊD{`»Ø^ÉÕ@ùJ
m¶6Ú1KTdT¢MlU#.µ#/m¦¶5e*X#/#/e
XE$D~rWuø®ý~HÊðî>ÐÈFiCÇæ¡á$ÁêõrÑ?#:hÙF
¬a¤FüoGR£[Ø5¾Ï-6ÈËðõ¨uE±^¨$#.à$Ò257Ðk©²bzf¦ãe¨øXÀ0xÄpÆ8ò
Xjhi)îäº\_p±Æàzó~@IÅWåù»j¢«Ô!"¿(S©Xv3ÎÒ0s¥Z"ÚTºpb!døaGßôGÌa0 !¯ÀFöâ c!7]ìf ´hÅfUôg5#)ä¹$AL´%*{!2JT5'Næ}öm¥㧹ÅC±öEa¨B«ì^jx·Stl"þ£lã7gg0PþdÚrÆ36¿?3B}oÃ>¹_fH
?z¡÷tBùi¿éÃg»Ñöý½Ýý÷\çC+DHfâ"$
÷yàÛÀÊL°¦Ö+dÀxNH§Ø#/ÉøÞjHa1(dÚ¢n{ù]_3Ìïïí³YÁo62ç)BþñEÓõr´?þïõhüZÄóÀ Å;x«mÝÕÙ2è>±¾êÒú~zÕû±Që`ãuÂ(îgÛæ5 -$´õú_¨Já pÂ.g46þfvÇkÂФf@zÊXj(¦N ɼÖ^N]ó²ÿ_»ó£È`qæTY²ui"wi;K#.¨ß~ÂßÏJOòI#.ê#/ü¶×ÔvâÔA¿«a[HÐÝ.6¸k'Û3©àV#/|>/¼ôûds%¼8B`þHoL'´ùÓ~%cxLÑðæ¢Zà(i©³O9''M0jë`fþr)ÓÏæ%¤8¡á)HuÀû5Ö+ÔØS/¡âÕ 1¬QµYâý#.¹o<òk{DrAg/)HB1¦\áëðÐR? þ»®9ç3Ø
bMÛ¢sUkImD*QÃ7Bf¨§nðYìHù´Õb_°ÄÉPø¾ÀöaøÕCÔýI¶¡õ ù°oujB~>ßýå=raû#gø¿#.n®ÃQÉ¥Li:þ?³·¸ôçî("Z<0Ä"V! ¥óü|wAS¡ÂX:q@¾íct´ç¥Lp¥NÐ ¥ÐÌK0Z =õí¢§*p7x;âÔ¿x?pÅUó- ÆC²/i»#/ÚÝýÏðë È8.ú"dÛÛ¹ìW®ë¦+ä"PrËád÷xèhÞÚ#/ÑÁúôiÆöÒøWe7ÉèrKæÓɳ¬´¾&B´#PrAãßÞ$¬»{ù\q2q<Ô¡0ZØÓÊD±d´&ø¦àÓ;*^ù5ÙÆJý:és°Ö·Ô<_Fð7ÞB 6wSMWã~K5[ãv%oC¾
:gk#,´avéâ¬Va¢´A#.2Ü5M°¦WÏ<G¶» 4jÐâû¶ÏîçZnëtÆuof~\L%ÃÖXK9^ÊÞ¸®UpׯzñÒ¬ÑXèHØÌLÎÑÞ#ÖübVÓaºSÏW*àb<²|~8Í/Ïîû!¯åæcdjÖwn®ó;v·«mLXÆ«¼[Øv®#°ë;yíñ+2÷«#.ÑqsEÕ&µ[~>ËÉmש¶;ºZºlBy®\·$Å#)çf÷óÙ¢Ü +¬òÙåé« =£°ð¹p<áyllÛ³Ñqb~æ·¼0ä\×>ñµÆ@£á¤àW¦ËPd$¸úp׿+$àg6LË`×YGT8ÎýÏ?oÙðO3,;4ÈànÝ[«`=/s'äÒòKtF(,Íí ^îØ!~ÌÝõhkSMZ.B²GT8HÙSfF±ðá¦øf$#/@íV:L17$K8Læõ©ÝÖ5:&&$Ü;ûý+×Ë`°Îe}õâbjJPVÛï÷}tõú+{6ß!" Á0Á1êzÐ#.|sî{+71CÂ0Qßy0É!°³Ôɱ?×O ¡ÆÍc#.×fhÁh;m.#.ë´ÛWI]U5ôçîR2SR´ê¹ ÷ª¬à¿HƽÓn|uGI.ü#K·ÎM1ï^ý96gußJõQÞÐ7Õøû%`³tÙy4Èd3r6 K_n׳3-aÙ·ü¢QzCt£¨`V×0ZI AÌide)65t×dî·Rd¢,ÀC3<¡²pÌ0MNNHVBj0Ö-!]¾cqwLv4¼=®ZKTsàxj¢¤#/VQt'dzv ©¢(&B@À$Ør¥ùÖ ù$ÒÐÅ$ó×cËÃð:ñèÅð¯»Ës6ç88Û Y=ÒÊeeWÕ]v>ÇtNfzõSSÄÁõíA(õÇgì7=x}ûÍ^Rÿ )E/pÃ@¨nï' ]_ªÐ*ÝÙaÍh¤cÍCF!nÅ»~Õb³~úI_8©RnSB ½3| ³[Fq'ÅM´-:*Ó^wÞħ߹æ§$2*YÇ*å»rÝnÕÚÝÖò)yqw&61ÅYUÐèÓõìçB×¼aó ;æ#)¾!SÚw!ICa"P>mìyå]BÑ.A#/Ä#ó£põ¬Ë»*ú¯Àíñ}xª°¶ìú)ûª¯^Ç5+Ù¥yè? ÆϪb Wyfåyð%yd¤L6£k#)mdÃ0n`øHÌ}»5㬵ÛxãQû½úWHT û³o Fqµ# ÂH1R;#.4Óu0HL7±ý¶°R¤Ù|g(z|zy··&<©pØF»UÎýg8¨Ì·èM½z㥵E2h¡P=GG$hÏ1÷5I®Pç²]oÇ× ZOß#/¥%þ̨I'9¸¦!_SØ{{róû%q Ý#/d)#/>Rñ8qÏW&|@ùó9w.p.NÓÙ÷r#GF qÛ7 Û¾1÷èþ3Ϫ{ÇCõpÀC^*ªÚî¬8ÌV£#)Vy¶ÒR¸h)6pÙEëÂ4Âji4+ºl ]ÂRbÞ!ù è:#/,ü;Ë5rnP@Û(¢NIB<¤ dÅåÎ÷e+ögÆ3ØÜtÛíÇF{S)|ê¦Bà<ÆqT $.¡¬K!L!#)È$#/ãl1Ù|ÌYL;µQ²VUFYH#/7àqSWIСen6\$Ľ¡¤)*Æ«x¥hcemðÖL#/xÎ-CÛ]»µééÛ^/ É>¨>Ü÷4_áqè6Ù'×Áv8óôQ||ÙQÓΡiva-á}§FÚÌNJC&`ÄFËÌû,gÒzËd@Ø©T1
1z»PIó0vzjáétQEvH[aÄäpÔ=ë4,ñF(&¸g"Vè<'6h KAHíãÇÕ¹ë¦ÍÇ6ÚVd6p³Àâ9¬ê@vP¨ d?Ndë´ÞNe²s( U¢IKÒøúÏìHJJ jyO2ôø~n¹Óba_¤<Ó¨lÛÉÛDÌÌêàWhÚÜåîT§Õpg&¨)F""(´]ºÝ¨bÕ`&(~4`pS#.ÃÓQÆçëÍ(,Ä{¤Ð3 Px9ÉÞÁý×F\"°qcÄJqS\%Å`ÈDÀhT#/=bQ©2ÈÞyESdq³[ùnÐ 1:yÝç¯Di%ì #)ÂÇ$úðMâ,TfrOÛÎ`Ú0öïpÒ u½¦ÿZßt4ĸ0º©@øÝuçV|ÖéÑ'|W¸ØA %<çwv¤ÃcvZÃ9
"§½[&úRÍÝc½}#Å·ÀÜ`³§·MØç-'Dm¢242àB0æË,¢C¸')ûOCåx°=BL2 îcúüAðhõOVNmÙ#/v`Òlu¨jG,ºdÔ$ÕèS¡.6ÎýbÆhÔ0eV"Pû³ÍÑi7Õ@j{¦ÒåRAqväiÇj¯DBQé#/°¬ædd#.²Öbe¥h¥(`Fiié=iê`*êÊ*¢XôUٴа<RQÖó>ºçq&èÿÉõ#ÃoݬO´oäÝ](ÜL½dÈ¥7GðJsqÇêm!¸¿<©Ph+wb;Æc+gWtF¶ïtpï®ÿk?ÌÌcqÖ#.bÃ~u#)à `'@d ¦É 1 ï$g±Êá#.Â4¢ 6ÍlXW &C¡d©·7@C³
»gDPPA±#ÎBè-#.`µ°©";FÛ/BkLFØÌDZcð8ÓThfáÈ4Ú5ìJ!8Á½®X®HPpLn;`ëéî%Í?§_©;wÆqëÌÄt\b#Tfè!UÅF`Å¥1xäÔJ®F»CSj$þ`¤4Âé¡ï698Ǥ³:-èpÀKz{ËÁÄ(Ç\l³·ªa²È¸:tôÒs,1ßÌ·|0Qó&=r!¨®'°ÐNRwèM¹çÊTê;°vë:s #.
ÅUVÉ@cÐã\ÚºêJoãÆÜ;¡ªNaFn]ZLb]7(áhM LÛcLYö2#.þÈm²ÈãǾ<±V}%ØOvÁÝ¿dæ»a¦6 4øRÌ.¸tªl!ñ8g8Çp&À8¿ÚæÈ)hÜëøs6ÃÞ&Ñ]¤ ³2L2XgBà#.Ïyd[qÌã H@À|CHðZ#)ÄÏÑì
Z÷¨ªt6a¥.Ë8¨ò6f{ffY²o&àÀ®M½Üö#)ù;t]ä\XA@hÇ=²dßB0«5 ,RIRl#¹¸ î/_HØ8àA%`=t$7X40uRÎÆÕ#)îú9)º¶ç_Àh) È%õWݼßÃOäm5G»fI¼Çò÷Ss$ÿ)ì.ï#.´V¥sÚáX¼Õøºãì'r@F «Ñ ±Â÷`zTÕS4-_SxÚñ&Q5¢¶Â¥¤r#)JU"EZT¤¬%Ô¢êJAÂ01zÏ¿ówªð°Cç_áRM«CØ$²·D°otóYÛ¡#)ß(@©¶|¼a¥NãÚûWܾ}&Ûo¯%!F ÉA¦ÔdÌRmI%m(d6T!%4F`IQ³$kæíÓ%i4lÒ«,Ó(ÉFZM¾=Ú ±³B$RI,¢6£$ Ôh%%)LQ¡1VR¶Be4FÍFbC(4$l,EËÄì@×nt:îhzÁÙ!5ÑTÁ2O
ÚN»}¾ÚèV#ü#/ãÑÞ²F¡J&K¯ÄåYÁRC2ºÖ³2¦ºO¯ ªY4czKë'sLI1eF{Cv!&ÒÎ:câMÒÝÌÃa9G#)n¢¢lËEÂÑËm/¶¨kG*$k¹ññôÒÍ£IpS?Gêû9çú*&;%M m°Ç*1½#)l#)àxt_Á_=SR±Ò[4ÒXѦZ&ja$LLÔÞëÚú;áôîøÜLÆ(Òq8ù-ñî5ê58·ZèzøiiðÑeàL>ݹÌ1&¤>{|0¶¢¦-'QÀÒڼà Lgà#.k¸êØÇ¥°f_rÑÍpⱩܢj{gÈ4kû,ÀG7îÁ{="@hû¶~K:|9:þ#/uQaBI!¿1èí?çùiÉ[þG^ËmqzbóÇcÐÉà©r×®Ì'iGwÅ¡_TÇ{Õ[ѹu°èÓ&lé6½Ì3ÁÂ׿8]¿ÍhôGU´â<6ìÿ^&>·¹ö 5Åûiï¦ýyå½zK¬ÇCÉn¶ÃxÞàæ#.OÚôk2`ºa&P/º`çî|n×g§Kùè»âCÈÃá3ÏNa¹j{Ív\y%Ù òI7"m^Fûe5uvvZOµÈï;¡Ç¥·zÍ-ª`@èsÜ÷ÖN#ÂHK½O)AÌ£½N«M²ènÏ×2R7;¯v@\ÃslêLfe3E,~{òspÔ3i.v0Ñ[E`Ç[õo2#.`÷õ0Ã@Üà²äû=C+¬!©LZô,g`öÀÍÖzp<Øõ¹ìÒãy_à3bh¨#.£°ª§~wiSjý
/ÓÇÒþM3r«a%&P¤ù4lòÆFN¶ãݹ¢-¿ÛÉ#)Á'0cgi¢75ÜiÞ3älz#ähjt'n:¢¾¾#.)'C¤
lå_ß#.Üø\@oíôìBLÝîñ#/Ý¥(:O ÑÁpBV6¨íh¥0|Ö¤û2;ÅãXMñbÞhlÉUGÑ{Vz¹Æk#RÜã®Â¡º^_ªf\ÍÌ5/2åÐóL£BÒÅ.K¯ËR½)Lf{fñì¦,ëÓ3Dt
.þIzM!8y/[µ,33ËL,¾Üêâÿ8Põru/
ÍNXΣ92L3Hà])éjã<¢Q¹¤ÿÄh Öյ˿32b]eØé/5Q
Æ3dîv]SaRfsWLfKÚV÷-Ö*MÿlàËÂ9THó3o Ga¡ó¡áÙÍ'˼óÜ7nø2ÐŲê;Uq¢6§$jæ8ÝîuB <Íâ1WLÈWÞÔj2a2&¢ÔÉÝAÁ×ç3©¶qYÎÈ>.¯7ÍÚ?»ÕÛ²ÞÙ'81G^|ʾ}\ÚÔRd+ìäÖn×ÎÛÿ!öìy(¢)Ãï ÚÐp¥>$çfl¤Åü»Æ!bÞôN§8|ñ½Á¥·8:gW!ä/>7S¸xíÇ)Þns/x.ï>¦4tI&ÚaÔ:ÞÄq²fç¡7b§#LüT8»ð,ñWSyv:¹ÔÁÒûpBÎ{ó'%¶:<n GtÆïvèç£w^ÜL;¾Û·àwÙÁnÛA¼²{(ÆPïU)ѺlââÓ*tciã3j¥ \4Í(,dÄB,¡åijíqW¢ð¸ÅCîoq$,p
±3È5µª¶92D½pCgV,7Å*h(ô4ÕYi»â«PzjkÏænJ 3»Hhîõ¹«uÉ5uÒbôál¦!¬6#-¦|Gnû3S®Ñ[¨ùO,º¼jT4ã}ø}ìH\hfngW~OMÌæ¦/®èL¢çÞé°È.ãvVͼàÊ˾èuÐG4ç&ÍSËL1sº²Î,Ës,)Ëf6hHè;WPÐìO#/÷Ww-RVðéÓ{ÞlÖ ÇÙxPVI証pçHÜX¹¢@G°D&ÞÞy[Àªgv̦QAÃå¥Áa±·J^º4q¬å--Qi¦g*XÙ8#9S"ALòíP¹á#/°H§)úé¹yÂè*Ðí©§$$?÷[²lU«!¶û»Öçs7k?Nò\8|pbÙ9ú xñ«¨ÆBÂ3z~Ìb,¡Ó»¹s
?ÀOË7¤*ãn,rÏ®ím]j³£#.à L(ù×9àûfzdM®xx(áàùÉGh,¬Ta¨µa©aáazÀ»á^.²ëL¦7éÒI8ÉBn×á»GèB±Ø£îɨøöP>=/Û¾O>`únîæ°Ê[«;rö]n}Éá#âõ(Núví3x·HÄa¢ÑyÍÕ HK*2cV1ïÃh(¡ß|c aÑuL%¾dnE¦pÅÇ;©ºefXÛoÌ4êd ddºæQö2½Üvï%ÜÇMh®ÍÙ4Ìu¹kDÈJ6ÉFPw1fûomYah£3Z¶Ú¶²Ãú¨¡n-§@+DñnulÅ[ÒøñÚ6BlÛêð4Nñiiäa¤·D¦`Í=á
ÔçqÔRvÈÙ#Ú|ÕÉBᣨÌJÖîÛkÆD6BnË[LQ$Ô¹8Xj0]#.IªðLΨÔÂ-1FL"&ÞDª% ªtM8
bqLÏgö1y®!ѶæÕ·ÎyÉ0&A·Òm :\±¨B Ý:tfù6¸#.Ô@Áç`#wVHwξìoßÒkè#/<q#$WN ÅÞ "&$.ú#.5ÂrÑ{bðàÙFGX@põÂNbAÆ:ç:®â'< C29ñw 7R¾{ö3%w&b¶(ûX#a®×¦A¦Á²NÎeM2:°§#/Þ°áÐiÈÀX$È1anC
BÒaÏX
Ú¬lQ$#.M5#.´3UHlBÞII#.¬lÚMUÑÂJ`±MÕ<4¬¢lÝ-Y¢Ù³&P7fqG'jȦª8ììÔeÐÔtt:è?X0¤F¨]eKÁà]D7F!{µI©UNØ:äuuGç´p0ØàØÞÍ&Ó¡2jlkÖqÀt2&Â\!áò·¡k8ÐðÜBÃåò_ÅuHsCºi]wCÃÅ cÐdÒi´;¬FhiBàÙº5lÚiÕ¶yx¦dC2rHâhHHQq/´ÄÉf^q(äCøèµêP
Ml$H&ÓspÐYª®9(yê
âì>Î, È/(wÇ¿bü_NÁ:K`d¯)h"6$4Dý#¶Cº]û»NÅÆxð\¶ £¢;y[â÷dyËióJv!¶; ½Ú
Èqç[¨Ìt&#.dCQ#2:t61Hp¤à{¨¨7:rä´á÷"äMeïrb74!#.Qõ`½,]¡)TD:9GL¬më¬Ò½©{^A¾_aÚNKuÄFX`§IËD+¦RÙSã5:Q½g Á(&f9®zM4Î3#.¼ã ¨ÄMFáÎ(LZ¶Áa:¡ÇI3³dpjЮéVBØ»´w±8Ùc PÜ#. æ©¥¶26Æ)$sËãß¾Ûã<É6 /²Û\]CÄÏÖÒÃ)Xа:ÓÁ$gTXix`©D©õ°YÁ´(à½
©¨¡oõ¦"¦ÃÏûõ?°>ß?#)èTm}WUÍ3Z22#/6ÊÙÀü¯ônRô è0Aá(w 'aÌÙ%3?#.È ³DÀQÃg.êìi¨EÑ
®¥ý±{¾aðê\Q¦FO>8ÌƵ:85Îâr9ÕçûO+ú¾
ÏG®èv{©´"ʪ1nð¸lrN.8´Sv!Ôôvv]Ð6äÓM {Ø¿i`eV$<5èB(ts1uY¼¤ÊÒò0ßj`Í°¿t4%AÆbJg¸ý]x¨ì8á`×ñlC0D ;°D¨èæ ðøB`î"ù#.Ö^¡6ÇO¥7Ð÷qÄR¢ÕTcïQ jÓn}>À8)ÁbýÓðØMJ¯à½?_@å$û$Ô:5DdI64×vg7D±mÒýóSñ)³ Ê\õªJ¡â=¥÷ê]?Ì{® بuviü[#ÞðOyÜñ$îîÅì
ñ6Ú_´þDð'\Ì È>I¥a&ùIPÀÒaìj7© «ÝCý?O¡ðî«ðÔÔ$gaÓy®!Ñ+«'9ZÒÄRVÏ P¼| 7¢½fÌMvd6cê.ØFz# TïÐÚäî:3',Aâl»)º©>>?o¾)4·ÈÅÈè8ùµ/0û³éûá£-u&µ£3à}}ðyÉ%)+lm¥+FµTRÓ3Q&6ÑfWÆ÷ÛP"{èYÇCóúQ×O·«Íä¼@ÒN!<¸C÷r8yÉã¦~W{`¤ãS% ©T4iK}dæÐ 3RÔaì=37S¬ñÔZúݤÿbï¼À;¥=Ñ(ACôJA)W¹ªKêUHÜÖú»9i« ØV,2¬ëª ¬Ðë°ºpÒ*o*lBBrP%¬¤Rj¥·´#/Døíø F(Ð=7ÁÌÌT2HeüvÈi«9;ó`{ ᪷4Ö5©ØM¿óXMÄCVrú»u#LäØ#)²k*°ÙÕÏ,$¬RäkÅy7ÔW¯«ã@4Å·,ÙÛJIu1MÈA¶ÈÈBû¯aÄ7ÈÇÄ8Úã¢ñÉÚVÚS¡¨4îÓß¿èûÕït8{=æ;l Äê\Ñ:1ȾõÈ1b[1(¿iZÁVÒ«ôÒr qQAQyÃh?FIîÜ¿c7F¥_N·5T+¨IùX±¡0KÃ7Ò35oÖC Êlý£nß6éÓJ[imSÏClc]º-í¬n°62´6&$ih{kqÂÆZƱbò"gúôÔt3¤3ÎU3¦ãÓ#¾ï<f6]s0RÊ´<l<5æTwu8~Véú4Ó«ùÄÕ#QùöÉ£cÝeÜsmÃØáRä d;^C§:>#.EÂ"bèsµ#)ÐÎÈØ.BPsONIDn.¶Ê°8ËwbÂÊ íJ0ÙÐÎxô#.ÍÕäǸB¦#);`¦Âà@cò^FÀ!·4È@¢hì0l÷Ç`oÓsÃüè°¤ýLÜ(Iá×Ú^WÕª_äúõú:Û}Åv¨=GúÏ3ª?\°¨¸}Ç0á¢ýþà#/ܾ^yCgû 9GD#)H°þkúîÄ4CÍo"Á3ÌÌÈÌÔuý£B¥"%@£ï ìö¹úxIb·û§#/óúàZ¢§5ßê?»Æ1Hûsq»N++ñÜLµÙñÙhâ×A±UbW*9g]8c}IºÓj)%
«§|V)³ØL>SÜj¦MØF#.äÀ<4À`CÅLeN^ÓA¤AÆp1IMW0·î7ÆÓ©iD)zº¯·zè9²LSN±yâG#/ª6©#.0åØìÍaÅ!#FdËÔCD^e±j´§Qó¦¾0½¬9ÇG#.#.ýn@t~npË$OÝ<PmN8°Å)ón4ÛÛnµ®d©X3ªÓî"1&JðÇX$©ìAxJ3·Ó)N%÷d®'Î"¸I]5Ù@wM¶$z8ÉÁâ¸.#.g°ßìL«ñZï#)ÐÐ2ó³m ÞÙÏU£EÆXrfD8$§Í8üÍÖ¥aâÔnb£
2¤Ø´7[µÖj)bÚøW<Hà#/ÄHÒ7ËO{¶k^5ý-Mè=·jr(cHËkl]µw%Û®3YÎשιÓ;tÇ]ÆUå«¥A]jí%`Ü®ë·wi^wJ¢d,Kg#.RP#¸,ITºsóòऻ¸c©Öâ½v«xØÊlÓ)2&ÍlVjh¦k©jéZY¨I"eZH÷û»®ðßHÓ5£RÕ¤¨ÖÊH#/ð6ùüÎ0U¶Ä¸'$S#/çMΩ®ìÒht'yá©b#.P(1Å'l3iAºN'tI.¡Û]gÎÈvdnÎÁ$6#.¾Ù¤ìÞI<#.Ï.EPÕÅ_8¯ÅÂ#/C ¤Î^CíöæadÎfaY4}¶uI©6(ª+ÇM±Ç4ÅS´hØU#.ÙíJâc°ã{Â@ÀmLLLÃ[`;²¨#.I´JFæäo#K`¦EÓª;0¾/SqìÀq*fs mMXç0pßʤ#/)¤RÚ[ªi¤XoR£¢ó]& o5XïzóD!¡7DÇ'4Yn=ÜÊíµêÅÓ
Æ9fWhXòtÐÃ?>Oâ»?D¿øM+Öð4x{#.`0èÄ¢Ö0xÿ>å§v"ï*U4${Ú@Äá3ýAC¯âÚç|ðP»Tt02®#/Èdrp²@fÉÉ/ñ"aG©£©&èm<¤íüÓ¦ït±ÆÀ·]]Þ´?@?Ê£*ÈJ§³åøséú<Ý(ÚTìÃ{¶ÜyAOÝm¿*8{¿°ÔþË4,¨*ùäG§dSXÚi,Ê%Ië®Û7msDe(JªbBÍB,¤JeÊdÓQFÖIL°¬³jISj(²Ö¥Îâ$Ì$¢è mT¢1jbU4ÚØ©dÅM·án«âä£I6AkXµ«dU5V÷+ªm¤¬yç^Y¤Ë-,£&ÍXV²¢{FU¢Ô8P뫧ѥTÄ+v³TÁuËI¡*ÜMqM!*×÷·mO¦n"i.S]þ~. >±ëª@6XTy¼ÞV}vj-¬ÄgJâ×rI¦ìÔÅ%a6ïMÑn#fÈ~¿gOÃîZ f+媻8aÛÆÐo#.4D#ðá(#Àª#.¬&(IH¢i¥¦Z#ÒÛ7Íhô{1OL#Â#))7
G{c#N@tÌL!(#)P*aÛ.:Î °Ò×v£Á æ¤&@5ilÔJm%%«Õ§M!Á* +$À±#)ȦTÅLQ-²¶&ÐÂPÚR©3e3,BÛ%T´jMIRm`ÒkJiE d¦¦)F¢KRÍ#e¬VFJ"i#.²ÌJX*+eÊTPe)3fM³jÆ*Ðd*jSVmK2jY Ý%\¤P)IHTêS!#)QÞCK P¡¡`§#)dB I:6CþI_TÄ7§ª[oOga½ñ~#.qr¨7]tøØÀ#.õ3Òmbßk6mQÌ:"y;:wpIJ½áìg#){b¤¢?ǻ۷nGç'¿±T=ÿ§ùGmÑH¨=Û¨h% Å~Ï/³kÃg^8bÀ͵ËîÈÏUЩ¿n@î!ÖY!¾Û4õ6ëíýÕuÎ4Hѱ/1P%¡¥FÄÒÎaÃlÁ;ÀÂ5Àï*¦ª{@<[ÀÜ6!õ Fðf`ë-lpF¨à½0OÕU43èG@õ(¸Ü2¯.¥ðxü±.3Aû¾AïMÖ êÄ©(wvÚ+y4Ô¾t~#.ÝSÖ#Èòé§ÞSÃ#.äê0z¤¥{]kÈ@!b{NÑ6r6ßÕQ»Ü]ÃbòÄûªt4I}XpV_|!F{8÷Îkò@°I¦ø,Bv²Ã96>ÓéÒfwõCÀ£I2ÞGËc#.²¨áFEÙ"o´Ý8\¶Þé±8ºBK#)è2@<!~¥ñ{½[{vÒà"¢¤]À#)#.Qjm¶ù*§oUß<¬C@1Ô f¡À³31Æwæô25×)xóÍ ¾ËÊÛ¿À÷¡¡ei9ÙéØ èâR8%¦ÔÍw|ÇN}üJ¿9Qñ?.»¯ïff`;kÉ6<ÍËyþ+ÔR}ç¯=íØôý0äbQYÑÛ¢!µ.Ô dßÄþÀqä¼3ÄQ´Eøú×µíØ×¥²^NÝÑ\µ×¥úvåËÚCßØ&CeT`11²m$,2%PÉ&(èØ`ÇˬAZ"(«Fã#.ÊÑ#.Hä#[éª#Zp`á$f¯Z@ÍT6&iV*ÍN¹#.Gm5¸«E°M n#/?;Âq$Õ#/p1qÍaàÒ·ë 2Á® ÇKðíMlØ'¥ý>°³=°:õª#.ÆJ-p*U0ÍʱäqÁ#)3o#._ÛqdÖ=&#ØLÉGsï·!¨9$ØFë2;ÔÆÍËl=ÖÒìLijM]qâ_#)ýÞKC)Â>ÖÕûüåÀd{ñnx$và,3A®X°)kóúaéê£b9hýù§Qo}àïzî߯qWÞ5¬W|ßQÇóu¼]0иXZê8«¬]#/#.kßಶð·eÎ}Í
·ßÙkÓpÚ°B8míSæç2"pê»óV#¿ò*LïÚì PáhjCi½ýh0|¤Úÿ=1êX!*IT«MÎþÙ8¦~/zź©#Q© Ð!2Xèªbmt&U¨8°`ÆYG¡àf X¦Þª**ÐÌ"^Ó0án.gCÝÏO|êá.GV,¡T2`ÂÈäW:áG@Qudiº¼âóâ.ZѦë9+*ZÓ«zÃE,7DÕ+^u\)¥hv©¹G¡ª:ÊSKCR,¼ju#.N;¾öíõ&}HÑ,,°¬deØpLª:o,ÕRÔÉYÄTÅ^Õéüýû ù§éÚ©4¢=óÇÌÆÉàLìÒÄ©4=°i*&qëEuɳTf(D÷g¼ì6ðÓR=ùj,a§a;è«:MGJ$gÃ/MEÙw^«×TÝDtríÉèeʾì1î0¶Úgüñ¶Fìí]*wpÍèﯲ¦¯SÂzq©<fR`ÓqI<_yË:N2µfê¼ÂÇç@å±àuÁHØÒD)×C/rí4?.ÌHØÀñLì®`/ÍãÎäÎbÎ|xð½Aîí¡8½àKÜu=ûK"ã#'oQ£!¤ZJ¦¯9YyÞ÷uǺÓÓÝ]ÈÀÃ9¢®³
R#.æLÊÖh)½Ìu/«¾3ƯeÍáÙp¨*Èn¾6²"aª/ÂíÕçiÜEÇ®]®L¦étÔn¹iy®õ¼ÝÍ#.#)ävÄJ7*R(ÓLí!îZ4ìaÑGßóM$ͧÑyhû@ô¯#×ÇÑáZÃsÚüS×ÑßZù òß+Ñ
\zó×¹ìÁÜÚç@'Ò` fÀAæ[:3}±JxantŪbajbu£ùþïBoõò{á>¼¿¦ZAÝMÑ@òJÖÕÊ£[l`/f²§-N>!1 s/(&s `1Y#)ëØÃÊ)#.(¡Öd²Läq7ðèÎÖâÀIIPKçb!²L8©
¾dI¡ofaÛjʪְÙC`ÂqA+yf(ZiÍãM«01%ÈpßT¡#/©HÑ] Àbi°:ôøN¦Ðú
ë4§Rôî{î#ïü}|NåPd]þï© ¹¾õøÎ}YÜ©q¦¸Àætî;º{½yx^w%éÀÒÓ>Ü8°fè±
ÈæäÈ?ä±,#.1Nó×¥àAÄ{Ó¾*´¡¨ ÚUkXÙ¶XR®.m;®Ú5{æKkßSÄbÄ^K\µ{RÛï ÑA!_Ýþ\Ô#)ÀmDÚâh7Ù0à;äÞ=ÙYûÖo#)ÓãG¨%¡®±l(d5×]"É>ÈhB¢§¯DV¾z×#)#qZ\B,!Òn'©>fÄÁ°üÍÃBdàDC¤ù±° =¬íè´Rm ùÁ¼#)(#/#.yQH°m×Ûv~º¥"ïS2k.G9@ã¨G§qçñÄþ>¬±¤$0À) ©#/H¡#/BÅAÅPëûÞ<í»Lt ¦8FâjÑ.èxaåâü{^$,Ç ã¥C_Ý·iö_Qvá áÌT¡ü$¡æÑ£Xøý½]À÷IÀömú:½7Tô#.Ór]Fè(_/¼é¶Ê¦¢®HaýRg$7W¯6½V}Ç8¢4û¨ Wª#/JU?R<ô÷Þ\ *-H¼¥ÕYsSï¨çcÏjözkÎR?tM_<"V3îM½3bºIIÝ
¤~è¶Íôm
Àðnãa Þë|ÃÐLï»ÞV"6·íæö#´pvv/¨°³J >FÞ©èr·`Tg[1n¬Tk¾î°þ¹iÐAyĬ/`«4;;Ð!µ|¶rfo:ìÃò®À>¯uë%@b#)¤È@ÁÂZR0pG%(R8Ú2#)m!@Pá&BñU[øO¯^!kZÑ®úRÁÀÂrÇxM Ù-cP,#/ÍLj=pu7{1a»ã/Ñx1ݱü§v'Åù¸s|áx=çAðÓÀÎå»Ì{#/<ÙT@¯â<ÆÓ{àÑ#."ª¤ßöÀyó#Að?,ïe¬i²Ò|út`EC2{Û#¤èløÐì9hãèC-c¾µçZüX~<ÇÔåÆÛÑÜ|ö,Ä
éà#/D#)ÍîMòã¤0íÄ#.fI¨`ÜÝúN®W£õ}G×÷ty/^ݱ Pf.¿ZMåÈßs2ÉÊ@2£a->2EM+þc?uÈÓ)dsÊ0æ#.«|¤+ü¦)¬Ö=5íMËNJ¹á!iºB¾ÕDY) n
$èD`ôÐØ¡ÃÍ&:J£´d<õã«yÍܽ¤x¬ÌD2R
¹a`2)M¤4Ò[xÒÎ cM-RÄé4C'©Jr®ª@Ë«tÿmµI pX.CQÈë0e² #:<cy27ÑædU4V,k©½PÖDîQȼ^yÛ=yyà]9ȶ9j#.nîÛsjå2½zïOFOR¸bcJ#.afä3¦pÕ§XhÞDº"íþ}fe820³8¸p¢/2дMqk:7Zé8 8PÒ½°&¼,£ÔTÚR@RAlL»_<âÉ#.½GÀV= æD?xêÄ÷hê¯~ ö'24~
öÑí¢oÏ5JÉ3HS1+E:°TÍf&dÄÇvM_ð¦Á¸×>;gYöG¾=Ü^*ö#)£àsÀ¾°ðëêÁÂÕ@¨/åRúOâ D°ÊGa2ZY65¼Ú¢¼êädÚ+¹[n¥EX1,p!!\WR¢tB@Ò04°zÁ7c£ ªQh¤.ügë
ì`#b¡ùÓnc_fúE³/jz:ê¨bÀåk0 \3¦#.A"ÃRvl9#)
A¶ë ®9éùþ|uZ/:ÒùÏõþ^¹í=Æð?'Cö!¢âbëG«®â®k½äYXª-yBäÃJí!Û"h#{¡5cZÍm¥cbº®À(SûFø8ËHG]¼ÝÑ¢#/I¥6©6Ú#.ÊG,v¢ãP BÖ"¸å,åøÁ©¨[FÓF#m«Hß³A¬H²e!Oð@rÝ`w!Ý-n@;À´è¥C©J×.%Aev4P%s0àþDi Á©vúC\ö8scl:;VLCì_J@â°Ú7w»G¬fÓU=§10æÕ'wGeE°)kù{ºiðÒ}ä I±Gìó'Kj»t1.(:õãAU ¸6õâ{û½í$FìÝ3dÞû;steõÒoLPÄÓÃP°Cà GÑ4ú÷²ÀÅÌ)(ÙZ6Êif5i¥e<ÒZJ² ¢JÓéöútéÎ L·YøNU P`« }?rï>}oWyB7GèGñò°ýçc6âb_mùôaÉÊ¡1¤.¡yÆìýò¯ xÑu¾R¸²k¶úeG¦Õ{ º,TIA:µ¢HxÒÅË¡*Ψ\k´5è#.2<É{> ëø>¯P# ¤ªäðËîïËêéÛÃÚ}_=|û c}ÝÉ¥_oYùôNBÍ9°!&ÌIþß×$ÎFûnuü,ò6än˾»ÀÓê©ÐSù³Ð´Í%"èÆ×H?DI¯ïV£TéfÍ@NÜîkÃETüYШe4a³Ä¡w´{~[pþÍ;¯q»ñÚLi¤#.&ÃaÕ¡àëVhi¹où¢TâªTgeö}Ia±Ä8©¤öi
¾ñòÄt¿-dµëô1Ø3ÚÞYXÚ_+Jz5®ÉݼßgÐ"ØHÂPµ&DÈÚ¥ZZj5£#üäÝ4%EK?DsmMÑQE0$"¦Fh%FQ©¦´Q6+FÚÍhikH¦k-6k[¥JýÏ@éIþ§ð&÷uÚáÍ"Nh<#)ü¥L(E1G%hÉB#/@¤S qÁ¨°$ôõùû8Ø¢Ò¤) ¦$ö!;#/ùâ÷^¿¸ØÆìïÒ¿_^PRñ0,"5ñqÙ>ß¿bàå_NÔÄ<лuõ: ]xüUWËt¯üï#¼!è#)È~PÈçاÖé§úN?%ýàa`ºC$2\ýPìBÚÅ6PïÅ~ ½¡¶;Hiñ{¦Ü/íâYÖv]8í¥P±Üò½QEzutª'
ÉS&® ¾å¹2{çË\&¿¤#.¤
Àñ?1öùÄÒ9ð7}ÀøÂs¸ë<lÌtXm©ÄÀtêxy¬è$æ Q`pBÃAØ#/»v/9,k9ÄB ;é#.ÐÕ?yâÂËjf"´Á¢AÆbPþúÏÍ!pI4Èú<6Ãs&;X>/¹5+«ÉeTé]û8ûb¶O·¡ ñÑú¶£a4÷#¢uÑ,Õ´e$C\[Çñ度I#)£$ßýmxqÏ¿ÒͧØNS×9òk
]:ÿYÉ®Så!¼»^Ìummj)[h"#üÔc!Ï¥÷lq~\÷~[®AÁ((ð¤&bA&IÖ!éQÙdVÛ8*scCAÐßþ:àiw9xa¬Ñ£B,PQJíTlòZ¶2&*e4MîÇo,fRQuâyäÑ(S[íi ]=Òd0PÒ,iì01CL#f÷pa¾ñ-îß5u#)%ÛjÄ`ÆÔâOåµBçAÃü»· Z$4C¨E¾`Ñ$ãÈrù<:IúWJ&ðèqÂ5ns#zjƬàJ)ÊeËGC[läÚXͲN AIHÍ4fCÀ°ÒEìÓµæ%åÖz»ÑÂÌBòÓ&:M,²À¡byÜ#.;#)ãë<{ôz=å Õ··@jëõúN#/BSØ{föÙQKG´,Gs2C;ïn'~úqöqóv#)aÌä2îiô à¯,<ûzqâºÐY å#)÷Hi¦lôÒ¢Ò"Zõ*]×&j£z\8g4O=Ûɵöp|v¨CÕÝ PU,BÁÞàQKHùôÎЦÄe*ÝÐ!ÞÐ8¥¬±ôD
z|/·DÅs[høf#/-vÊ#/i°évÉc9Ҧâqs8[)% ºaú4´ÍëóØ÷£]nKîïñ¼ð÷+T#gÖ&t Ä5ÍÇT5¡ÇvC@ÄÒÍ1@pLÆØ®®\§îfqô«ûiº¯ÙÀâ¨q&÷O{Xߧ²¦½.è°óÀq$#ýÀá¶H¶ëÈlÑÔ:ÁѵÉUS#/nªPß{϶}¦ñ#6ßÝBCe<¶¯À1È&æDØV"ëV#.ðÑBxk£EãIà3OG,¨9àè$A½%,J~üéÕF$il]×Y-%eêq|7½Û%BÓ£T=)NnÛ]6>^äæïÅ\°ç®UÉT³¦c¹çü_Á>Æß_¯@È£]HP,.;#.d\ÌE#/Ù0"U¥JÑàQQ!=Mh#/cðò0=ñ§èHèy=]¿]èüà"ø½}cîÍÐÉFÞF0?¶]~;·SÁÃÅMÎÏ7ÅØ?É($@)ÔwG¢G³ºÎîí¢pQÐì²ÝæI¨ n~,ûõoC©Î$á>wpö*üOGVhÔBV1T@Ð8X#/#.Ejm¸mØb!ª"ã#%\#@**¢eQ3ñýÞóÞytmîú&/½¡i *!vGx¬$rHÐ fÙ>zX4BL.ùp<æjra-)©Q»óáÂk9\uwXKnà 1¶¤i3/2ÞK%«ËÊM|G¥W§¦Ý¬2M°$:ãQMcÐR&7¢mpbGdÆR³ç$¦äUeàjèÎ4òîêôòÈmÖÕ"j4ÛfN,Ä/íÚ´ÐØa¤ãs`Ö¤UD,³Í1wèÈptê¤q]j{àOñ÷ é:ÓÜXâv¯//¹~/Ú÷þXi/òþm¯å>wm?µðªNf]8f£ü\ÇS¢t>Aê#)/×ê" 6¢%}¡D¬È@PLÈ¥#)A(zàöÂ>¤Jë§v®X×5ºh×+Eú¼!ééý<ÈÏÈNöYéä£.ùn¦qòw³0ÈæßÏÕ`²Ögß'¨ÃãÏìåËÁUàb{äÎ7L=ýA1÷#)Hl$,L8oN >|Ïè°ërÛmdâ¤Hº¹{'ÕUm¿Mm¾QIÉÈÎ8Hù©A(0çQmZIáÐ8Y6ë M6Èm¤.z #)D,¡óTÝ!ÂyÃÎÓOI͸BôçûÀåË1BÇEFúáÇKS$è¼L~iÖrßÌÑLïÎø<éÚ)S5ô'Õ4£é³ûÒüqMÛñ#gz8ðCO½Ødòaä|40;ýù×£ì"'¡|½øY£C%[¾¸àWKç#)Õ0rÄHg-nÍ°ù¤ÄßÍ6`yzPßE9¡¢Óp£ÚDcÝ6BdQê7 l´æÍ#&\Î_{áJÌjjíÇgÔgÔ1ëCI,",ªÕ¬è·4#.+Fä?*sNødÕ¢=éO&+#)É>I!{P[_óóïÃ>#/èm¤3Ù¾N2²Xèñ,Ô{-hÄñZ:ó)JZSh*:áuvD84'w7÷#cñûºg¯D#)È
~K°ºN¾ßÐT·÷¾Ô7ée¡uRÄH*rµ
Ô$@qÛ#/$#.ºÛ 'br`*ý¬!$Äa¼Yäé$q6OÒÆCP¤ÔÕ¶33£ôI¤·¤ãwyÇdIñfh&nÁß0<s»=]Ò`¬iIIµß&=åFäây§xR¤,YD #ÆRk9é]"sÉ3B0ñ(ÓcËU±ëóhõè¾°JÇ>'¾øw½çËñu¥*6ßVò!ØýgvQb(XYlJTÑVúÒjCs0ÈfT#)"¶e[u[7JRñrMuXâ@LÒªBÐ#/;nöc¶óÐ;àxýsCOÑ©Raæb6#ÀHçãQ@¶MR@Ϧ¹¡&¢FHºýöæ¤ölÏÀc4Ì$¯g¹ËâlM¢3<Û£R5u%"0I2Ëþ¾JÑ'r¬ÌG}ðMÍdÚSjÃAæp}V¬èbE,
Æ4ù#.Uq0Ùó`ÝLpC4îl³E}ã/ÞÓÓ¹öb8+ö§î>»·ç¯§µdî:JìI¥ÓØÍsgKvZÆ|ïåòAi&`.fa³~}¥v¾ç]?x¿}%sI m
wS"ÆÙYü×®ÒàÑÞN&Ãcø&,±$õ±ÇÊ[.ÖFD½ñwýî~ïðþü-kè±Z&|â5¢QdtÉ@ÓC$µýâäb1#.D2V¶Ää?i«{@#.YûöÜ5¬¥+Éo`PgSPÕÎ5ÐSçV¼J¢;©*®ç"`®úZOÑÙÝÜqAú,|i¦9:Ñ3D¦5õV@îæOâÔ÷µi& `+záÒý§HÝÈy3d(ghc"Ó5ÂQýawLÐÍî¶ùT©æðÈÀ:ìCB«BÃFØ*Ì,°óûÏî5Ë29#!Ì6#<Âðî¢
ª¡*ê[}½æqX_vG\°oïÎu¥YÒ·ÏVÂjf zË%È2gªÑÿraB;)ç=¾YËbB\Z{óÛ0t/ÊHÍnIèPÑÇð}Ía äÓæ³ÉÄNþ,m1ð #/Hi#.neÐ]=ômü-|i÷q=\ge
ou·I¡¤jì}ÓÄ÷Ò[Iæ÷õ?]ÞåÞ_ÈAæ*"7}/Ø; üÜöu; bwCJ©UJVZP#/DE5d©¢s.Ïn<Mx¯×Û]#/¡dÛùd
TIÌã0 nkÇ^ÆYZ!D6Ó¬q #.÷#)5#/$y¾Ð#.ó»õñüøuuÞ
k¯ã,º):ñ#)ÊÆ'@TjºeHVÖ9©ãyào#.ÐíÒOépwOÓÌ>¡ã kt<§ù¿ø_Y9#)aQñWëíæèsÅ%t#/apPxYæQ7¼Cø ³#/ý
Õ#.¿Õ6Ì.3îw?ÑÇÃl9è#TWÁßë#)Ìó1UHLÈc~%"üSWmÚQoÛµí¶% ¿ê4Úd>'_¬#)³ÐÞk{JÐÃ>l´
¡É#/±IèܸPú7ôùÛõSÏÃ"¤4å:È<Ò¿
©5ÒÃ9hÄIÇüFÈb APIÔé8Ö?wê°&Ä6Dº±Dï²ÈvT,©kÅ>Þß^höíËÒWyIþfWÀÌÅÃ(Ìc*"båÒß]îÓ£5!²µ^üÍy<M¶Þ¢Ï´ã<³ øùðÓ§ig1?oó»t49UG«q#.=C<çôúµö÷⤠û>êì.¡$Hôi0v)¶÷#/Ïìçöw³7³È¥iáeûØ¢|6:ö9uųÙÙ±¬©»kiûD8Îbi6VÐam4Û¬»#/Dµ`SZ4ö¶¶ÞÙ âm#.bqYjuè66hY
3«¶HÛL´ReE×uÈöbX
£)cíÄÖ¨¨j&(fÚÃgrÇM.o¾ÙÈ Â ÓlAêÚ7&¡D2hª]âf89¾ }0ÉHFÅl^Û°K'Â[#)/÷ù#/h&)@£a/QAt껬´ÊY4·weдKÊÛia&«VGV8@h3$ªÞTpm:ÅÐ#.MÊbÔÓKe$£&6¨Pf[6)j10ÕJZ^ÝÇ©ÚÊu$F4CP1±F#.P¬-FÒd+S·ÁÞß|`©¡ êt·%0dc9ÅÌ´Öå00tm§G³W#.!4 A ²*RáeN@25º©8áSoCL»P£#.4lQÖ-Æ+¶13q]f 4ðg¾}´PÜSpZkC&æ,¥TDQí*T(³S$ÁrÀ1jKÛk
#.½wJÍ<ÎêmÃDÁè0Ó¬"¢¤Û²ë,n<¦0·4HîAFøî1B¶¸hÈ M#.#/ÐÂTBÑjX²)X1.ª
F)¥cÚ]X4Ñi-+HIÔæ61¡X¢Lhc3µ3~̹²¡
Á1/ J%´]PÈ
áÈÆÕªM*Ð1»g²î{°Ó?C¯ovMU
=Dx#.7&ÈxE×ðdÍl%iáDÉìÅc1>3gA[ÊáUa#.CÃbðe¦¼sÏ#/½&4e¬DkCÒ7á¤bÐh´ø1ب޼Þä44ZJßÝpŲL'£$â~î¡ÌмoZàÉ!ÄÜNÍÁAÕJð¨K|jB]Ä0 -1)ÂJd¡!£#/V%ËhO0EFX¶AªÄ¨ÆVo¦Þ·¢HÉîBtÎQY¸ÒÌV!c
gè(ëL.سZo/GÊ$¿|XAb R_Ù0@»C]H mkPN£n ËQiHÆǯ }°¶á.Â<L4&V Ö@é 0eÑ#.d"bQ62&D"¢ J¸FH«t6¾ê§«·»Ïñ=ÔtE3å~Úb®ñ~XCçúæëë`=îk«÷°òj{¤6~24p#Lx}¿rÞôk9ÏëõnzÒ7!Ê?dLJï=ZBÈw~Ý»JªhJ
éAjÉ¥z¸wv\EJqB§«0ÉG~Ð×|&ß5¨¤¢pxx KSMTðdNf½{ì|ïFÕl×ò.Ì%Ä(#q$Oqyèá½(®ùéÁ¾XMÑÈD:,Dn1#¥¬òÙ¥DÒÂ1ÁÂCrÀãMFÉæzeÊå«ô¶úñð:lç°º(êQG|Ü"¾êÜ6¸Á¿ârÊ~ÜùÃ[ÃÌò*¹=QÍ};3¯dtç!^\08|1Ľ}ªìd÷¢3âÍÇ6ÛA"Âu)¾åU|d6BFbÒ{a¬}3ckܶ@âFùnúÕöÓV=/p;ÆN\Ô~?¦qø¶ãëS¼~ tÚRR¨!è?5#/Dvc и)¤Òá7J}Ø#/º@í<º³h2·#.6TM$:´¬$YuP&M®ñɱj6òêK]µNÜÍÝxª+«Yf¤Y±³f¹Â§uZ+ITªËr\%B#DaÒä¥"º,0]PybjdûøCMÑéCÌvªS\Ï~ë9ÉÊ£Ê@ F7U#*HÀÖ/BÄlÁ@téc¡g¤-6&êh(
M`!ñ»9ìq-I`!8ðB¡ÀZ/õ»T2lVLÊl[Ñ´ÍFÑQTVÙ#.Ffd¬ÊI0¶hѵ&¡FÛM@£ÀÊ0:ß··BâàpOGÜÒ5ÐM$R¢jt¿CÍt½kÛÆ[ùSG;ÉβM#øî¼U]³¥fÓJ@¶ID&¯M Jö@úeW(MJaß9yuÒj»©6»v¦0¢Ä@æ8$ªÁ´ª) RKÿ®ñî:÷Ñø7 ó*÷&*âÃÂ#)u$Õ!Êk׺)¥b°kDë.ýiÌòïë/* ì3×¾<ÐÈX8>Ócm*pÑ鼧êMg³¥{wö`£òá¦_-#¢z üqEÞ}ö¥ÑÄϬ'-c³1bÆ1ÈVðûìªH61ªðcÙ PBÕ«2¨=²º$ad§ò²õâ¹:[¸|¦¬ öç.0XfKyÇ/SÛë1°èrJÑÐ2]Ønú[¦~·å¥±Õ(àctwaI¼e0C±v9³W\(6á¦ó~«ë²,NDjº§;Îf²u,¢/jh%¢°Ã!V=º/6PdK%´ËºÙâðMþpí¸¨*Ä~DéèàÝ£ÇòØóLë"wÊnÉɼôç¼Æáþ±ãCúV?@äÄñì#.&#/y2o:;66¸÷%è¨þKìAù$¾ðäÚÂE~1#/(P#.D/ 4¨| 4AACýÄ%ã#)abwÌ#/#/#)É4_Æ'¨a§_áÏ_LÑ(}^:ÜÀ}#)ù'
}3ÎL\ûHb2KIÚhÉ8J#.#)@;A¢6ÁihѨqÌì¥ Ó¾æÛûCn*Hl¨æÈ#ÛU 0DÑM*®¡ç³@Ìr(å*Ø¢UÙT½ÆîBaÛP¯vV=è¥cUá@b#.36ËFjÒQ² ¸«XDÌ1È@aERDEj`¸O"¤$5ôâQ`#)&pQ 91xÒ>¡ûï·1 I4ÄÉí£~»öðòq%'®f÷D?yÛ#{ §FMBRs¬íbø,IÇçÞr#. £ÅãÇøyz;ÀÁ#)C¸T}F¢bd#.m&bi á¸ÕO¹¸ÝÇvM3âÙò´þ¨Ü×¥§É¡¬@¿s30wMv#.?rÄÈÊtü]ÈsÞ;àÇ$ù§lýr4¢gÕüüÒÕ<ÕkðFïFúgj\cüÜs[,¬é$ES6s|¨\{7äÙ4¾M¿4ÄÍJWD,¢yS? õHäZê½Õ#¾>Ú}04~ ðX#TRÔÒ[r@ ¶Èaä`±PhfBzµ¥]G·ñ*&óú±31ST?=ºVõÁ{6Dy¢±Ðïð·\<?¾æmÙ£#))%j_ö?hÇPó&óRfXádHà!ý»¼W$ÈOYä@WñrnÃhÕ&eTÊXÂ8Dß Ó¥Ó÷¾¾Æ©¥£f³ZÒM¹RFç̨SºójeF%±ÕxÖëKX´PIcFÁotÖhîuy¼£¥Ö×6îíÒ+¥âÞ6¯r$Ñ£Ë!fJ+@¸(j×5;¨Ö¢³MN×T*Ƨw.»Ý×[¢ÊÎë¶æ®¡ÎÍÄVB.$¡Ý vºAMWëO®`ê7N aôõý]¢üt ù½A@èãó{ð(zÔÿ7#.J1æÙ#/·Ø¡ëe#.Üñüê>ñ<SÓÄGßû'<iAÐÕ;"Ø)Xïôù¾¼õf9î³äkê߬ëïL±ï[7½ê«/cÉá&öÖg¤=β%Rª¥@¢ #©#.õB&\k5ÇüfÆü²Lr¼ÿo~DܨbQ¨§ð$úÏdm/Ôª<r1¥ªX2À0Ì $(YÌ%pôiÑQQ¾7×fcÄã´¿"@N1ÂP-bUH&1-ªù½ûuËW[A¾àíP14ÀRj6Ð`E*!!#.Îtä@²R4 ØÈ'÷óç#.B}VÔ/ùü__¸¨AÂC9(ZPÉ(,Éõ?Ùþ×såYP#.»ÃpȶhTaTdZU a#´#.¥xtüfÉ£ÎBÄâÈVV d#/X Z@BT#/|}ǵø 'hJ¡Ù~ͽ墤ÒU0SJe*ÙH
P @FÆÁÚ*/úaßÕ¬o¿<.ptCë,xÀ N"Ô?o3#vèH(XPíðÙ+X.m¦û:|rÃàÜñ¯ê)à¿#m¶û¯Ý¯#.¡Hä¼Pz°ã?;0pl&`_×ͺò#)+!!ÝU(k|ÖÀÚD4¶kLá´38ù£^-dGø!a¸0¬
qk0TLF P$P¹6àë4á"ÓF*§RÁu¤J7Ac³$*FÔ±âÄX@i lv¸#.#/¶Ä6ÔxªåÅ\£oVjÕÊÚ#/ÆÑ¥ö¥clÎs'G>OmÍ]]«ÜªÁÀ8QlÂM Ì60[K¯#ÞI#.kùEQ£MQhÓÕL ¬µ4d¤`ähÛc&EZ@"iPÀà &$Ð ¦-06ì«°c°Àhv9ç. 3cäòfÖ°ûðo(¡ä:TA'"Zh FHÄvtÈm££Ëu¢õÌT(vtHlG BI ¢¿ëTüA!Æ>øPÈZH9 ÂZ21I9²P+\ÑÌ÷Å'8¼ñwÜ#)SâSþ^<öUîìX£i$-|`´T¡ÇÊSèÍ&Ë\Häc#@66Ùd²a ¢úU1ÁFL¸W¬alÿ«
ÓifU§Éý'gýR|m¡óÈ:%Z-äÞ¶ç#®Ç·ü÷0Ú²Rõ6¡µ6n×RÉm#/Æ9Øa1éÇ#¦Ðõ)HÕ¼& ä¤wôªPØxv" Ø©H¿²A#)£#)û0pQ%¯#)õ4öM¥õ æhüâ¡î_ÎÄ-_ï¯kHc·¼8×/8öÿ§éoCâ"JHJ¤ /¹BÄB]ùíBÀò°ÌÌXóNh\=Û¸^ÞÒmOÜdÍ樮~%44j@¹Cìû¦Æ¯¿7àÁÑÓ (z^5!]IéTÝd©W¾ 1ÒA©>©ÌfüùÕrøÖ¬Í8Ì~©qn»5ÈO¢5²-aFyÐ+#ID ¥ ã
2¦ÌÍyÜM£ÏàÃDZò$ÄH1&áÐf¥é0pÃySèB¹Û¿)0îêù[ïKbücÚùÍÁ¹Êª£ÚG9Ë(¸Å^ȨwråÔ1üöDÄ#.øÖ{VÊgBÝY<o,?¿Éa#)ÐØ0 ,#.iÔYfÒ4ÔÊ-¸áØQMëhÆÒÓi5}RI"'c¾l¶d~ÌÃ:4NxÜ8ÖçØÄ«NYÍt¸õ#/l½`±qRºNåûCÏG=¾nÌZd}hÛvGA÷8×)k{#/r§©«Ó¯1åÜï)ß²Ú¤LýÓ*öö!þ¾s§°±, °véÆÌILÌ]Ú$p@e!#/,!ȯ²¹ñæ<=½Ïd.ý5ëÐåÛ©E:o2a8!èTûU ÀV¦#@TSÄ#.ü}¶iÐpLqÝøÂNä>Å^ËeíSàx¥ô7ºõßKÀN¼m(LÍ¥D4ÄbÝ.q¨Q¼ÒÜåÌla«@l±ÙÃÛ$gh¥3\_3=©i=IÔÿwED¦$ÃP B+>éÓ[5ãcñæ1ÓÜ`±FØGii¬C`¢a$ #.±Ôõ÷ìMÚlA@Ú2=qY;Wkôkáéôg¨MQQÃCZO]iUVQUF-¯_·:Àf©¨³êÛùjÜUä©6°îÕÈFÖã¹#.RÚÎÊa¸ðs%~#.{ðÖÌÝvï¥9:,²HÿZ<æÚRǯNþ-IÏv.Èá}$íU-ñ8Ôáιi±p¡A-¥ÐÞ)¸ºÛÈ ×=M°Â"#)a #/E'x\¢3°èaÃN.§|Fëwëfõ]¤2Ç)¶]ÓnIñËÒ0î´ ë£ímúeÕ°'VIß~:÷%TIÄç8Ä0<Ã]K`~ælÇ&̵92¬PCOF`ø7ã!Uw=]+`N^¾8gN^&.KÇé;ªª©,ºØ`>ûC+ñ×Í÷øü+ÖëÔ^¡vaJÔ#T¨{Ôþd¼ÛöÇäÿ;>D¨)@ÐÄ)D_Y¬ÙPêú{¶;i¿9úñø?Ühë`Åh½ñdÉaÜzçê;Ú¤ÀÍüÏ6£´Aʦ#)ÌTwô·+¶½Ç´¬#o%òøq;ýáÊEwÒ:>ÙéÉW4Ûëa¬Î9lyxM?m¹%]XÑOzuÄÉO#)Or)#.6þêûtJëË_CïI#.w9Óq3#.ÐÍoeoÝpðoÞnZMzý<»r4+ mz°}z2þÕ¯fàE#)"$õÈ°##Ð< ükÁÛé6;Xá^3qô;ÒЬLzyPäÈAôDaV_Ñþ?±NøwTý0
Ô#)¦Ù#/JvpCº^]^ààe#)rUЧ4î¶$@ÉÍnhúÌ Ú]
ÞI'÷t¾éøAAS3÷¨&xÌV|tÿKHÈå©èT¨àÇBº;!X
zÒ4_G©N±ì@/#)
K¢Ô#ÜWÎ#.ÿ¢*Ô¯aU(41üÍ4L6múÜ#)Ökí[æ¹5íKºIZLõ©ù}>#.@5Öí$Ýók;úßág#/RCºeùʤU¦Ün(ùBG2#髬Jc¹>Ïæ8ö¡Êj:q0O<ïC4TV·¨»¥ È¿#.
Låøô4x$;9-öP?YËQ´û7Ëã4½:%)E,ÔÙÜQ®¿V bÃP9µbÁO}BF1~Yts.|íaHÈ":qôùpâÂÔRUHÒú@)h BZPPÈ÷rápå:T u4>zý}ÁOâ¨!=ü>ܦøz-UT³3#-$iIB)°ÃRJ4ÉÙfÌbY¢PJe@IUTä^ÞP~)*@iHH;u&c±6zêë¤öDÔµÍ\»qµµ8msÄQLà#.s®Z#)cM{AÎ ;ú,¿¸¾ÄÃ+*qÝíc³ß©Yyx²ñZ ¸c3å9ÌöNÚMâìM#/ébÕeÐТibêCØ0Ã9ÀPö#.E#.¤g(¢F$f£òæ|É!Üwõ!®¬8IbpáEkñ"Ëéդ¼÷$³¯uüÓáMP¥Ú<úþa×ðcÞ¢Ö pY¼"çÆÑ"|ÿv×JÉÖ¡²ØÒH)?z«mdÜ` àF``+b¨he&q }vÊçQjå¥uÛdÙÉsp`Äf梡H,MÍHA0YjD¦#)´ÂF;á@ð¡uDB;JDÜ~LÚ*
&CRäDàãCPbäqLÒ&üŦ=#á0F´0AX¹iA=ÕÃ4ÇèUkrBÕáTÈ3VSüÒ¿o¸ÖHGÝÖ±ó0ê®Ñ£¸x1øD¯Ü^#/ß,6ŨÛE(òPNÈ,2XBµMM#.&´g@ÉJ#.H0\ÝÅÙ)ºé×OVÝË(íÕxÀxÙ9£¢SFiIh!ÜHVè&6°pP#,E$Pæ(°ÌÕ±±&áci,¤sYTL®V,ydÊ̼$Fn",TÊ4ä@©ÖÕGJ±²më-(ÍHc£qD Ñ)4(AÕ_#.½<æÖÓ¹³oZÖo(jï7»Iî4Bbml¦ðS.]-OÀåM¦ÈbRdum[ºQ6G>rVðh+U8æXd#Ã!KÀF@zÄo mMaÉjNí¾ZTÔÉ{$z!°\
Fmd¬éT 5uCtµ22WF4<Ý¡£TÆ6uÖ¬ÄÜQÒE½³DÀ`27nÑ¢ç.r0$yªJ±¤¸l#/F³pa£IƨÀÐÈEè\Ò[3Db¸àp0Þ¶8\m àÑÆA_/Î@'¤×BõÄKHoRÚ,ʤ»²#.T,`eÕË][¤ðßxD¥Ú@È2Y2LLÂÊcH`ìmV$û¶&B}ÅÄ#ot7ÀÇFµg #nVÆÉFÖ:^²12"D¥
+ÕWãÛJH}Xk#.#ÃXÓLÛé¼#/ªl¯JcÍLX0Ü#`¸g Y0©4Å2Æã[¤è`FfÙçcÓÏ0æÓEÎQÖýód«ÀÇ|@,=¹3#.J4²lFâ*¤'¢<ðá×^àè5FiEµmºXâ8×¹¶&0<]4n#-8ÅRE!gRf%£ß¤#)Ò\@cB(m*!¨ EK#)Ãj´»@Ðw9'çìí,©þÉ4þ¼È2mfB¡ ÛLòºH¨B0Æ«59Ìèa( ªT(¤¨BZ!&Z&!N?ÈTè©P?Z|ý`(yy/àôOwîí×ZTz ßùaÃ@è7öo3F »É»;].Zz!Ç* `2fX
¡RaL9§i+± ê9hùD?3ÁÂ{øì.<>:k*h#bS¿f?yÜ·"sQ.!Ê Bí*,7NÙζ ÕÕÒÚÞÛ¥Yè!B<\ÃPy3°`ï§u´'®¼òQ±l_#.ñPrçk9Xþ
,òÎÊ$¸njnËpÈÁlÞtB8ÚS®aÇþU ·KßÖé`oy¶5Â\æõÃ]O¥Ä´¿CéåcØA#.%¹³#KõòZýÍuhÃL_BÐ(ç=±&EüBúvÌø ñ:2¯ìþÔïÜF ¬Öu/0èaÁx(a£ïf#.&¢Ö¿SÈ$çxeô¯SÏ`=WiõÀ3ZÃ}ßSî=#ü}¾îÌKñüRÄVìø0Þ¶Õ=ì0ÙcÐÕ²aeÄæ³#/¦ÀõkåeÅEà1'=£Ád× d!±(ÌÅT4mkí=31#Ï|ö»~"THXWê#.] ʨò+¦z&ªÿݹ²?ËÌôÙË«lO#)ÉW±päpùjêT >¯ê çVëÏ)o³ÄíccT8î²TJUÒSÝ°p5TG>é7Kï?GWY«rÒª"pbÃM°A@-#/a³ )¥Q6xáØoÎ' &¸Îþí)RRBsl#/©ýUAª¥íÀÞM4k2W³SX`ãT¤[FAK½:ÜwvhkQIµxæ®Z,oʼmX£¢V@á#/jRê@) #.k!ÿa(ºF- ´¨3cDa#.Àèz4TÂØvÕ"}#)ÙsñN_X{ζÃ#)i¤ #)xÈ)í%u#)âªæØÖÿFãÀ6q&NÏ.¿NgíâÓ=Ïm¿CÅç)ÜÇö(Î@éÌ¥þILÑøó¢§d´F7W¯4õdB8É BáS
åë6ö`.!Ø ¤8Ñ7%(¥U#/q¢T2!ªBDè&©4éXPÄÜ'y¼=rB¢xQ"ãìÈ®BÌ<ØöÕCàªÂOò?nÆÀûÈMÅ>Aî3᣹Í#.Þ#/ <' |¸·x¢^£©3oJ¯àx7ÞaBxâø_PqeõÈû¤DááP<ë5Rf¥Ee6R"4¨ÄM#.´Ë)Ðʵm¡ IZV@ hX6#ÜMRØ ³ VÈLb#er$ØO³#/\ÔPËâ(Óc¤d
a¬#¸!+DI1ct!E#)l5Dbjij#/34ÚEÆ0m;Æ죥d*@¸B̨0Ð#.¸#/©`ãþ:ÙwòÀt #Èc0"îa# PÌ5g¨íCW\*>\±¾|>Ó»Ìëðõùg#.>QUwõ³Jíû²e\ëi¾äá,(¬¸µfc>ÇG(ÛB`3eMeK(Aí:Hëuí1ÆC5xRbHÈ-Ì*1¡²ÕµÇÁ:Ì¡S¼)ÒEff¢§BF@LÌíÙÜG$iA¡i\p3cBSº;·cÿÍ 3ý)éOý¹ÁcZ×jkÚÅ (ÌÕ"»÷kffå#)m#.Ú#.@çÑ}`w>Îç]ÜÊ?§/(í¬Á$;7H3ã¾®'q#²Öúÿ/¾¹¼Õ6öé=tDÏ^qPzig;A¾gDívH#ìîo§[£ó°t §\èJâ-¥A#.4.Äë|o²<\!5×9§ìv¢½
4òEïÁö&Ç#/ÈÁÞ'Ì|Y§*;¡ÐC'R¢iÖ a)(ýaã_Gh˹Úä;¢uÝ3áøD bà®ß±ì¦#/°ÏôÁ;8Æ-58ýß;®FfnÓ%OÛTdÍ{xȩ̀å?
às®Z¶4@âqº;hDôdS Mµ®ü^æ滸8¼Os£Jt7;Q k©Ò¼ß#.v±1ðZ-ÎoáªóåîKèܵôô¹:§ç!/Ëwß¹÷ï ý1)ÖaÙóç×^ RçåórÀhG ÃËÃó·ÂÑFDÁ$}$R@;Úf#)ÚfKtìÁÕ03ÊÏ['×ÛüuíLR=Ò·äz»m 'óÙ:X£È]f#/rA(éP±þ.áãÐ îþ2kn><
;¶0øôbJv&»|ïÐ
aY~¥Î\[2ÎJ_~níeSLðÇr1=ÕIÝÇX¸(wö£¾Tu1𢢲TÞæç^Ý&ºwMôHFQdÂéTOX;wÕ°vÖñ`äØÉÆjn<]õ/qÎs%Áë¸}ý0êéÁ0cFÐßIÕI²´¬¿Øª×BM`¯ÀN<¢NtNÎfp¶9òæHunÎJCÂ%¼¤êjí¶pÃwéÇl)8g4a´cEar#¥CIº/4ê¶À×Gtøhµ§7k8'Z3-tyM#.«wÂpw#G/®Úö {I¾¼¥<ó$¬Wrõ½©ÑóÄÍyq«ëÓñhuz&
sg>ÞbÁPã@×Ü[[üÏ'Y"äø÷ßuFÇ<Aàäç©7ë}ðiï´»w<½¶sEwv÷¦é»ýW¾$Á'~îHñðíD{*¼v]þ(wî±è3tOß#*NÇì¹ØTç#ú68mL£<£ÉäZMâJÔõ¥Wb-÷Ã)3Èt:ôm_-¸ºLxMu¯ö¸V$AífºOëyHñ~Gz#/Ý3éõªe,¶å³\ï°7Û#.¤C q¢#.&/"¢+]$r(FÝr1¹jÖÚho#£2)ï:f°üÏ#©Éq¾£·°³Ð äFªc"hjXÁåGbDqS"Jç}1`Ç£¹C¥×ÌìÝîCÚÎAMDQ ÛEÙ#/
òI@äöë4ÑØá%Ï;:1!û/88Ï,Aé¼³TO_:0K#.äøà)~±)°â%nÊàp¸¢]ÈæWFÿC4¨Uâ.MÀÂÀ¾ÝC»@:ÁD&>>BÖ$ì]£CDB¡Û°ÑßÂtrÅÀ{rÛXÕºòaK. £79z²ûk»ÜJ[i å¶É°v²X^Mb¸x¹lhD D"#)¡#)g¡cªhÑíûiUsfvÍaa´p#/,ØMûëÑïñ7#)Ð8pGd@0{lÛ{éËYZ$¾;>¨3C ç6Né¸Ó³èGòCÖoI'|Ò\"z§¨AÖ>}Å
ÓÞwìíõ«D´Á©Slä¤JLr\p÷CýävMd¸~¶×8[lÌ<o18¨ò8r]ùÇRy®è»qê(=Áøw1'ïlê%â3®'Éaí8ñÄUè;'ðç?+Â3Þh&*K4L·KóPtcbr<·{s©ÇÓA×£ôÂXætr>ÎUôö¦¥âÉK/cºãæ»Ç<Ú.Ä%t»S\Á;§z;ÆaQ©ó¤û.5o`#/$Ñ#)tïÒRöá!úpSÄæZyvvÛ½Eò5ݬ×IÆæ4èímÞÙ9â2#.F5Þë¡ ÑïOº¼é»Wæ+#4bô
-²K6¶Mºv]VU`¬):l½Ö=iØÃj¥×Lõl;¦Ö¾8[,³DBæ¡°VçÞpê8¿ÝX1³Ê¸£ËOÕPùëÚ%ÝRzÑI« P{¤BÕz³=bÑv¸Î6e*ÞN.Eú¨[cXEfða¶##. ú$_Q[0^çOqyh÷¾ñ^2äjS¯Y4Áý8úi=%¹dZÑV|q?gNB:ZQJ0IIcC8N#/©ÇpÂ@H=W©êi²´V0úívÊÝ{<=zS:d´`VòºR$e¹;1F@¼,'Ê·Å`zxèPIĺÀÁ'¤n¦ Q,¹KÔçÕ|`i9¤õN6C¿smØÃÖçD6Å®MиÂ礸hk²WÛÃCº)*©2Aл¯Äæi#. 0S´_2f Ôw3 ,0JÙ6È7hfÛ#.¥3ÎÎqì%º+åvpÃY0\Ì<g§ÑJo'Dyâ ü0Τå|QJLzyfägjj£¿óèæBqæ1¥ÕOzÂ{4Ã4_;|Ìmû'fi 50qíÖmÄLÐÁQÞ2®®À5^¶-5°¸m[Ç_â>y(a Hd&èDm0Ì3V0x5PÍ#.4Í4¥¢ÒU1iÇN(Èb«oMh Ö5ÍÄæ×6Ç¥Ö 4´Ó@>Éfi©«mé®Æ¨ÚµÕÐ@¨Ei>*¨*ä38Àz3§7WÈÇ:mÌàcgTâÝ2Æí¶_ä×Zbu#/F;eC¨!Ȭ´0¤ª¡ð)(E\d7ÙÌÂÍÏ~úvÊFpÙ÷Ã5öÝcÇ-.RSHaüaØ,ëÇ^TbÁòÜ4Üü2aÃþïå0lálYÑ2|Ъä;æ4T(ÉIc#.pòµÓcP)Kϯ&R#/8H©#"W´Ê FË=Hîx±í¢0 ÂdCÊðÅvè=HWM¤Úlh$0¥j)ÍÄU9¹FÓc±àì&®]uªcWc;ÖúÌζ֣½ÂÅ´HJ8ir(#.ªXb3%¡ÈØef=íêõ¤âdâÆÁ²ÄfÈW+ qåàÞ,æF#x¸ê9|¬Á³Í¡¬Ë82,u®5µ:Ä77»L¶ÔM¢XjBÂYw-Ö®g^¤`*uvf¡tíV'T©aH# Nia#)j#.A¶1´ÅÄ#f¤#.0ÔÒíRFT.¯&¬×®%:5qÀÃ%Ùä!2êT1¶@Óæ+\ФIÛR¶Â7vÕÛmá¦o´¨#.)Á6RCc´È;Ô¬#/ ³#)È´8%S)TTT*ÃÞ Òic#/Æ6óQe¹yâéhá
ÜÆFÆ.JCi50um#.7IÂ-Æ9¦î³ hrÙH4ÃÀv3k?é90²üÃq9:aض@êf,yµ#.ªQ¬Ë«p&3ÜA.âà7f]é©H®qt2ÐJQK#F6È5aB
hmFLD#.¡$Íä墩©¹ç ÖnÜÒ«Ë28t"'®G¥×F[ Õ¥iGʪ©µ@¡Ę̀±Äel«ËèøL!XîE®öªã)ÓiUß¼\R[Zr<bÖæ¶ëCá½,-J`pÍ:_ÛF÷aZ³ JFÙÜ$éÝ)µe7L¤Ñ1Ìî°ÄÅÆ]¯OÒ"Ò ¨`¨×]Z·ÑÂ#8ÆÂPùdÛØ]"I¢K;j8n<½$f>¿7×ÌEUA0Y#/½åÝm~a·¼þàÉR¨'~ðê"S#µ1ÄÈ2ªñó¹/öX{qÀ?A¼'zö*5;k.¦b¥1Ý¡È ÂEUTd£$=Þ¢§¹%}ƯÁ9¦?k§ekeÓfq3 ý â@6ýÞ äêA"pm!7'³Üõì!賦 qnqa²Þ7ê[x³ ~B°v±¡ÿ¢³|³Áb"²¦«Ç[o ÚcFÄUªoq+³F*.¥ª"ª5AæÄ[;^Þ3¯I{ØäDøÛå4èpçRB k2ÙMT?9ûq$ý~þjny×_2xôSÚ?zd¤÷ª#/ì¾e'i2¥Q eB¹ N¥@Ô#)>)ϳù-ÓàâJ~ùìô{,9ßÔÌT¬¨Ù¤«h(Ô!BÊL*ÔÊ0Ê(C-,0DìIRbÊLÒÍQJSI¨Y¥JE1PR´RQ±¦ÉJh³iRHÙ2ÄÂÌURLLH#Mózi69k/7j2pïж²ÑîX35ulr˱Qüxó9'g¬EáÔÄû®Åu'±-ð4ØR<rO´×1qèJbËõ÷| ÃqMvÁ2ÃmvÜ/ßF2Ýæ H(Éð,9J{Níü!Ù`Bh\ÞpêX¨$ênC1ì>~ïM¤|øxÄÝ<
B¹-`Êü?zÁ¾}MÖ·c/8+ýQ |ÄÒÒ %w ¬k#/L#VL·Ö¡ !b´Å4cí#.ÐøÄÙ¤#/&"#'ÒUû)py7ô.5"#pY1ü#.èsïË£E`ÔLåÅFQÑèìr#fÆðqÒ,b
Þnde0lY¶´.Ò¤x#.#AU>Ûó8.õÝB}=ì×¾WªM#.OnäÀcXù¤K_d0hÆ'ª±ÔÕe§{ÒR¡cH1¤B$&FE`EwqíèkNÇʲÂqaý&X·CmN( Ñ·LÆÖP©f¢Ê4å¡8»;jÿb.V@{zðeÔ·öCh7¥¶DÙ¢bv½:D ÈÛ3)öIQ 4î;&ScuRâàkà$IUSº"××Ýé¯;ÕC Ü'Ã)¾¯A }ð|Í#ö:¿cÙÀ<=¨oZÌéã¯KV}ìÇT;¸nL$Oß9w4¦È©øü!å/ܾ(Ç=0ÜØ9ÔpÙçÊO~U6Y7õbºÓ
½WPsÞVÃ+G¨¼@#`Y)¾½8¯Þñ^mÆêQJ-Õ¼1ë?/Ç]t5*¨¥vÕÐˤé>âàpÓ³1tGyÆËoäb=/POZ8>é§3ñË>7%t¯l±zT\ç0\èb+0 góÏj¾»Ã-D¿_Ô|´äóv}Pô¦~ ø¿[/Ýb¹H4öäÑã<Å,=#.ÊçÄ}wÙæµ~Õ{3ÜÅÌÌz)HI®âÎ^o*ÈoØUbX5{. ÷cÂý\JÜÌ#/±ùwd³CO}XïÐo
Ø#Cý?9nì;£¦·(Q¼0õ0Òc±0ÌÅ4=ÚÐ ¢(Èo?Hõ/mRF_C/ì6&\#)|N)²÷^5òü(ç ">¯1läé#)°üÓE(cD$+ÖLG$`³E#.BÛ<ðÅèçõ¢IÛø!h%UO½=µ.+[ÂgL¯ü.U¨¢]B7A®T&X6£Zs¤Q£n¯Ø¼``Û\[üòk·U*©Ò¦\)T,ÙqQÃÄâ±ÄÎÐ'NW¶-41Ä!¸ 6 NØ2 ¡"DÎlÓSúKJÁhaþR$EF9ȸd\rõÓÇz6^ÈßtÙBBÉÜ4BôBiAG>Ö(įHnç40Hgf]¥¯@Àg^¶pA»f!!¦RĹZq·Ó¡D·nD>ÕNÜH§FaÎ#)Þú]X:ìÐÕe*<L:ÏaúÝh#.%ß0r£NÒ=<Z9«[ØÝWÄ`ÐÓuÇy±Ól¢b+"E¹FÜ72`ÓÆÅÄÈ#/Lj#)ÙÆÖk5X6ëi´lå:N+ûÞO®v²ß[é\. JÃAM*ÅPö¥ÝÑAIZjÝõçv*ü *ºo#)±y-Fár,nÙvì<»Á·ÅüõÀtä¦b^ÓÔ7yÒHpÜ §lT!íYíÕ9ÍÕ¡6.(ÑG$y¡é°JA¬Ù#.ÃI@ôd`å#)o3ZV-!*åS©qÒW>uEaÓáÔÇML{»#.)ª\ãz=7»2¸íÇ'[Ë2eÚöc³K@:6ÛÃ#)ècMB2¤!Ç=Ñ]v`Áë¶"aic&TPõÌè3i´¨CR#);9stB¦Hae°b|ErEbÓ±¬e´è;.Q0éJ£$À§3©2÷k¦LAzîÎ#.iålÓ÷ÍC6Í éÝXܦM× ûA[¤ÙgDØ6@%j%+xVÏ(réUTîåF5Mn¸HÚ?_<c×t!£2u"eñ×1µ»áV^éº6ä)g(XW¹#.FìN¹kµ·\¥»îL`Þj"ì=æ®uV»*6úaSKxQÃtInCÎE?b1&iÓSÕËÅjMë`WËxé°²+ f@!Òõ8
ÔðF¸
¢,;,YBú8ò¾Mt×'plØèr6:Í!4,ÓàTÊ73&ÁÐ9§kégÈkYfhPâë:Ç(:@÷GlÕ§§<é¶m.#T²ÈOøôX¶þòIK+ßqr- ÃÑ?$Cãf#ÈgM6vÕb)(B¢#)ÚÉÃSÓÆ-Î(0
tÌf$áÜtCÉ)xy·AèðãÅ^åÐg¡.PîQÊ¥#.4¨,VO3±ßò\ï:Óð1 ¸ë\Zg;Ø0SC3&3TQUÚBI²pÛ ä¼±j%Í\
u;0e"ÏÎÿðilå3dPå5¥â~>F¯ìoò<4#)ÂL&N¬Õ|îf,E¸C9©jÔÃ2´¦>Fdº¾Ñ²ü¡·îk´õÌØßhæ+,"áÙ¬¸AÁbw°j>yn%[Þ5ÃÊ"0{OCïIõçTbåh"l\D¥!ÈÌN~K´f5½Å¡¶éêÞsEbÑv»û-Z á9hß,§È°ï|('«ñFìÜ0ã2bBÂ0È"ÉJMNKÕÐß©ÃX^ÌY7¥Cf÷G4}@ËDSX:ªÜlÛÄí0á×\µÌæ_ÊȦtê`,Hõç}0jÌÔÁ¿"µÖ$»6qëÛMܹ}#.%Ð$Õ9Ô.poJ
G+§Èb´#.qV= ¼J1Xo ³J©·Á0_£Õäb·N&ñl}i©F"PÈy¡ªhEçAFH"¸ªPÝÔlÙúAÅâ^-µé&Èm#.(.9u =Ó+ÀØáÔ¯ ! ØÐsnúñ%Ha173º1bETcQªdÉ/U!¹È2#.)ª^¥RË]ZO·Cb*Hlik¯°3Là %Ú£B´¢hëC°ø±4uÔ#Æ#.Á9uTUSSx`0G©1 Mc'²õ¸fIRÐv$fé¼lR¥õSgc¨Ç9gc¡ë:*×ÜÄÐi64é:)AÒ"1´|½}¯ËovâHÌ1o_Z4ëãðôWÈtwû{ÉT#ÒÀ$è¦@+âJþßíøõkuP÷ÆÚ}yµÞøØk_¿âLĹ_Lmt¶±þEà1rJo)¬§ÀéglR¤l#.»ÊêinÅxÅØÙ&ªÄÎSÐÄÛ4R¢=míñ¥L3¡m[CÕø¼½£§fÖY?#XAûù£Ê¡ó$_N'ÙÍ4% Ù'1îg:è\?Wæ;£
Ð]Jc²¬©@ñ,TÐiZ ü¬²ýÑ¥÷èáaÝ=¸#.(´,Ùh®
æ¹+©Ü1àT§-ZÊZ÷Áa5_nK!¥^êUq,¼¡ï0}a;]æl©»¬3fcI×=âÿËö/Ùí@ЫóÃyøÆ âwoÙI¥v¸ß<à}RB þöB9î>Úèáp`îP9GhÐÄ8(1²Bd}§p)±¤ç&ðÆcF,ÂE%RÀ!nbhb)Á5¢4æ5.Ö1F!!K(ÆG
#)J d: ´à,c"ºÜ#)°äÐì`a6>#.hÚK(4]mʨ¾+6Û#.ËÁw78ÝR×$¥a#Üûnæ;·òà©ÄáeàÉÐ6Ä31ÁwòiýÆj"W8,èTp RKs1µU º!Êeyð¬ØÎ
N.~I8Ló÷Ú`0]BxÂ:FBuÞÙæÌõhës )ºDßlóë{i*¸ic8x yg8·¢t×N²'<í!ßÝeëû´i³;å4Èdoo=Núñ'Ðv^]nؼáæz=3Õ^lÁA5áÓcØñÈÐHO0s¥1õjÚ²`Ó¥LM¶Ò¿lúãx,¨eõ;O-ÃCpÑî|<g¯åÑø4ú%A fÕe#/YU)o·MdI´EÂ!)àB"jßqÀ#.@ma!úá¡\#)ÒB3¼Eë|¤±T]êBþÚ0ÌÍàÀ0_h¯£qùô¹ÜëáùMòmK2hÕ&C¸û|Þ'ÅN*#.ôÆîóñþH @hA)é÷ïöÛëðÀáñð5_Þ/Zû¼éµóîî?fÜ&HJæHLx!Pm¤B+.e#/(ÅG|Ó8賺UvÞ6®h«¤¸!ADc cL&0
ÁXEw7Á&9#.Êg#.ô!¨#)`ÀìÒ(C jÞþæ`c¯I´éÉ´¶ÆÒ£ùä|?i÷Ðé¨:TÄ8@aªA+XWFÊ$@6m§°{y´1îÚfà`D11#)êã˾ð˾Æ}}E<ø!Ðb!V"á&#.3ºÂ°Ð^¹<xtd37ÇmBÀ(x îr2úÿ.þÝZ¹a#.Ñhäôºòt×¼
gÍ7ß°
l·Íc]s¿"Öv7U0ZT`:Fõ׿³OÃ*²¹ÄZSµäÄÛOGj2EC¡ÎD´Ñ"m8iÇ #/PμÑù,ûÀ¸é,üµðë>=SîìBd~¤x·\"HHmL¦hÌT%ª¶c5¨hÙµ#_u±néI«\gMÓ6»Sk¦Ä-\.ó2Y¾ÆfÁÄæÒórÖ¹ékçí2HÏaM»@#)¯¨alð×6ó½Òd`1#.ÞAãÀèxÌrf;ÃÇÆ`̨fAA0µúîlöï¯}Ý/Ôà&i}#.pÖõYt®HcÉêr½±²m?1ù(Âäq´·¨bwAMÂÍXé΢(4W!ß--¦x£¯êÐJhKwήxCà.[ÎI6`ïRÒS,Ý7èXÖq¹¹¦tØN&6äï¢\7ÎéREYnåɹ¹d£ý~3åÎèxzà0ûU@#)GÍ\pAlj ;LÖÑÆ¥Fà7eÑfCRè·ÛUüÝÉIPË%!OÄ¥AÊgÐÍÛPlö{¼ÐDD½Ç¹kÔz<@ÄHkò(&È#)?Â#/°Ãi«=^u»rÓ³&*k¬Ö§3X ©¬bÌ{HP qTRzýçïC±ãÐ;0ÌûÌu0BN8éHr°ö ¼j#/}þ^äzzà°LLBxzxl=õÅ8V)RÕ\auùPàÖÄ@fR
ï=ã1hw÷ú7ß×¢,L!ó³)²}¿©Èqê.ïäÇú#øÕÑìâÑ·#)íÛºj}dè=àh"Chk?L(¸5ô?··ûÌýfd{AÛ>ø:<¤b'h¿ÝèÐlè$ô÷ô@X4u²ÆBBF$V5È#/·T;¦\U!wRÐüF]Ðkmie1(¡jX¤#.@<ÑhÚdcs]¥ILbSøÀc!õÆ@f'þ"¾ïGz9s$@!»LÄ9mä ÜÁw!2Ï f§ áäGYZE£eOyìA#.ý$´J&D±RjÉfBÉzþ¢Ð¢ bÆm4_^·ñ·y@£´T9~ÅÏGÌnC°FÀü t!Ù#)öcTÄÅòx aÈ5k6Æ*¥¦HHª¢ÛZÒ ,éÀP!/jÿC^" Óýyýe÷?Ãùɵ´\Ŷ¶-óFìõ\zë+7éêÙHCð·©ì( #Ôöäx^#)§6ü¤úÁwŶf´H9Iɧï}#/õÑ>[bF0øíAÄMϸ¹Brd
\òzµÓçX|8h0qà(}f
8dù®Ä/Í1LNI¢®¼LXRM\.MU*Ѳ5¦©Åp ¤Øè미·E7þÂUæ°:C#.Ë1ÃÛRG×8öᬼ×Þã$l-[¢'ÊoÚcÁØÕBÙÕÏÕB>¿Ý/HEùì\¹m/5àÃK#/37â,ú>H°ÅËfÍî- À7Óùÿr¨`{ÀæG·+#/jd¡©M5%ƬdÚ£Yö;[ó-^&°V¥O¦Þ ¬ñnç8bÊpdàÎü1Âåßíé¢4ª¾ ®ü±ºõõF§³g¤¢hJ(h£TR&Úl£Y¤9Ë]}ý.3ß
U9oÕðý[¿l¡©Qûþþ~íù|H¥ß»@¦ô#/:ïPæɪ=õ2ÉôW×ÈnË`¢¬G#.*ó!LÚÓ`4 ÛCGgPFFkþ=#/í"´<¢ #)ܵ¨Æ2Q9ëCE,Ñ*:ûNXn@tïT/HMHìGxç¾I¨s#@Ĺ3·ücAZM±¦ÛcÛ1#)®|ø·#.õ¹¬rÔÂ#/((+SoÝ5êDÑ¥5©;¡Á#.&Ö2Js3 ÚM:hqfeWs¦*7®ís)`! ¥¤u¦ fÚ#.ê¯=uzyåØÝ4¤RX!$YÂ\sË Êd9Êεm!ÄïC¸Ó{Á>¡^á:øÿFê»<=|O¢8c :à¸Âµ'B"ÁSníòvðçvìßä8ù9Âh ;XGDZª±-ÂJ¬3ë8qPàU¯]zqÂf¨þ$-U#(Þ4~%',ÔL'bI~0m/èܱǢF+²¤¥¼¶ú¦É
e²£±\^GÜtwçKæÐq¤F±/SJ¶ý äL¦ÝR¡¾;N ¹ä_<#.Cµß·Xx=;z(©ª?c"ä¡XÝ0íf\kÂ#.ÁpÏ#)äJôÌ«Gà@Å^'"%2ÙPÂàÛÏpðM<.Ûñ#.ÖEy°´:B)clWr<¤Õ±/$Âa#X&ÀwÓà{:|nÿçcWlãꪤ2îz?2P?ó}f1~ûrȤTÚàØ÷#$ ÿ£èy,»móÅr¿4â¯ùøñ=6Çé%Ì¡ý°ªØÆ(Ûv!oÖ#)½=ó«YÑ¥$âIÓmÀLàÅExÁ¨7Cc sÖº;õªdiEàt²jw»l¿Fo3ò ª9%.ºwC¼öBÌ»#.Ný6÷ïk!!×Oé÷óxÜQO3¬Çd!ÔäÎw¢dÍ.ýA6#.P;p-!¯ÛÛ#.VúX7çÒî¥ý!ÔJ!ûxãóà8§+ÝZaH%à÷m7ìýáJw#O$i$#.µüf=múI |ýZz¸pùcm·Ìv3$V:þ¾½5¢ßø¤^É@å £ÿû¿èÿWãÿ§þüßøÿ«á÷í÷ÿïÏÉïÿ³þ¼¿ýÿßÿúü?ãÿ»ÿ/oñÿùÿãnÏû¿íýñÕÿüGü?öõ~ÿöÉÿþÿ¿þüãÿoü¿òÿÏÿó§Ç¯çÿÏããÿ/'ýòìü«ýÿýß/OåýÜïýe¡WúÀýu0 NGötäÌØ?Ò<OéÀÄL¡¹ýÏüb§p_îª":Í>ö»ïy㻦L$Êeõ}7¶#)<ÀéhYéG]¡Ý¦Ñ#.qârB¦¢#)1|ïáüßô`Ò>ÿ«ãÏt¤N=ÁÏ;ó±ëÅÿ3#/ÙnÉéßàÓר7/kLfv̧¾#)c_Ûå5åúûÇûóô¼<<ýÜM*,ɪHÿ xLÑ7AÐÆ@ÊÖÞì?ãp·_GÿË]ç¸Ì+LpÔgR¬Ï÷¸»#)ÞëL*ú²5ìÚÓlkzY(ÁÀïâÄÆlÿgµb¥±tÓ1ì²" «¿¦wpZeX´h=Í0Ñ&5IË7j²î=Ê:2Ãt#EÛ/5£zÚa¦<CêF2UÜFÄ¡®kÙâ°wÌÈ?w&±db:4rø>G7®'?ÕfÀ¾G
ÝÊÄÌY³DÁ¦.^x1«k##½pWÛ!ÑúQÀçfò]d½æ¬ßÝ«¦8±Ï\û·ûÂLGÃð¡ØÕKÛ×{RW_Ç=h¦'b¢:ävvÙ4ÂQªâÙ0Qdæ_i¯wÃpÛYQFîɵÐÓÓ¯.ÏÖc©øi0<X¢1FBß:©Îûs#1ïÎËXÍ¡&Hc|·E!l$zQõ«B$/c^:tmRPL(Qþq±ç³³ð´ªØF%½D«ï&fÿî¸X('ÎñÐ+éÉë:X ÜCæ#/=9À ÛLY¡**#.¨ÖÒ+Y-IjdË1QÏ#1ANùSDlýí!ã ý'üD®Ç4f£¼ô¸PAMècÂØ,1Y>z¨}áåïÏ4ߥ¤üÊËdüæ¾÷å5Ðÿ¿Lcåu¦|àmð5OÏë;á³OVöÊgé·]Æëf~ºWÖ!z ÖÊÞË5»§[3^Á£N#.*cÜAy9·¶Hs¿ÇbËï*ºQHYX .0é¾]qdc"d:,¶¤Ú¾CÞÆÙÊß"Ømþ¿oGÓ;¦¹VÓ£9õ,)$Îò=ܼó¨ÔmË^¼Z´¥¶¼oUxµ&ÅQª!¤¡@ÞéÇZ#.Û!ÛN´e×÷ñàmÒbÄãþìCþsaî&©HÆ.á.òÑUAN6ѧ¨¸ÿã1GTxJ®|*s#/AÇÿûoÉäw×pûmÿ#äzÈ÷ñ<QìGòïÛ¯üàÀgpz~C ÿÑÁ"oZ=¦æ b
#/I)Hs» ©`7Ð{â¡f#)x«åôà{??ãé¬ µs ç\8§;úÕ)6¢ÆÛ&ÚÉ÷É7Üb{??ë°B½?¦^ `ÿÃS3¿ýEÇbËþáÝ«èÿçP½ëåÿ|gøYñ?êßB¿YnýKOü<õxÿ×÷FÏ[ý^¯Á6sìk;ts#©m·¢ òcÛZ=>©(|è'¥A³Ûêæ8¥óTlâs¹ÿêóÑÎmÿ¸¢oívö&j BøÓ6 dJ?C"ϧoÿ5°ü¥kÝqEcõxæþ[¾rÂsóÄ%ÿ©Ä,¨IÔ"Åɲe¾Jíã%S8 új¹åË5ïpCÙõÑ9vÙ8ÊÉN`þçIbðë-bYãhTKY¸Ä!kÁåôéË0"°ÉB7§ÆGBYÈJU3D!×{`&øVW´Ð7-ìÓîÿÑYóâ;×)UEø¿íëzÏÞ"ýß_à`aÿâîH§#/¹)
-#<==
diff --git a/NFD/websocketpp b/NFD/websocketpp
deleted file mode 160000
index 4309749..0000000
--- a/NFD/websocketpp
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 4309749dd98937b8a7be5dc0bfe679ba201c5512
diff --git a/NFD/wscript b/NFD/wscript
deleted file mode 100644
index 65c249a..0000000
--- a/NFD/wscript
+++ /dev/null
@@ -1,321 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-"""
-Copyright (c) 2014 Regents of the University of California,
- Arizona Board of Regents,
- Colorado State University,
- University Pierre & Marie Curie, Sorbonne University,
- Washington University in St. Louis,
- Beijing Institute of Technology
-
-This file is part of NFD (Named Data Networking Forwarding Daemon).
-See AUTHORS.md for complete list of NFD authors and contributors.
-
-NFD is free software: you can redistribute it and/or modify it under the terms
-of the GNU General Public License as published by the Free Software Foundation,
-either version 3 of the License, or (at your option) any later version.
-
-NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
-"""
-
-VERSION = "0.2.0"
-APPNAME = "nfd"
-BUGREPORT = "http://redmine.named-data.net/projects/nfd"
-URL = "http://named-data.net/doc/NFD/"
-GIT_TAG_PREFIX = "NFD-"
-
-from waflib import Logs, Utils, Context
-import os
-
-def options(opt):
- opt.load(['compiler_cxx', 'gnu_dirs'])
- opt.load(['boost', 'unix-socket', 'dependency-checker', 'websocket',
- 'default-compiler-flags', 'coverage', 'pch', 'boost-kqueue',
- 'doxygen', 'sphinx_build', 'type_traits', 'compiler-features'],
- tooldir=['.waf-tools'])
-
- nfdopt = opt.add_option_group('NFD Options')
- opt.addUnixOptions(nfdopt)
- opt.addWebsocketOptions(nfdopt)
- opt.addDependencyOptions(nfdopt, 'libpcap')
- nfdopt.add_option('--without-libpcap', action='store_true', default=False,
- dest='without_libpcap',
- help='''Disable libpcap (Ethernet face support will be disabled)''')
-
- opt.addDependencyOptions(nfdopt, 'librt', '(optional)')
- opt.addDependencyOptions(nfdopt, 'libresolv', '(optional)')
-
- nfdopt.add_option('--with-tests', action='store_true', default=False,
- dest='with_tests', help='''Build unit tests''')
- nfdopt.add_option('--with-other-tests', action='store_true', default=False,
- dest='with_other_tests', help='''Build other tests''')
-
-def configure(conf):
- conf.load(['compiler_cxx', 'gnu_dirs',
- 'default-compiler-flags', 'pch', 'boost-kqueue',
- 'boost', 'dependency-checker', 'websocket',
- 'doxygen', 'sphinx_build', 'type_traits', 'compiler-features'])
-
- conf.find_program('bash', var='BASH')
-
- if not os.environ.has_key('PKG_CONFIG_PATH'):
- os.environ['PKG_CONFIG_PATH'] = ':'.join([
- '/usr/local/lib/pkgconfig',
- '/opt/local/lib/pkgconfig'])
- conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
- uselib_store='NDN_CXX', mandatory=True)
-
- conf.checkDependency(name='librt', lib='rt', mandatory=False)
- conf.checkDependency(name='libresolv', lib='resolv', mandatory=False)
-
- boost_libs = 'system chrono program_options random'
- if conf.options.with_tests:
- conf.env['WITH_TESTS'] = 1
- conf.define('WITH_TESTS', 1);
- boost_libs += ' unit_test_framework'
-
- if conf.options.with_other_tests:
- conf.env['WITH_OTHER_TESTS'] = 1
-
- conf.check_boost(lib=boost_libs)
- if conf.env.BOOST_VERSION_NUMBER < 104800:
- Logs.error("Minimum required boost version is 1.48.0")
- Logs.error("Please upgrade your distribution or install custom boost libraries" +
- " (http://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)")
- return
-
- conf.load('unix-socket')
- conf.checkWebsocket(mandatory=True)
-
- if not conf.options.without_libpcap:
- conf.check_asio_pcap_support()
- if conf.env['HAVE_ASIO_PCAP_SUPPORT']:
- conf.checkDependency(name='libpcap', lib='pcap', mandatory=True,
- errmsg='not found, but required for Ethernet face support. '
- 'Specify --without-libpcap to disable Ethernet face support.')
- else:
- Logs.warn('Warning: Ethernet face support is not supported on this platform with Boost libraries version 1.56. '
- 'See http://redmine.named-data.net/issues/1877 for more details')
- if conf.env['HAVE_LIBPCAP']:
- conf.check_cxx(function_name='pcap_set_immediate_mode', header_name='pcap/pcap.h',
- cxxflags='-Wno-error', use='LIBPCAP', mandatory=False)
-
- conf.load('coverage')
-
- conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/nfd.conf' % conf.env['SYSCONFDIR'])
-
- # disable assertions in release builds
- if not conf.options.debug:
- conf.define('NDEBUG', 1)
-
- conf.write_config_header('config.hpp')
-
-def build(bld):
- version(bld)
-
- bld(features="subst",
- name='version',
- source='version.hpp.in',
- target='version.hpp',
- install_path=None,
- VERSION_STRING=VERSION_BASE,
- VERSION_BUILD=VERSION,
- VERSION=int(VERSION_SPLIT[0]) * 1000000 +
- int(VERSION_SPLIT[1]) * 1000 +
- int(VERSION_SPLIT[2]),
- VERSION_MAJOR=VERSION_SPLIT[0],
- VERSION_MINOR=VERSION_SPLIT[1],
- VERSION_PATCH=VERSION_SPLIT[2],
- )
-
- core = bld(
- target='core-objects',
- name='core-objects',
- features='cxx pch',
- source=bld.path.ant_glob(['core/**/*.cpp']),
- use='version BOOST NDN_CXX LIBRT',
- includes='. core',
- export_includes='. core',
- headers='common.hpp',
- )
-
- nfd_objects = bld(
- target='daemon-objects',
- name='daemon-objects',
- features='cxx',
- source=bld.path.ant_glob(['daemon/**/*.cpp'],
- excl=['daemon/face/ethernet-*.cpp',
- 'daemon/face/unix-*.cpp',
- 'daemon/face/websocket-*.cpp',
- 'daemon/main.cpp']),
- use='core-objects WEBSOCKET',
- includes='daemon',
- export_includes='daemon',
- )
-
- if bld.env['HAVE_LIBPCAP']:
- nfd_objects.source += bld.path.ant_glob('daemon/face/ethernet-*.cpp')
- nfd_objects.use += ' LIBPCAP'
-
- if bld.env['HAVE_UNIX_SOCKETS']:
- nfd_objects.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
-
- if bld.env['HAVE_WEBSOCKET']:
- nfd_objects.source += bld.path.ant_glob('daemon/face/websocket-*.cpp')
-
- bld(target='bin/nfd',
- features='cxx cxxprogram',
- source='daemon/main.cpp',
- use='daemon-objects',
- )
-
- rib_objects = bld(
- target='rib-objects',
- name='rib-objects',
- features='cxx',
- source=bld.path.ant_glob(['rib/**/*.cpp'],
- excl=['rib/main.cpp']),
- use='core-objects',
- )
-
- bld(target='bin/nrd',
- features='cxx cxxprogram',
- source='rib/main.cpp',
- use='rib-objects',
- )
-
- for app in bld.path.ant_glob('tools/*.cpp'):
- bld(features=['cxx', 'cxxprogram'],
- target='bin/%s' % (str(app.change_ext(''))),
- source=['tools/%s' % (str(app))],
- use='core-objects LIBRESOLV',
- )
-
- bld.recurse("tests")
-
- bld(features="subst",
- source='nfd.conf.sample.in',
- target='nfd.conf.sample',
- install_path="${SYSCONFDIR}/ndn",
- IF_HAVE_LIBPCAP="" if bld.env['HAVE_LIBPCAP'] else "; ",
- IF_HAVE_WEBSOCKET="" if bld.env['HAVE_WEBSOCKET'] else "; ")
-
- if bld.env['SPHINX_BUILD']:
- bld(features="sphinx",
- builder="man",
- outdir="docs/manpages",
- config="docs/conf.py",
- source=bld.path.ant_glob('docs/manpages/**/*.rst'),
- install_path="${MANDIR}/",
- VERSION=VERSION)
-
- for script in bld.path.ant_glob(['tools/*.sh', 'tools/*.py']):
- bld(features='subst',
- source='tools/%s' % (str(script)),
- target='bin/%s' % (str(script.change_ext(''))),
- install_path="${BINDIR}",
- chmod=Utils.O755,
- VERSION=VERSION)
-
- bld.install_files("${DATAROOTDIR}/ndn",
- bld.path.ant_glob('tools/nfd-status-http-server-files/*'))
-
-def docs(bld):
- from waflib import Options
- Options.commands = ['doxygen', 'sphinx'] + Options.commands
-
-def doxygen(bld):
- version(bld)
-
- if not bld.env.DOXYGEN:
- Logs.error("ERROR: cannot build documentation (`doxygen' is not found in $PATH)")
- else:
- bld(features="subst",
- name="doxygen-conf",
- source=["docs/doxygen.conf.in",
- "docs/named_data_theme/named_data_footer-with-analytics.html.in"],
- target=["docs/doxygen.conf",
- "docs/named_data_theme/named_data_footer-with-analytics.html"],
- VERSION=VERSION_BASE,
- HTML_FOOTER="../build/docs/named_data_theme/named_data_footer-with-analytics.html" \
- if os.getenv('GOOGLE_ANALYTICS', None) \
- else "../docs/named_data_theme/named_data_footer.html",
- GOOGLE_ANALYTICS=os.getenv('GOOGLE_ANALYTICS', ""),
- )
-
- bld(features="doxygen",
- doxyfile='docs/doxygen.conf',
- use="doxygen-conf")
-
-def sphinx(bld):
- version(bld)
-
- if not bld.env.SPHINX_BUILD:
- bld.fatal("ERROR: cannot build documentation (`sphinx-build' is not found in $PATH)")
- else:
- bld(features="sphinx",
- outdir="docs",
- source=bld.path.ant_glob('docs/**/*.rst'),
- config="docs/conf.py",
- VERSION=VERSION_BASE)
-
-def version(ctx):
- if getattr(Context.g_module, 'VERSION_BASE', None):
- return
-
- Context.g_module.VERSION_BASE = Context.g_module.VERSION
- Context.g_module.VERSION_SPLIT = [v for v in VERSION_BASE.split('.')]
-
- didGetVersion = False
- try:
- cmd = ['git', 'describe', '--always', '--match', '%s*' % GIT_TAG_PREFIX]
- p = Utils.subprocess.Popen(cmd, stdout=Utils.subprocess.PIPE,
- stderr=None, stdin=None)
- out = str(p.communicate()[0].strip())
- didGetVersion = (p.returncode == 0 and out != "")
- if didGetVersion:
- if out.startswith(GIT_TAG_PREFIX):
- Context.g_module.VERSION = out[len(GIT_TAG_PREFIX):]
- else:
- Context.g_module.VERSION = "%s-commit-%s" % (Context.g_module.VERSION_BASE, out)
- except OSError:
- pass
-
- versionFile = ctx.path.find_node('VERSION')
-
- if not didGetVersion and versionFile is not None:
- try:
- Context.g_module.VERSION = versionFile.read()
- return
- except (OSError, IOError):
- pass
-
- # version was obtained from git, update VERSION file if necessary
- if versionFile is not None:
- try:
- version = versionFile.read()
- if version == Context.g_module.VERSION:
- return # no need to update
- except (OSError, IOError):
- Logs.warn("VERSION file exists, but not readable")
- else:
- versionFile = ctx.path.make_node('VERSION')
-
- if versionFile is None:
- return
-
- try:
- versionFile.write(Context.g_module.VERSION)
- except (OSError, IOError):
- Logs.warn("VERSION file is not writeable")
-
-def dist(ctx):
- version(ctx)
-
-def distcheck(ctx):
- version(ctx)