16 Commits

Author SHA1 Message Date
Davide Pesavento 36b78ea6ee ci: add build testing against named-data PPA
Change-Id: I42c0901dc152986706b0c7b7f908dff80c23064b
2023-11-25 23:11:24 -05:00
Davide Pesavento 7e9d7e4f9a Switch to Face::getIoContext()
Change-Id: Ice05b0b8e9af4ed4651abcf6fc4ea6b84c34da7c
2023-11-11 15:00:03 -05:00
Davide Pesavento 816767b4c2 build: disable -Wnon-virtual-dtor compiler warning
See also named-data/NFD@0a05f7aea6

Change-Id: If93d766fa8ee2b0cb6a0eb8ff9febc2dc0a4cac0
2023-10-17 15:40:22 -04:00
Davide Pesavento 2ab04a2b9f build: require boost >= 1.71.0
Refs: #5276
Change-Id: Ib62b24b041e21b2c017cd9c290f7d5dc09003d63
2023-09-15 22:08:22 -04:00
Davide Pesavento b6e10dd86a build: use python f-strings
Change-Id: I5a6537d263d8bd6297b0975f34c90dd76b9468cd
2023-09-11 21:41:24 -04:00
Davide Pesavento 4a9e0b194b build: update waf to version 2.0.26
Change-Id: I8fa8a8906617769f7cc511848b9e64fd6a314334
2023-08-19 01:48:02 -04:00
Junxiao Shi 869d73e924 Change namespace of DummyClientFace, Signal, Segmenter
refs #3940

Change-Id: I67ca0ecb8c916aab411a2f90454e0d25925978cd
2023-08-10 22:52:26 +00:00
Davide Pesavento dd808b0bae build: enable a few more compiler warnings
Refactor default-compiler-flags.py to reduce duplication

Change-Id: I40bf0b1d94356dcaac3bdfebd66af920ef3d5aff
2023-08-06 16:00:02 -04:00
Davide Pesavento 8148cd4a96 build: decrease level of debug information produced by default
Refs: #5279
Change-Id: Ie73909de8c51300abb00c873af722d730e6b70e1
2023-08-06 14:01:32 -04:00
Davide Pesavento 0df0e1c5b0 dissect: avoid deprecated overload of ndn::escape
Change-Id: Ifb9ffa1400b4109b4400f59367a079dac3a4e792
2023-04-25 15:50:05 -04:00
Davide Pesavento 003e45a9f3 build: fix detection of libpcap on Ubuntu 23.04
Beginning with version 1.10.2, pcap-config treats
unrecognized command-line options as an error.

Change-Id: Iba62d6d4586cf505c68032338048d04597baff96
2023-04-25 15:25:03 -04:00
Davide Pesavento 3653daedb6 tests: use std::optional
Change-Id: I53feb53061cd8374bc296b7dfd13175d7c7d4e37
2023-03-13 17:44:22 -04:00
Davide Pesavento ad26607467 build: drop official support for Ubuntu 18.04 and macOS 10.15
Increase the minimum required version of clang to 7.0 on linux, because
older versions fail to compile libstdc++'s implementation of std::variant

Change-Id: I5cde13b8789fceb5715d5496aeed7f9050ec801d
2023-03-07 21:14:42 -05:00
Davide Pesavento a22a742de4 build: switch source archive to xz compression
Change-Id: I8ec1968161aa6c85bf9ba7dd7859e81b160fabfb
2023-02-14 23:56:46 -05:00
Davide Pesavento c2297b11d2 ci: adopt reusable workflows from named-data/actions
Change-Id: I372cc2fa1b26cede28982bbd88ca445eb08eef5c
2023-02-08 13:22:22 -05:00
Davide Pesavento db9613e5fd Minor README improvements; fix outdated URLs
Change-Id: Ia57f83892471ad85a2301ba4c8ab3df144581000
2023-01-21 02:22:27 -05:00
52 changed files with 346 additions and 383 deletions
+9 -58
View File
@@ -1,65 +1,16 @@
name: CI
on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
- '.mailmap'
workflow_dispatch:
permissions:
contents: read
permissions: {}
jobs:
linux:
name: ${{ matrix.compiler }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
compiler: [g++-7, g++-8, g++-9, g++-10,
clang++-7, clang++-8, clang++-9, clang++-10, clang++-11, clang++-12]
include:
- os: ubuntu-22.04
compiler: g++-11
- os: ubuntu-22.04
compiler: g++-12
- os: ubuntu-22.04
compiler: clang++-13
- os: ubuntu-22.04
compiler: clang++-14
env:
CXX: ${{ matrix.compiler }}
steps:
- name: Install C++ compiler
run: |
sudo apt-get -qy install ${CXX/clang++/clang}
${CXX} --version
- name: Checkout
uses: actions/checkout@v3
- name: Build and test
run: ./.jenkins
macos:
name: Xcode ${{ matrix.xcode }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-11]
xcode: ['12.4', '12.5', '13.2']
include:
- os: macos-12
xcode: '13.4'
- os: macos-12
xcode: '14.2'
steps:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Checkout
uses: actions/checkout@v3
- name: Build and test
run: ./.jenkins
Ubuntu:
uses: named-data/actions/.github/workflows/jenkins-script-ubuntu.yml@v1
macOS:
uses: named-data/actions/.github/workflows/jenkins-script-macos.yml@v1
PPA:
uses: named-data/actions/.github/workflows/ppa.yml@v1
with:
extra-deps: libboost-program-options-dev libpcap-dev
+3 -26
View File
@@ -1,33 +1,10 @@
name: Docs
on:
push:
paths-ignore:
- '*.md'
- '.mailmap'
workflow_dispatch:
permissions:
contents: read
permissions: {}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
env:
JOB_NAME: Docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
find .jenkins.d/ -type f -name '[1-9]*.sh' -exec chmod -x '{}' +
./.jenkins
- name: Build documentation
run: |
pybindir=$(python3 -c 'import sysconfig; print(sysconfig.get_path("scripts", "posix_user"))')
export PATH="${pybindir}${PATH:+:}${PATH}"
./waf --color=yes configure
./waf --color=yes build --targets=manpages
man:
uses: named-data/actions/.github/workflows/docs-man.yml@v1
+3
View File
@@ -32,6 +32,9 @@ if [[ $JOB_NAME == *"code-coverage" ]]; then
export DISABLE_HEADERS_CHECK=yes
fi
# https://reproducible-builds.org/docs/source-date-epoch/
export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)
for file in .jenkins.d/*; do
[[ -f $file && -x $file ]] || continue
+81 -64
View File
@@ -3,10 +3,12 @@
import platform
from waflib import Configure, Logs, Utils
def options(opt):
opt.add_option('--debug', '--with-debug', action='store_true', default=False,
help='Compile in debugging mode with minimal optimizations (-Og)')
def configure(conf):
conf.start_msg('Checking C++ compiler version')
@@ -18,19 +20,22 @@ def configure(conf):
if cxx == 'gcc':
if ccver < (7, 4, 0):
errmsg = ('The version of gcc you are using is too old.\n'
'The minimum supported gcc version is 7.4.')
'The minimum supported gcc version is 9.3.')
elif ccver < (9, 3, 0):
warnmsg = ('Using a version of gcc older than 9.3 is not '
'officially supported and may result in build failures.')
conf.flags = GccFlags()
elif cxx == 'clang':
if Utils.unversioned_sys_platform() == 'darwin':
if ccver < (10, 0, 0):
errmsg = ('The version of Xcode you are using is too old.\n'
'The minimum supported Xcode version is 11.3.')
elif ccver < (11, 0, 0):
warnmsg = ('Using a version of Xcode older than 11.3 is not '
'The minimum supported Xcode version is 12.4.')
elif ccver < (12, 0, 0):
warnmsg = ('Using a version of Xcode older than 12.4 is not '
'officially supported and may result in build failures.')
elif ccver < (6, 0, 0):
elif ccver < (7, 0, 0):
errmsg = ('The version of clang you are using is too old.\n'
'The minimum supported clang version is 6.0.')
'The minimum supported clang version is 7.0.')
conf.flags = ClangFlags()
else:
warnmsg = f'{cxx} compiler is unsupported'
@@ -45,7 +50,7 @@ def configure(conf):
else:
conf.end_msg(ccverstr)
conf.areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
conf.areCustomCxxflagsPresent = len(conf.env.CXXFLAGS) > 0
# General flags are always applied (e.g., selecting C++ language standard)
generalFlags = conf.flags.getGeneralFlags(conf)
@@ -53,6 +58,7 @@ def configure(conf):
conf.add_supported_linkflags(generalFlags['LINKFLAGS'])
conf.env.DEFINES += generalFlags['DEFINES']
@Configure.conf
def check_compiler_flags(conf):
# Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the
@@ -75,10 +81,11 @@ def check_compiler_flags(conf):
conf.env.DEFINES += extraFlags['DEFINES']
@Configure.conf
def add_supported_cxxflags(self, cxxflags):
"""
Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
Check which cxxflags are supported by the active compiler and add them to env.CXXFLAGS variable.
"""
if len(cxxflags) == 0:
return
@@ -94,10 +101,11 @@ def add_supported_cxxflags(self, cxxflags):
self.end_msg(' '.join(supportedFlags))
self.env.prepend_value('CXXFLAGS', supportedFlags)
@Configure.conf
def add_supported_linkflags(self, linkflags):
"""
Check which linkflags are supported by compiler and add them to env.LINKFLAGS variable
Check which linkflags are supported by the active compiler and add them to env.LINKFLAGS variable.
"""
if len(linkflags) == 0:
return
@@ -114,13 +122,17 @@ def add_supported_linkflags(self, linkflags):
self.env.prepend_value('LINKFLAGS', supportedFlags)
class CompilerFlags(object):
class CompilerFlags:
def getCompilerVersion(self, conf):
return tuple(int(i) for i in conf.env.CC_VERSION)
def getGeneralFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
return {
'CXXFLAGS': [],
'LINKFLAGS': [],
'DEFINES': ['BOOST_ASIO_NO_DEPRECATED', 'BOOST_FILESYSTEM_NO_DEPRECATED'],
}
def getDebugFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
@@ -130,94 +142,99 @@ class CompilerFlags(object):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']}
class GccBasicFlags(CompilerFlags):
class GccClangCommonFlags(CompilerFlags):
"""
This class defines basic flags that work for both gcc and clang compilers
This class defines common flags that work for both gcc and clang compilers.
"""
def getGeneralFlags(self, conf):
flags = super(GccBasicFlags, self).getGeneralFlags(conf)
flags = super().getGeneralFlags(conf)
flags['CXXFLAGS'] += ['-std=c++17']
if Utils.unversioned_sys_platform() != 'darwin':
flags['LINKFLAGS'] += ['-fuse-ld=lld']
return flags
__cxxFlags = [
'-fdiagnostics-color',
'-Wall',
'-Wextra',
'-Wpedantic',
'-Wenum-conversion',
'-Wextra-semi',
'-Wno-unused-parameter',
]
__linkFlags = ['-Wl,-O1']
def getDebugFlags(self, conf):
flags = super(GccBasicFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-Og',
'-g3',
'-Wall',
'-Wextra',
'-Wpedantic',
'-Werror',
'-Wcatch-value=2',
'-Wextra-semi',
'-Wnon-virtual-dtor',
'-Wno-error=deprecated-declarations', # Bug #3795
'-Wno-error=maybe-uninitialized', # Bug #1615
'-Wno-unused-parameter',
]
flags['LINKFLAGS'] += ['-Wl,-O1']
flags = super().getDebugFlags(conf)
flags['CXXFLAGS'] += ['-Og', '-g'] + self.__cxxFlags + [
'-Werror',
'-Wno-error=deprecated-declarations', # Bug #3795
'-Wno-error=maybe-uninitialized', # Bug #1615
]
flags['LINKFLAGS'] += self.__linkFlags
return flags
def getOptimizedFlags(self, conf):
flags = super(GccBasicFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-O2',
'-g',
'-Wall',
'-Wextra',
'-Wpedantic',
'-Wcatch-value=2',
'-Wextra-semi',
'-Wnon-virtual-dtor',
'-Wno-unused-parameter',
]
flags['LINKFLAGS'] += ['-Wl,-O1']
flags = super().getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-O2', '-g1'] + self.__cxxFlags
flags['LINKFLAGS'] += self.__linkFlags
return flags
class GccFlags(GccBasicFlags):
class GccFlags(GccClangCommonFlags):
__cxxFlags = [
'-Wcatch-value=2',
'-Wcomma-subscript', # enabled by default in C++20
'-Wduplicated-branches',
'-Wduplicated-cond',
'-Wlogical-op',
'-Wredundant-tags',
'-Wvolatile', # enabled by default in C++20
]
def getDebugFlags(self, conf):
flags = super(GccFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-fdiagnostics-color',
'-Wredundant-tags',
]
flags = super().getDebugFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
if platform.machine() == 'armv7l':
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
return flags
def getOptimizedFlags(self, conf):
flags = super(GccFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-fdiagnostics-color',
'-Wredundant-tags',
]
flags = super().getOptimizedFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
if platform.machine() == 'armv7l':
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
return flags
class ClangFlags(GccBasicFlags):
class ClangFlags(GccClangCommonFlags):
def getGeneralFlags(self, conf):
flags = super(ClangFlags, self).getGeneralFlags(conf)
flags = super().getGeneralFlags(conf)
if Utils.unversioned_sys_platform() == 'darwin':
# Bug #4296
brewdir = '/opt/homebrew' if platform.machine() == 'arm64' else '/usr/local'
flags['CXXFLAGS'] += [['-isystem', f'{brewdir}/include'], # for Homebrew
['-isystem', '/opt/local/include']] # for MacPorts
flags['CXXFLAGS'] += [
['-isystem', f'{brewdir}/include'], # for Homebrew
['-isystem', '/opt/local/include'], # for MacPorts
]
elif Utils.unversioned_sys_platform() == 'freebsd':
# Bug #4790
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
return flags
__cxxFlags = [
'-Wundefined-func-template',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
def getDebugFlags(self, conf):
flags = super(ClangFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
'-Wundefined-func-template',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
flags = super().getDebugFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
return flags
def getOptimizedFlags(self, conf):
flags = super(ClangFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
'-Wundefined-func-template',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
flags = super().getOptimizedFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
return flags
+1 -1
View File
@@ -2,7 +2,7 @@
The following lists maintainers, primary developers, and all much-appreciated contributors to ndn-tools in alphabetical order.
The specific contributions of individual authors can be obtained from the git history of the [official ndn-tools repository](https://github.com/named-data/ndn-tools).
If you would like to become a contributor to the official repository, please follow the recommendations in <https://github.com/named-data/.github/blob/master/CONTRIBUTING.md>.
If you would like to become a contributor to the official repository, please follow the recommendations in <https://github.com/named-data/.github/blob/main/CONTRIBUTING.md>.
* Jerald Paul Abraham <https://cs.arizona.edu/~jeraldabraham>
* ***(Maintainer)*** Alexander Afanasyev <https://users.cs.fiu.edu/~afanasyev>
+5 -7
View File
@@ -4,17 +4,15 @@ This document describes how to build and install ndn-tools.
## Prerequisites
- Install the [ndn-cxx](https://named-data.net/doc/ndn-cxx/current/) library and its prerequisites.
Please see [Getting Started with ndn-cxx](https://named-data.net/doc/ndn-cxx/current/INSTALL.html)
for instructions.
All operating systems and compilers supported by ndn-cxx are also supported by ndn-tools.
* Install the [ndn-cxx](https://github.com/named-data/ndn-cxx) library and its dependencies.
Check out [the documentation](https://docs.named-data.net/ndn-cxx/current/INSTALL.html) for
detailed installation instructions. All platforms supported by ndn-cxx are also supported
by ndn-tools.
*Note*: If you have installed ndn-cxx from a binary package, please make sure the development
headers are installed (e.g., if using Ubuntu PPA, the `libndn-cxx-dev` package is needed).
- `libpcap`
Comes with the base system on macOS.
* Install `libpcap` (except on macOS where it is provided by the base system).
On Debian and Ubuntu:
+33 -30
View File
@@ -1,9 +1,10 @@
# Notes for ndn-tools Developers
# Notes for ndn-tools developers
## Licensing Requirements
Contributions to ndn-tools must be licensed under the GPL 3.0 or a compatible license.
If you choose GPL 3.0, include the following license boilerplate into all C++ code files:
Contributions to ndn-tools must be licensed under the GPL v3 or a compatible license.
If you choose the GPL v3, please use the following license boilerplate in all `.hpp`
and `.cpp` files:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
@@ -57,7 +58,7 @@ and placed in the [`manpages`](manpages) directory.
## Code Guidelines
C++ code should conform to the
[ndn-cxx code style](https://named-data.net/doc/ndn-cxx/current/code-style.html).
[ndn-cxx code style](https://docs.named-data.net/ndn-cxx/current/code-style.html).
### Namespace
@@ -83,38 +84,40 @@ subdirectory.
Example:
namespace ndn {
namespace foo {
```cpp
namespace ndn {
namespace foo {
class Bar
{
public:
explicit
Bar(Face& face);
class Bar
{
public:
explicit
Bar(Face& face);
void
run();
};
void
run();
};
static int
main(int argc, char* argv[])
{
Face face;
Bar program(face);
program.run();
return 0;
}
static int
main(int argc, char* argv[])
{
Face face;
Bar program(face);
program.run();
return 0;
}
} // namespace foo
} // namespace ndn
} // namespace foo
} // namespace ndn
int
main(int argc, char* argv[])
{
return ndn::foo::main(argc, argv);
}
int
main(int argc, char* argv[])
{
return ndn::foo::main(argc, argv);
}
```
### Command Line Arguments
[Boost.Program\_options](https://www.boost.org/doc/libs/1_65_1/doc/html/program_options.html)
[Boost.Program\_options](https://www.boost.org/doc/libs/1_71_0/doc/html/program_options.html)
is strongly preferred over `getopt(3)` for parsing command line arguments.
+15 -14
View File
@@ -5,16 +5,16 @@
![Language](https://img.shields.io/badge/C%2B%2B-17-blue)
![Latest version](https://img.shields.io/github/v/tag/named-data/ndn-tools?label=Latest%20version)
**ndn-tools** is a collection of basic tools for [Named Data Networking](https://named-data.net/).
Tools in this collection include:
This repository contains a collection of basic tools for [Named Data Networking (NDN)](https://named-data.net/).
The tools currently included are:
* [peek](tools/peek): transmit a single Interest/Data packet between a consumer
* [**peek**](tools/peek): transmit a single Interest/Data packet between a consumer
and a producer
* [chunks](tools/chunks): segmented file transfer between a consumer and a producer
* [ping](tools/ping): test reachability between two NDN nodes
* [dump](tools/dump): capture and analyze live traffic on an NDN network
* [dissect](tools/dissect): inspect the TLV structure of an NDN packet
* [dissect-wireshark](tools/dissect-wireshark): Wireshark extension to inspect
* [**chunks**](tools/chunks): segmented file transfer between a consumer and a producer
* [**ping**](tools/ping): test reachability between two NDN nodes
* [**dump**](tools/dump): capture and analyze live traffic on an NDN network
* [**dissect**](tools/dissect): inspect the TLV structure of an NDN packet
* [**dissect-wireshark**](tools/dissect-wireshark): Wireshark extension to inspect
the TLV structure of NDN packets
## Installation
@@ -28,12 +28,13 @@ Please submit any bug reports or feature requests to the
## Contributing
We greatly appreciate contributions to ndn-tools. If you are new to the NDN
software community, please read [`README-dev.md`](README-dev.md) and the
[Contributor's Guide](https://github.com/named-data/.github/blob/master/CONTRIBUTING.md)
to get started.
Contributions to ndn-tools are greatly appreciated and can be made through our
[Gerrit code review site](https://gerrit.named-data.net/).
If you are new to the NDN software community, please read our
[Contributor's Guide](https://github.com/named-data/.github/blob/main/CONTRIBUTING.md)
and [`README-dev.md`](README-dev.md) to get started.
## License
ndn-tools is an open source project licensed under the GPL version 3.
See [`COPYING.md`](COPYING.md) for more information.
ndn-tools is free software distributed under the GNU General Public License version 3.
See [`COPYING.md`](COPYING.md) for details.
+1 -1
View File
@@ -7,7 +7,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'NDN Essential Tools'
copyright = 'Copyright © 2014-2022 Named Data Networking Project.'
copyright = 'Copyright © 2014-2023 Named Data Networking Project.'
author = 'Named Data Networking Project'
# The short X.Y version.
+1 -1
View File
@@ -15,7 +15,7 @@ and makes it available as NDN Data segments.
Version and segment number components are appended to the specified *name* as needed,
according to the `NDN naming conventions`_.
.. _NDN naming conventions: https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
.. _NDN naming conventions: https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
Options
-------
+7 -3
View File
@@ -8,15 +8,19 @@ except the object that contains the `main()` function.
For example:
bld(features='cxx',
name='tool-subtool-objects',
```python
def build(bld):
bld.objects(
target='tool-subtool-objects',
source=bld.path.ant_glob('subtool/*.cpp', excl='subtool/main.cpp'),
use='core-objects')
bld(features='cxx cxxprogram',
bld.program(
name='subtool',
target='../../bin/subtool',
source='subtool/main.cpp',
use='tool-subtool-objects')
bld(name='tool-objects',
use='tool-subtool-objects')
```
+5 -5
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(InOrderData)
"consequat massa Donec pede justo,"
};
util::DummyClientFace face;
DummyClientFace face;
output_test_stream output("");
Consumer cons(security::getAcceptAllValidator(), output);
@@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(OutOfOrderData)
"consequat massa Donec pede justo,"
};
util::DummyClientFace face;
DummyClientFace face;
output_test_stream output("");
Consumer cons(security::getAcceptAllValidator(), output);
@@ -125,7 +125,7 @@ BOOST_AUTO_TEST_CASE(OutOfOrderData)
BOOST_CHECK(output.is_equal(testStrings[2]));
}
class PipelineInterestsDummy : public PipelineInterests
class PipelineInterestsDummy final : public PipelineInterests
{
public:
using PipelineInterests::PipelineInterests;
@@ -148,7 +148,7 @@ public:
BOOST_FIXTURE_TEST_CASE(RunBasic, IoFixture)
{
util::DummyClientFace face(m_io);
DummyClientFace face(m_io);
Options options;
Consumer consumer(security::getAcceptAllValidator());
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -60,7 +60,7 @@ public:
protected:
const Name name = "/ndn/chunks/test";
const uint64_t version = 1449227841747;
util::DummyClientFace face{m_io};
DummyClientFace face{m_io};
Options opt;
unique_ptr<DiscoverVersion> discover;
std::optional<Name> discoveredName;
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -77,7 +77,7 @@ protected:
}
protected:
util::DummyClientFace face{m_io};
DummyClientFace face{m_io};
Name name{"/ndn/chunks/test"};
uint64_t nDataSegments = 0;
bool hasFailed = false;
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -51,7 +51,7 @@ protected:
}
protected:
util::DummyClientFace face{m_io, {true, true}};
DummyClientFace face{m_io, {true, true}};
Name prefix = "/ndn/chunks/test";
Producer::Options options;
uint64_t version = 1449227841747;
+2 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, University of Memphis,
* Copyright (c) 2014-2023, University of Memphis,
* University Pierre & Marie Curie, Sorbonne University.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
@@ -32,6 +32,7 @@
#include <boost/test/tools/output_test_stream.hpp>
#include <ndn-cxx/encoding/encoding-buffer.hpp>
#include <ndn-cxx/lp/fields.hpp>
#include <ndn-cxx/lp/packet.hpp>
#include <ndn-cxx/net/ethernet.hpp>
+3 -7
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
#include "tests/clock-fixture.hpp"
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
namespace ndn::tests {
@@ -39,17 +39,13 @@ private:
afterTick() final
{
if (m_io.stopped()) {
#if BOOST_VERSION >= 106600
m_io.restart();
#else
m_io.reset();
#endif
}
m_io.poll();
}
protected:
boost::asio::io_service m_io;
boost::asio::io_context m_io;
};
} // namespace ndn::tests
+4 -5
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -24,7 +24,6 @@
#include <ndn-cxx/util/dummy-client-face.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/test/tools/output_test_stream.hpp>
namespace ndn::peek::tests {
@@ -68,7 +67,7 @@ protected:
}
protected:
ndn::util::DummyClientFace face{m_io};
DummyClientFace face{m_io};
output_test_stream output;
unique_ptr<NdnPeek> peek;
};
@@ -129,7 +128,7 @@ public:
BOOST_AUTO_TEST_SUITE(Peek)
BOOST_FIXTURE_TEST_SUITE(TestNdnPeek, NdnPeekFixture)
using OutputChecks = boost::mpl::vector<OutputFull, OutputPayloadOnly>;
using OutputChecks = std::tuple<OutputFull, OutputPayloadOnly>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Default, OutputCheck, OutputChecks)
{
@@ -153,7 +152,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Default, OutputCheck, OutputChecks)
BOOST_CHECK_EQUAL(interest.getMustBeFresh(), false);
BOOST_CHECK_EQUAL(interest.getForwardingHint().empty(), true);
BOOST_CHECK_EQUAL(interest.getInterestLifetime(), DEFAULT_INTEREST_LIFETIME);
BOOST_CHECK(interest.getHopLimit() == nullopt);
BOOST_CHECK(interest.getHopLimit() == std::nullopt);
BOOST_CHECK(!interest.hasApplicationParameters());
BOOST_CHECK(peek->getResult() == NdnPeek::Result::DATA);
}
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -59,7 +59,7 @@ protected:
}
protected:
ndn::util::DummyClientFace face{m_io, m_keyChain, {true, WANT_PREFIX_REG_REPLY}};
DummyClientFace face{m_io, m_keyChain, {true, WANT_PREFIX_REG_REPLY}};
std::stringstream payload{"Hello, world!\n"};
unique_ptr<NdnPoke> poke;
};
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -35,7 +35,7 @@ using client::Ping;
BOOST_FIXTURE_TEST_CASE(Basic, IoFixture)
{
util::DummyClientFace face(m_io, {true, true});
DummyClientFace face(m_io, {true, true});
Options pingOptions;
pingOptions.prefix = "/test-prefix";
pingOptions.shouldAllowStaleData = false;
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -44,7 +44,7 @@ private:
}
protected:
util::DummyClientFace face;
DummyClientFace face;
Options pingOptions{makeOptions()};
Ping pingProgram{face, pingOptions};
StatisticsCollector sc{pingProgram, pingOptions};
+6 -5
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015-2022, Arizona Board of Regents.
* Copyright (c) 2015-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -25,6 +25,7 @@
#include "tests/key-chain-fixture.hpp"
#include <ndn-cxx/util/dummy-client-face.hpp>
#include <boost/asio/post.hpp>
namespace ndn::ping::tests {
@@ -51,9 +52,9 @@ protected:
template<typename Packet>
void
receive(util::DummyClientFace& face, const Packet& pkt)
receive(DummyClientFace& face, const Packet& pkt)
{
m_io.post([=, &face] {
boost::asio::post(m_io, [=, &face] {
if (!wantLoss) {
face.receive(pkt);
}
@@ -69,8 +70,8 @@ protected:
}
protected:
util::DummyClientFace serverFace{m_io, m_keyChain, {false, true}};
util::DummyClientFace clientFace{m_io, m_keyChain, {false, true}};
DummyClientFace serverFace{m_io, m_keyChain, {false, true}};
DummyClientFace clientFace{m_io, m_keyChain, {false, true}};
std::unique_ptr<server::PingServer> server;
std::unique_ptr<client::Ping> client;
bool wantLoss = false;
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -59,7 +59,7 @@ private:
}
protected:
util::DummyClientFace face{m_io, m_keyChain, {false, true}};
DummyClientFace face{m_io, m_keyChain, {false, true}};
Options pingOptions{makeOptions()};
PingServer pingServer{face, m_keyChain, pingOptions};
};
+1 -1
View File
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE(Test1)
int i = 0;
// For reference of available Boost.Test macros, see
// https://www.boost.org/doc/libs/1_65_1/libs/test/doc/html/boost_test/testing_tools/summary.html
// https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/testing_tools/summary.html
BOOST_REQUIRE_NO_THROW(i = 1);
BOOST_CHECK_EQUAL(i, 1);
+3 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,8 @@
namespace ndn::tests {
shared_ptr<Interest>
makeInterest(const Name& name, bool canBePrefix, optional<time::milliseconds> lifetime,
optional<Interest::Nonce> nonce)
makeInterest(const Name& name, bool canBePrefix, std::optional<time::milliseconds> lifetime,
std::optional<Interest::Nonce> nonce)
{
auto interest = std::make_shared<Interest>(name);
interest->setCanBePrefix(canBePrefix);
+4 -4
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -36,8 +36,8 @@ namespace ndn::tests {
*/
shared_ptr<Interest>
makeInterest(const Name& name, bool canBePrefix = false,
optional<time::milliseconds> lifetime = nullopt,
optional<Interest::Nonce> nonce = nullopt);
std::optional<time::milliseconds> lifetime = std::nullopt,
std::optional<Interest::Nonce> nonce = std::nullopt);
/**
* \brief Create a Data with a null (i.e., empty) signature
@@ -71,7 +71,7 @@ makeNack(Interest interest, lp::NackReason reason);
/**
* \brief Replace a name component in a packet
* \param[inout] pkt the packet
* \param[in,out] pkt the packet
* \param index the index of the name component to replace
* \param args arguments to name::Component constructor
*/
+3 -3
View File
@@ -3,8 +3,8 @@ top = '..'
def build(bld):
bld.program(
target='../unit-tests',
target=f'{top}/unit-tests',
name='unit-tests',
source=bld.path.ant_glob(['*.cpp'] + ['%s/**/*.cpp' % tool for tool in bld.env.BUILD_TOOLS]),
use=['core-objects'] + ['%s-objects' % tool for tool in bld.env.BUILD_TOOLS],
source=bld.path.ant_glob(['*.cpp'] + [f'{tool}/**/*.cpp' for tool in bld.env.BUILD_TOOLS]),
use=['BOOST_TESTS', 'core-objects'] + [f'{tool}-objects' for tool in bld.env.BUILD_TOOLS],
install_path=None)
+4 -4
View File
@@ -4,8 +4,8 @@
* **ndnputchunks** is a producer program that reads a file from the standard input, and makes
it available as a set of NDN Data segments. It appends version and segment number components
to the specified name as needed, according to the
[NDN naming conventions](https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/).
to the specified name as needed, according to the [NDN naming conventions](
https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/).
* **ndncatchunks** is a consumer program that fetches Data segments of a file, optionally
discovering the latest version of the file, and writes the content of the retrieved file to
@@ -18,7 +18,7 @@ number will be used, without any version discovery process. Otherwise, discovery
be sent out to fetch metadata of the solicited content from which the Data version will be resolved.
For more information about the packet format and naming conventions of Interest and Data packets
used for version discovery in ndncatchunks, please refer to:
[Realtime Data Retrieval (RDR) protocol wiki page](https://redmine.named-data.net/projects/ndn-tlv/wiki/RDR)
[Realtime Data Retrieval (RDR) protocol](https://redmine.named-data.net/projects/ndn-tlv/wiki/RDR).
## Interest pipeline types in ndncatchunks
@@ -32,7 +32,7 @@ used for version discovery in ndncatchunks, please refer to:
* `cubic`: adjusts the window size similar to the TCP CUBIC algorithm.
For details about both aimd and cubic please refer to:
[A Practical Congestion Control Scheme for Named Data
Networking](https://conferences2.sigcomm.org/acm-icn/2016/proceedings/p21-schneider.pdf)
Networking](https://conferences2.sigcomm.org/acm-icn/2016/proceedings/p21-schneider.pdf).
The default Interest pipeline type is `cubic`.
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -50,7 +50,7 @@ DataFetcher::DataFetcher(Face& face, int maxNackRetries, int maxTimeoutRetries,
DataCallback onData, FailureCallback onNack, FailureCallback onTimeout,
bool isVerbose)
: m_face(face)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
, m_onData(std::move(onData))
, m_onNack(std::move(onNack))
, m_onTimeout(std::move(onTimeout))
+3 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -51,12 +51,12 @@ public:
/**
* @brief Signal emitted when the versioned name of Data is found.
*/
util::Signal<DiscoverVersion, Name> onDiscoverySuccess;
signal::Signal<DiscoverVersion, Name> onDiscoverySuccess;
/**
* @brief Signal emitted when a failure occurs.
*/
util::Signal<DiscoverVersion, std::string> onDiscoveryFailure;
signal::Signal<DiscoverVersion, std::string> onDiscoveryFailure;
void
run();
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -29,7 +29,6 @@
#include "pipeline-interests-adaptive.hpp"
#include "data-fetcher.hpp"
#include <cmath>
#include <iomanip>
namespace ndn::chunks {
@@ -41,7 +40,7 @@ PipelineInterestsAdaptive::PipelineInterestsAdaptive(Face& face,
, m_cwnd(m_options.initCwnd)
, m_ssthresh(m_options.initSsthresh)
, m_rttEstimator(rttEstimator)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
{
}
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -94,7 +94,7 @@ public:
* The callback function should be: `void(nanoseconds age, double cwnd)`, where `age` is the
* time since the pipeline started and `cwnd` is the new congestion window size (in segments).
*/
util::Signal<PipelineInterestsAdaptive, time::nanoseconds, double> afterCwndChange;
signal::Signal<PipelineInterestsAdaptive, time::nanoseconds, double> afterCwndChange;
struct RttSample
{
@@ -108,7 +108,7 @@ public:
/**
* @brief Signals when a new RTT sample has been taken.
*/
util::Signal<PipelineInterestsAdaptive, RttSample> afterRttMeasurement;
signal::Signal<PipelineInterestsAdaptive, RttSample> afterRttMeasurement;
protected:
DECLARE_SIGNAL_EMIT(afterCwndChange)
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -31,7 +31,8 @@
#include "pipeline-interests.hpp"
#include "data-fetcher.hpp"
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/post.hpp>
namespace ndn::chunks {
@@ -101,8 +102,9 @@ PipelineInterests::onFailure(const std::string& reason)
cancel();
if (m_onFailure)
m_face.getIoService().post([this, reason] { m_onFailure(reason); });
if (m_onFailure) {
boost::asio::post(m_face.getIoContext(), [this, reason] { m_onFailure(reason); });
}
}
void
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -53,7 +53,7 @@ Producer::Producer(const Name& prefix, Face& face, KeyChain& keyChain, std::istr
if (!m_options.isQuiet) {
std::cerr << "Loading input ...\n";
}
util::Segmenter segmenter(m_keyChain, m_options.signingInfo);
Segmenter segmenter(m_keyChain, m_options.signingInfo);
m_store = segmenter.segment(is, m_versionedPrefix, m_options.maxSegmentSize, m_options.freshnessPeriod);
// register m_prefix without Interest handler
+29 -25
View File
@@ -1,19 +1,18 @@
NDN Packet Dissector for Wireshark
==================================
# NDN Packet Dissector for Wireshark
**NDN packet dissector requires at least version 1.12.6 of Wireshark with LUA support enabled**
*NOTE: The dissector requires at least version 1.12.6 of Wireshark with LUA support enabled.*
The dissection of [Named Data Networking (NDN) packets](http://named-data.net/doc/ndn-tlv/) is
supported in the following cases:
The dissection of [NDN packets](https://docs.named-data.net/NDN-packet-spec/current/)
is supported in the following cases:
- NDN packets are encapsulated in IPv4/IPv6 UDP packets with source or destination port
6363 or 56363.
- NDN packets are encapsulated in IPv4/IPv6 UDP datagrams with source or destination
port 6363 or 56363.
- NDN packets are encapsulated in IPv4/IPv6 TCP segments with source or destination
port 6363.
- NDN packets are encapsulated in IPv4/IPv6 TCP/HTTP WebSocket packets with source or
destination port 9696.
- NDN packets are encapsulated in IPv4/IPv6 WebSocket packets with source or destination
port 9696.
- NDN packets are encapsulated in Ethernet frames with EtherType 0x8624.
@@ -56,11 +55,15 @@ On some platforms, it may also be installed in `/usr/share/ndn-dissect-wireshark
`/opt/local/share/ndn-dissect-wireshark`. To enable the dissector for Wireshark session,
use `-X` command line option, specifying the full path to the `ndn.lua` script:
wireshark -X lua_script:/usr/local/share/ndn-dissect-wireshark/ndn.lua
```shell
wireshark -X lua_script:/usr/local/share/ndn-dissect-wireshark/ndn.lua
```
Similarly, NDN packets dissector can be enabled when using `tshark`:
tshark shark -X lua_script:/usr/local/share/ndn-dissect-wireshark/ndn.lua
```shell
tshark shark -X lua_script:/usr/local/share/ndn-dissect-wireshark/ndn.lua
```
To enable NDN packets dissector for all future Wireshark sessions, you can create/edit
Wireshark's `init.lua` script, which located in `/usr/share/wireshark`,
@@ -68,8 +71,9 @@ Wireshark's `init.lua` script, which located in `/usr/share/wireshark`,
or similar location depending on the platform and the way Wireshark is installed. The
`dofile` command should be added to the end of `init.lua` file:
-- dofile("/full/path/to/ndn.lua")
dofile("/usr/local/share/ndn-dissect-wireshark/ndn.lua")
```lua
dofile("/usr/local/share/ndn-dissect-wireshark/ndn.lua")
```
For more detailed information about how to use Lua refer to [Lua wiki](https://wiki.wireshark.org/Lua).
@@ -78,26 +82,26 @@ For more detailed information about how to use Lua refer to [Lua wiki](https://w
Due to security issues, customized lua scripts are not allowed to be loaded when Wireshark
is started with root privileges. There are two workarounds:
- run Wireshark, `dumpcap`, or `tcpdump` with root privileges to capture traffic to a file, later
running Wireshark without root privileges and to analyze the captured traffic.
- Run `dumpcap` or `tcpdump` with root privileges to capture traffic to a file, and later
run Wireshark *without* root privileges to analyze the captured traffic.
- (beware of potential security implications) allow non-root users to capture packets:
- Allow non-root users to capture packets (beware of potential security implications!)
* On Linux platform, you can use `setcap`
* On Linux, you can use `setcap`:
sudo setcap cap_net_raw,cap_net_admin=eip /full/path/to/wireshark
sudo setcap cap_net_raw,cap_net_admin=eip /full/path/to/wireshark
You may need to install a package to use setcap (e.g., `sudo apt-get install libcap2-bin` on Ubuntu)
You may need to install a package to use `setcap` (e.g., `sudo apt install libcap2-bin` on Ubuntu)
* On Debian/Ubuntu Linux, capturing traffic with Wireshark by a non-root user can be enabled by adding
this user to the `wireshark` group.
* On Debian/Ubuntu Linux, capturing traffic with Wireshark by a non-root user can be enabled by
adding the user to the `wireshark` group.
See [Wireshark Debian README](http://anonscm.debian.org/viewvc/collab-maint/ext-maint/wireshark/trunk/debian/README.Debian?view=markup)
for more details.
See Debian's [README file](https://salsa.debian.org/debian/wireshark/-/blob/debian/master/debian/README.Debian)
for details.
* On OSX platform, `/dev/bpf*` devices need to be assigned proper permissions
* On macOS, `/dev/bpf*` devices need to be assigned proper permissions.
Automatically using ChmodBPF app
Automatically using ChmodBPF app:
curl https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3373 -o ChmodBPF.tar.gz
tar zxvf ChmodBPF.tar.gz
+2 -2
View File
@@ -1,4 +1,4 @@
-- Copyright (c) 2015-2019, Regents of the University of California.
-- Copyright (c) 2015-2023, Regents of the University of California.
--
-- This file is part of ndn-tools (Named Data Networking Essential Tools).
-- See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -173,7 +173,7 @@ function getGenericBlockInfo(block)
local name = ""
-- TODO: Properly format informational message based type value reservations
-- (https://named-data.net/doc/NDN-packet-spec/current/types.html#tlv-type-number-reservations)
-- (https://docs.named-data.net/NDN-packet-spec/current/types.html#reserved-ranges)
if (block.type <= AppPrivateBlock1) then
name = "Unrecognized from the reserved range " .. 0 .. "-" .. AppPrivateBlock1 .. ""
elseif (AppPrivateBlock1 < block.type and block.type < AppPrivateBlock2) then
+3 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2022, Regents of the University of California.
* Copyright (c) 2013-2023, Regents of the University of California.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -74,7 +74,7 @@ Dissector::printBranches()
}
}
// https://named-data.net/doc/NDN-packet-spec/current/types.html
// https://docs.named-data.net/NDN-packet-spec/current/types.html
static const std::map<uint32_t, std::string_view> TLV_DICT = {
{tlv::Interest , "Interest"},
{tlv::Data , "Data"},
@@ -168,7 +168,7 @@ Dissector::printBlock(const Block& block)
const auto& elements = block.elements();
if (elements.empty()) {
m_out << " [[";
escape(m_out, reinterpret_cast<const char*>(block.value()), block.value_size());
escape(m_out, {reinterpret_cast<const char*>(block.value()), block.value_size()});
m_out << "]]";
}
m_out << "\n";
+5 -4
View File
@@ -5,9 +5,10 @@ and displays brief information about captured packets.
Usage example:
1. start NFD on local machine
2. create an IPv4 UDP tunnel to a remote machine
3. cause some traffic going on the tunnel
4. execute `sudo ndndump`
1. start NFD on the local machine
2. create a UDP tunnel to a remote machine
3. run `sudo ndndump`
4. cause some NDN traffic to be sent/received on the tunnel
5. observe the output of `ndndump`
For more information, consult the manpage.
+2 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2011-2022, Regents of the University of California.
* Copyright (c) 2011-2023, Regents of the University of California.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -31,6 +31,7 @@
#include <iomanip>
#include <sstream>
#include <ndn-cxx/lp/fields.hpp>
#include <ndn-cxx/lp/nack.hpp>
#include <ndn-cxx/lp/packet.hpp>
#include <ndn-cxx/net/ethernet.hpp>
+3 -2
View File
@@ -2,8 +2,9 @@
top = '../..'
def configure(conf):
conf.check_cfg(package='libpcap', uselib_store='PCAP',
path='pcap-config', args='--libs --cflags')
conf.check_cfg(msg='Checking for libpcap',
path='pcap-config', args='--cflags --libs',
package='', uselib_store='PCAP')
conf.check_cxx(msg='Checking if struct tcphdr has member th_off ',
define_name='HAVE_BSD_TCPHDR', mandatory=False,
fragment='''#include <netinet/tcp.h>
+3 -3
View File
@@ -8,7 +8,7 @@
Usage example:
1. start NFD
2. execute `echo 'HELLO WORLD' | ndnpoke /localhost/demo/hello`
3. in another terminal, execute `ndnpeek -p /localhost/demo/hello`
2. run `echo 'HELLO WORLD' | ndnpoke /localhost/demo/hello`
3. in another terminal, run `ndnpeek -p /localhost/demo/hello`
For more information, consult the manpages of these programs.
For more information on these programs, consult their respective manpages.
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,7 +34,7 @@ namespace ndn::peek {
NdnPeek::NdnPeek(Face& face, const PeekOptions& options)
: m_options(options)
, m_face(face)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
{
}
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,7 +37,7 @@ NdnPoke::NdnPoke(Face& face, KeyChain& keyChain, std::istream& input, const Poke
, m_face(face)
, m_keyChain(keyChain)
, m_input(input)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
{
}
+18 -17
View File
@@ -2,47 +2,48 @@
## Introduction
**ndnping** and **ndnpingserver** are reachability testing tools for
[Named Data Networking](http://named-data.net). They test the reachability between two nodes. The
client sends an Interest intended for a node running **ndnpingserver**. The ping server then sends
Data in response. The client then calculates the roundtrip time for the Interest-Data exchange, or
marks it as a timeout if the Data is not received within the timeout period.
**ndnping** and **ndnpingserver** are reachability testing tools for NDN. They can be used
to test the network reachability between two nodes. The client sends an Interest intended
for a node running **ndnpingserver**. The server then sends Data in response. The client
then calculates the roundtrip time for the Interest-Data exchange, or marks it as a timeout
if the Data packet is not received within the timeout period.
## Using the Client
## Using the client
The client can be invoked by calling **ndnping** with a name to ping. For example, to ping
`/edu/arizona`, one would execute:
The client can be invoked by calling `ndnping` with a name to ping. For example, to ping
`/edu/arizona`, one would run:
ndnping /edu/arizona
There are also a variety of options to control the behavior of the ping client. For example, to
send only four pings to `/edu/arizona`, displaying a timestamp with each received Data or
There are also a variety of options to control the behavior of the ping client. For example,
to send only four pings to `/edu/arizona`, displaying a timestamp with each received Data or
timeout, type:
ndnping -c 4 -t /edu/arizona
A list of the available options can be found with `man ndnping`.
## Using the Server
## Using the server
The server can be invoked by calling **ndnpingserver** with a name to listen for pings to. For
example, to listen for pings to `/edu/arizona`, one would execute:
The server can be invoked by calling `ndnpingserver` with a name to listen for pings to. For
example, to listen for pings to `/edu/arizona`, one would run:
ndnpingserver /edu/arizona
There are also a variety of options to control the behavior of the ping server. For example, to
satisfy only 4 ping requests before exiting, execute the following:
There are also a variety of options to control the behavior of the ping server. For example,
to satisfy only 4 ping requests before exiting, run the following:
ndnpingserver -p 4 /edu/arizona
A list of the available options can be found with `man ndnpingserver`.
## ndnping Protocol
## NDN ping protocol
This section briefly describes ndnping's protocol, in order to allow alternate implementations
to be compatible with this implementation.
The current protocol version is **ndnping protocol version 1**.
This version number will be incremented in case there's an incompatible change.
This version number will be incremented whenever there is an incompatible change.
### Probe Interests
+3 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -42,8 +42,8 @@ public:
: m_ping(m_face, options)
, m_statisticsCollector(m_ping, options)
, m_tracer(m_ping, options)
, m_signalSetInt(m_face.getIoService(), SIGINT)
, m_signalSetQuit(m_face.getIoService(), SIGQUIT)
, m_signalSetInt(m_face.getIoContext(), SIGINT)
, m_signalSetQuit(m_face.getIoContext(), SIGQUIT)
{
m_signalSetInt.async_wait([this] (const auto& err, int) { onInterruptSignal(err); });
m_signalSetQuit.async_wait([this] (const auto& err, int) { onQuitSignal(err); });
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -31,7 +31,7 @@ Ping::Ping(Face& face, const Options& options)
: m_options(options)
, m_nextSeq(options.startSeq)
, m_face(face)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
{
if (m_options.shouldGenerateRandomSeq) {
m_nextSeq = random::generateWord64();
+5 -5
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015-2022, Arizona Board of Regents.
* Copyright (c) 2015-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -62,7 +62,7 @@ public:
* @param seq ping sequence number
* @param rtt round trip time
*/
util::Signal<Ping, uint64_t, Rtt> afterData;
signal::Signal<Ping, uint64_t, Rtt> afterData;
/**
* @brief Signals on the return of a Nack
@@ -71,19 +71,19 @@ public:
* @param rtt round trip time
* @param header the received Network NACK header
*/
util::Signal<Ping, uint64_t, Rtt, lp::NackHeader> afterNack;
signal::Signal<Ping, uint64_t, Rtt, lp::NackHeader> afterNack;
/**
* @brief Signals on timeout of a packet
*
* @param seq ping sequence number
*/
util::Signal<Ping, uint64_t> afterTimeout;
signal::Signal<Ping, uint64_t> afterTimeout;
/**
* @brief Signals when finished pinging
*/
util::Signal<Ping> afterFinish;
signal::Signal<Ping> afterFinish;
/**
* @brief Start sending ping interests
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015-2022, Arizona Board of Regents.
* Copyright (c) 2015-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -43,7 +43,7 @@ public:
: m_options(options)
, m_pingServer(m_face, m_keyChain, options)
, m_tracer(m_pingServer, options)
, m_signalSet(m_face.getIoService(), SIGINT)
, m_signalSet(m_face.getIoContext(), SIGINT)
{
m_pingServer.afterFinish.connect([this] {
m_pingServer.stop();
+3 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015-2022, Arizona Board of Regents.
* Copyright (c) 2015-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -55,12 +55,12 @@ public:
*
* @param name incoming interest name
*/
util::Signal<PingServer, Name> afterReceive;
signal::Signal<PingServer, Name> afterReceive;
/**
* @brief Signals when finished pinging
*/
util::Signal<PingServer> afterFinish;
signal::Signal<PingServer> afterFinish;
/** @brief starts ping server
*
+9 -9
View File
@@ -6,12 +6,12 @@ from waflib import Options
def options(opt):
for subdir in opt.path.ant_glob('*', dir=True, src=False):
tool = subdir.path_from(opt.path)
opt.add_option('--enable-%s' % tool,
help='Build tool %s (enabled by default)' % tool,
action='store_true', dest='enable_%s' % tool)
opt.add_option('--disable-%s' % tool,
help='Do not build tool %s' % tool,
action='store_true', dest='disable_%s' % tool)
opt.add_option(f'--enable-{tool}',
help=f'Build tool {tool} (enabled by default)',
action='store_true', dest=f'enable_{tool}')
opt.add_option(f'--disable-{tool}',
help=f'Do not build tool {tool}',
action='store_true', dest=f'disable_{tool}')
opt.recurse(str(tool), mandatory=False)
def configure(conf):
@@ -23,11 +23,11 @@ def configure(conf):
tool = subdir.path_from(conf.path)
all_tools.add(tool)
is_enabled = getattr(Options.options, 'enable_%s' % tool)
is_disabled = getattr(Options.options, 'disable_%s' % tool)
is_enabled = getattr(Options.options, f'enable_{tool}')
is_disabled = getattr(Options.options, f'disable_{tool}')
if is_enabled and is_disabled:
conf.fatal('--enable-%s and --disable-%s cannot be both specified' % (tool, tool))
conf.fatal(f'--enable-{tool} and --disable-{tool} cannot be both specified')
if is_enabled:
enabled_tools.add(tool)
Vendored
+7 -7
View File
File diff suppressed because one or more lines are too long
+20 -17
View File
@@ -1,7 +1,8 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os
import subprocess
from waflib import Context, Logs, Utils
import os, subprocess
VERSION = '22.12'
APPNAME = 'ndn-tools'
@@ -36,17 +37,15 @@ def configure(conf):
conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.1', '--cflags', '--libs'],
uselib_store='NDN_CXX', pkg_config_path=pkg_config_path)
boost_libs = ['system', 'program_options']
if conf.env.WITH_TESTS:
boost_libs.append('unit_test_framework')
conf.define('WITH_TESTS', 1)
conf.check_boost(lib=boost_libs, mt=True)
if conf.env.BOOST_VERSION_NUMBER < 106501:
conf.fatal('The minimum supported version of Boost is 1.65.1.\n'
conf.check_boost(lib='program_options', mt=True)
if conf.env.BOOST_VERSION_NUMBER < 107100:
conf.fatal('The minimum supported version of Boost is 1.71.0.\n'
'Please upgrade your distribution or manually install a newer version of Boost.\n'
'For more information, see https://redmine.named-data.net/projects/nfd/wiki/Boost')
if conf.env.WITH_TESTS:
conf.check_boost(lib='unit_test_framework', mt=True, uselib_store='BOOST_TESTS')
conf.recurse('tools')
conf.check_compiler_flags()
@@ -55,6 +54,8 @@ def configure(conf):
conf.load('coverage')
conf.load('sanitizers')
conf.define_cond('WITH_TESTS', conf.env.WITH_TESTS)
conf.msg('Tools to build', ', '.join(conf.env.BUILD_TOOLS))
def build(bld):
@@ -68,8 +69,8 @@ def build(bld):
bld.objects(
target='core-objects',
source=bld.path.find_node('core').ant_glob('*.cpp') + ['core/version.cpp'],
use='NDN_CXX BOOST',
source=bld.path.find_dir('core').ant_glob('*.cpp') + ['core/version.cpp'],
use='BOOST NDN_CXX',
includes='.',
export_includes='.')
@@ -107,16 +108,16 @@ def version(ctx):
# first, try to get a version string from git
gotVersionFromGit = False
try:
cmd = ['git', 'describe', '--always', '--match', '%s*' % GIT_TAG_PREFIX]
out = subprocess.check_output(cmd, universal_newlines=True).strip()
cmd = ['git', 'describe', '--always', '--match', f'{GIT_TAG_PREFIX}*']
out = subprocess.run(cmd, capture_output=True, check=True, text=True).stdout.strip()
if out:
gotVersionFromGit = True
if out.startswith(GIT_TAG_PREFIX):
Context.g_module.VERSION = out.lstrip(GIT_TAG_PREFIX)
else:
# no tags matched
Context.g_module.VERSION = '%s-commit-%s' % (VERSION_BASE, out)
except (OSError, subprocess.CalledProcessError):
Context.g_module.VERSION = f'{VERSION_BASE}-commit-{out}'
except (OSError, subprocess.SubprocessError):
pass
versionFile = ctx.path.find_node('VERSION.info')
@@ -134,17 +135,19 @@ def version(ctx):
# already up-to-date
return
except EnvironmentError as e:
Logs.warn('%s exists but is not readable (%s)' % (versionFile, e.strerror))
Logs.warn(f'{versionFile} exists but is not readable ({e.strerror})')
else:
versionFile = ctx.path.make_node('VERSION.info')
try:
versionFile.write(Context.g_module.VERSION)
except EnvironmentError as e:
Logs.warn('%s is not writable (%s)' % (versionFile, e.strerror))
Logs.warn(f'{versionFile} is not writable ({e.strerror})')
def dist(ctx):
ctx.algo = 'tar.xz'
version(ctx)
def distcheck(ctx):
ctx.algo = 'tar.xz'
version(ctx)