Compare commits
291
Commits
ndn-cxx-0.6.6
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ad02f3428 | ||
|
|
6d4a6536fd | ||
|
|
e58bab2e8a | ||
|
|
995c411ae4 | ||
|
|
49e1e87b24 | ||
|
|
2f46d6543e | ||
|
|
550d8c99ab | ||
|
|
e1005da0a2 | ||
|
|
6028418380 | ||
|
|
5686c51b87 | ||
|
|
c996742bad | ||
|
|
90d3a96dc2 | ||
|
|
fffdd62715 | ||
|
|
ce442c4c95 | ||
|
|
ee97139dcd | ||
|
|
03fdfb17a1 | ||
|
|
747cb45c16 | ||
|
|
9404892918 | ||
|
|
382de67df8 | ||
|
|
0af48fb516 | ||
|
|
12b8aaa9f2 | ||
|
|
502c4c3bd6 | ||
|
|
f81de71486 | ||
|
|
67bc114aa8 | ||
|
|
699cca4ba0 | ||
|
|
296c3a185d | ||
|
|
47ce2eed3a | ||
|
|
21b7f1b379 | ||
|
|
581dd52b0d | ||
|
|
152ef44da9 | ||
|
|
3fdb02f62e | ||
|
|
a3651646a9 | ||
|
|
23483c76d5 | ||
|
|
0910343957 | ||
|
|
187e9f99b2 | ||
|
|
eb87c28200 | ||
|
|
869d1a3c36 | ||
|
|
05ec0be21b | ||
|
|
f6b458930f | ||
|
|
a2fbc35f12 | ||
|
|
fcd3e44028 | ||
|
|
762548b15e | ||
|
|
02ed332ddd | ||
|
|
d09d52bdfa | ||
|
|
ae39daf4de | ||
|
|
a90b2cf762 | ||
|
|
535bd33223 | ||
|
|
81de5d98e9 | ||
|
|
15fa994bf6 | ||
|
|
67090837ab | ||
|
|
90795be569 | ||
|
|
576c21ba33 | ||
|
|
ffddbbf745 | ||
|
|
09c064f1c5 | ||
|
|
b5e95f9106 | ||
|
|
83faec7308 | ||
|
|
017a9c066f | ||
|
|
5c4f376e05 | ||
|
|
8fbffe4577 | ||
|
|
637ea3b2a9 | ||
|
|
2acce25696 | ||
|
|
ea5ce49651 | ||
|
|
e16ac8693f | ||
|
|
c860bd1ccb | ||
|
|
0f56226142 | ||
|
|
05b56a8250 | ||
|
|
02bbfa7b0f | ||
|
|
87208f964a | ||
|
|
a821f59741 | ||
|
|
73e946e2c8 | ||
|
|
f662500858 | ||
|
|
dc3575fd92 | ||
|
|
134ed4832b | ||
|
|
2d7c585965 | ||
|
|
fbca611095 | ||
|
|
80d671f996 | ||
|
|
58de07ae20 | ||
|
|
9faf34bdf4 | ||
|
|
bbe7942288 | ||
|
|
e30389c32a | ||
|
|
0e768ef03a | ||
|
|
8e2a61d357 | ||
|
|
07db0733d9 | ||
|
|
8618c1e026 | ||
|
|
487e3d3c63 | ||
|
|
78ca8aeca0 | ||
|
|
b99c711a9f | ||
|
|
56cc0d7c06 | ||
|
|
1c62884f6b | ||
|
|
4999b2eddd | ||
|
|
9ee770bdcd | ||
|
|
dd0724bd70 | ||
|
|
5b4b27f3b7 | ||
|
|
85bd6998be | ||
|
|
7d72868a2e | ||
|
|
2f92b6ea7c | ||
|
|
e727229400 | ||
|
|
d6bcdbf67e | ||
|
|
85be940ae9 | ||
|
|
5b06597e84 | ||
|
|
21ee89904f | ||
|
|
541a822ae6 | ||
|
|
258d51a6d8 | ||
|
|
0838f3dacc | ||
|
|
df8fd8a158 | ||
|
|
273ea019b6 | ||
|
|
aee2ada5f0 | ||
|
|
778ad714f0 | ||
|
|
fbea4fc83d | ||
|
|
a3d809ea54 | ||
|
|
35c6379830 | ||
|
|
5bd6c643ee | ||
|
|
e4603e1028 | ||
|
|
f135f1581b | ||
|
|
3826406a1d | ||
|
|
221a72dd70 | ||
|
|
765abc9087 | ||
|
|
d1b6f95864 | ||
|
|
21ce3ad9c2 | ||
|
|
6700044973 | ||
|
|
1bf15aef02 | ||
|
|
47a94d10dc | ||
|
|
8c1c5b1849 | ||
|
|
949075ab7b | ||
|
|
682e6b4c02 | ||
|
|
83f8d167ca | ||
|
|
94dfcf11db | ||
|
|
ea9e43ec19 | ||
|
|
2b47ac0a6f | ||
|
|
3ffae2600e | ||
|
|
09d5662f2a | ||
|
|
01cea502ca | ||
|
|
b3b9562135 | ||
|
|
2e481fc28d | ||
|
|
30ed628efa | ||
|
|
74cb28f6aa | ||
|
|
93101df38f | ||
|
|
045664345c | ||
|
|
d8e0cad339 | ||
|
|
97157b4936 | ||
|
|
f3089c3522 | ||
|
|
3f13f35987 | ||
|
|
8eecc7f1ab | ||
|
|
77c5ce85aa | ||
|
|
99431c13b5 | ||
|
|
e02d2f9f6e | ||
|
|
90b6a1b0b5 | ||
|
|
a76ea9ac7d | ||
|
|
5f6865cc73 | ||
|
|
dbe645f879 | ||
|
|
cad94b0255 | ||
|
|
39535f4493 | ||
|
|
c25e463e91 | ||
|
|
3c34ec1c4c | ||
|
|
fcf4d5186c | ||
|
|
809f754bf6 | ||
|
|
f2cae616fa | ||
|
|
09904410ca | ||
|
|
fbc2f5273e | ||
|
|
478d338253 | ||
|
|
17d4b93f04 | ||
|
|
aef53b6c26 | ||
|
|
58b9e0fdc9 | ||
|
|
5dc7560d5d | ||
|
|
861e0944f7 | ||
|
|
b08edd8d3e | ||
|
|
fe24bf8412 | ||
|
|
a86300a867 | ||
|
|
1a4a7bf2a9 | ||
|
|
0b2aa13fbf | ||
|
|
737103670a | ||
|
|
574c3f96f8 | ||
|
|
20d264e148 | ||
|
|
4c1ad4ca65 | ||
|
|
bdfb53aa09 | ||
|
|
287a7faad9 | ||
|
|
fa33f8d532 | ||
|
|
1caa634dca | ||
|
|
e36aae1eb8 | ||
|
|
670a52f2a3 | ||
|
|
97ee811129 | ||
|
|
599623c303 | ||
|
|
483087f56d | ||
|
|
81bd696ed9 | ||
|
|
17d7c47ca9 | ||
|
|
933a567c8a | ||
|
|
f2c4c53208 | ||
|
|
6b2cb79748 | ||
|
|
b74bbdab84 | ||
|
|
6d024bad65 | ||
|
|
8afba42296 | ||
|
|
2ca5e79633 | ||
|
|
905d40fad9 | ||
|
|
355fd789c8 | ||
|
|
75c3af824a | ||
|
|
46cdf909a5 | ||
|
|
9d1089aa29 | ||
|
|
6e262f0f1e | ||
|
|
09236c2b8d | ||
|
|
f601e1988b | ||
|
|
ab9d7ed25a | ||
|
|
3de8aac22d | ||
|
|
f165bb4e77 | ||
|
|
78ffc635cc | ||
|
|
14c56cd8bd | ||
|
|
bc2e78e074 | ||
|
|
a3c8bd1772 | ||
|
|
40ebaad603 | ||
|
|
3ad8923060 | ||
|
|
25d4f1c95e | ||
|
|
71c622bb68 | ||
|
|
394977c2f2 | ||
|
|
fbb6990abc | ||
|
|
702467b816 | ||
|
|
4c68b6e62c | ||
|
|
78338c5ee8 | ||
|
|
9603325ba6 | ||
|
|
ab7300b747 | ||
|
|
52a803cb9d | ||
|
|
2349e28c6d | ||
|
|
d776a93c9c | ||
|
|
ce9c1952ff | ||
|
|
53533947d1 | ||
|
|
97242f78e9 | ||
|
|
bc17d950e0 | ||
|
|
d247d49469 | ||
|
|
8d6d10ae53 | ||
|
|
9c8f00e3fb | ||
|
|
3b9a2c8b74 | ||
|
|
cf8ffd495a | ||
|
|
a39c0b5c48 | ||
|
|
21a4ea5ad7 | ||
|
|
813ae5831b | ||
|
|
7c67ab5938 | ||
|
|
39cb402377 | ||
|
|
39570d9313 | ||
|
|
009062db2e | ||
|
|
a421c80b10 | ||
|
|
0a6456cbe7 | ||
|
|
4fb35d8a35 | ||
|
|
12cef87c0c | ||
|
|
bc997e5ddd | ||
|
|
73940c93a6 | ||
|
|
56a812d633 | ||
|
|
e6e125ea1b | ||
|
|
5e494c0c3b | ||
|
|
cb672523a5 | ||
|
|
835f027df8 | ||
|
|
28a5bf107b | ||
|
|
75c56016a9 | ||
|
|
2fdb274627 | ||
|
|
0e0b389c80 | ||
|
|
ef654dd3ba | ||
|
|
140e9cbc62 | ||
|
|
869b11e5c5 | ||
|
|
4c5b7b88d6 | ||
|
|
92dbb008fe | ||
|
|
6c6e3854be | ||
|
|
b3f78b5db8 | ||
|
|
43eac58ed6 | ||
|
|
5149350bb4 | ||
|
|
7b2f58c9df | ||
|
|
fe407f2ddc | ||
|
|
65f697f5e8 | ||
|
|
2b0cc7bf01 | ||
|
|
720e25c294 | ||
|
|
adc9aa230c | ||
|
|
576b4ff50e | ||
|
|
ecfb391e20 | ||
|
|
700e12a0b8 | ||
|
|
9a04ddacb9 | ||
|
|
cf0baa2375 | ||
|
|
8b0344d4bc | ||
|
|
57a3276d44 | ||
|
|
c81637150c | ||
|
|
1bac111c3c | ||
|
|
ccce0bc969 | ||
|
|
3243c3dad3 | ||
|
|
48f97244b8 | ||
|
|
4ad933a757 | ||
|
|
77d9e815c5 | ||
|
|
0fe72eacc6 | ||
|
|
2ad2fbeb20 | ||
|
|
3510d299ba | ||
|
|
e37ec7ded4 | ||
|
|
530c10f523 | ||
|
|
5223ea82f5 | ||
|
|
c9650e4cb5 | ||
|
|
2ec13ebc10 | ||
|
|
fcdc873185 | ||
|
|
f1bb38d3aa |
No files matched your search
@@ -0,0 +1,17 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '*.conf.sample*'
|
||||
- '*.md'
|
||||
- '.mailmap'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
Ubuntu:
|
||||
uses: named-data/actions/.github/workflows/jenkins-script-ubuntu.yml@v1
|
||||
macOS:
|
||||
uses: named-data/actions/.github/workflows/jenkins-script-macos.yml@v1
|
||||
@@ -0,0 +1,48 @@
|
||||
name: Publish Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- '.mailmap'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to ${{ env.REGISTRY }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
flavor: latest=true
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
pull: true
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Docs
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
skip-deploy:
|
||||
description: 'Skip deployment?'
|
||||
required: true
|
||||
type: boolean
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
html:
|
||||
uses: named-data/actions/.github/workflows/docs-html.yml@v1
|
||||
with:
|
||||
# Deploy only the master branch and release tags
|
||||
deploy: ${{ !inputs.skip-deploy && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/ndn-cxx-')) }}
|
||||
secrets: inherit
|
||||
man:
|
||||
uses: named-data/actions/.github/workflows/docs-man.yml@v1
|
||||
+2
-1
@@ -26,4 +26,5 @@ __pycache__/
|
||||
*.py[cod]
|
||||
|
||||
# Other
|
||||
/VERSION
|
||||
/VERSION.info
|
||||
/examples/example-trust-anchor.cert
|
||||
@@ -1,10 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -eo pipefail
|
||||
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
case $(uname) in
|
||||
Linux)
|
||||
if [[ -e /etc/os-release ]]; then
|
||||
source /etc/os-release
|
||||
else
|
||||
source /usr/lib/os-release
|
||||
fi
|
||||
export ID VERSION_ID
|
||||
export ID_LIKE="${ID} ${ID_LIKE} linux"
|
||||
export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
|
||||
;;
|
||||
Darwin)
|
||||
# Emulate a subset of os-release(5)
|
||||
export ID=macos
|
||||
export VERSION_ID=$(sw_vers -productVersion)
|
||||
export PATH="/usr/local/bin${PATH:+:}${PATH}"
|
||||
if [[ -x /opt/homebrew/bin/brew ]]; then
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
elif [[ -x /usr/local/bin/brew ]]; then
|
||||
eval "$(/usr/local/bin/brew shellenv)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for file in "$DIR"/.jenkins.d/*; do
|
||||
export CACHE_DIR=${CACHE_DIR:-/tmp}
|
||||
|
||||
if [[ $JOB_NAME == *"code-coverage" ]]; then
|
||||
export DISABLE_ASAN=yes
|
||||
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
|
||||
echo "Run: $file"
|
||||
|
||||
if [[ -n $GITHUB_ACTIONS ]]; then
|
||||
label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
|
||||
echo "::group::${label}"
|
||||
fi
|
||||
|
||||
echo "\$ $file"
|
||||
"$file"
|
||||
|
||||
if [[ -n $GITHUB_ACTIONS ]]; then
|
||||
echo "::endgroup::"
|
||||
fi
|
||||
done
|
||||
+27
-42
@@ -1,53 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -eo pipefail
|
||||
|
||||
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
source "$JDIR"/util.sh
|
||||
APT_PKGS=(build-essential pkg-config python3-minimal
|
||||
libboost-all-dev libssl-dev libsqlite3-dev)
|
||||
FORMULAE=(boost openssl pkg-config)
|
||||
PIP_PKGS=()
|
||||
case $JOB_NAME in
|
||||
*code-coverage)
|
||||
APT_PKGS+=(lcov python3-pip)
|
||||
PIP_PKGS+=('gcovr~=5.2')
|
||||
;;
|
||||
*Docs)
|
||||
APT_PKGS+=(doxygen graphviz python3-pip)
|
||||
FORMULAE+=(doxygen graphviz)
|
||||
PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
|
||||
;;
|
||||
esac
|
||||
|
||||
set -x
|
||||
|
||||
if has OSX $NODE_LABELS; then
|
||||
FORMULAE=(boost pkg-config)
|
||||
if [[ -n $USE_OPENSSL_1_1 ]]; then
|
||||
FORMULAE+=(openssl@1.1)
|
||||
else
|
||||
FORMULAE+=(openssl)
|
||||
if [[ $ID == macos ]]; then
|
||||
if [[ -n $GITHUB_ACTIONS ]]; then
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
fi
|
||||
|
||||
brew update
|
||||
if [[ -n $TRAVIS ]]; then
|
||||
# travis images come with a large number of brew packages
|
||||
# pre-installed, don't waste time upgrading all of them
|
||||
for FORMULA in "${FORMULAE[@]}"; do
|
||||
brew outdated $FORMULA || brew upgrade $FORMULA
|
||||
done
|
||||
else
|
||||
brew upgrade
|
||||
fi
|
||||
brew install "${FORMULAE[@]}"
|
||||
brew cleanup
|
||||
fi
|
||||
|
||||
if has Ubuntu $NODE_LABELS; then
|
||||
brew install --formula "${FORMULAE[@]}"
|
||||
elif [[ $ID_LIKE == *debian* ]]; then
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get -qy install build-essential pkg-config libboost-all-dev \
|
||||
libsqlite3-dev libssl-dev
|
||||
|
||||
if [[ $JOB_NAME == *"code-coverage" ]]; then
|
||||
sudo apt-get -qy install gcovr lcov libgd-perl
|
||||
fi
|
||||
sudo apt-get -qy install "${APT_PKGS[@]}"
|
||||
elif [[ $ID_LIKE == *fedora* ]]; then
|
||||
sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
|
||||
boost-devel openssl-devel sqlite-devel
|
||||
fi
|
||||
|
||||
if has CentOS $NODE_LABELS; then
|
||||
sudo yum -y install yum-utils pkgconfig \
|
||||
openssl-devel libtranslit-icu \
|
||||
python-devel sqlite-devel \
|
||||
devtoolset-7-libasan-devel \
|
||||
devtoolset-7-liblsan-devel
|
||||
sudo yum -y groupinstall 'Development Tools'
|
||||
|
||||
svn checkout https://github.com/cmscaltech/sandie-ndn/trunk/packaging/RPMS/x86_64/boost1_58_0
|
||||
pushd boost1_58_0 >/dev/null
|
||||
sudo rpm -Uv --replacepkgs --replacefiles boost-devel* boost-license* libboost_*
|
||||
popd >/dev/null
|
||||
if (( ${#PIP_PKGS[@]} )); then
|
||||
pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
|
||||
fi
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -exo pipefail
|
||||
|
||||
PROJ=ndn-cxx
|
||||
|
||||
sudo rm -f /usr/local/bin/ndnsec*
|
||||
sudo rm -fr /usr/local/include/"$PROJ"
|
||||
sudo rm -f /usr/local/lib{,64}/lib"$PROJ"*
|
||||
sudo rm -f /usr/local/lib{,64}/pkgconfig/{,lib}"$PROJ".pc
|
||||
+32
-37
@@ -1,54 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -eo pipefail
|
||||
|
||||
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
source "$JDIR"/util.sh
|
||||
if [[ -z $DISABLE_ASAN ]]; then
|
||||
ASAN="--with-sanitizer=address"
|
||||
fi
|
||||
if [[ $JOB_NAME == *"code-coverage" ]]; then
|
||||
COVERAGE="--with-coverage"
|
||||
fi
|
||||
if [[ $ID == macos && ${VERSION_ID%%.*} -ge 12 ]]; then
|
||||
KEYCHAIN="--without-osx-keychain"
|
||||
fi
|
||||
if [[ -n $DISABLE_PCH ]]; then
|
||||
PCH="--without-pch"
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
sudo rm -f /usr/local/bin/ndnsec*
|
||||
sudo rm -fr /usr/local/include/ndn-cxx
|
||||
sudo rm -f /usr/local/lib{,64}/libndn-cxx*
|
||||
sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
|
||||
|
||||
if [[ $JOB_NAME == *"code-coverage" ]]; then
|
||||
COVERAGE="--with-coverage"
|
||||
elif [[ -z $DISABLE_ASAN ]]; then
|
||||
ASAN="--with-sanitizer=address"
|
||||
fi
|
||||
if [[ -n $USE_OPENSSL_1_1 ]] && has OSX $NODE_LABELS; then
|
||||
OPENSSL="--with-openssl=/usr/local/opt/openssl@1.1"
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
sudo_preserve_env PATH -- ./waf --color=yes distclean
|
||||
|
||||
if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
|
||||
# Configure/build static library in optimized mode with tests
|
||||
./waf --color=yes configure --enable-static --disable-shared --with-tests $OPENSSL
|
||||
./waf --color=yes build -j${WAF_JOBS:-1}
|
||||
# Build static library in release mode with tests and without precompiled headers
|
||||
./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
|
||||
./waf --color=yes build
|
||||
|
||||
# Cleanup
|
||||
sudo_preserve_env PATH -- ./waf --color=yes distclean
|
||||
# Cleanup
|
||||
./waf --color=yes distclean
|
||||
|
||||
# Configure/build static and shared library in optimized mode without tests
|
||||
./waf --color=yes configure --enable-static --enable-shared $OPENSSL
|
||||
./waf --color=yes build -j${WAF_JOBS:-1}
|
||||
# Build static and shared library in release mode without tests
|
||||
./waf --color=yes configure --enable-static --enable-shared $PCH
|
||||
./waf --color=yes build
|
||||
|
||||
# Cleanup
|
||||
sudo_preserve_env PATH -- ./waf --color=yes distclean
|
||||
# Cleanup
|
||||
./waf --color=yes distclean
|
||||
fi
|
||||
|
||||
# Configure/build shared library in debug mode with tests/examples and without precompiled headers
|
||||
./waf --color=yes configure --disable-static --enable-shared --debug --with-tests \
|
||||
--with-examples --without-pch $ASAN $COVERAGE $OPENSSL
|
||||
./waf --color=yes build -j${WAF_JOBS:-1}
|
||||
# Build shared library in debug mode with tests and examples
|
||||
./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $KEYCHAIN $PCH
|
||||
./waf --color=yes build
|
||||
|
||||
# (tests will be run against debug version)
|
||||
# (tests will be run against the debug version)
|
||||
|
||||
# Install
|
||||
sudo_preserve_env PATH -- ./waf --color=yes install
|
||||
sudo ./waf --color=yes install
|
||||
|
||||
if has Linux $NODE_LABELS; then
|
||||
if [[ $ID_LIKE == *fedora* ]]; then
|
||||
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
|
||||
fi
|
||||
if [[ $ID_LIKE == *linux* ]]; then
|
||||
sudo ldconfig
|
||||
fi
|
||||
+18
-39
@@ -1,47 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -eo pipefail
|
||||
|
||||
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
source "$JDIR"/util.sh
|
||||
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
||||
ASAN_OPTIONS="color=always"
|
||||
ASAN_OPTIONS+=":check_initialization_order=1"
|
||||
ASAN_OPTIONS+=":detect_stack_use_after_return=1"
|
||||
ASAN_OPTIONS+=":strict_init_order=1"
|
||||
ASAN_OPTIONS+=":strict_string_checks=1"
|
||||
ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2"
|
||||
ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
|
||||
export ASAN_OPTIONS
|
||||
|
||||
# https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/runtime_config/summary.html
|
||||
export BOOST_TEST_BUILD_INFO=1
|
||||
export BOOST_TEST_COLOR_OUTPUT=1
|
||||
export BOOST_TEST_DETECT_MEMORY_LEAK=0
|
||||
export BOOST_TEST_LOGGER=HRF,test_suite,stdout:XML,all,build/xunit-log.xml
|
||||
|
||||
set -x
|
||||
|
||||
# Prepare environment
|
||||
rm -Rf ~/.ndn
|
||||
|
||||
if has OSX $NODE_LABELS; then
|
||||
security unlock-keychain -p named-data
|
||||
fi
|
||||
|
||||
ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
|
||||
|
||||
BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
|
||||
|
||||
ut_log_args() {
|
||||
if (( BOOST_VERSION >= 106200 )); then
|
||||
echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
|
||||
else
|
||||
if [[ -n $XUNIT ]]; then
|
||||
echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
|
||||
--log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
|
||||
else
|
||||
echo --log_level=test_suite
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ASAN_OPTIONS="color=always"
|
||||
ASAN_OPTIONS+=":detect_stack_use_after_return=true"
|
||||
ASAN_OPTIONS+=":check_initialization_order=true"
|
||||
ASAN_OPTIONS+=":strict_init_order=true"
|
||||
ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
|
||||
ASAN_OPTIONS+=":detect_container_overflow=false"
|
||||
ASAN_OPTIONS+=":strict_string_checks=true"
|
||||
ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
|
||||
export ASAN_OPTIONS
|
||||
|
||||
export BOOST_TEST_BUILD_INFO=1
|
||||
export BOOST_TEST_COLOR_OUTPUT=1
|
||||
rm -rf ~/.ndn
|
||||
|
||||
# Run unit tests
|
||||
./build/unit-tests $(ut_log_args)
|
||||
./build/unit-tests
|
||||
+15
-19
@@ -1,36 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
source "$JDIR"/util.sh
|
||||
|
||||
set -x
|
||||
set -exo pipefail
|
||||
|
||||
if [[ $JOB_NAME == *"code-coverage" ]]; then
|
||||
gcovr --object-directory=build \
|
||||
--output=build/coverage.xml \
|
||||
--exclude="$PWD/(examples|tests)" \
|
||||
--root=. \
|
||||
--xml
|
||||
# Generate an XML report (Cobertura format) and a detailed HTML report using gcovr
|
||||
# Note: trailing slashes are important in the paths below. Do not remove them!
|
||||
gcovr --object-directory build \
|
||||
--filter ndn-cxx/ \
|
||||
--exclude ndn-cxx/detail/nonstd/ \
|
||||
--exclude-throw-branches \
|
||||
--exclude-unreachable-branches \
|
||||
--cobertura build/coverage.xml \
|
||||
--html-details build/gcovr/ \
|
||||
--print-summary
|
||||
|
||||
# Generate also a detailed HTML output, but using lcov (better results)
|
||||
# Generate a detailed HTML report using lcov
|
||||
lcov --quiet \
|
||||
--capture \
|
||||
--directory . \
|
||||
--exclude "$PWD/ndn-cxx/detail/nonstd/*" \
|
||||
--exclude "$PWD/tests/*" \
|
||||
--no-external \
|
||||
--rc lcov_branch_coverage=1 \
|
||||
--output-file build/coverage-with-tests.info
|
||||
|
||||
lcov --quiet \
|
||||
--remove build/coverage-with-tests.info "$PWD/tests/*" \
|
||||
--rc lcov_branch_coverage=1 \
|
||||
--output-file build/coverage.info
|
||||
|
||||
genhtml --branch-coverage \
|
||||
--demangle-cpp \
|
||||
--frames \
|
||||
--legend \
|
||||
--output-directory build/coverage \
|
||||
--output-directory build/lcov \
|
||||
--title "ndn-cxx unit tests" \
|
||||
build/coverage.info
|
||||
fi
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
# It's intentional not to use `set -x`, because this script explicitly prints useful information
|
||||
# and should not run in trace mode.
|
||||
|
||||
PROJ=ndn-cxx
|
||||
PCFILE=libndn-cxx
|
||||
|
||||
if [[ -n $DISABLE_HEADERS_CHECK ]]; then
|
||||
echo 'Skipping headers check.'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $ID_LIKE == *fedora* ]]; then
|
||||
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
|
||||
fi
|
||||
|
||||
CXX=${CXX:-g++}
|
||||
STD=-std=c++17
|
||||
CXXFLAGS="-O2 -Wall -Wno-unneeded-internal-declaration -Wno-unused-const-variable $(pkg-config --cflags libndn-cxx $PCFILE)"
|
||||
INCLUDEDIR="$(pkg-config --variable=includedir $PCFILE)"/$PROJ
|
||||
|
||||
echo "Using: $CXX $STD $CXXFLAGS"
|
||||
|
||||
NCHECKED=0
|
||||
NERRORS=0
|
||||
while IFS= read -r -d '' H; do
|
||||
echo "Checking header ${H#${INCLUDEDIR}/}"
|
||||
"$CXX" -xc++ $STD $CXXFLAGS -c -o /dev/null "$H" || : $((NERRORS++))
|
||||
: $((NCHECKED++))
|
||||
done < <(find "$INCLUDEDIR" -name '*.hpp' -type f -print0 2>/dev/null)
|
||||
|
||||
if [[ $NCHECKED -eq 0 ]]; then
|
||||
echo "No headers found. Is $PROJ installed?"
|
||||
exit 1
|
||||
else
|
||||
echo "$NCHECKED headers checked."
|
||||
fi
|
||||
|
||||
if [[ $NERRORS -gt 0 ]]; then
|
||||
echo "$NERRORS headers could not be compiled."
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# It's intentional not to use `set -x`, because this script explicitly prints useful information
|
||||
# and should not run in trace mode.
|
||||
# It's intentional not to use `set -e`, because this script wants to check all headers
|
||||
# (similar to running all test cases), instead of failing at the first error.
|
||||
|
||||
CXX=${CXX:-g++}
|
||||
STD=-std=c++14
|
||||
CXXFLAGS="-O2 -Wall -Wno-unused-const-variable -Wno-unused-local-typedef $(pkg-config --cflags libndn-cxx)"
|
||||
INCLUDEDIR="$(pkg-config --variable=includedir libndn-cxx)"/ndn-cxx
|
||||
|
||||
echo "Using: $CXX $STD $CXXFLAGS"
|
||||
|
||||
NCHECKED=0
|
||||
NERRORS=0
|
||||
while IFS= read -r -d '' H; do
|
||||
echo "Verifying standalone header compilation for ${H#${INCLUDEDIR}/}"
|
||||
"$CXX" -xc++ $STD $CXXFLAGS -c -o /dev/null "$H"
|
||||
[[ $? -eq 0 ]] || ((NERRORS++))
|
||||
((NCHECKED++))
|
||||
done < <(find "$INCLUDEDIR" -name '*.hpp' -type f -print0 2>/dev/null)
|
||||
|
||||
if [[ $NCHECKED -eq 0 ]]; then
|
||||
echo 'No header found. Is ndn-cxx installed?'
|
||||
exit 1
|
||||
else
|
||||
echo "$NCHECKED headers checked."
|
||||
fi
|
||||
|
||||
if [[ $NERRORS -gt 0 ]]; then
|
||||
echo "$NERRORS headers could not be compiled."
|
||||
exit 1
|
||||
fi
|
||||
+25
-22
@@ -1,33 +1,36 @@
|
||||
CONTINUOUS INTEGRATION SCRIPTS
|
||||
==============================
|
||||
# Continuous Integration Scripts
|
||||
|
||||
Environment Variables Used in Build Scripts
|
||||
-------------------------------------------
|
||||
## Environment Variables
|
||||
|
||||
- `NODE_LABELS`: the variable defines a list of OS properties. The set values are used by the
|
||||
build scripts to select proper behavior for different OS.
|
||||
- `ID`: lower-case string that identifies the operating system, for example: `ID=ubuntu`,
|
||||
`ID=centos`. See [os-release(5)] for more information. On macOS, where `os-release` is
|
||||
not available, we emulate it by setting `ID=macos`.
|
||||
|
||||
The list should include at least `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`.
|
||||
- `ID_LIKE`: space-separated list of operating system identifiers that are closely related
|
||||
to the running OS. See [os-release(5)] for more information. The listed values are used
|
||||
by the CI scripts to select the proper behavior for different platforms and OS flavors.
|
||||
|
||||
Possible values for Linux:
|
||||
Examples:
|
||||
|
||||
* `[OS_TYPE]`: `Linux`
|
||||
* `[DISTRO_TYPE]`: `Ubuntu`
|
||||
* `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`
|
||||
- On CentOS, `ID_LIKE="centos rhel fedora linux"`
|
||||
- On Ubuntu, `ID_LIKE="ubuntu debian linux"`
|
||||
|
||||
Possible values for macOS:
|
||||
- `VERSION_ID`: identifies the operating system version, excluding any release code names.
|
||||
See [os-release(5)] for more information. Examples: `VERSION_ID=42`, `VERSION_ID=22.04`.
|
||||
|
||||
* `[OS_TYPE]`: `OSX`
|
||||
* `[DISTRO_TYPE]`: `OSX` (can be absent)
|
||||
* `[DISTRO_VERSION]`: `OSX-10.12`, `OSX-10.13`, `OSX-10.14`
|
||||
- `JOB_NAME`: defines the type of the current CI job. Depending on the job type, the CI
|
||||
scripts can perform different tasks.
|
||||
|
||||
- `JOB_NAME`: optional variable to define type of the job. Depending on the defined job type,
|
||||
the build scripts can perform different tasks.
|
||||
Supported values:
|
||||
|
||||
Possible values:
|
||||
- empty: default build task
|
||||
- `code-coverage`: debug build with tests and code coverage analysis
|
||||
- `limited-build`: only a single debug build with tests
|
||||
|
||||
* empty: default build process
|
||||
* `code-coverage` (Ubuntu Linux is assumed): debug build with tests and code coverage analysis
|
||||
* `limited-build`: only a single debug build with tests
|
||||
- `CACHE_DIR`: directory containing cached files from previous builds, e.g., a compiled
|
||||
version of ndn-cxx. If not set, `/tmp` is used.
|
||||
|
||||
- `WAF_JOBS`: number of parallel build jobs used by waf, defaults to 1.
|
||||
- `DISABLE_ASAN`: disable building with AddressSanitizer. This is automatically set for
|
||||
the `code-coverage` job type.
|
||||
|
||||
[os-release(5)]: https://www.freedesktop.org/software/systemd/man/os-release.html
|
||||
@@ -1,37 +0,0 @@
|
||||
has() {
|
||||
local saved_xtrace
|
||||
[[ $- == *x* ]] && saved_xtrace=-x || saved_xtrace=+x
|
||||
set +x
|
||||
|
||||
local p=$1
|
||||
shift
|
||||
local i ret=1
|
||||
for i in "$@"; do
|
||||
if [[ "${i}" == "${p}" ]]; then
|
||||
ret=0
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
set ${saved_xtrace}
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
sudo_preserve_env() {
|
||||
local saved_xtrace
|
||||
[[ $- == *x* ]] && saved_xtrace=-x || saved_xtrace=+x
|
||||
set +x
|
||||
|
||||
local vars=()
|
||||
while [[ $# -gt 0 ]]; do
|
||||
local arg=$1
|
||||
shift
|
||||
case ${arg} in
|
||||
--) break ;;
|
||||
*) vars+=("${arg}=${!arg}") ;;
|
||||
esac
|
||||
done
|
||||
|
||||
set ${saved_xtrace}
|
||||
sudo env "${vars[@]}" "$@"
|
||||
}
|
||||
@@ -5,3 +5,5 @@
|
||||
Teng Liang <philoliang2011@gmail.com>
|
||||
<lybmath2009@gmail.com> <lybmath@ucla.edu>
|
||||
Hila Ben Abraham <hilata@gmail.com>
|
||||
Laqin Fan <flq12021@gmail.com>
|
||||
Jeremy Clark <jrclark2@memphis.edu>
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
language: cpp
|
||||
dist: xenial
|
||||
env:
|
||||
global:
|
||||
- JOB_NAME=limited-build
|
||||
- WAF_JOBS=2
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# Linux/gcc
|
||||
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/+packages
|
||||
- os: linux
|
||||
env: COMPILER=g++-5
|
||||
- os: linux
|
||||
env: COMPILER=g++-6
|
||||
- os: linux
|
||||
env: COMPILER=g++-7
|
||||
- os: linux
|
||||
env: COMPILER=g++-8
|
||||
|
||||
# Linux/clang
|
||||
# https://apt.llvm.org/
|
||||
- os: linux
|
||||
env: COMPILER=clang++-3.8
|
||||
- os: linux
|
||||
env: COMPILER=clang++-3.9
|
||||
- os: linux
|
||||
env: COMPILER=clang++-4.0
|
||||
- os: linux
|
||||
env: COMPILER=clang++-5.0
|
||||
- os: linux
|
||||
env: COMPILER=clang++-6.0
|
||||
# temporarily disable AddressSanitizer on clang-7 and later
|
||||
# due to https://bugs.llvm.org/show_bug.cgi?id=40808
|
||||
- os: linux
|
||||
env: COMPILER=clang++-7 DISABLE_ASAN=yes
|
||||
- os: linux
|
||||
env: COMPILER=clang++-8 DISABLE_ASAN=yes
|
||||
- os: linux
|
||||
env: COMPILER=clang++-9 DISABLE_ASAN=yes
|
||||
|
||||
# macOS/clang
|
||||
# https://docs.travis-ci.com/user/reference/osx/#macos-version
|
||||
- os: osx
|
||||
osx_image: xcode8.3
|
||||
env: OSX_VERSION=10.12
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
env: OSX_VERSION=10.12
|
||||
- os: osx
|
||||
osx_image: xcode9.4
|
||||
env: OSX_VERSION=10.13
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
env: OSX_VERSION=10.13
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
env: OSX_VERSION=10.13 USE_OPENSSL_1_1=yes
|
||||
- os: osx
|
||||
osx_image: xcode10.2
|
||||
env: OSX_VERSION=10.14
|
||||
- os: osx
|
||||
osx_image: xcode10.2
|
||||
env: OSX_VERSION=10.14 USE_OPENSSL_1_1=yes
|
||||
|
||||
allow_failures:
|
||||
- env: COMPILER=clang++-9 DISABLE_ASAN=yes
|
||||
|
||||
fast_finish: true
|
||||
|
||||
install: |
|
||||
case ${COMPILER} in
|
||||
g++-5)
|
||||
;;
|
||||
g++-*)
|
||||
travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
travis_retry sudo apt-get -qq update
|
||||
travis_retry sudo apt-get -qy install "${COMPILER}"
|
||||
;;
|
||||
clang++-*)
|
||||
CLANG_VERSION=${COMPILER/clang++}
|
||||
if [[ ${CLANG_VERSION} != "-3."* ]]; then
|
||||
travis_retry wget -nv -O - "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add -
|
||||
travis_retry sudo add-apt-repository -y "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial${CLANG_VERSION/-9} main"
|
||||
fi
|
||||
travis_retry sudo apt-get -qq update
|
||||
travis_retry sudo apt-get -qy install "clang${CLANG_VERSION}"
|
||||
;;
|
||||
esac
|
||||
|
||||
before_script:
|
||||
- if [[ ${TRAVIS_OS_NAME} == linux ]]; then export NODE_LABELS="Linux Ubuntu Ubuntu-16.04"; fi
|
||||
- if [[ ${TRAVIS_OS_NAME} == osx ]]; then export NODE_LABELS="OSX OSX-${OSX_VERSION}"; fi
|
||||
- if [[ ${OSX_VERSION} == 10.12 ]]; then brew update; fi
|
||||
# workaround for https://github.com/Homebrew/homebrew-core/issues/26358
|
||||
- if [[ ${OSX_VERSION} == 10.12 ]]; then brew outdated python || brew upgrade python; fi
|
||||
# workaround for https://github.com/travis-ci/travis-ci/issues/6688
|
||||
- if [[ ${OSX_VERSION} == 10.12 ]]; then /usr/bin/yes | pip2 uninstall numpy || true; fi
|
||||
- if [[ -n ${COMPILER} ]]; then export CXX=${COMPILER}; fi
|
||||
- ${CXX:-c++} --version
|
||||
- python --version
|
||||
|
||||
script:
|
||||
- ./.jenkins
|
||||
+2
-2
@@ -54,8 +54,8 @@ from waflib import Utils, Logs, Errors
|
||||
from waflib.Configure import conf
|
||||
from waflib.TaskGen import feature, after_method
|
||||
|
||||
BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib']
|
||||
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include']
|
||||
BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/homebrew/lib', '/opt/local/lib', '/sw/lib', '/lib']
|
||||
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/homebrew/include', '/opt/local/include', '/sw/include']
|
||||
|
||||
BOOST_VERSION_FILE = 'boost/version.hpp'
|
||||
BOOST_VERSION_CODE = '''
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
from waflib.Configure import conf
|
||||
|
||||
STD_TO_STRING = '''
|
||||
#include <string>
|
||||
int
|
||||
main()
|
||||
{
|
||||
std::string s = std::to_string(0);
|
||||
s = std::to_string(0l);
|
||||
s = std::to_string(0ll);
|
||||
s = std::to_string(0u);
|
||||
s = std::to_string(0ul);
|
||||
s = std::to_string(0ull);
|
||||
s = std::to_string(0.0f);
|
||||
s = std::to_string(0.0);
|
||||
s = std::to_string(0.0l);
|
||||
s.clear();
|
||||
}
|
||||
'''
|
||||
|
||||
@conf
|
||||
def check_std_to_string(self):
|
||||
if self.check_cxx(msg='Checking for std::to_string',
|
||||
fragment=STD_TO_STRING, mandatory=False):
|
||||
self.define('HAVE_STD_TO_STRING', 1)
|
||||
|
||||
def configure(conf):
|
||||
conf.check_std_to_string()
|
||||
@@ -0,0 +1,25 @@
|
||||
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
from waflib import Utils
|
||||
|
||||
def options(opt):
|
||||
opt.add_option('--build', default=Utils.unversioned_sys_platform(),
|
||||
help='Build platform that is doing the actual compilation (e.g., darwin)')
|
||||
opt.add_option('--host', default=Utils.unversioned_sys_platform(),
|
||||
help='Host platform on which the compiled binary will run (e.g., android)')
|
||||
# opt.add_option('--target', default=Utils.unversioned_sys_platform(),
|
||||
# help='Target platform on which the compiled binary's output will run')
|
||||
|
||||
def configure(conf):
|
||||
conf.env.BUILD = conf.options.build
|
||||
conf.env.HOST = conf.options.host
|
||||
# conf.env.TARGET = conf.options.target
|
||||
|
||||
conf.start_msg('Build platform')
|
||||
conf.end_msg(conf.env.BUILD)
|
||||
|
||||
conf.start_msg('Host platform')
|
||||
conf.end_msg(conf.env.HOST)
|
||||
|
||||
# conf.start_msg('Target platform')
|
||||
# conf.end_msg(conf.env.TARGET)
|
||||
@@ -1,10 +1,13 @@
|
||||
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
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 (-O0 or -Og)')
|
||||
help='Compile in debugging mode with minimal optimizations (-Og)')
|
||||
|
||||
|
||||
def configure(conf):
|
||||
conf.start_msg('Checking C++ compiler version')
|
||||
@@ -15,17 +18,27 @@ def configure(conf):
|
||||
errmsg = ''
|
||||
warnmsg = ''
|
||||
if cxx == 'gcc':
|
||||
if ccver < (5, 3, 0):
|
||||
if ccver < (7, 4, 0):
|
||||
errmsg = ('The version of gcc you are using is too old.\n'
|
||||
'The minimum supported gcc version is 5.3.0.')
|
||||
'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 ccver < (3, 6, 0):
|
||||
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 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 < (7, 0, 0):
|
||||
errmsg = ('The version of clang you are using is too old.\n'
|
||||
'The minimum supported clang version is 3.6.0.')
|
||||
'The minimum supported clang version is 7.0.')
|
||||
conf.flags = ClangFlags()
|
||||
else:
|
||||
warnmsg = 'Note: %s compiler is unsupported' % cxx
|
||||
warnmsg = f'{cxx} compiler is unsupported'
|
||||
conf.flags = CompilerFlags()
|
||||
|
||||
if errmsg:
|
||||
@@ -33,11 +46,11 @@ def configure(conf):
|
||||
conf.fatal(errmsg)
|
||||
elif warnmsg:
|
||||
conf.end_msg(ccverstr, color='YELLOW')
|
||||
Logs.warn(warnmsg)
|
||||
Logs.warn('WARNING: ' + warnmsg)
|
||||
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)
|
||||
@@ -45,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
|
||||
@@ -67,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
|
||||
@@ -86,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
|
||||
@@ -106,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"""
|
||||
@@ -122,95 +142,100 @@ 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['CXXFLAGS'] += ['-std=c++14']
|
||||
if Utils.unversioned_sys_platform() == 'linux':
|
||||
flags['LINKFLAGS'] += ['-fuse-ld=gold']
|
||||
elif Utils.unversioned_sys_platform() == 'freebsd':
|
||||
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',
|
||||
'-Wnon-virtual-dtor',
|
||||
'-Wno-unused-parameter',
|
||||
]
|
||||
__linkFlags = ['-Wl,-O1']
|
||||
|
||||
def getDebugFlags(self, conf):
|
||||
flags = super(GccBasicFlags, self).getDebugFlags(conf)
|
||||
flags['CXXFLAGS'] += ['-O0',
|
||||
'-Og', # gcc >= 4.8, clang >= 4.0
|
||||
'-g3',
|
||||
'-pedantic',
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-Werror',
|
||||
'-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',
|
||||
'-pedantic',
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-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']
|
||||
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']
|
||||
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)
|
||||
if Utils.unversioned_sys_platform() == 'darwin' and self.getCompilerVersion(conf) >= (9, 0, 0):
|
||||
flags = super().getGeneralFlags(conf)
|
||||
if Utils.unversioned_sys_platform() == 'darwin':
|
||||
# Bug #4296
|
||||
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew
|
||||
['-isystem', '/opt/local/include']] # for MacPorts
|
||||
if Utils.unversioned_sys_platform() == 'freebsd':
|
||||
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']] # Bug #4790
|
||||
brewdir = '/opt/homebrew' if platform.machine() == 'arm64' else '/usr/local'
|
||||
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',
|
||||
'-Wextra-semi',
|
||||
'-Wundefined-func-template',
|
||||
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
|
||||
]
|
||||
version = self.getCompilerVersion(conf)
|
||||
if version < (3, 9, 0) or (Utils.unversioned_sys_platform() == 'darwin' and version < (8, 1, 0)):
|
||||
flags['CXXFLAGS'] += ['-Wno-unknown-pragmas']
|
||||
if version < (6, 0, 0):
|
||||
flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
|
||||
flags = super().getDebugFlags(conf)
|
||||
flags['CXXFLAGS'] += self.__cxxFlags
|
||||
return flags
|
||||
|
||||
def getOptimizedFlags(self, conf):
|
||||
flags = super(ClangFlags, self).getOptimizedFlags(conf)
|
||||
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
|
||||
'-Wextra-semi',
|
||||
'-Wundefined-func-template',
|
||||
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
|
||||
]
|
||||
version = self.getCompilerVersion(conf)
|
||||
if version < (3, 9, 0) or (Utils.unversioned_sys_platform() == 'darwin' and version < (8, 1, 0)):
|
||||
flags['CXXFLAGS'] += ['-Wno-unknown-pragmas']
|
||||
if version < (6, 0, 0):
|
||||
flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
|
||||
flags = super().getOptimizedFlags(conf)
|
||||
flags['CXXFLAGS'] += self.__cxxFlags
|
||||
return flags
|
||||
+55
-49
@@ -1,10 +1,8 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
# Yingdi Yu (UCLA) 2016
|
||||
|
||||
'''
|
||||
|
||||
When using this tool, the wscript will look like:
|
||||
"""
|
||||
When using this tool, the wscript should look like:
|
||||
|
||||
def options(opt):
|
||||
opt.load('openssl')
|
||||
@@ -15,15 +13,17 @@ When using this tool, the wscript will look like:
|
||||
|
||||
def build(bld):
|
||||
bld(source='main.cpp', target='app', use='OPENSSL')
|
||||
|
||||
'''
|
||||
"""
|
||||
|
||||
import re
|
||||
from waflib import Utils
|
||||
from waflib.Configure import conf
|
||||
|
||||
OPENSSL_DIR_OSX = ['/usr/local', '/opt/local', '/usr/local/opt/openssl']
|
||||
OPENSSL_DIR = ['/usr', '/usr/local', '/opt/local', '/sw']
|
||||
OPENSSL_DIR_MACOS = ['/usr/local',
|
||||
'/opt/homebrew/opt/openssl', # Homebrew on arm64
|
||||
'/usr/local/opt/openssl', # Homebrew on x86_64
|
||||
'/opt/local'] # MacPorts
|
||||
|
||||
def options(opt):
|
||||
opt.add_option('--with-openssl', type='string', default=None, dest='openssl_dir',
|
||||
@@ -37,55 +37,62 @@ def __openssl_get_version_file(self, dir):
|
||||
return None
|
||||
|
||||
@conf
|
||||
def __openssl_find_root_and_version_file(self, *k, **kw):
|
||||
root = k and k[0] or kw.get('path', self.options.openssl_dir)
|
||||
|
||||
file = self.__openssl_get_version_file(root)
|
||||
if root and file:
|
||||
def __openssl_find_root_and_version_file(self, root):
|
||||
if root:
|
||||
file = self.__openssl_get_version_file(root)
|
||||
if not file:
|
||||
self.fatal(f'OpenSSL not found in {root}')
|
||||
return (root, file)
|
||||
|
||||
openssl_dir = []
|
||||
openssl_dirs = OPENSSL_DIR
|
||||
if Utils.unversioned_sys_platform() == 'darwin':
|
||||
openssl_dir = OPENSSL_DIR_OSX
|
||||
else:
|
||||
openssl_dir = OPENSSL_DIR
|
||||
openssl_dirs = OPENSSL_DIR_MACOS
|
||||
|
||||
if not root:
|
||||
for dir in openssl_dir:
|
||||
file = self.__openssl_get_version_file(dir)
|
||||
if file:
|
||||
return (dir, file)
|
||||
for dir in openssl_dirs:
|
||||
file = self.__openssl_get_version_file(dir)
|
||||
if file:
|
||||
return (dir, file)
|
||||
|
||||
if root:
|
||||
self.fatal('OpenSSL not found in %s' % root)
|
||||
else:
|
||||
self.fatal('OpenSSL not found, please provide a --with-openssl=PATH argument (see help)')
|
||||
self.fatal('OpenSSL not found, please provide a --with-openssl=PATH argument (see --help)')
|
||||
|
||||
@conf
|
||||
def __openssl_check_version(self, version_file, atleast_version):
|
||||
min_version = tuple(int(i) for i in atleast_version.split('.'))
|
||||
txt = version_file.read()
|
||||
|
||||
# OpenSSL 3.0.0 and later
|
||||
ver_tuple = (re.search(r'^#\s*define\s+OPENSSL_VERSION_MAJOR\s+(\d+)', txt, re.MULTILINE),
|
||||
re.search(r'^#\s*define\s+OPENSSL_VERSION_MINOR\s+(\d+)', txt, re.MULTILINE),
|
||||
re.search(r'^#\s*define\s+OPENSSL_VERSION_PATCH\s+(\d+)', txt, re.MULTILINE))
|
||||
ver_string = re.search(r'^#\s*define\s+OPENSSL_FULL_VERSION_STR\s+"(.+)"', txt, re.MULTILINE)
|
||||
if all(ver_tuple):
|
||||
version = tuple(int(i[1]) for i in ver_tuple)
|
||||
ver_string = ver_string[1] if ver_string else '.'.join(version)
|
||||
return (version >= min_version, ver_string)
|
||||
|
||||
# OpenSSL 1.1.1 and earlier
|
||||
ver_number = re.search(r'^#\s*define\s+OPENSSL_VERSION_NUMBER\s+(.+)L', txt, re.MULTILINE)
|
||||
ver_string = re.search(r'^#\s*define\s+OPENSSL_VERSION_TEXT\s+"(.+)"', txt, re.MULTILINE)
|
||||
if ver_number and ver_string:
|
||||
version = int(ver_number[1], 16)
|
||||
min_version = (min_version[0] << 28) | (min_version[1] << 20) | (min_version[2] << 12) | 0xf
|
||||
return (version >= min_version, ver_string[1])
|
||||
|
||||
self.fatal(f'Cannot extract version information from {version_file}')
|
||||
|
||||
@conf
|
||||
def check_openssl(self, *k, **kw):
|
||||
self.start_msg('Checking for OpenSSL version')
|
||||
(root, file) = self.__openssl_find_root_and_version_file(*k, **kw)
|
||||
|
||||
try:
|
||||
txt = file.read()
|
||||
re_version = re.compile('^#\\s*define\\s+OPENSSL_VERSION_NUMBER\\s+(.*)L', re.M)
|
||||
version_number = re_version.search(txt)
|
||||
|
||||
re_version_text = re.compile('^#\\s*define\\s+OPENSSL_VERSION_TEXT\\s+(.*)', re.M)
|
||||
version_text = re_version_text.search(txt)
|
||||
|
||||
if version_number and version_text:
|
||||
version = version_number.group(1)
|
||||
self.end_msg(version_text.group(1))
|
||||
else:
|
||||
self.fatal('OpenSSL version file is present, but is not recognizable')
|
||||
except:
|
||||
self.fatal('OpenSSL version file is not found or is not usable')
|
||||
|
||||
path = k and k[0] or kw.get('path', self.options.openssl_dir)
|
||||
root, version_file = self.__openssl_find_root_and_version_file(path)
|
||||
atleast_version = kw.get('atleast_version', 0)
|
||||
if int(version, 16) < atleast_version:
|
||||
self.fatal('The version of OpenSSL is too old\n'
|
||||
'Please upgrade your distribution or manually install a newer version of OpenSSL')
|
||||
ok, version_str = self.__openssl_check_version(version_file, atleast_version)
|
||||
|
||||
self.end_msg(version_str)
|
||||
if not ok:
|
||||
self.fatal(f'The version of OpenSSL is too old; {atleast_version} or later is required.\n'
|
||||
'Please upgrade your distribution or manually install a newer version of OpenSSL.')
|
||||
|
||||
if 'msg' not in kw:
|
||||
kw['msg'] = 'Checking if OpenSSL library works'
|
||||
@@ -94,9 +101,8 @@ def check_openssl(self, *k, **kw):
|
||||
if 'uselib_store' not in kw:
|
||||
kw['uselib_store'] = 'OPENSSL'
|
||||
if 'define_name' not in kw:
|
||||
kw['define_name'] = 'HAVE_%s' % kw['uselib_store']
|
||||
if root:
|
||||
kw['includes'] = '%s/include' % root
|
||||
kw['libpath'] = '%s/lib' % root
|
||||
kw['define_name'] = f"HAVE_{kw['uselib_store']}"
|
||||
kw['includes'] = f'{root}/include'
|
||||
kw['libpath'] = f'{root}/lib'
|
||||
|
||||
self.check_cxx(**kw)
|
||||
+57
-39
@@ -1,43 +1,61 @@
|
||||
ndn-cxx authors
|
||||
===============
|
||||
# ndn-cxx Authors
|
||||
|
||||
## The primary authors are (and/or have been):
|
||||
The following lists maintainers, primary developers, and all much-appreciated contributors to ndn-cxx in alphabetical order.
|
||||
The specific contributions of individual authors can be obtained from the git history of the [official ndn-cxx repository](https://github.com/named-data/ndn-cxx).
|
||||
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>.
|
||||
|
||||
* Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
|
||||
* Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
|
||||
* Junxiao Shi <http://www.cs.arizona.edu/people/shijunxiao/>
|
||||
* Jeff Thompson <jefft0@remap.ucla.edu>
|
||||
* Zhenkai Zhu <http://irl.cs.ucla.edu/~zhenkai/>
|
||||
* Sepehr Abdous <https://sepehrabdous.github.io>
|
||||
* ***(Maintainer)*** Alexander Afanasyev <https://users.cs.fiu.edu/~afanasyev>
|
||||
* Syed Obaid Amin <http://obaidamin.weebly.com>
|
||||
* Hila Ben Abraham <https://sites.wustl.edu/hbabraham>
|
||||
* Shuo Chen <https://github.com/chenatu>
|
||||
* Muktadir R. Chowdhury <https://github.com/alvyC>
|
||||
* Jeremy Clark <https://github.com/jrandallclark>
|
||||
* Damian Coomes <https://github.com/dmcoomes>
|
||||
* Stephanie DiBenedetto
|
||||
* Qiuhan Ding <https://irl.cs.ucla.edu/~qiuhanding>
|
||||
* Chengyu Fan <https://github.com/chengyu>
|
||||
* Laqin Fan <https://github.com/laqinfan>
|
||||
* Ashlesh Gawande <https://www.linkedin.com/in/agawande>
|
||||
* Chavoosh Ghasemi <https://chavoosh.github.io>
|
||||
* Mathias Gibbens <https://calenhad.com>
|
||||
* Nick Gordon <https://github.com/gorgonical>
|
||||
* Xiaoke Jiang <http://netarchlab.tsinghua.edu.cn/~shock>
|
||||
* Marcin Juszkiewicz <https://marcin.juszkiewicz.com.pl>
|
||||
* Luca Keidel <https://lucakeidel.de>
|
||||
* Spencer Lee <https://www.linkedin.com/in/spenlee>
|
||||
* Vince Lehman <http://vslehman.com>
|
||||
* Yanbiao Li <https://www.linkedin.com/pub/yanbiao-li/24/7a1/4ba>
|
||||
* Teng Liang <https://cs.arizona.edu/~philoliang>
|
||||
* Weiwei Liu <https://www.linkedin.com/in/weiweiliu10>
|
||||
* Tianxing Ma <https://github.com/matianxing1992>
|
||||
* Xingyu Ma <https://www.linkedin.com/pub/xingyu-ma/1a/384/5a8>
|
||||
* Spyridon Mastorakis <https://sites.google.com/site/spyridonmastorakis>
|
||||
* Ernest McCracken <https://github.com/emccrckn>
|
||||
* Stephen McQuistin <https://smcquistin.uk>
|
||||
* Ilya Moiseenko <https://www.linkedin.com/in/ilya-moiseenko-52884317>
|
||||
* Alex Nano <http://alexnano.net>
|
||||
* Eric Newberry <https://ericnewberry.com>
|
||||
* Arthi Padmanabhan <https://github.com/arthipadmanabhan>
|
||||
* Ju Pan <https://cs-jupan.com>
|
||||
* João Pereira <http://website.jpereira.co.uk>
|
||||
* ***(Maintainer)*** Davide Pesavento <https://github.com/Pesa>
|
||||
* José Quevedo <http://atnog.av.it.pt/members/jquevedo>
|
||||
* Md Ashiqur Rahman <https://ashiqrahman.com>
|
||||
* Niv Sardi <http://core.evilgiggle.com>
|
||||
* Wentao Shang <https://irl.cs.ucla.edu/~wentao>
|
||||
* Susmit Shannigrahi <https://susm.it>
|
||||
* Junxiao Shi <https://cs.arizona.edu/~shijunxiao>
|
||||
* Michael Sweatt <https://www.linkedin.com/in/michaelsweatt>
|
||||
* Jiewen Tan <https://github.com/alanwaketan>
|
||||
* ***(Former Maintainer)*** Jeff Thompson <https://remap.ucla.edu/jeff-thompson>
|
||||
* Yukai Tu <https://irl.cs.ucla.edu/~yukai>
|
||||
* Yingdi Yu <https://irl.cs.ucla.edu/~yingdi>
|
||||
* Zhiyi Zhang <https://zhiyi-zhang.com>
|
||||
* Zhenkai Zhu <https://irl.cs.ucla.edu/~zhenkai>
|
||||
|
||||
## All project authors and contributors
|
||||
## Technical Advisors
|
||||
|
||||
The following is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS,
|
||||
people who have reported bugs, submitted patches, and implemented new features
|
||||
in the library:
|
||||
|
||||
* Wentao Shang <http://irl.cs.ucla.edu/~wentao/>
|
||||
* Steve DiBenedetto <http://www.cs.colostate.edu/~dibenede/>
|
||||
* Davide Pesavento <https://www.linkedin.com/in/davidepesavento>
|
||||
* Syed Obaid Amin <http://obaidamin.weebly.com/>
|
||||
* Shuo Chen <chenatu2006@gmail.com>
|
||||
* Hila Ben Abraham <http://research.engineering.wustl.edu/~abrahamh/>
|
||||
* Xingyu Ma <http://www.linkedin.com/pub/xingyu-ma/1a/384/5a8>
|
||||
* Michael Sweatt <https://www.linkedin.com/in/michaelsweatt>
|
||||
* Lixia Zhang <http://www.cs.ucla.edu/~lixia/home.html>
|
||||
* Jeff Burke <http://remap.ucla.edu/jburke/>
|
||||
* Xiaoke Jiang <http://netarchlab.tsinghua.edu.cn/~shock/>
|
||||
* Jiewen Tan <alanwake@ucla.edu>
|
||||
* Vince Lehman <http://vslehman.com>
|
||||
* Mathias Gibbens <gibmat@cs.arizona.edu>
|
||||
* Chengyu Fan <chengyu@cs.colostate.edu>
|
||||
* Qiuhan Ding <http://irl.cs.ucla.edu/~qiuhanding/>
|
||||
* Spyridon Mastorakis <http://cs.ucla.edu/~mastorakis/>
|
||||
* Eric Newberry <http://cs.arizona.edu/~enewberry/>
|
||||
* João Pereira <http://website.jpereira.co.uk>
|
||||
* Mickey Sweatt <https://www.linkedin.com/in/michaelsweatt>
|
||||
* Yanbiao Li <https://www.linkedin.com/pub/yanbiao-li/24/7a1/4ba>
|
||||
* Marcin Juszkiewicz <http://marcin.juszkiewicz.com.pl/>
|
||||
* Susmit Shannigrahi <https://www.linkedin.com/in/susmit-shannigrahi-90433b8>
|
||||
* José Quevedo <http://atnog.av.it.pt/members/jquevedo>
|
||||
* Zhiyi Zhang <http://irl.cs.ucla.edu/~zhiyi/>
|
||||
* Chavoosh Ghasemi <https://www.linkedin.com/in/chavoosh-ghasemi-421327117/>
|
||||
* Jeff Burke <https://jeff-burke.com>
|
||||
* Beichuan Zhang <https://cs.arizona.edu/~bzhang>
|
||||
* Lixia Zhang <https://cs.ucla.edu/~lixia>
|
||||
+13
-18
@@ -6,35 +6,30 @@ ndn-cxx relies on third-party software, licensed under the following licenses:
|
||||
- The Boost libraries are licensed under the
|
||||
[Boost Software License 1.0](https://www.boost.org/users/license.html)
|
||||
|
||||
- any-lite by Martin Moene is licensed under the
|
||||
[Boost Software License 1.0](https://github.com/martinmoene/any-lite/blob/master/LICENSE.txt)
|
||||
- OpenSSL is licensed under the
|
||||
[Apache License 2.0](https://www.openssl.org/source/license.html)
|
||||
|
||||
- optional-lite by Martin Moene is licensed under the
|
||||
[Boost Software License 1.0](https://github.com/martinmoene/optional-lite/blob/master/LICENSE.txt)
|
||||
- scope-lite by Martin Moene is licensed under the
|
||||
[Boost Software License 1.0](https://github.com/martinmoene/scope-lite/blob/master/LICENSE.txt)
|
||||
|
||||
- variant-lite by Martin Moene is licensed under the
|
||||
[Boost Software License 1.0](https://github.com/martinmoene/variant-lite/blob/master/LICENSE.txt)
|
||||
- span-lite by Martin Moene is licensed under the
|
||||
[Boost Software License 1.0](https://github.com/martinmoene/span-lite/blob/master/LICENSE.txt)
|
||||
|
||||
- SQLite is in the [public domain](https://www.sqlite.org/copyright.html)
|
||||
|
||||
- The waf build system is licensed under the terms of the
|
||||
[BSD license](https://github.com/named-data/ndn-cxx/blob/master/waf)
|
||||
|
||||
The ndn-cxx library also relies on other third-party software with a GPL-incompatible
|
||||
free software license. The following libraries fall into the category of "System
|
||||
Libraries" under the GPL license definitions and are used in accordance with the GPL
|
||||
license exception for "System Libraries":
|
||||
|
||||
The ndn-cxx library also relies on several other third-party libraries with non-GPL
|
||||
compatible license. These library fall into category of "System Libraries" under GPL
|
||||
license definitions and are used in accordance with GPL license exception for "System
|
||||
Libraries":
|
||||
|
||||
- OpenSSL is licensed under an
|
||||
[Apache-style license](https://www.openssl.org/source/license.html)
|
||||
|
||||
- (macOS platform only) The macOS Security Framework is licensed under the
|
||||
[Apple Public Source License](https://opensource.apple.com/apsl)
|
||||
|
||||
- *(macOS platform only)* The macOS Security Framework is licensed under the
|
||||
[Apple Public Source License 2.0](https://opensource.apple.com/apsl)
|
||||
|
||||
The LGPL and GPL licenses are provided below in this file. For more information
|
||||
about these licenses, see https://www.gnu.org/licenses/
|
||||
about these licenses, see <https://www.gnu.org/licenses/>
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
FROM gcc:12-bookworm
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
dpkg-dev \
|
||||
libboost-atomic-dev \
|
||||
libboost-chrono-dev \
|
||||
libboost-date-time-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-iostreams-dev \
|
||||
libboost-log-dev \
|
||||
libboost-program-options-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-stacktrace-dev \
|
||||
libboost-system-dev \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . /ndn-cxx
|
||||
|
||||
RUN cd /ndn-cxx \
|
||||
&& ./waf configure --without-pch --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --enable-shared \
|
||||
&& ./waf \
|
||||
&& ./waf install \
|
||||
&& cd \
|
||||
&& rm -rf /ndn-cxx
|
||||
+9
-15
@@ -1,20 +1,20 @@
|
||||
Notes for ndn-cxx developers
|
||||
============================
|
||||
|
||||
If you are new to the NDN community of software generally, read the
|
||||
[Contributor's Guide](https://github.com/named-data/NFD/blob/master/CONTRIBUTING.md).
|
||||
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).
|
||||
|
||||
Code style
|
||||
----------
|
||||
|
||||
ndn-cxx code is subject to [ndn-cxx code style](https://named-data.net/doc/ndn-cxx/current/code-style.html).
|
||||
ndn-cxx code is subject to [ndn-cxx code style](https://docs.named-data.net/ndn-cxx/current/code-style.html).
|
||||
|
||||
Licensing
|
||||
---------
|
||||
|
||||
Contributions to the library must be licensed under the LGPL v3 or compatible license. If
|
||||
you are choosing LGPL v3, please use the following license boilerplate in all `.hpp` and
|
||||
`.cpp` files:
|
||||
Contributions to ndn-cxx must be licensed under the LGPL v3 or a compatible license.
|
||||
If you choose the LGPL v3, please use the following license boilerplate in all `.hpp`
|
||||
and `.cpp` files:
|
||||
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
@@ -35,11 +35,6 @@ you are choosing LGPL v3, please use the following license boilerplate in all `.
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
////// [optional part] //////
|
||||
*
|
||||
* @author Author's Name <email@domain-or-homepage://url>
|
||||
* @author Other Author's Name <another.email@domain-or-homepage://url>
|
||||
////// [end of optional part] //////
|
||||
*/
|
||||
|
||||
If you are affiliated to an NSF-supported NDN project institution, please use the [NDN Team License
|
||||
@@ -62,7 +57,7 @@ The simplest way to run the tests is to launch the compiled binary without any p
|
||||
|
||||
./build/unit-tests
|
||||
|
||||
[Boost.Test framework](https://www.boost.org/doc/libs/1_58_0/libs/test/doc/html/index.html)
|
||||
The [Boost.Test framework](https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/index.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:
|
||||
@@ -94,9 +89,8 @@ or `-p` to show a progress bar:
|
||||
./build/unit-tests -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](https://www.boost.org/doc/libs/1_58_0/libs/test/doc/html/index.html)
|
||||
website.
|
||||
either from the command line using the `--help` switch, or online on the
|
||||
[Boost.Test website](https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/runtime_config.html).
|
||||
|
||||
**Warning:** If you have customized parameters for NDN platform using `client.conf` in
|
||||
`/etc/ndn` or `/usr/local/etc/ndn` (or other `@SYSCONFDIR@/etc` if it was configured to custom
|
||||
|
||||
@@ -1,40 +1,51 @@
|
||||
<div align="center">
|
||||
|
||||
[<img alt height="65" src="docs/named_data_theme/static/ndn-logo.svg"/>](https://named-data.net/)
|
||||
|
||||
# ndn-cxx: NDN C++ library with eXperimental eXtensions
|
||||
|
||||

|
||||
[](https://travis-ci.org/named-data/ndn-cxx)
|
||||

|
||||
</div>
|
||||
|
||||
**ndn-cxx** is a C++14 library implementing Named Data Networking (NDN) primitives
|
||||
[](https://github.com/named-data/ndn-cxx/actions/workflows/ci.yml)
|
||||
[](https://github.com/named-data/ndn-cxx/actions/workflows/docs.yml)
|
||||

|
||||

|
||||
|
||||
**ndn-cxx** is a C++17 library implementing Named Data Networking (NDN) primitives
|
||||
that can be used to write various NDN applications. The library is currently being
|
||||
used by the following projects:
|
||||
|
||||
* [NFD - NDN Forwarding Daemon](https://github.com/named-data/NFD)
|
||||
* [NLSR - Named-data Link-State Routing protocol](https://github.com/named-data/NLSR)
|
||||
* [ndn-tools - Essential NDN command-line tools](https://github.com/named-data/ndn-tools)
|
||||
* [repo-ng - Next generation of NDN repository](https://github.com/named-data/repo-ng)
|
||||
* [ChronoSync - Sync library for multiuser realtime applications](https://github.com/named-data/ChronoSync)
|
||||
* [PSync - Partial and full synchronization library](https://github.com/named-data/PSync)
|
||||
* [ndn-traffic-generator - Traffic generator for NDN](https://github.com/named-data/ndn-traffic-generator)
|
||||
* [NAC - Name-based Access Control](https://github.com/named-data/name-based-access-control)
|
||||
* [NDNS - Domain Name Service for NDN](https://github.com/named-data/ndns)
|
||||
* [**NFD** - NDN Forwarding Daemon](https://github.com/named-data/NFD)
|
||||
* [**NLSR** - Named-data Link-State Routing protocol](https://github.com/named-data/NLSR)
|
||||
* [**ndn-tools** - Essential NDN command-line tools](https://github.com/named-data/ndn-tools)
|
||||
* [**ndn-svs** - State Vector Sync library](https://github.com/named-data/ndn-svs)
|
||||
* [**PSync** - Partial and full Sync library](https://github.com/named-data/PSync)
|
||||
* [**ChronoSync** - Sync library for distributed real-time applications *(deprecated)*](https://github.com/named-data/ChronoSync)
|
||||
* [**NAC** - Name-based Access Control library](https://github.com/named-data/name-based-access-control)
|
||||
* [**NDNCERT** - NDN certificate management protocol](https://github.com/named-data/ndncert)
|
||||
* [**repo-ng** - NDN repository implementation in C++ *(deprecated)*](https://github.com/named-data/repo-ng)
|
||||
* [**ndn-traffic-generator** - Simple NDN traffic generator](https://github.com/named-data/ndn-traffic-generator)
|
||||
|
||||
## Documentation
|
||||
|
||||
See [`docs/INSTALL.rst`](docs/INSTALL.rst) for compilation and installation instructions.
|
||||
|
||||
Extensive documentation is available on the library's [homepage](https://named-data.net/doc/ndn-cxx/).
|
||||
Extensive documentation is available on the library's [homepage](https://docs.named-data.net/ndn-cxx/).
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
Please submit any bugs or feature requests to the
|
||||
Please submit any bug reports or feature requests to the
|
||||
[ndn-cxx issue tracker](https://redmine.named-data.net/projects/ndn-cxx/issues).
|
||||
|
||||
## Contributing
|
||||
|
||||
You're encouraged to contribute to ndn-cxx! Check out the
|
||||
[Contributor's Guide](https://github.com/named-data/NFD/blob/master/CONTRIBUTING.md) to get started.
|
||||
Contributions to ndn-cxx 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-cxx is an open source project licensed under the LGPL version 3.
|
||||
See [`COPYING.md`](COPYING.md) for more information.
|
||||
ndn-cxx is free software distributed under the GNU Lesser General Public License version 3.
|
||||
See [`COPYING.md`](COPYING.md) for details.
|
||||
@@ -1 +0,0 @@
|
||||
docs/release-notes-latest.rst
|
||||
+4
-1
@@ -6,7 +6,10 @@
|
||||
; tcp://192.0.2.1
|
||||
; tcp4://example.com:6363
|
||||
;
|
||||
transport=unix:///var/run/nfd.sock
|
||||
; The default value of this field is platform-dependent, being unix:///run/nfd.sock on Linux and
|
||||
; unix:///var/run/nfd.sock on other platforms.
|
||||
;
|
||||
;transport=unix:///var/run/nfd.sock
|
||||
|
||||
; "pib" determines which Public Info Base (PIB) should used by default in applications.
|
||||
; If "pib" is not specified, a platform-dependent default will be used.
|
||||
|
||||
+179
-143
@@ -1,158 +1,181 @@
|
||||
.. _Getting Started with ndn-cxx:
|
||||
|
||||
Getting started with ndn-cxx
|
||||
============================
|
||||
|
||||
Supported platforms
|
||||
-------------------
|
||||
|
||||
ndn-cxx uses continuous integration and has been tested on the following
|
||||
platforms:
|
||||
ndn-cxx is built against a continuous integration system and has been tested on the
|
||||
following platforms:
|
||||
|
||||
- Ubuntu 16.04 (amd64, armhf, i386)
|
||||
- Ubuntu 18.04 (amd64)
|
||||
- Ubuntu 19.04 (amd64)
|
||||
- macOS 10.12
|
||||
- macOS 10.13
|
||||
- macOS 10.14
|
||||
- CentOS 7 (with gcc 7 and boost 1.58.0)
|
||||
- Ubuntu 20.04 (focal)
|
||||
- Ubuntu 22.04 (jammy)
|
||||
- Debian 11 (bullseye)
|
||||
- Debian 12 (bookworm)
|
||||
- CentOS Stream 9
|
||||
- macOS 11 / 12 / 13 / 14
|
||||
|
||||
ndn-cxx is known to work on the following platforms, although they are not officially
|
||||
ndn-cxx should also work on the following platforms, although they are not officially
|
||||
supported:
|
||||
|
||||
- Debian >= 9
|
||||
- Fedora >= 24
|
||||
- Gentoo Linux
|
||||
- Raspbian >= 2017-08-16
|
||||
- FreeBSD 11.2
|
||||
|
||||
- Any other recent version of Ubuntu not listed above
|
||||
- Fedora >= 33
|
||||
- Alpine >= 3.12
|
||||
- Any version of Raspberry Pi OS based on Debian 11 (bullseye) or later
|
||||
- macOS 10.15
|
||||
- FreeBSD >= 12.2
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
Required:
|
||||
~~~~~~~~~
|
||||
Required
|
||||
~~~~~~~~
|
||||
|
||||
- GCC >= 5.3, or clang >= 3.6
|
||||
- ``python2`` >= 2.7, or ``python3`` >= 3.4
|
||||
- Boost libraries >= 1.58
|
||||
- ``pkg-config``
|
||||
- SQLite 3.x
|
||||
- OpenSSL >= 1.0.2
|
||||
- Apple Security framework (on macOS only)
|
||||
- GCC >= 9.3 or clang >= 7.0 (if you are on Linux or FreeBSD)
|
||||
- Xcode >= 12.4 or corresponding version of Command Line Tools (if you are on macOS)
|
||||
- Python >= 3.8
|
||||
- pkg-config
|
||||
- Boost >= 1.71.0
|
||||
- OpenSSL >= 1.1.1
|
||||
- SQLite 3.x
|
||||
|
||||
Following are the detailed steps for each platform to install the compiler, all necessary
|
||||
development tools and libraries, and ndn-cxx prerequisites.
|
||||
To build ndn-cxx from source, one must first install a C++ compiler and all necessary
|
||||
development tools and libraries:
|
||||
|
||||
- macOS
|
||||
- On **Debian** and **Ubuntu**
|
||||
|
||||
* Install Xcode from the App Store, or at least the Command Line Tools
|
||||
(``xcode-select --install``)
|
||||
In a terminal, enter::
|
||||
|
||||
* If using Homebrew (recommended), enter the following in a terminal::
|
||||
sudo apt install build-essential pkg-config python3-minimal libboost-all-dev libssl-dev libsqlite3-dev
|
||||
|
||||
- On **CentOS** and **Fedora**
|
||||
|
||||
In a terminal, enter::
|
||||
|
||||
sudo dnf install gcc-c++ pkgconf-pkg-config python3 boost-devel openssl-devel sqlite-devel
|
||||
|
||||
- On **macOS**
|
||||
|
||||
* Install either Xcode (from the App Store) or the Command Line Tools
|
||||
(with ``xcode-select --install``)
|
||||
|
||||
* If using Homebrew (recommended), enter the following in a terminal:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
brew install boost openssl pkg-config
|
||||
|
||||
.. note::
|
||||
.. warning::
|
||||
|
||||
If a major OS upgrade is performed after installing the dependencies
|
||||
with Homebrew, remember to reinstall all packages.
|
||||
|
||||
- Ubuntu
|
||||
- On **FreeBSD**
|
||||
|
||||
In a terminal, enter::
|
||||
|
||||
sudo apt install build-essential libboost-all-dev libssl-dev libsqlite3-dev pkg-config python-minimal
|
||||
sudo pkg install pkgconf python3 boost-libs openssl sqlite3
|
||||
|
||||
- Fedora
|
||||
Optional
|
||||
~~~~~~~~
|
||||
|
||||
In a terminal, enter::
|
||||
To build tutorials, man pages, and API documentation the following additional dependencies
|
||||
need to be installed:
|
||||
|
||||
sudo yum install gcc-g++ sqlite-devel boost-devel openssl-devel
|
||||
- doxygen
|
||||
- graphviz
|
||||
- sphinx >= 4.0
|
||||
- sphinxcontrib-doxylink
|
||||
|
||||
- FreeBSD
|
||||
The following lists the steps to install these prerequisites on various common platforms.
|
||||
|
||||
In a terminal, enter::
|
||||
.. note::
|
||||
On Linux, you may need to add ``$HOME/.local/bin`` to the ``PATH`` environment variable
|
||||
for your user, for example:
|
||||
|
||||
sudo pkg install python pkgconf sqlite3 boost-libs
|
||||
.. code-block:: sh
|
||||
|
||||
Optional:
|
||||
~~~~~~~~~
|
||||
export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
|
||||
|
||||
To build tutorials, manpages, and API documentation the following
|
||||
dependencies need to be installed:
|
||||
- On **Debian** and **Ubuntu**:
|
||||
|
||||
- ``doxygen``
|
||||
- ``graphviz``
|
||||
- ``python-sphinx``
|
||||
- ``sphinxcontrib-doxylink``
|
||||
|
||||
The following lists steps for common platforms to install these prerequisites:
|
||||
|
||||
- On macOS with Homebrew and pip::
|
||||
|
||||
brew install doxygen graphviz
|
||||
sudo pip install sphinx sphinxcontrib-doxylink
|
||||
|
||||
- On Ubuntu::
|
||||
.. code-block:: sh
|
||||
|
||||
sudo apt install doxygen graphviz python3-pip
|
||||
pip3 install --user sphinx sphinxcontrib-doxylink
|
||||
|
||||
- On **CentOS** and **Fedora**:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
sudo dnf install doxygen graphviz python3-pip
|
||||
pip3 install --user sphinx sphinxcontrib-doxylink
|
||||
|
||||
- On **macOS**:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
brew install doxygen graphviz
|
||||
sudo pip3 install sphinx sphinxcontrib-doxylink
|
||||
|
||||
- On Fedora::
|
||||
- On **FreeBSD**:
|
||||
|
||||
sudo yum install doxygen graphviz python-sphinx
|
||||
sudo pip install sphinxcontrib-doxylink
|
||||
.. code-block:: sh
|
||||
|
||||
- On FreeBSD::
|
||||
|
||||
sudo pkg install doxygen graphviz py27-sphinx
|
||||
|
||||
|
||||
.. _build:
|
||||
sudo pkg install doxygen graphviz py39-sphinx
|
||||
|
||||
Build
|
||||
-----
|
||||
|
||||
.. note::
|
||||
These are instructions for regular builds of ndn-cxx (release mode).
|
||||
To do development of ndn-cxx code itself, see "Development build" below.
|
||||
These are instructions for regular builds of ndn-cxx (release mode). If you are
|
||||
planning to develop the ndn-cxx code itself, you should do a :ref:`Development build`.
|
||||
|
||||
To build in a terminal, change directory to the ndn-cxx root, then enter::
|
||||
To build in a terminal, change directory to the ndn-cxx root, then enter:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
./waf configure
|
||||
./waf
|
||||
sudo ./waf install
|
||||
|
||||
By default, only the shared version of ndn-cxx library is built. To build the static library,
|
||||
use ``--enable-static`` option for ``./waf configure`` command::
|
||||
By default, only the shared variant of the ndn-cxx library will be built. To build the
|
||||
static library, pass ``--enable-static`` to the ``./waf configure`` command:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
./waf configure --enable-static
|
||||
|
||||
To disable build of the shared library and build only the static library, use additional
|
||||
``--disable-shared`` option. Note that at least one version of the library needs to be
|
||||
enabled.
|
||||
To disable the build of the shared library and build only the static library, use the
|
||||
additional ``--disable-shared`` option. Note that at least one variant of the library
|
||||
needs to be enabled.
|
||||
|
||||
::
|
||||
.. code-block:: sh
|
||||
|
||||
./waf configure --enable-static --disable-shared
|
||||
|
||||
After the shared library is installed, on Linux it is also necessary to run::
|
||||
On Linux, it is necessary to run the following command after the shared library has
|
||||
been installed:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
sudo ldconfig
|
||||
|
||||
.. note::
|
||||
When the library is installed in a non-standard path (in general: not in ``/usr/lib``
|
||||
or ``/usr/local/lib``; on some Linux distros including Fedora: not in ``/usr/lib``),
|
||||
additional actions may be necessary.
|
||||
When the library is installed in a non-default location (in general: not in ``/usr/lib``
|
||||
or ``/usr/local/lib``; on some Linux distros like Fedora and its derivatives, including
|
||||
CentOS: not in ``/usr/lib``), the following additional actions may be necessary.
|
||||
|
||||
The installation path should be added to ``/etc/ld.so.conf`` (or in
|
||||
``/etc/ld.so.conf.d``) **before** running ``sudo ldconfig``. For example::
|
||||
The library installation path should be added to ``/etc/ld.so.conf`` or in
|
||||
``/etc/ld.so.conf.d/*.conf`` **before** running ``ldconfig``. For example:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
echo /usr/local/lib | sudo tee /etc/ld.so.conf.d/ndn-cxx.conf
|
||||
|
||||
Alternatively, the ``LD_LIBRARY_PATH`` environment variable can be set to point to
|
||||
the installation directory of the shared library::
|
||||
the installation directory of the shared library:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export LD_LIBRARY_PATH=/usr/local/lib
|
||||
|
||||
@@ -162,38 +185,41 @@ The ``./waf install`` command installs the following files:
|
||||
- ``<LIBPATH>/libndn-cxx.so``, ``<LIBPATH>/libndn-cxx.so.<VERSION>`` (on Linux),
|
||||
``<LIBPATH>/libndn-cxx.dylib``, ``<LIBPATH>/libndn-cxx.<VERSION>.dylib`` (on macOS):
|
||||
shared NDN C++ library (if enabled).
|
||||
- ``<LIBPATH>/pkgconfig/libndn-cxx.pc``: pkgconfig file storing all
|
||||
neccessary flags to build against the library. For example, if
|
||||
pkg-config or pkgconf package is installed and ``PKG_CONFIG_PATH`` is
|
||||
configured properly (or ``<LIBPATH>/pkgconfig`` is a default path),
|
||||
``pkgconfig --libs --clflags libndn-cxx`` will return all necessary
|
||||
compile and link flags for the library.
|
||||
- ``<BINPATH>/ndnsec``: tool to manage NDN keys and certificates.
|
||||
- ``<LIBPATH>/pkgconfig/libndn-cxx.pc``: pkgconfig file storing all necessary flags to
|
||||
build against the library. For example, if the ``pkg-config`` or ``pkgconf-pkg-config``
|
||||
package is installed and ``PKG_CONFIG_PATH`` is configured properly (or if
|
||||
``<LIBPATH>/pkgconfig`` is a default search path), the command ``pkg-config --cflags
|
||||
--libs libndn-cxx`` will return all necessary compile and link flags for the library.
|
||||
- ``<BINPATH>/ndnsec``: command-line tool to manage NDN keys and certificates.
|
||||
- ``<BINPATH>/ndnsec-*``: convenience aliases for ``ndnsec`` tools.
|
||||
|
||||
If configured with tests (``./waf configure --with-tests``), the above
|
||||
commands will also produce:
|
||||
If configured with tests (``./waf configure --with-tests``), the above commands
|
||||
will also produce:
|
||||
|
||||
- ``build/unit-tests``: a unit test binary for the library.
|
||||
|
||||
1.5GB available memory per CPU core is necessary for efficient compilation.
|
||||
On a multi-core machine with less than 1.5GB available memory per CPU core,
|
||||
limit the objects being compiled in parallel with ``./waf -jN`` where N is the amount
|
||||
of available memory divided by 1.5GB (eg. ``./waf -j1`` for 1.5GB memory),
|
||||
which should usually avoid memory thrashing and result in faster compilation.
|
||||
1.5 GB available memory per CPU core is necessary for efficient compilation. On a
|
||||
multi-core machine with less than 1.5 GB available memory per CPU core, limit the
|
||||
objects being compiled in parallel with ``./waf -jN``, where N is the amount of
|
||||
available memory divided by 1.5 GB (e.g., ``./waf -j2`` for 3 GB of memory). This
|
||||
should avoid memory thrashing and result in faster compilation.
|
||||
|
||||
Build with examples
|
||||
-------------------
|
||||
|
||||
By default, examples in ``examples/`` are not built. To enable them, use the
|
||||
``--with-examples`` configure option::
|
||||
By default, the examples in the ``examples/`` directory will not be built. To enable
|
||||
them, pass ``--with-examples`` during the configuration step:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
./waf configure --with-examples
|
||||
./waf
|
||||
sudo ./waf install
|
||||
sudo ldconfig # (on Linux only)
|
||||
sudo ldconfig # on Linux only
|
||||
|
||||
To run examples::
|
||||
To run the examples:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
# trivial producer app
|
||||
./build/examples/producer
|
||||
@@ -204,79 +230,89 @@ To run examples::
|
||||
# trivial consumer app with timers
|
||||
./build/examples/consumer-with-timer
|
||||
|
||||
If you want to test out a sample application, just create a ``.cpp`` file in ``examples/``
|
||||
folder and it will be compiled on the next run on ``./waf``. For example::
|
||||
If you want to make a new sample application, just create a ``.cpp`` file inside the
|
||||
``examples/`` directory and it will be compiled during the next run of ``./waf``:
|
||||
|
||||
cp examples/consumer.cpp examples/my-new-consumer-app.cpp
|
||||
.. code-block:: sh
|
||||
|
||||
cp examples/consumer.cpp examples/my-new-app.cpp
|
||||
... # edit examples/my-new-app.cpp with your preferred editor
|
||||
./waf
|
||||
sudo ./waf install
|
||||
sudo ldconfig # (on Linux only)
|
||||
./build/examples/my-new-consumer-app
|
||||
sudo ldconfig # on Linux only
|
||||
./build/examples/my-new-app
|
||||
|
||||
Debug symbols
|
||||
~~~~~~~~~~~~~
|
||||
-------------
|
||||
|
||||
The default compiler flags enable debug symbols to be included in binaries (i.e., ``-g``
|
||||
flag for ``./waf configure`` and ``-g3`` for ``./waf configure --debug``). This
|
||||
potentially allows more meaningful debugging information if your application crashes.
|
||||
The default compiler flags include debug symbols in binaries. This should provide
|
||||
more meaningful debugging information if ndn-cxx or your application crashes.
|
||||
|
||||
The default build flags can easily be overridden::
|
||||
If this is not desired, the default flags can be overridden to disable debug symbols.
|
||||
The following example shows how to completely disable debug symbols and configure
|
||||
ndn-cxx to be installed into ``/usr`` with configuration in the ``/etc`` directory.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
CXXFLAGS="-O2" ./waf configure --prefix=/usr --sysconfdir=/etc
|
||||
./waf
|
||||
sudo ./waf install
|
||||
|
||||
Customizing the compiler
|
||||
------------------------
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
To build ndn-cxx with a different compiler (rather than the platform default), set the
|
||||
``CXX`` environment variable to point to the compiler binary. For example, to build
|
||||
with clang on Linux, use the following:
|
||||
|
||||
ndn-cxx tutorials and API documentation can be built using the following
|
||||
commands::
|
||||
.. code-block:: sh
|
||||
|
||||
CXX=clang++ ./waf configure
|
||||
|
||||
Building the documentation
|
||||
--------------------------
|
||||
|
||||
Tutorials and API documentation can be built using the following commands:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
# Full set of documentation (tutorials + API) in build/docs
|
||||
./waf docs
|
||||
|
||||
# Only tutorials in `build/docs`
|
||||
# Only tutorials in build/docs
|
||||
./waf sphinx
|
||||
|
||||
# Only API docs in `build/docs/doxygen`
|
||||
# Only API docs in build/docs/doxygen
|
||||
./waf doxygen
|
||||
|
||||
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.
|
||||
If ``sphinx-build`` is detected during ``./waf configure``, man pages will automatically
|
||||
be built and installed during the normal build process (i.e., during ``./waf`` and
|
||||
``./waf install``). By default, man pages will be installed into ``${PREFIX}/share/man``
|
||||
(the default value for ``PREFIX`` is ``/usr/local``). This location can be changed
|
||||
during the ``./waf configure`` stage using the ``--prefix``, ``--datarootdir``, or
|
||||
``--mandir`` options.
|
||||
|
||||
For more details, refer to ``./waf --help``.
|
||||
For further details, please refer to ``./waf --help``.
|
||||
|
||||
.. _Development build:
|
||||
|
||||
Development build
|
||||
-----------------
|
||||
|
||||
The following is the suggested configure command for development builds::
|
||||
The following is the suggested build procedure for development builds:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
./waf configure --debug --with-tests
|
||||
./waf
|
||||
sudo ./waf install
|
||||
sudo ldconfig # (on Linux only)
|
||||
sudo ldconfig # on Linux only
|
||||
|
||||
In the development build most compiler optimizations are disabled by
|
||||
default and all warnings are treated as errors. The default behavior can
|
||||
be overridden by setting ``CXXFLAGS`` environment variable before
|
||||
running ``./waf configure``::
|
||||
In a development build, most compiler optimizations will be disabled and all warnings
|
||||
will be treated as errors. This default behavior can be overridden by setting the
|
||||
``CXXFLAGS`` environment variable before running ``./waf configure``, for example:
|
||||
|
||||
CXXFLAGS="-O1 -g3" ./waf configure --debug --with-tests
|
||||
...
|
||||
.. code-block:: sh
|
||||
|
||||
|
||||
Customizing the compiler
|
||||
------------------------
|
||||
|
||||
To choose a custom C++ compiler for building ndn-cxx, set the ``CXX`` environment
|
||||
variable to point to the compiler binary. For example, to build with clang on
|
||||
Linux, use the following::
|
||||
|
||||
CXX=clang++ ./waf configure
|
||||
CXXFLAGS="-O1 -g3 -Wall" ./waf configure --debug --with-tests
|
||||
./waf
|
||||
@@ -1,4 +0,0 @@
|
||||
Release Notes
|
||||
+++++++++++++
|
||||
|
||||
.. include:: release-notes-latest.rst
|
||||
+100
-95
@@ -3,11 +3,11 @@ ndn-cxx Code Style and Coding Guidelines
|
||||
|
||||
Based on
|
||||
|
||||
* "C++ Programming Style Guidelines" by Geotechnical Software Services, Copyright © 1996 – 2011.
|
||||
The original document is available at `<http://geosoft.no/development/cppstyle.html>`_
|
||||
* "C++ Programming Style Guidelines" by Geotechnical Software Services, Copyright © 1996-2011.
|
||||
The original document is available at `<http://geosoft.no/development/cppstyle.html>`__
|
||||
|
||||
* NDN Platform "C++, C, C#, Java and JavaScript Code Guidelines".
|
||||
The original document available at `<http://named-data.net/codebase/platform/documentation/ndn-platform-development-guidelines/cpp-code-guidelines/>`_
|
||||
* NDN Platform "C++, C, C#, Java and JavaScript Code Guidelines".
|
||||
The original document is available at `<https://named-data.net/codebase/platform/documentation/ndn-platform-development-guidelines/cpp-code-guidelines/>`__
|
||||
|
||||
1. Code layout
|
||||
--------------
|
||||
@@ -31,14 +31,14 @@ extended it to C++.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
a = (b + c) * d; // NOT: a=(b+c)*d
|
||||
a = (b + c) * d; // NOT: a=(b+c)*d
|
||||
|
||||
while (true) { // NOT: while(true)
|
||||
while (true) { // NOT: while(true)
|
||||
...
|
||||
|
||||
doSomething(a, b, c, d); // NOT: doSomething(a,b,c,d);
|
||||
doSomething(a, b, c, d); // NOT: doSomething(a,b,c,d);
|
||||
|
||||
for (i = 0; i < 10; i++) { // NOT: for(i=0;i<10;i++){
|
||||
for (i = 0; i < 10; i++) { // NOT: for(i=0;i<10;i++){
|
||||
...
|
||||
|
||||
1.3. Namespaces should have the following form:
|
||||
@@ -52,11 +52,11 @@ extended it to C++.
|
||||
|
||||
} // namespace example
|
||||
|
||||
Note that code inside namespace is **not** indented. Avoid the following:
|
||||
Note that code inside the namespace is **not** indented. Avoid the following:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// NOT
|
||||
// WRONG
|
||||
//
|
||||
// namespace example {
|
||||
//
|
||||
@@ -180,7 +180,7 @@ extended it to C++.
|
||||
switch (condition) {
|
||||
case ABC: // 2 space indent
|
||||
statements; // 4 space indent
|
||||
NDN_CXX_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
|
||||
case DEF:
|
||||
statements;
|
||||
@@ -211,7 +211,7 @@ extended it to C++.
|
||||
// Correct style
|
||||
case A1: {
|
||||
statements;
|
||||
NDN_CXX_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
}
|
||||
|
||||
// Incorrect style: braces should cover the entire case block
|
||||
@@ -232,7 +232,7 @@ extended it to C++.
|
||||
switch (condition) {
|
||||
case ABC: // no indent
|
||||
statements; // 2 space indent
|
||||
NDN_CXX_FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
|
||||
case DEF:
|
||||
statements;
|
||||
@@ -243,11 +243,11 @@ extended it to C++.
|
||||
break;
|
||||
}
|
||||
|
||||
The ``NDN_CXX_FALLTHROUGH;`` annotation must be included whenever there is
|
||||
a case without a break statement. Leaving the break out is a common error,
|
||||
The ``[[fallthrough]]`` annotation must be included whenever there is a
|
||||
case without a break statement. Leaving the break out is a common error,
|
||||
and it must be made clear that it is intentional when it is not there.
|
||||
Moreover, modern compilers will warn when a case that falls through is not
|
||||
explicitly annotated.
|
||||
Moreover, modern compilers will warn when a case that falls through is
|
||||
not explicitly annotated.
|
||||
|
||||
1.11. A ``try-catch`` statement should have the following form:
|
||||
|
||||
@@ -329,19 +329,6 @@ should take the following form:
|
||||
statements;
|
||||
}
|
||||
|
||||
If the lambda has no parameters, ``()`` should be omitted.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
[&capture1, capture2] {
|
||||
statements;
|
||||
}
|
||||
|
||||
Either capture-default (``[&]`` or ``[=]``) is permitted, but its usage should be minimized.
|
||||
Only use a capture-default when it significantly simplifies code and improves readability.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
[&] (T arg) {
|
||||
statements;
|
||||
}
|
||||
@@ -350,8 +337,16 @@ should take the following form:
|
||||
statements;
|
||||
}
|
||||
|
||||
Trailing return type should be omitted whenever possible. Add it only when the compiler
|
||||
cannot deduce the return type automatically, or when it improves readability.
|
||||
If the lambda has no parameters, ``()`` should be omitted.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
[&capture1, capture2] {
|
||||
statements;
|
||||
}
|
||||
|
||||
Trailing return types should be omitted whenever possible. Add it only when the compiler
|
||||
cannot deduce the return type automatically, or when it improves readability. Note that
|
||||
``()`` is required by the C++ standard when ``mutable`` or a trailing return type is used.
|
||||
|
||||
.. code-block:: c++
|
||||
@@ -371,7 +366,7 @@ should take the following form:
|
||||
|
||||
[&capture1, capture2] (T1 arg1, T2 arg2) { statement; }
|
||||
|
||||
No-op can be written in a more compact form:
|
||||
A no-op lambda can be written in a more compact form:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
@@ -395,26 +390,20 @@ should take the following form:
|
||||
|
||||
T({arg1, arg2})
|
||||
|
||||
T object = {arg1, arg2};
|
||||
|
||||
class Class
|
||||
{
|
||||
private:
|
||||
T m_member = {arg1, arg2};
|
||||
T m_member{arg1, arg2};
|
||||
static T s_member = {arg1, arg2};
|
||||
};
|
||||
|
||||
Class::Class()
|
||||
: m_member{arg1, arg2}
|
||||
{
|
||||
}
|
||||
|
||||
T object = {arg1, arg2};
|
||||
|
||||
An empty braced-init-list is written as ``{}``. For example:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
T object{};
|
||||
|
||||
T object = {};
|
||||
|
||||
2. Naming Conventions
|
||||
@@ -490,13 +479,11 @@ written in mixed case starting with lower case.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
namespace model {
|
||||
namespace analyzer {
|
||||
namespace model::analyzer {
|
||||
|
||||
...
|
||||
|
||||
} // namespace analyzer
|
||||
} // namespace model
|
||||
} // namespace model::analyzer
|
||||
|
||||
2.7. Names representing generic template types should be a single uppercase letter.
|
||||
|
||||
@@ -530,8 +517,8 @@ written in mixed case starting with lower case.
|
||||
In general, the use of global variables should be avoided. Consider using singleton
|
||||
objects instead.
|
||||
|
||||
2.10. Private class variables should have ``m_`` prefix. Static class variables should have
|
||||
``s_`` prefix.
|
||||
2.10. All non-static data members of a class should be prefixed with ``m_`` unless they
|
||||
are public. Similarly, non-public static data members should be prefixed with ``s_``.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
@@ -629,13 +616,13 @@ symmetry.
|
||||
|
||||
::
|
||||
|
||||
get/set, add/remove, create/destroy, start/stop, insert/delete,
|
||||
get/set, add/remove, create/destroy, start/stop, insert/erase,
|
||||
increment/decrement, old/new, begin/end, first/last, up/down, min/max,
|
||||
next/previous (and commonly used next/prev), open/close, show/hide,
|
||||
suspend/resume, etc.
|
||||
|
||||
Pair ``insert/erase`` should be preferred. ``insert/delete`` can also be used if it
|
||||
does not conflict with C++ delete keyword.
|
||||
The pair ``insert/erase`` is preferred. ``insert/delete`` can also be used if it
|
||||
does not conflict with the ``delete`` keyword of C++.
|
||||
|
||||
2.21. Variable names should not include reference to variable type (do not use Hungarian
|
||||
notation).
|
||||
@@ -758,20 +745,29 @@ For example, the include section of ``ndn-cxx/foo/bar.cpp`` may look like this:
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
3.5. Types that are local to one file only can be declared inside that file.
|
||||
3.5. Definitions that are local to only one ``.cpp`` file should be declared inside that
|
||||
file and be placed in an unnamed namespace or declared ``static``.
|
||||
|
||||
3.6. Implicit conversion is generally allowed.
|
||||
|
||||
Implicit conversion between integer and floating point numbers can cause problems and
|
||||
should be avoided.
|
||||
|
||||
Implicit conversion in single-argument constructor is usually undesirable. Therefore, all
|
||||
single-argument constructors should be marked 'explicit', unless implicit conversion is
|
||||
desirable. In that case, a comment should document the reason.
|
||||
Implicit conversion in constructors that can be called with a single argument is usually
|
||||
undesirable. Therefore, all single-argument constructors should be marked ``explicit``,
|
||||
unless implicit conversion is desirable. In that case, a comment should document the
|
||||
reason for this.
|
||||
As an exception, copy and move constructors should not be explicit, since they do not
|
||||
perform type conversion.
|
||||
Constructors that cannot be called with a single argument may omit ``explicit``.
|
||||
Constructors that take a single ``std::initializer_list`` parameter should also omit
|
||||
``explicit``, in order to support copy-initialization.
|
||||
|
||||
Avoid C-style casts. Use ``static_cast``, ``dynamic_cast``, ``reinterpret_cast``,
|
||||
``const_cast`` instead where appropriate. Use ``static_pointer_cast``,
|
||||
``dynamic_pointer_cast``, ``const_pointer_cast`` when dealing with ``shared_ptr``.
|
||||
Avoid C-style casts.
|
||||
Use ``static_cast``, ``dynamic_cast``, ``const_cast``, ``reinterpret_cast``, or
|
||||
``bit_cast`` instead where appropriate.
|
||||
Use ``static_pointer_cast``, ``dynamic_pointer_cast``, or ``const_pointer_cast``
|
||||
when dealing with ``shared_ptr``.
|
||||
|
||||
3.7. Variables should be initialized where they are declared.
|
||||
|
||||
@@ -793,9 +789,9 @@ For example, the include section of ``ndn-cxx/foo/bar.cpp`` may look like this:
|
||||
|
||||
Exceptions to this rule:
|
||||
|
||||
* When the class is essentially a dumb data structure with no or minimal behavior
|
||||
(equivalent to a C struct, also known as POD type). In this case it is appropriate
|
||||
to make the instance variables public by using ``struct``.
|
||||
* When the class is essentially a passive data structure with no or minimal behavior
|
||||
(equivalent to a C struct, also known as POD type). In this case, all fields should
|
||||
be public and the keyword ``struct`` should be used instead of ``class``.
|
||||
|
||||
* When the class is used only inside the compilation unit, e.g., when implementing pImpl
|
||||
idiom (aka Bridge pattern) or similar cases.
|
||||
@@ -812,8 +808,11 @@ than to the name.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
if (nLines != 0) // NOT: if (nLines)
|
||||
if (value != 0.0) // NOT: if (value)
|
||||
if (nLines != 0) // NOT: if (nLines)
|
||||
|
||||
int* ptr = ...
|
||||
if (ptr) // OK
|
||||
if (ptr != nullptr) // also OK
|
||||
|
||||
3.11. *(removed)*
|
||||
|
||||
@@ -837,10 +836,10 @@ than to the name.
|
||||
|
||||
// NOT:
|
||||
for (;;) { // NO!
|
||||
:
|
||||
...
|
||||
}
|
||||
while (1) { // NO!
|
||||
:
|
||||
...
|
||||
}
|
||||
|
||||
3.14. Complex conditional expressions must be avoided. Introduce temporary boolean variables
|
||||
@@ -1004,10 +1003,10 @@ decimal, and without omitting 0 before the decimal point.
|
||||
int z = x + y;
|
||||
BOOST_ASSERT(z - y == x);
|
||||
|
||||
The expression passed to ``BOOST_ASSERT`` MUST NOT have side effects,
|
||||
because it MAY NOT be evaluated in release builds.
|
||||
The expression passed to ``BOOST_ASSERT`` must not have side effects,
|
||||
because it may not be evaluated in release builds.
|
||||
|
||||
3.28. Use ``static_assert`` for static assertions.
|
||||
3.28. Use ``static_assert`` for compile-time assertions.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
@@ -1022,43 +1021,32 @@ decimal, and without omitting 0 before the decimal point.
|
||||
static_assert(std::is_base_of<BaseClass, DerivedClass>::value,
|
||||
"DerivedClass must inherit from BaseClass");
|
||||
|
||||
3.29. ``auto`` type specifier MAY be used for local variables, if a human reader
|
||||
can easily deduce the actual type.
|
||||
3.29. The ``auto`` type specifier may be used for local variables if a human reader can
|
||||
easily deduce the actual type, or if it makes the code safer.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
std::vector<int> intVector;
|
||||
auto i = intVector.find(4);
|
||||
auto i = intVector.find(4); // OK
|
||||
|
||||
auto stringSet = std::make_shared<std::set<std::string>>();
|
||||
auto stringSet = std::make_shared<std::set<std::string>>(); // OK
|
||||
|
||||
``auto`` SHOULD NOT be used if a human reader cannot easily deduce the actual type.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto x = foo(); // BAD if the declaration of foo() isn't nearby
|
||||
|
||||
``const auto&`` SHOULD be used to represent constant reference types.
|
||||
``auto&&`` SHOULD be used to represent mutable reference types.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
std::list<std::string> strings;
|
||||
for (const auto& str : strings) {
|
||||
statements; // cannot modify `str`
|
||||
}
|
||||
for (auto&& str : strings) {
|
||||
statements; // can modify `str`
|
||||
std::vector<std::string> strings;
|
||||
for (const auto& str : strings) { // OK, iterating over the elements of a container
|
||||
std::cout << str;
|
||||
}
|
||||
|
||||
obj.onEvent([] (auto&&...) { std::cout << "hi!"; }); // OK, unused lambda parameters
|
||||
|
||||
auto x = foo(); // BAD unless foo() is declared nearby or has a well-known prototype
|
||||
|
||||
3.30. Use the ``override`` or ``final`` specifier when overriding a virtual
|
||||
member function or a virtual destructor.
|
||||
|
||||
``virtual`` MUST NOT be used along with ``final``, so that the compiler
|
||||
can generate an error when a final function does not override.
|
||||
``virtual`` must not be used along with ``final`` so that the compiler can generate
|
||||
an error when a final function does not override.
|
||||
|
||||
``virtual`` SHOULD NOT be used along with ``override``, for consistency
|
||||
with ``final``.
|
||||
``virtual`` should not be used along with ``override`` for consistency with ``final``.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
@@ -1085,5 +1073,22 @@ member function or a virtual destructor.
|
||||
|
||||
3.31. The recommended way to throw an exception derived from ``std::exception`` is to use
|
||||
``NDN_THROW`` or one of the other ``NDN_THROW_*`` macros.
|
||||
Exceptions thrown using these macros will be augmented with additional diagnostic information,
|
||||
including the file name, line number, and function name from which the exception was thrown.
|
||||
|
||||
Exceptions thrown using these macros will be augmented with additional diagnostic
|
||||
information, including the file name, line number, and function name from which
|
||||
the exception was thrown.
|
||||
|
||||
The extended diagnostic information contained in the exception can be printed with
|
||||
``boost::diagnostic_information()``.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <iostream>
|
||||
|
||||
try {
|
||||
operationThatMayThrow();
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << boost::diagnostic_information(e);
|
||||
}
|
||||
+43
-102
@@ -1,32 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# http://www.sphinx-doc.org/en/master/config
|
||||
# For the full list of built-in configuration values, see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# 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.
|
||||
#
|
||||
import os
|
||||
import importlib.util
|
||||
import sys
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||
|
||||
project = u'ndn-cxx: NDN C++ library with eXperimental eXtensions'
|
||||
copyright = u'Copyright © 2013-2019 Regents of the University of California.'
|
||||
author = u'Named Data Networking Project'
|
||||
project = 'ndn-cxx: NDN C++ library with eXperimental eXtensions'
|
||||
copyright = 'Copyright © 2013-2023 Regents of the University of California.'
|
||||
author = 'Named Data Networking Project'
|
||||
|
||||
# The short X.Y version
|
||||
# The short X.Y version.
|
||||
#version = ''
|
||||
|
||||
# The full version, including alpha/beta/rc tags
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
#release = ''
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
@@ -37,54 +27,34 @@ today_fmt = '%Y-%m-%d'
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#
|
||||
needs_sphinx = '1.1'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
needs_sphinx = '4.0'
|
||||
extensions = [
|
||||
'sphinx.ext.extlinks',
|
||||
'sphinx.ext.todo',
|
||||
]
|
||||
|
||||
def addExtensionIfExists(extension):
|
||||
def addExtensionIfExists(extension: str):
|
||||
try:
|
||||
__import__(extension)
|
||||
if importlib.util.find_spec(extension) is None:
|
||||
raise ModuleNotFoundError(extension)
|
||||
except (ImportError, ValueError):
|
||||
sys.stderr.write(f'WARNING: Extension {extension!r} not found. '
|
||||
'Some documentation may not build correctly.\n')
|
||||
else:
|
||||
extensions.append(extension)
|
||||
except ImportError:
|
||||
sys.stderr.write("Extension '%s' not found. "
|
||||
"Some documentation may not build correctly.\n" % extension)
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
addExtensionIfExists('sphinxcontrib.doxylink')
|
||||
addExtensionIfExists('sphinxcontrib.doxylink')
|
||||
|
||||
# sphinxcontrib.googleanalytics is currently not working with the latest version of Sphinx
|
||||
# if os.getenv('GOOGLE_ANALYTICS', None):
|
||||
# addExtensionIfExists('sphinxcontrib.googleanalytics')
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = []
|
||||
exclude_patterns = ['Thumbs.db', '.DS_Store']
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#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 = 'named_data_theme'
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
html_theme_path = ['.']
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
@@ -92,72 +62,43 @@ html_theme_path = ['.']
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
html_copy_source = False
|
||||
html_show_sourcelink = False
|
||||
|
||||
# -- 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': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# 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', 'ndn-cxx-docs.tex', u'NDN C++ library with eXperimental eXtensions',
|
||||
author, 'manual'),
|
||||
]
|
||||
# Disable syntax highlighting of code blocks by default.
|
||||
highlight_language = 'none'
|
||||
|
||||
|
||||
# -- Options for manual page output ------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-manual-page-output
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('manpages/ndnsec', 'ndnsec', 'NDN security toolkit', None, 1),
|
||||
('manpages/ndnsec-cert-dump', 'ndnsec-cert-dump', 'export an NDN certificate', None, 1),
|
||||
('manpages/ndnsec-cert-gen', 'ndnsec-cert-gen', 'create an NDN certificate for an identity', None, 1),
|
||||
('manpages/ndnsec-cert-install', 'ndnsec-cert-install', 'import an NDN certificate from a file', None, 1),
|
||||
('manpages/ndnsec-delete', 'ndnsec-delete', 'delete an NDN identity, key, or certificate', None, 1),
|
||||
('manpages/ndnsec-export', 'ndnsec-export', 'export an NDN certificate and its private key to a file', None, 1),
|
||||
('manpages/ndnsec-get-default', 'ndnsec-get-default', 'show the default NDN identity, key, and certificate for the current user', None, 1),
|
||||
('manpages/ndnsec-import', 'ndnsec-import', 'import an NDN certificate and its private key from a file', None, 1),
|
||||
('manpages/ndnsec-key-gen', 'ndnsec-key-gen', 'generate an NDN key for an identity', None, 1),
|
||||
('manpages/ndnsec-list', 'ndnsec-list', 'list all known NDN identities, keys, and certificates', None, 1),
|
||||
('manpages/ndnsec-set-default', 'ndnsec-set-default', 'change the default NDN identity, key, or certificate for the current user', None, 1),
|
||||
('manpages/ndnsec-sign-req', 'ndnsec-sign-req', 'generate an NDN certificate signing request', None, 1),
|
||||
('manpages/ndnsec-unlock-tpm', 'ndnsec-unlock-tpm', 'unlock the TPM', None, 1),
|
||||
('manpages/ndn-client.conf', 'ndn-client.conf', 'configuration file for NDN platform', None, 5),
|
||||
('manpages/ndn-log', 'ndn-log', 'ndn-cxx logging', None, 7),
|
||||
('manpages/ndnsec', 'ndnsec', 'NDN security toolkit', [], 1),
|
||||
('manpages/ndnsec-cert-dump', 'ndnsec-cert-dump', 'export an NDN certificate', [], 1),
|
||||
('manpages/ndnsec-cert-gen', 'ndnsec-cert-gen', 'create an NDN certificate for an identity', [], 1),
|
||||
('manpages/ndnsec-cert-install', 'ndnsec-cert-install', 'import an NDN certificate from a file', [], 1),
|
||||
('manpages/ndnsec-delete', 'ndnsec-delete', 'delete an NDN identity, key, or certificate', [], 1),
|
||||
('manpages/ndnsec-export', 'ndnsec-export', 'export an NDN certificate and its private key to a file', [], 1),
|
||||
('manpages/ndnsec-get-default', 'ndnsec-get-default', 'show the default NDN identity, key, and certificate for the current user', [], 1),
|
||||
('manpages/ndnsec-import', 'ndnsec-import', 'import an NDN certificate and its private key from a file', [], 1),
|
||||
('manpages/ndnsec-key-gen', 'ndnsec-key-gen', 'generate an NDN key for an identity', [], 1),
|
||||
('manpages/ndnsec-list', 'ndnsec-list', 'list all known NDN identities, keys, and certificates', [], 1),
|
||||
('manpages/ndnsec-set-default', 'ndnsec-set-default', 'change the default NDN identity, key, or certificate for the current user', [], 1),
|
||||
('manpages/ndnsec-sign-req', 'ndnsec-sign-req', 'generate an NDN certificate signing request', [], 1),
|
||||
('manpages/ndnsec-unlock-tpm', 'ndnsec-unlock-tpm', 'unlock the TPM', [], 1),
|
||||
('manpages/ndn-client.conf', 'ndn-client.conf', 'configuration file for NDN applications', [], 5),
|
||||
('manpages/ndn-log', 'ndn-log', 'ndn-cxx logging', [], 7),
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = True
|
||||
|
||||
|
||||
# -- Custom options ----------------------------------------------------------
|
||||
# -- Misc options ------------------------------------------------------------
|
||||
|
||||
doxylink = {
|
||||
'ndn-cxx': ('ndn-cxx.tag', 'doxygen/'),
|
||||
}
|
||||
|
||||
extlinks = {
|
||||
'issue': ('https://redmine.named-data.net/issues/%s', 'issue #'),
|
||||
'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'),
|
||||
}
|
||||
|
||||
if os.getenv('GOOGLE_ANALYTICS', None):
|
||||
googleanalytics_id = os.environ['GOOGLE_ANALYTICS']
|
||||
googleanalytics_enabled = True
|
||||
+6
-72
@@ -68,7 +68,7 @@ OUTPUT_DIRECTORY = docs/doxygen
|
||||
# performance problems for the file system.
|
||||
# The default value is: NO.
|
||||
|
||||
CREATE_SUBDIRS = YES
|
||||
CREATE_SUBDIRS = NO
|
||||
|
||||
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
|
||||
# characters to appear in the names of generated files. If set to NO, non-ASCII
|
||||
@@ -230,12 +230,6 @@ TAB_SIZE = 4
|
||||
|
||||
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
|
||||
@@ -443,7 +437,7 @@ EXTRACT_PACKAGE = NO
|
||||
# included in the documentation.
|
||||
# The default value is: NO.
|
||||
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_STATIC = NO
|
||||
|
||||
# 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,
|
||||
@@ -780,7 +774,7 @@ WARN_LOGFILE =
|
||||
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = ndn-cxx
|
||||
INPUT = ndn-cxx build/ndn-cxx/version.hpp
|
||||
|
||||
# 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
|
||||
@@ -836,7 +830,7 @@ EXCLUDE_SYMLINKS = NO
|
||||
# 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 = */ndn-cxx/impl/* */ndn-cxx/*/impl/*
|
||||
EXCLUDE_PATTERNS = */ndn-cxx/impl/* */ndn-cxx/*/impl/* */ndn-cxx/detail/nonstd/*
|
||||
|
||||
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
||||
# (namespaces, classes, functions, etc.) that should be excluded from the
|
||||
@@ -1047,13 +1041,6 @@ VERBATIM_HEADERS = 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
|
||||
@@ -1191,7 +1178,7 @@ HTML_COLORSTYLE_GAMMA = 91
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_TIMESTAMP = YES
|
||||
HTML_TIMESTAMP = NO
|
||||
|
||||
# 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
|
||||
@@ -1752,16 +1739,6 @@ LATEX_BATCHMODE = NO
|
||||
|
||||
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.
|
||||
@@ -1834,16 +1811,6 @@ RTF_STYLESHEET_FILE =
|
||||
|
||||
RTF_EXTENSIONS_FILE =
|
||||
|
||||
# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
|
||||
# with syntax highlighting in the RTF 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_RTF is set to YES.
|
||||
|
||||
RTF_SOURCE_CODE = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -1933,15 +1900,6 @@ GENERATE_DOCBOOK = NO
|
||||
|
||||
DOCBOOK_OUTPUT = docbook
|
||||
|
||||
# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
|
||||
# program listings (including syntax highlighting and cross-referencing
|
||||
# information) to the DOCBOOK output. Note that enabling this will significantly
|
||||
# increase the size of the DOCBOOK output.
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
|
||||
|
||||
DOCBOOK_PROGRAMLISTING = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -2128,34 +2086,10 @@ EXTERNAL_GROUPS = 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 =
|
||||
|
||||
# You can include diagrams made with dia in doxygen documentation. Doxygen will
|
||||
# then run dia to produce the diagram and insert it in the documentation. The
|
||||
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
|
||||
@@ -2176,7 +2110,7 @@ HIDE_UNDOC_RELATIONS = YES
|
||||
# set to NO
|
||||
# The default value is: YES.
|
||||
|
||||
HAVE_DOT = YES
|
||||
HAVE_DOT = @HAVE_DOT@
|
||||
|
||||
# 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
|
||||
|
||||
+12
-15
@@ -5,7 +5,7 @@ Trivial applications
|
||||
|
||||
To successfully run the following examples, please make sure that NFD is properly
|
||||
configured and running. For more information about NFD, refer to `NFD's official
|
||||
homepage <http://named-data.net/doc/NFD/>`_.
|
||||
homepage <https://docs.named-data.net/NFD/>`__.
|
||||
|
||||
Trivial consumer
|
||||
----------------
|
||||
@@ -18,8 +18,7 @@ callbacks to be called when Data/Nack is retrieved or Interest times out.
|
||||
.. literalinclude:: ../examples/consumer.cpp
|
||||
:language: c++
|
||||
:linenos:
|
||||
:emphasize-lines: 24-27,39,43-47,51,58,75
|
||||
|
||||
:emphasize-lines: 43-48,51-54,62,76,82
|
||||
|
||||
Trivial producer
|
||||
----------------
|
||||
@@ -42,8 +41,7 @@ using :ndn-cxx:`Face::put` method.
|
||||
.. literalinclude:: ../examples/producer.cpp
|
||||
:language: c++
|
||||
:linenos:
|
||||
:emphasize-lines: 42,55-58,61,64,67,70,76
|
||||
|
||||
:emphasize-lines: 39-42,55,60-63,78,86,90
|
||||
|
||||
Consumer that uses Scheduler
|
||||
----------------------------
|
||||
@@ -51,20 +49,19 @@ Consumer that uses Scheduler
|
||||
The following example demonstrates how to use :ndn-cxx:`Scheduler` to schedule arbitrary
|
||||
events for execution at specific points of time.
|
||||
|
||||
The library internally uses `boost::asio::io_service
|
||||
<https://www.boost.org/doc/libs/1_58_0/doc/html/boost_asio/reference/io_service.html>`_ to
|
||||
implement fully asynchronous NDN operations (i.e., sending and receiving Interests and
|
||||
Data). In addition to network-related operations, ``boost::asio::io_service`` can be used
|
||||
The library internally uses `boost::asio::io_context
|
||||
<https://www.boost.org/doc/libs/1_71_0/doc/html/boost_asio/reference/io_context.html>`__
|
||||
to implement fully asynchronous NDN operations (i.e., sending and receiving Interests and
|
||||
Data). In addition to network-related operations, ``boost::asio::io_context`` can be used
|
||||
to execute any arbitrary callback within the processing thread (run either explicitly via
|
||||
``io.run`` or implicitly via :ndn-cxx:`Face::processEvents` as in previous examples).
|
||||
:ndn-cxx:`Scheduler` is just a wrapper on top of ``boost::asio::io_service``,
|
||||
allowing simple interface to schedule tasks at specific times.
|
||||
``io_context::run()`` or implicitly via :ndn-cxx:`Face::processEvents` as in previous
|
||||
examples). :ndn-cxx:`Scheduler` is just a wrapper on top of ``io_context``, providing a
|
||||
simple interface to schedule tasks at specific times.
|
||||
|
||||
The highlighted lines in the example demonstrate all that is needed to express a second
|
||||
Interest approximately 2 seconds after the first one.
|
||||
Interest approximately 3 seconds after the first one.
|
||||
|
||||
.. literalinclude:: ../examples/consumer-with-timer.cpp
|
||||
:language: c++
|
||||
:linenos:
|
||||
:emphasize-lines: 39-40,51-55,59-60,62-63,108-109
|
||||
|
||||
:emphasize-lines: 47-50,53,84,96-99,104-106
|
||||
+36
-37
@@ -1,26 +1,6 @@
|
||||
ndn-cxx: NDN C++ library with eXperimental eXtensions
|
||||
=====================================================
|
||||
|
||||
**ndn-cxx** is a C++14 library implementing Named Data Networking (NDN) primitives
|
||||
that can be used to write various NDN applications. The library is currently being
|
||||
used by the following projects:
|
||||
|
||||
* `NFD - NDN Forwarding Daemon <https://github.com/named-data/NFD>`_
|
||||
* `NLSR - Named-data Link-State Routing protocol <https://github.com/named-data/NLSR>`_
|
||||
* `ndn-tools - Essential NDN command-line tools <https://github.com/named-data/ndn-tools>`_
|
||||
* `repo-ng - Next generation of NDN repository <https://github.com/named-data/repo-ng>`_
|
||||
* `ChronoSync - Sync library for multiuser realtime applications <https://github.com/named-data/ChronoSync>`_
|
||||
* `PSync - Partial and full synchronization library <https://github.com/named-data/PSync>`_
|
||||
* `ndn-traffic-generator - Traffic generator for NDN <https://github.com/named-data/ndn-traffic-generator>`_
|
||||
* `NAC - Name-based Access Control <https://github.com/named-data/name-based-access-control>`_
|
||||
* `NDNS - Domain Name Service for NDN <https://github.com/named-data/ndns>`_
|
||||
|
||||
Please submit any bugs or feature requests to the `ndn-cxx issue tracker
|
||||
<https://redmine.named-data.net/projects/ndn-cxx/issues>`_.
|
||||
|
||||
ndn-cxx Documentation
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
:maxdepth: 3
|
||||
@@ -36,41 +16,60 @@ ndn-cxx Documentation
|
||||
:maxdepth: 1
|
||||
|
||||
code-style
|
||||
RELEASE_NOTES
|
||||
release-notes
|
||||
releases
|
||||
|
||||
**ndn-cxx** is a C++17 library implementing Named Data Networking (NDN) primitives
|
||||
that can be used to write various NDN applications. The library is currently being
|
||||
used by the following projects:
|
||||
|
||||
* `NFD - NDN Forwarding Daemon <https://github.com/named-data/NFD>`_
|
||||
* `NLSR - Named-data Link-State Routing protocol <https://github.com/named-data/NLSR>`_
|
||||
* `ndn-tools - Essential NDN command-line tools <https://github.com/named-data/ndn-tools>`_
|
||||
* `ndn-svs - State Vector Sync library <https://github.com/named-data/ndn-svs>`_
|
||||
* `PSync - Partial and full Sync library <https://github.com/named-data/PSync>`_
|
||||
* `ChronoSync - Sync library for distributed real-time applications (deprecated) <https://github.com/named-data/ChronoSync>`_
|
||||
* `NAC - Name-based Access Control library <https://github.com/named-data/name-based-access-control>`_
|
||||
* `NDNCERT - NDN certificate management protocol <https://github.com/named-data/ndncert>`_
|
||||
* `repo-ng - NDN repository implementation in C++ (deprecated) <https://github.com/named-data/repo-ng>`_
|
||||
* `ndn-traffic-generator - Simple NDN traffic generator <https://github.com/named-data/ndn-traffic-generator>`_
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
- :doc:`INSTALL`
|
||||
|
||||
- :doc:`examples`
|
||||
|
||||
- :doc:`tutorials`
|
||||
|
||||
+ `NDN Software Contributor's Guide <https://github.com/named-data/NFD/blob/master/CONTRIBUTING.md>`_ (guide for newcomers to the NDN community of software generally)
|
||||
|
||||
+ :doc:`tutorials/utils-ndn-regex`
|
||||
+ :doc:`tutorials/security-validator-config`
|
||||
|
||||
- :doc:`manpages`
|
||||
- :doc:`release-notes`
|
||||
- :doc:`releases`
|
||||
|
||||
For developers
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- `NDN Software Contributor's Guide <https://github.com/named-data/.github/blob/main/CONTRIBUTING.md>`__
|
||||
(guide for newcomers to the NDN community of software)
|
||||
|
||||
- :doc:`specs`
|
||||
|
||||
+ :doc:`specs/signed-interest`
|
||||
+ :doc:`specs/certificate-format`
|
||||
+ :doc:`specs/safe-bag`
|
||||
+ :doc:`specs/validation-error-code`
|
||||
|
||||
- :doc:`manpages`
|
||||
|
||||
**Additional documentation**
|
||||
|
||||
- `API documentation (doxygen) <doxygen/annotated.html>`_
|
||||
+ :doc:`specs/signed-interest`
|
||||
|
||||
- `API documentation (doxygen) <doxygen/annotated.html>`__
|
||||
- :doc:`code-style`
|
||||
|
||||
- :doc:`RELEASE_NOTES`
|
||||
Issues
|
||||
------
|
||||
|
||||
- :doc:`releases`
|
||||
Please submit any bug reports or feature requests to the
|
||||
`ndn-cxx issue tracker <https://redmine.named-data.net/projects/ndn-cxx/issues>`__.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
ndn-cxx is an open source project licensed under the LGPL version 3. For more information about
|
||||
the license, refer to `COPYING.md <https://github.com/named-data/ndn-cxx/blob/master/COPYING.md>`_.
|
||||
the license, refer to `COPYING.md <https://github.com/named-data/ndn-cxx/blob/master/COPYING.md>`__.
|
||||
+8
-18
@@ -1,20 +1,10 @@
|
||||
Manpages
|
||||
========
|
||||
Man pages
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
ndn-client.conf <manpages/ndn-client.conf>
|
||||
ndn-cxx logging <manpages/ndn-log>
|
||||
manpages/ndnsec
|
||||
ndnsec-list <manpages/ndnsec-list>
|
||||
ndnsec-get-default <manpages/ndnsec-get-default>
|
||||
ndnsec-set-default <manpages/ndnsec-set-default>
|
||||
ndnsec-key-gen <manpages/ndnsec-key-gen>
|
||||
ndnsec-sign-req <manpages/ndnsec-sign-req>
|
||||
ndnsec-cert-gen <manpages/ndnsec-cert-gen>
|
||||
ndnsec-cert-install <manpages/ndnsec-cert-install>
|
||||
ndnsec-cert-dump <manpages/ndnsec-cert-dump>
|
||||
ndnsec-delete <manpages/ndnsec-delete>
|
||||
ndnsec-export <manpages/ndnsec-export>
|
||||
ndnsec-import <manpages/ndnsec-import>
|
||||
ndnsec-unlock-tpm <manpages/ndnsec-unlock-tpm>
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
:maxdepth: 1
|
||||
|
||||
ndn-client.conf <manpages/ndn-client.conf>
|
||||
ndn-log: ndn-cxx logging <manpages/ndn-log>
|
||||
manpages/ndnsec*
|
||||
@@ -1,28 +1,33 @@
|
||||
client.conf
|
||||
===========
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
System configuration of NDN platform is specified in ``client.conf``.
|
||||
|
||||
The configuration file ``client.conf`` is looked up in several directories in the following order:
|
||||
|
||||
- ``$HOME/.ndn``: user-specific settings
|
||||
- ``@SYSCONFDIR@/ndn`` (``/usr/local/etc/ndn``, ``/opt/local/etc/ndn``, or other, depending how the
|
||||
library is configured): system-wide settings
|
||||
- ``SYSCONFDIR/ndn``: system-wide settings (where ``SYSCONFDIR`` can be ``/usr/local/etc``,
|
||||
``/opt/local/etc``, or other, depending on how the library is configured)
|
||||
- ``/etc/ndn``: default system-wide settings
|
||||
|
||||
Here is an example of ``client.conf`` for current ndn-cxx package:
|
||||
Here is an example of ``client.conf`` for the current ndn-cxx package:
|
||||
|
||||
.. literalinclude:: ../../client.conf.sample
|
||||
:language: ini
|
||||
|
||||
|
||||
NFD
|
||||
---
|
||||
Forwarder
|
||||
---------
|
||||
|
||||
transport
|
||||
FaceUri for default connection toward local NDN forwarder. Only ``unix`` and ``tcp4`` FaceUris
|
||||
can be specified here.
|
||||
FaceUri for default connection toward local NDN forwarder. Only ``unix``, ``tcp``, ``tcp4``, and
|
||||
``tcp6`` FaceUris can be specified here.
|
||||
|
||||
By default, ``unix:///var/run/nfd.sock`` is used.
|
||||
By default, ``unix:///run/nfd.sock`` is used on Linux and ``unix:///var/run/nfd.sock`` is used on
|
||||
other platforms.
|
||||
|
||||
.. note::
|
||||
This value can be overridden using the ``NDN_CLIENT_TRANSPORT`` environment variable.
|
||||
@@ -36,17 +41,17 @@ pib
|
||||
|
||||
pib=[scheme]:[location]
|
||||
|
||||
Possible values for ``[scheme]``:
|
||||
Possible values for ``[scheme]`` are:
|
||||
|
||||
* ``pib-sqlite3``: local PIB implementation with SQLite3 storage engine
|
||||
* ``pib-sqlite3``: local PIB implementation using the SQLite3 storage engine.
|
||||
|
||||
Possible values for ``[location]``:
|
||||
|
||||
* absolute path where SQLite3 database will be stored
|
||||
* relative path (relative to ``config.conf``)
|
||||
* empty: default path ``$HOME/.ndn`` will be used
|
||||
* absolute path where the SQLite3 database will be stored
|
||||
* relative path (relative to ``client.conf``)
|
||||
* empty: the default path ``$HOME/.ndn`` will be used
|
||||
|
||||
When ``[location]`` is empty, trailing ``:`` can be omitted. For example::
|
||||
When ``[location]`` is empty, the trailing ``:`` can be omitted. For example::
|
||||
|
||||
pib=pib-sqlite3
|
||||
|
||||
@@ -68,12 +73,12 @@ tpm
|
||||
|
||||
tpm=[scheme]:[location]
|
||||
|
||||
Possible values for ``[scheme]``:
|
||||
Possible values for ``[scheme]`` are:
|
||||
|
||||
* ``tpm-osx-keychain`` (default on macOS): secure storage of private keys in the macOS
|
||||
* ``tpm-osxkeychain`` (default on macOS): secure storage of private keys in the macOS
|
||||
Keychain with OS-provided access restrictions.
|
||||
|
||||
``[location]`` parameter is ignored.
|
||||
The ``[location]`` parameter is ignored.
|
||||
|
||||
May not work for daemon applications, as user interaction may be required to access the
|
||||
macOS Keychain.
|
||||
@@ -84,10 +89,10 @@ tpm
|
||||
|
||||
* absolute path to directory that will store private/public key files (unencrypted with
|
||||
``0700`` permission)
|
||||
* relative path (relative to ``config.conf``)
|
||||
* empty: default path ``$HOME/.ndn/ndnsec-tpm-file`` will be used
|
||||
* relative path (relative to ``client.conf``)
|
||||
* empty: the default path ``$HOME/.ndn/ndnsec-tpm-file`` will be used
|
||||
|
||||
When ``[location]`` is empty, trailing ``:`` can be omitted. For example::
|
||||
When ``[location]`` is empty, the trailing ``:`` can be omitted. For example::
|
||||
|
||||
tpm=tpm-file
|
||||
|
||||
|
||||
+43
-23
@@ -1,5 +1,8 @@
|
||||
ndn-log
|
||||
=======
|
||||
ndn-cxx logging
|
||||
===============
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The ndn-cxx logging facility exposes the internal state of NDN libraries and
|
||||
applications so the user can investigate internal interactions, such as interest
|
||||
@@ -8,8 +11,8 @@ sync and recovery Interest processing inside ChronoSync, etc. During runtime, th
|
||||
user is able to specify the types of messages he or she would like to receive from
|
||||
a set of logging modules pre-configured by library and application developers.
|
||||
|
||||
Environment Variable
|
||||
--------------------
|
||||
Environment
|
||||
-----------
|
||||
|
||||
One way to control ndn-cxx logging facility is through the environment variable
|
||||
``NDN_LOG``. Using this variable, one can set the log levels for the available logging
|
||||
@@ -18,6 +21,11 @@ distinguishing prefixes (``ndn.``, ``sync.``, etc.), which can be specified when
|
||||
setting the environment variable. Wildcards can be used to enable logging for all
|
||||
modules (just ``*``) or all modules under a selected prefix (e.g., ``ndn.*``).
|
||||
|
||||
If an additional environment variable ``NDN_LOG_NOFLUSH`` is set, the automatic flushing
|
||||
after each log record will be disabled. This can improve logging performance but may
|
||||
cause the log records to appear delayed or, in case of application crash, the last
|
||||
few log records may be lost.
|
||||
|
||||
ndn-cxx logging facility provides a mechanism to manage the type of log messages
|
||||
that are written by classifying log messages by severity levels. Listed below
|
||||
are the available log levels.
|
||||
@@ -41,11 +49,13 @@ written.
|
||||
Setting NDN_LOG requires the following syntax with as many prefixes and
|
||||
corresponding loglevels as the user desires:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export NDN_LOG="<prefix1>=<loglevel1>:<prefix2>=<loglevel2>"
|
||||
|
||||
**Examples:**
|
||||
*Example:*
|
||||
|
||||
::
|
||||
.. code-block:: sh
|
||||
|
||||
export NDN_LOG="ndn.*=DEBUG"
|
||||
export NDN_LOG="ndn.UnixTransport=INFO"
|
||||
@@ -54,30 +64,40 @@ corresponding loglevels as the user desires:
|
||||
|
||||
**Note:**
|
||||
|
||||
Shorter (general) prefixes should be placed before longer (specific) prefixes.
|
||||
Otherwise, the specific prefix's loglevel will be overwritten. For example,
|
||||
`export NDN_LOG="ndn.UnixTransport=TRACE:ndn.*=ERROR:*=INFO"` sets all modules
|
||||
to INFO; it should be written as
|
||||
`export NDN_LOG="*=INFO:ndn.*=ERROR:ndn.UnixTransport=TRACE"` for the desired effect.
|
||||
The loglevel assignments in ``NDN_LOG`` are processed left-to-right. Thus, shorter
|
||||
(more general) prefixes should be listed before longer (more specific) prefixes.
|
||||
Otherwise, the loglevel setting of a more specific prefix may be overwritten by a
|
||||
more general assignment appearing later in the string. For example:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export NDN_LOG="ndn.UnixTransport=TRACE:ndn.*=ERROR:*=INFO"
|
||||
|
||||
will set all modules to INFO. To obtain the desired effect, it should instead be
|
||||
written as:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export NDN_LOG="*=INFO:ndn.*=ERROR:ndn.UnixTransport=TRACE"
|
||||
|
||||
**Note:**
|
||||
|
||||
Setting the environment variable with sudo requires the application to be run
|
||||
in the same command.
|
||||
|
||||
::
|
||||
.. code-block:: sh
|
||||
|
||||
Correct:
|
||||
# Correct
|
||||
sudo env NDN_LOG=logLevel ./ndn-application
|
||||
|
||||
sudo env NDN_LOG=logLevel ./ndn-application
|
||||
# Also correct
|
||||
sudo -s
|
||||
export NDN_LOG=logLevel
|
||||
./ndn-application
|
||||
|
||||
sudo -s
|
||||
export NDN_LOG=logLevel
|
||||
./ndn-application
|
||||
# Incorrect
|
||||
sudo export NDN_LOG=logLevel
|
||||
sudo ./ndn-application
|
||||
|
||||
Incorrect:
|
||||
|
||||
sudo export NDN_LOG=logLevel
|
||||
sudo ./ndn-application
|
||||
|
||||
NDN_LOG=logLevel sudo ./ndn-application
|
||||
# Incorrect
|
||||
NDN_LOG=logLevel sudo ./ndn-application
|
||||
@@ -11,7 +11,7 @@ Description
|
||||
-----------
|
||||
|
||||
:program:`ndnsec-cert-dump` reads a certificate from the **Public Info Base (PIB)**
|
||||
or from a file, and prints it on the standard output.
|
||||
or from a file, and prints it on the standard output in Base64 encoding.
|
||||
|
||||
By default, *name* is interpreted as a certificate name.
|
||||
|
||||
@@ -44,22 +44,21 @@ Dump a certificate from PIB to standard output::
|
||||
|
||||
$ ndnsec-cert-dump /ndn/test/david/KEY/ksk-1396913058196/ID-CERT/%00%00%01E%3E%9D%A0%DE
|
||||
|
||||
Dump a certificate in human-readable format::
|
||||
Print the NDN testbed root certificate in human-readable format::
|
||||
|
||||
$ ndnsec-cert-dump -p /ndn/test/david/KEY/ksk-1396913058196/ID-CERT/%00%00%01E%3E%9D%A0%DE
|
||||
Certificate name:
|
||||
/ndn/test/david/KEY/ksk-1396913058196/ID-CERT/%00%00%01E%3E%9D%A0%DE
|
||||
$ curl -A ndnsec -fsLS https://named-data.net/ndnsec/ndn-testbed-root.ndncert.x3.base64 | ndnsec-cert-dump -fp -
|
||||
Certificate Name:
|
||||
/ndn/KEY/%EC%F1L%8EQ%23%15%E0/ndn/%FD%00%00%01u%E6%7F2%10
|
||||
Additional Description:
|
||||
fullname: NDN Testbed Root X3
|
||||
Public Key:
|
||||
Key Type: 256-bit EC
|
||||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGx+3Y4FvYo1eScIvgD74lQhQdzN4
|
||||
zq021dop8t7kGfEpfGdKf2HGpnn4/qoF9iJ1yUZE/7Na8zzO4xT6RpIM0Q==
|
||||
Validity:
|
||||
NotBefore: 20140401T000000
|
||||
NotAfter: 20150331T235959
|
||||
Subject Description:
|
||||
2.5.4.41: David
|
||||
2.5.4.10: Some Organization
|
||||
Public key bits:
|
||||
MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAtLq50tpynJ15zExEh9l6
|
||||
jvh/HOmwhOppr/hTEPYUn2VTh21+JJIg5pHAAH/DQr8Bq5BGrdDUCIShxSxbaHwu
|
||||
a1y4XgKP1MYBQP/WzcIhIzB/3PBDdmE0jM3Qg6yuk8BOwett3C07GtwW9dfgacwt
|
||||
aC29xIHnYKfryH/gBSIDUIb38M7ILIDgQeIiQcHGHoFO8CbDtKY2OvVkFNgxowAR
|
||||
Xn+gtkIfMdE77Z8p0S21pYfdvPuIpVVLy7lnFdwGzyCi3nmbtd/r9NSTepBczWQz
|
||||
zBbThT7yfeNyHWLu0PZPdz84UpNPsBad3Bx9tT31noIVnt8yyBEfEU1jyEIVkm8U
|
||||
VQIB
|
||||
Not Before: 2020-11-20T16:31:37
|
||||
Not After: 2024-12-31T23:59:59
|
||||
Signature Information:
|
||||
Signature Type: SignatureSha256WithEcdsa
|
||||
Key Locator: Name=/ndn/KEY/%EC%F1L%8EQ%23%15%E0
|
||||
Self-Signed: yes
|
||||
@@ -37,9 +37,14 @@ Options
|
||||
|
||||
.. option:: -I <info>, --info <info>
|
||||
|
||||
Other information to be included in the issued certificate. For example::
|
||||
Other information to be included in the issued certificate. Must be in the
|
||||
form of key and value pairs, where the key is an arbitrary string without
|
||||
spaces, followed by one or more spaces, followed by an arbitrary string
|
||||
representing the value. This option may be repeated multiple times.
|
||||
|
||||
-I "affiliation Some Organization" -I "homepage http://home.page/"
|
||||
For example::
|
||||
|
||||
-I "affiliation Some Organization" -I "homepage https://home.page/"
|
||||
|
||||
.. option:: -s <signer>, --sign-id <signer>
|
||||
|
||||
@@ -57,21 +62,31 @@ Example
|
||||
|
||||
::
|
||||
|
||||
$ ndnsec-cert-gen -S 20140401000000 -E 20150331235959 -N "David"
|
||||
-I "2.5.4.10 'Some Organization'" -s /ndn/test request.cert
|
||||
Bv0C9wc9CANuZG4IBHRlc3QIA0tFWQgFZGF2aWQIEWtzay0xMzk2OTEzMDU4MTk2
|
||||
CAdJRC1DRVJUCAgAAAFFPp2g3hQDGAECFf0BdjCCAXIwIhgPMjAxNDA0MDEwMDAw
|
||||
MDBaGA8yMDE1MDMzMTIzNTk1OVowKDAMBgNVBCkTBURhdmlkMBgGA1UEChMRU29t
|
||||
ZSBPcmdhbml6YXRpb24wggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAwggEIAoIBAQC0
|
||||
urnS2nKcnXnMTESH2XqO+H8c6bCE6mmv+FMQ9hSfZVOHbX4kkiDmkcAAf8NCvwGr
|
||||
kEat0NQIhKHFLFtofC5rXLheAo/UxgFA/9bNwiEjMH/c8EN2YTSMzdCDrK6TwE7B
|
||||
623cLTsa3Bb11+BpzC1oLb3Egedgp+vIf+AFIgNQhvfwzsgsgOBB4iJBwcYegU7w
|
||||
JsO0pjY69WQU2DGjABFef6C2Qh8x0TvtnynRLbWlh928+4ilVUvLuWcV3AbPIKLe
|
||||
eZu13+v01JN6kFzNZDPMFtOFPvJ943IdYu7Q9k93PzhSk0+wFp3cHH21PfWeghWe
|
||||
3zLIER8RTWPIQhWSbxRVAgERFjMbAQEcLgcsCANuZG4IA0tFWQgEdGVzdAgRa3Nr
|
||||
LTEzOTQxMjk2OTQ3ODgIB0lELUNFUlQX/QEABUGcl7U+F8cwMHKckerv+1H2Nvsd
|
||||
OfeqX0+4RzWU+wRx2emMGMZZdHSx8M/i45hb0P5hbNEF99L35/SrSTSzhTZdOriD
|
||||
t/LQOcKBoNXY+iw3EUFM0gvRGU0kaEVBKAHtbYhtoHc48QLEyrsVaMqmrjCmpeF/
|
||||
JOcClhzJfFW3cZ/SlhcTEayF0ntogYLR2cMzIwQhhSj5L/Kl7I7uxNxZhK1DS98n
|
||||
q8oGAxHufEAluPrRpDQfI+jeQ4h/YYKcXPW3Vn7VQAGOqIi6gTlUxrmEbyCDF70E
|
||||
xj5t3wfSUmDa1N+hLRMdEAI+IjRRHDSx2Lhj/QcoPIZPWwKjBz9CBL92og==
|
||||
$ ndnsec-cert-gen -S 20200501000000 -E 20210101000000 -I "affiliation Some Organization" -I "foobar Foo Bar" -i "Universe" -s /ndn/test request.cert > signed.cert
|
||||
|
||||
$ cat signed.cert
|
||||
Bv0BcgctCAdleGFtcGxlCANLRVkICOQUmX8oloLrCAhVbml2ZXJzZQgJ/QAAAXHR
|
||||
Ak6CFAkYAQIZBAA27oAVWzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDpJsCkv
|
||||
E5RMjxRVdyK6W6z+FoCq+qREEn/sxf+n2gnsl25qm1NarCfSGf96zIJy9BRA9btu
|
||||
MMeuWlAN/ymvMFwWkBsBAxwcBxoIA25kbggEdGVzdAgDS0VZCAhJP1OaKLualf0A
|
||||
/Sb9AP4PMjAyMDA1MDFUMDAwMDAw/QD/DzIwMjEwMTAxVDAwMDAwMP0BAkH9AgAk
|
||||
/QIBC2FmZmlsaWF0aW9u/QICEVNvbWUgT3JnYW5pemF0aW9u/QIAFf0CAQZmb29i
|
||||
YXL9AgIHRm9vIEJhchdHMEUCIQDPT9Hq1kvkE0r9W1aYSBVTnHlTEzgtz+v1DwkC
|
||||
ug/vLAIgY3xJITCwf55sqey33q5GIQSk1TRCkNNl58ojvPs5sNU=
|
||||
|
||||
$ ndnsec-cert-dump -p -f signed.cert
|
||||
Certificate Name:
|
||||
/example/KEY/%E4%14%99%7F%28%96%82%EB/Universe/%FD%00%00%01q%D1%02N%82
|
||||
Additional Description:
|
||||
affiliation: Some Organization
|
||||
foobar: Foo Bar
|
||||
Public Key:
|
||||
Key Type: 256-bit EC
|
||||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEOkmwKS8TlEyPFFV3IrpbrP4WgKr6
|
||||
pEQSf+zF/6faCeyXbmqbU1qsJ9IZ/3rMgnL0FED1u24wx65aUA3/Ka8wXA==
|
||||
Validity:
|
||||
Not Before: 2020-05-01T00:00:00
|
||||
Not After: 2021-01-01T00:00:00
|
||||
Signature Information:
|
||||
Signature Type: SignatureSha256WithEcdsa
|
||||
Key Locator: Name=/ndn/test/KEY/I%3FS%9A%28%BB%9A%95
|
||||
@@ -14,8 +14,9 @@ Description
|
||||
will be set as the default certificate for the corresponding identity and
|
||||
the identity will be set as the user's default identity.
|
||||
|
||||
*file* can be a filesystem path or an HTTP URL of a file containing the certificate
|
||||
to install. If *file* is "-", the certificate will be read from the standard input.
|
||||
*file* is a path to a file that contains the certificate to install.
|
||||
If *file* is "-", the certificate will be read from the standard input.
|
||||
The certificate should be in Base64 encoding.
|
||||
|
||||
Options
|
||||
-------
|
||||
@@ -41,10 +42,6 @@ Install a certificate and set it as the default certificate::
|
||||
|
||||
$ ndnsec-cert-install cert_file.cert
|
||||
|
||||
Install a certificate via HTTP and set it as the default certificate::
|
||||
|
||||
$ ndnsec-install-cert "http://ndncert.domain.com/cert/get/my-certificate.ndncert"
|
||||
|
||||
Install a certificate but do not change any default settings::
|
||||
|
||||
$ ndnsec-cert-install -N cert_file.cert
|
||||
@@ -4,18 +4,32 @@ ndnsec-export
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
**ndnsec-export** [**-h**] [**-o** *file*] [**-P** *passphrase*] *identity*
|
||||
**ndnsec-export** [**-h**] [**-o** *file*] [**-P** *passphrase*]
|
||||
[**-i**\|\ **-k**\|\ **-c**] *name*
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
:program:`ndnsec-export` exports the default certificate of *identity* and its
|
||||
private key to a file. It will ask for a passphrase to encrypt the private key.
|
||||
:program:`ndnsec-export` exports a certificate from the **Public Info Base (PIB)** and
|
||||
its private key to a file. It will ask for a passphrase to encrypt the private key.
|
||||
The resulting file can be imported again using :program:`ndnsec-import`.
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
.. option:: -i, --identity
|
||||
|
||||
Interpret *name* as an identity name. The default certificate of the identity will be exported.
|
||||
This is the default unless **-k** or **-c** is specified.
|
||||
|
||||
.. option:: -k, --key
|
||||
|
||||
Interpret *name* as a key name. The default certificate of the key will be exported.
|
||||
|
||||
.. option:: -c, --cert
|
||||
|
||||
Interpret *name* as a certificate name.
|
||||
|
||||
.. option:: -o <file>, --output <file>
|
||||
|
||||
Write to the specified output file instead of the standard output.
|
||||
@@ -34,6 +48,6 @@ Export an identity's default certificate and private key into a file::
|
||||
|
||||
$ ndnsec-export -o alice.ndnkey /ndn/test/alice
|
||||
|
||||
Export an identity's default certificate and private key to the standard output::
|
||||
Export a specific certificate and its private key to the standard output::
|
||||
|
||||
$ ndnsec-export /ndn/test/alice
|
||||
$ ndnsec-export -c /ndn/edu/ucla/alice/KEY/1%5D%A7g%90%B2%CF%AA/self/%FD%00%00%01r-%D3%DC%2A
|
||||
@@ -4,7 +4,8 @@ ndnsec-key-gen
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
**ndnsec-key-gen** [**-h**] [**-n**] [**-t** *type*] [**-k** *keyidtype*] *identity*
|
||||
**ndnsec-key-gen** [**-h**] [**-n**] [**-t** *type*]
|
||||
[**-k** *keyidtype*\|\ **--keyid** *keyid*] *identity*
|
||||
|
||||
Description
|
||||
-----------
|
||||
@@ -28,12 +29,16 @@ Options
|
||||
|
||||
.. option:: -t <type>, --type <type>
|
||||
|
||||
Type of key to generate. "r" for RSA (default), "e" for ECDSA.
|
||||
Type of key to generate. "r" for RSA, "e" for ECDSA (the default).
|
||||
|
||||
.. option:: -k <keyidtype>, --keyid-type <keyidtype>
|
||||
|
||||
Type of KeyId for the generated key. "r" for 64-bit random number (default),
|
||||
"h" for SHA256 of the public key.
|
||||
Type of KeyId for the generated key. "r" for a 64-bit random number (the default
|
||||
unless **--keyid** is specified), "h" for the SHA-256 of the public key.
|
||||
|
||||
.. option:: --keyid <keyid>
|
||||
|
||||
User-specified KeyId. Must be a non-empty generic name component.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
+14
-25
@@ -21,51 +21,40 @@ provides a command-line interface for managing and using the NDN security data.
|
||||
Commands
|
||||
--------
|
||||
|
||||
list_
|
||||
The following commands are understood:
|
||||
|
||||
:doc:`list <ndnsec-list>`
|
||||
List all known identities/keys/certificates.
|
||||
|
||||
get-default_
|
||||
:doc:`get-default <ndnsec-get-default>`
|
||||
Show the default identity/key/certificate.
|
||||
|
||||
set-default_
|
||||
:doc:`set-default <ndnsec-set-default>`
|
||||
Change the default identity/key/certificate.
|
||||
|
||||
delete_
|
||||
:doc:`delete <ndnsec-delete>`
|
||||
Delete an identity/key/certificate.
|
||||
|
||||
key-gen_
|
||||
:doc:`key-gen <ndnsec-key-gen>`
|
||||
Generate a key for an identity.
|
||||
|
||||
sign-req_
|
||||
:doc:`sign-req <ndnsec-sign-req>`
|
||||
Generate a certificate signing request.
|
||||
|
||||
cert-gen_
|
||||
:doc:`cert-gen <ndnsec-cert-gen>`
|
||||
Create a certificate for an identity.
|
||||
|
||||
cert-dump_
|
||||
:doc:`cert-dump <ndnsec-cert-dump>`
|
||||
Export a certificate.
|
||||
|
||||
cert-install_
|
||||
:doc:`cert-install <ndnsec-cert-install>`
|
||||
Import a certificate from a file.
|
||||
|
||||
export_
|
||||
:doc:`export <ndnsec-export>`
|
||||
Export an identity as a SafeBag.
|
||||
|
||||
import_
|
||||
:doc:`import <ndnsec-import>`
|
||||
Import an identity from a SafeBag.
|
||||
|
||||
unlock-tpm_
|
||||
:doc:`unlock-tpm <ndnsec-unlock-tpm>`
|
||||
Unlock the TPM.
|
||||
|
||||
.. _list: ndnsec-list.html
|
||||
.. _get-default: ndnsec-get-default.html
|
||||
.. _set-default: ndnsec-set-default.html
|
||||
.. _delete: ndnsec-delete.html
|
||||
.. _key-gen: ndnsec-key-gen.html
|
||||
.. _sign-req: ndnsec-sign-req.html
|
||||
.. _cert-gen: ndnsec-cert-gen.html
|
||||
.. _cert-dump: ndnsec-cert-dump.html
|
||||
.. _cert-install: ndnsec-cert-install.html
|
||||
.. _export: ndnsec-export.html
|
||||
.. _import: ndnsec-import.html
|
||||
.. _unlock-tpm: ndnsec-unlock-tpm.html
|
||||
@@ -1,86 +1,45 @@
|
||||
{#
|
||||
named_data_theme/layout.html
|
||||
~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#}
|
||||
{% extends "basic/layout.html" %}
|
||||
{%- extends "agogo/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 class="row">
|
||||
<div class="three columns">
|
||||
<p class="logo"><a href="https://named-data.net" title="A Future Internet Architecture">
|
||||
<img class="logo" src="{{ pathto('_static/ndn-logo.svg', 1)|e }}" alt="Logo" width="210"/>
|
||||
</a></p>
|
||||
</div>
|
||||
</div><!--header container end-->
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content-wrapper">
|
||||
<div class="content">
|
||||
<div class="document">
|
||||
{%- block document %}
|
||||
{{ super() }}
|
||||
{%- endblock %}
|
||||
<div id="menu_container" class="nine columns">
|
||||
<h1><a href="{{ pathto(master_doc)|e }}">{{ shorttitle|e }}</a></h1>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
{%- block sidebartoc %}
|
||||
<h3>{{ _('Table Of Contents') }}</h3>
|
||||
{{ toctree(includehidden=True) }}
|
||||
|
||||
<h3>{{ _('Developer documentation') }}</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="doxygen/annotated.html">API documentation (doxygen)</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="code-style.html">ndn-cxx Code Style and Coding Guidelines</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 sidebartoc %}
|
||||
<h3>{{ _('Table of Contents') }}</h3>
|
||||
{{ toctree(includehidden=True) }}
|
||||
<h3>{{ _('Developer Documentation') }}</h3>
|
||||
<ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="doxygen/annotated.html">API Documentation (doxygen)</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="code-style.html">ndn-cxx Code Style and Coding Guidelines</a></li>
|
||||
</ul>
|
||||
{%- 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 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/>
|
||||
Licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/" target="_blank">Creative Commons Attribution 3.0 Unported License</a> except where noted.
|
||||
</div>
|
||||
</div>
|
||||
</div><!--footer info end-->
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block relbar1 %}{% endblock %}
|
||||
{% block relbar2 %}{% endblock %}
|
||||
@@ -26,13 +26,13 @@ $mathjax
|
||||
<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>
|
||||
<a href="https://named-data.net" title="A Future Internet Architecture"><img src="https://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/ndn-cxx/$projectnumber/">$projectname $projectnumber documentation</a></h1>
|
||||
<h1><a href="https://docs.named-data.net/ndn-cxx/$projectnumber/">$projectname $projectnumber documentation</a></h1>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--header container end-->
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
+26
-3
@@ -123,10 +123,10 @@ 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, blockquote p { line-height: 1.5; color: #6f6f6f; }
|
||||
|
||||
blockquote { margin: 0 0 17px; padding: 9px 20px 0 19px; }
|
||||
blockquote cite { display: block; font-size: 13pt; color: #555555; }
|
||||
blockquote { margin: 0 0 17px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; }
|
||||
blockquote cite { display: block; font-size: 13px; color: #555555; }
|
||||
blockquote cite:before { content: "\2014 \0020"; }
|
||||
blockquote cite a, blockquote cite a:visited { color: #555555; }
|
||||
|
||||
@@ -786,3 +786,26 @@ ul.link-list li a { display: block; }
|
||||
.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%; }
|
||||
|
||||
@media only screen and (max-device-width: 800px), only screen and (device-width: 1024px) and (device-height: 600px), only screen and (width: 1280px) and (orientation: landscape), only screen and (device-width: 800px), only screen and (max-width: 767px) { .flex-video { padding-top: 0; } }
|
||||
|
||||
/* Microformats ---------------------- */
|
||||
ul.vcard { display: inline-block; margin: 0 0 12px 0; border: 1px solid #ddd; padding: 10px; }
|
||||
ul.vcard li { margin: 0; display: block; }
|
||||
ul.vcard li.fn { font-weight: bold; font-size: 15px; font-size: 1.5rem; }
|
||||
|
||||
p.vevent span.summary { font-weight: bold; }
|
||||
p.vevent abbr { cursor: default; text-decoration: none; font-weight: bold; border: none; padding: 0 1px; }
|
||||
|
||||
/* Progress Bar ---------------------- */
|
||||
div.progress { padding: 2px; margin-bottom: 10px; border: 1px solid #cccccc; height: 25px; /* meter */ /* border radii */ }
|
||||
div.progress .meter { background: #fd7800; height: 100%; display: block; width: 50%; }
|
||||
div.progress.secondary .meter { background: #e9e9e9; }
|
||||
div.progress.success .meter { background: #5da423; }
|
||||
div.progress.alert .meter { background: #c60f13; }
|
||||
div.progress.radius { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
|
||||
div.progress.radius .meter { -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; }
|
||||
div.progress.round { -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; }
|
||||
div.progress.round .meter { -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; }
|
||||
|
||||
ul li p { display: inline; }
|
||||
@@ -0,0 +1,75 @@
|
||||
@import "agogo.css";
|
||||
@import "foundation.css";
|
||||
@import "named_data_style.css";
|
||||
|
||||
body, h1, h2, h3, h4, p {
|
||||
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
||||
}
|
||||
|
||||
h1 { font-size: 26px; }
|
||||
h2 { font-size: 20px; }
|
||||
h3 { font-size: 17px; }
|
||||
h4 { font-size: 15px; }
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h2, h3, h4 {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border-left: none;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
blockquote p {
|
||||
color: #222;
|
||||
}
|
||||
|
||||
p.logo {
|
||||
float: left;
|
||||
margin: 1px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid #666;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
div.document p {
|
||||
margin: 0.5em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.document ol,
|
||||
div.document ul {
|
||||
margin: 0 0 0 2em;
|
||||
}
|
||||
|
||||
div.document pre {
|
||||
font-size: 13px;
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
div.document table p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.document th p {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.bodywrapper a,
|
||||
div.header a:hover,
|
||||
div.sidebar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -0,0 +1,713 @@
|
||||
/* General */
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
body {
|
||||
/* background: #ccc;
|
||||
font: normal 12px Verdana, sans-serif;
|
||||
color: #777;
|
||||
line-height:18px; */
|
||||
border-top: 4px solid #fd7800;
|
||||
}
|
||||
|
||||
a {
|
||||
/* color: #000;
|
||||
outline: 0; */
|
||||
}
|
||||
|
||||
a:link {
|
||||
text-decoration: none;
|
||||
}
|
||||
a:visited {
|
||||
text-decoration: none;
|
||||
}
|
||||
a:active,
|
||||
a:hover {
|
||||
/* color: #ccc; */
|
||||
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: normal; font-size: 14px; line-height: 14px; }
|
||||
h4 { font-weight: normal; font-size: 12px; line-height: 12px; }
|
||||
|
||||
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;
|
||||
line-height: 18px;
|
||||
margin-bottom: 18px;
|
||||
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,
|
||||
pre,
|
||||
hr {
|
||||
margin-bottom:10px;
|
||||
}
|
||||
ul ul,
|
||||
ol ol,
|
||||
ul ol,
|
||||
ol ul {
|
||||
margin-bottom:0;
|
||||
}
|
||||
pre,
|
||||
kbd,
|
||||
tt,
|
||||
var {
|
||||
font-size: 15px;
|
||||
line-height: 21px;
|
||||
}
|
||||
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-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; }
|
||||
}
|
||||
|
||||
|
||||
/*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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 152.13 43.86"><defs><style>.cls-1{fill:#dc9610;}.cls-2{fill:#fff;}.cls-3{fill:#bf4818;}</style></defs><rect class="cls-1" width="87.68" height="22.95" rx="5"/><rect class="cls-1" x="89.93" width="62.2" height="22.95" rx="5"/><path class="cls-2" d="M94.88,4.14h5.28c3.16,0,4.82.55,6.22,2.11a8.1,8.1,0,0,1,1.92,5.47,8.41,8.41,0,0,1-2,5.71c-1.35,1.42-3.08,2-6,2h-5.4Zm5.87,12.37A3.29,3.29,0,0,0,104,15a6.14,6.14,0,0,0,.77-3.24A5.94,5.94,0,0,0,104,8.62a3.09,3.09,0,0,0-3-1.54H98.39v9.43Z" transform="translate(-0.18)"/><path class="cls-2" d="M113.7,16.37l-1,3.08h-3.81l5.45-15.31h4.37l5,15.31h-4l-.84-3.08Zm2.76-8.81-1.89,6h3.53Z" transform="translate(-0.18)"/><path class="cls-2" d="M131,19.45h-3.5V7.08h-4.73V4.14h13V7.08H131Z" transform="translate(-0.18)"/><path class="cls-2" d="M139.37,16.37l-1,3.08h-3.81L140,4.14h4.37l4.95,15.31h-4l-.84-3.08Zm2.76-8.81-1.89,6h3.53Z" transform="translate(-0.18)"/><path class="cls-3" d="M10.82,43.52,6.4,35.69l-1.61-3c0,.8,0,1.38,0,1.83,0,.83,0,1.72,0,2.69v6.29H1.66V28.21H5.3l4.3,7.62c.61,1.15,1,2,1.59,3.1,0-.62,0-1,0-1.49l0-1.15V28.21h3.2V43.52Z" transform="translate(-0.18)"/><path class="cls-3" d="M29.23,31.15H21.12v3H28.2v2.71H21.12v3.74h8.25v2.94H17.61V28.21H29.23Z" transform="translate(-0.18)"/><path class="cls-3" d="M39,43.52H35.53V31.15H30.81V28.21H43.75v2.94H39Z" transform="translate(-0.18)"/><path class="cls-3" d="M49,43.52l-4.2-15.31h3.48L50,35.07c.3,1.29.47,2,.86,3.81.26-1.74.42-2.66.66-3.81L53,28.21h3.36l1.45,7c.31,1.51.47,2.34.68,3.69.14-.66.4-1.9.79-3.69l1.73-7h3.48L60.11,43.52H56.84l-1.43-6.38c-.35-1.59-.67-3.24-.77-4-.3,1.65-.49,2.64-.79,4l-1.47,6.38Z" transform="translate(-0.18)"/><path class="cls-3" d="M80.76,36c0,4.66-3.15,7.87-7.71,7.87s-7.73-3.21-7.73-8a7.92,7.92,0,0,1,2.4-6A7.73,7.73,0,0,1,73,27.87C77.72,27.87,80.76,31.06,80.76,36ZM69,35.85C69,39,70.5,41,73.05,41s4-1.91,4-5S75.6,30.78,73,30.78,69,32.68,69,35.85Z" transform="translate(-0.18)"/><path class="cls-3" d="M86.88,43.52H83.45V28.21h6.79c2,0,3.13.25,4.07.92a3.81,3.81,0,0,1,1.49,3.21A3.59,3.59,0,0,1,93.21,36c1.54.48,2.08,1.28,2.2,3.3l.11,2.18a3.24,3.24,0,0,0,.63,2H92.72c-.42-.32-.54-.55-.58-1.33L92,40.1c-.14-1.88-1-2.71-2.78-2.71H86.88Zm3.43-8.84c1.29,0,2-.64,2-1.77s-.7-1.76-2-1.76H86.88v3.53Z" transform="translate(-0.18)"/><path class="cls-3" d="M112.65,43.52h-4.21l-4.72-6.93L102.27,38v5.49H98.84V28.21h3.43v5.65l5.26-5.65h4.6l-6.07,6Z" transform="translate(-0.18)"/><path class="cls-3" d="M117.83,43.52h-3.5V28.21h3.5Z" transform="translate(-0.18)"/><path class="cls-3" d="M130.28,43.52l-4.41-7.83-1.61-3c0,.8,0,1.38,0,1.83,0,.83,0,1.72,0,2.69v6.29h-3.2V28.21h3.64l4.3,7.62c.61,1.15,1,2,1.59,3.1,0-.62,0-1,0-1.49l0-1.15V28.21h3.2V43.52Z" transform="translate(-0.18)"/><path class="cls-3" d="M151,35.05v8.47h-2.1l-.49-2c-1.08,1.65-2.41,2.29-4.67,2.29-4.42,0-7.13-3-7.13-7.89s3-8.1,7.57-8.1a6.48,6.48,0,0,1,6.71,5l-3.39.2a3.13,3.13,0,0,0-3.3-2.27c-2.52,0-4.08,1.88-4.08,5,0,3.3,1.51,5.28,4.06,5.28A3.71,3.71,0,0,0,148,37.87h-3.81V35.05Z" transform="translate(-0.18)"/><path class="cls-2" d="M14.72,19.45,10.3,11.62l-1.61-3c.05.8.05,1.38.05,1.84,0,.82,0,1.72,0,2.68v6.29H5.56V4.14H9.2l4.3,7.62c.61,1.15,1,2,1.59,3.1,0-.62,0-1,0-1.49l0-1.15V4.14h3.21V19.45Z" transform="translate(-0.18)"/><path class="cls-2" d="M24.82,16.37l-1,3.08H20L25.47,4.14h4.38L34.8,19.45h-4L30,16.37Zm2.76-8.81-1.89,6h3.52Z" transform="translate(-0.18)"/><path class="cls-2" d="M42.43,19.45,40.27,11.3c-.16-.69-.3-1.17-.39-1.49-.12-.48-.14-.57-.28-1,0,.55,0,.94,0,1.19l0,1.47v8H36.46V4.14H41.4l2,8c.31,1.19.57,2.46.75,3.47a4.72,4.72,0,0,0,.1-.49l.25-1c.05-.28.14-.62.24-1s.23-1,.23-1l2-8h4.89V19.45h-3.2v-8l0-1.47a11.79,11.79,0,0,1,.05-1.19c-.26.92-.42,1.54-.49,1.74-.14.42-.21.72-.24.74l-2.13,8.17Z" transform="translate(-0.18)"/><path class="cls-2" d="M66.81,7.08H58.7v3h7.08v2.71H58.7v3.74H67v2.94H55.19V4.14H66.81Z" transform="translate(-0.18)"/><path class="cls-2" d="M69.53,4.14h5.28c3.15,0,4.81.55,6.22,2.11a8.09,8.09,0,0,1,1.91,5.47,8.41,8.41,0,0,1-2,5.71c-1.36,1.42-3.09,2-6,2H69.53Zm5.86,12.37A3.29,3.29,0,0,0,78.59,15a6,6,0,0,0,.78-3.24,6,6,0,0,0-.75-3.16,3.11,3.11,0,0,0-3-1.54H73v9.43Z" transform="translate(-0.18)"/></svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
@@ -1,15 +1,12 @@
|
||||
[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"
|
||||
stylesheet = named_data.css
|
||||
|
||||
[options]
|
||||
|
||||
stickysidebar = true
|
||||
collapsiblesidebar = true
|
||||
pagewidth = 90%
|
||||
documentwidth = 70%
|
||||
sidebarwidth = 20%
|
||||
bgcolor = white
|
||||
headerbg = none
|
||||
footerbg = none
|
||||
textalign = left
|
||||
@@ -1 +0,0 @@
|
||||
release-notes/release-notes-0.6.6.rst
|
||||
@@ -0,0 +1,4 @@
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
.. include:: release-notes/release-notes-0.8.1.rst
|
||||
@@ -17,17 +17,17 @@ The current features include:
|
||||
- **Base**
|
||||
|
||||
+ Fully asynchronous, event-driven communication model, which is implemented using `Boost.Asio
|
||||
<http://www.boost.org/doc/libs/1_48_0/doc/html/boost_asio.html>`_
|
||||
<https://www.boost.org/doc/libs/1_48_0/doc/html/boost_asio.html>`_
|
||||
+ Single-threaded, but thread-safe Face operations
|
||||
|
||||
A single Face object can be safely used in multiple threads to express Interests and
|
||||
publish Data packets
|
||||
|
||||
+ Explicit time management for NDN operations using `Boost.Chrono
|
||||
<http://www.boost.org/doc/libs/1_48_0/doc/html/chrono.html>`_
|
||||
<https://www.boost.org/doc/libs/1_48_0/doc/html/chrono.html>`_
|
||||
+ Simplified and extended `NDN API <doxygen/annotated.html>`_
|
||||
+ Extensive set of unit-tests based on `Boost.Test framework
|
||||
<http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/index.html>`_
|
||||
<https://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/index.html>`_
|
||||
|
||||
- Continuous integration using an in-house installation of Jenkins build bots and the
|
||||
hosted `Travis CI <https://travis-ci.org/named-data/ndn-cxx>`_ continuous
|
||||
@@ -35,7 +35,7 @@ The current features include:
|
||||
|
||||
- **Wire format**
|
||||
|
||||
+ Full support of `NDN-TLV packet format v0.1 <http://named-data.net/doc/NDN-TLV/0.1/>`_
|
||||
+ Full support of `NDN-TLV packet format v0.1 <https://docs.named-data.net/NDN-packet-spec/0.1/>`__
|
||||
+ Pure C++ implementation of wire encoding/decoding with simple access to wire format
|
||||
of all NDN packet abstractions via ``wireEncode`` and ``wireDecode`` methods
|
||||
|
||||
|
||||
@@ -5,25 +5,26 @@ Release date: August 25, 2014
|
||||
|
||||
Changes since version 0.1.0:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- **Base**
|
||||
|
||||
+ The license under which the library is released is changed to **Lesser GNU Public
|
||||
License version 3.0**.
|
||||
+ The license under which the library is released is changed to the **GNU Lesser
|
||||
General Public License version 3.0**
|
||||
|
||||
+ New ways to use incoming Interest dispatching:
|
||||
|
||||
* New :ndn-cxx:`InterestFilter` abstraction that supports filtering based on name
|
||||
prefixes and regular expressions.
|
||||
|
||||
* Separated :ndn-cxx:`Face::registerPrefix()` and :ndn-cxx:`Face::setInterestFilter()`
|
||||
methods allow distinct operations of registering with the local NDN forwarder and setting
|
||||
* Separate ``Face::registerPrefix()`` and ``Face::setInterestFilter()`` methods
|
||||
allow distinct operations of registering with the local NDN forwarder and setting
|
||||
up application-specific ``OnInterest`` call dispatch using InterestFilters.
|
||||
|
||||
+ Add support for new `NDN naming conventions
|
||||
<http://named-data.net/doc/tech-memos/naming-conventions.pdf>`_ (:issue:`1761`)
|
||||
+ Add support for the `NDN naming conventions (revision 1)
|
||||
<https://named-data.net/publications/techreports/ndn-tr-22-ndn-memo-naming-conventions/>`_
|
||||
(:issue:`1761`)
|
||||
|
||||
- **Security**
|
||||
|
||||
@@ -36,27 +37,26 @@ New features:
|
||||
|
||||
+ New :ndn-cxx:`SignatureSha256WithEcdsa` signature type
|
||||
|
||||
+ Updates in :ndn-cxx:`Signature` data structure to reflect changes in `NDN-TLV spec
|
||||
0.1.1 <http://named-data.net/doc/NDN-TLV/0.1.1/>`_
|
||||
+ Updates in ``Signature`` data structure to reflect changes in the `NDN-TLV spec v0.1.1
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.1.1/>`__
|
||||
|
||||
- **Wire encoding**
|
||||
|
||||
+ :ndn-cxx:`Data::getFullName() <getFullName()>` method to get :ndn-cxx:`Data` packet
|
||||
name with implicit digest
|
||||
+ :ndn-cxx:`Data::getFullName` method to get the Data packet name including the implicit digest
|
||||
|
||||
+ New :ndn-cxx:`Name::getSuccessor()` method to get name successor (:issue:`1677`)
|
||||
+ :ndn-cxx:`Name::getSuccessor` method to get name successor (:issue:`1677`)
|
||||
|
||||
+ New in-wire refreshing of Interest's nonce (:issue:`1758`)
|
||||
|
||||
- **Management**
|
||||
|
||||
+ Support for :ndn-cxx:`ChannelStatus`, :ndn-cxx:`StrategyChoice` datasets
|
||||
+ Support for :ndn-cxx:`ChannelStatus` and :ndn-cxx:`StrategyChoice` datasets
|
||||
|
||||
+ Defining new common Route Origins for NFD RIB management protocol (:issue:`1719`)
|
||||
|
||||
+ New RibEntry and Route data structures for RIB management protocol (:issue:`1764`)
|
||||
+ New ``RibEntry`` and ``Route`` data structures for RIB management protocol (:issue:`1764`)
|
||||
|
||||
+ Add support for RIB flags for setInterestFilter and registerPrefix (:issue:`1842`)
|
||||
+ Add support for RIB flags in ``setInterestFilter()`` and ``registerPrefix()`` (:issue:`1842`)
|
||||
|
||||
- **Miscellaneous tools**
|
||||
|
||||
@@ -66,31 +66,31 @@ New features:
|
||||
+ Introduce ``util::EventEmitter``, :ndn-cxx:`util::NotificationSubscriber`,
|
||||
:ndn-cxx:`util::NotificationStream`, and :ndn-cxx:`nfd::FaceMonitor` utility classes
|
||||
|
||||
+ Introduce :ndn-cxx:`util::SegmentFetcher` helper class to fetch multi-segmented data
|
||||
+ Introduce :ndn-cxx:`SegmentFetcher` helper class to fetch multi-segmented data
|
||||
(:issue:`1879`)
|
||||
|
||||
- **Build**
|
||||
|
||||
+ enabled support of precompiled headers for clang and gcc compilers to speed up compilation
|
||||
+ Enabled support of precompiled headers for clang and gcc compilers to speed up compilation
|
||||
|
||||
Updates and bug fixes:
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Updates and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- **Base**
|
||||
|
||||
+ Serialization of socket write operations (:issue:`1707`)
|
||||
+ Serialization of socket write operations (:issue:`1769`)
|
||||
|
||||
+ Enforcing limit on Interest and Data packet size in :ndn-cxx:`Face::expressInterest` and
|
||||
:ndn-cxx:`Face::put` methods (:issue:`1774`)
|
||||
|
||||
+ Cleaning up transport state on communication failure, so Face can try to reconnect
|
||||
in the future.
|
||||
in the future
|
||||
|
||||
+ Fix bug with Face::removePendingInterest (:issue:`1917`)
|
||||
+ Fix bug in ``Face::removePendingInterest()`` (:issue:`1917`)
|
||||
|
||||
- **Wire encoding**
|
||||
|
||||
+ Nonce field is now encoded as 4-byte uint8_t value, as defined by NDN-TLV spec.
|
||||
+ The Nonce field is now encoded as a 4-byte value, as defined by NDN-TLV spec
|
||||
|
||||
+ Optimized Data packet signing
|
||||
|
||||
@@ -104,27 +104,27 @@ Updates and bug fixes:
|
||||
|
||||
- **Management**
|
||||
|
||||
+ Add link-layer byte counts in FaceStatus data structure (:issue:`1765`)
|
||||
+ Add link-layer byte counts in ``FaceStatus`` data structure (:issue:`1765`)
|
||||
|
||||
- **Security**
|
||||
|
||||
+ Allow user to explicitly specify the cert name prefix before 'KEY' component in
|
||||
``ndnsec-certgen``
|
||||
|
||||
+ ``SignatureSha256`` has been renamed to :ndn-cxx:`DigestSha256` to conform with
|
||||
`NDN-TLV specification <http://named-data.net/doc/ndn-tlv/>`_.
|
||||
+ ``SignatureSha256`` has been renamed to :ndn-cxx:`DigestSha256` to conform to the
|
||||
`NDN-TLV specification <https://docs.named-data.net/NDN-packet-spec/0.1.1/>`__
|
||||
|
||||
+ Add checking of ``Timestamp`` and ``Nonce`` fields in signed Interest within
|
||||
+ Add checking of Timestamp and Nonce fields in signed Interest within
|
||||
:ndn-cxx:`ValidatorConfig`
|
||||
|
||||
+ Allow validator customization using hooks:
|
||||
+ Allow validator customization using hooks.
|
||||
|
||||
Sub-classes of :ndn-cxx:`Validator` class can use the following hooks to fine-tune the
|
||||
validation process:
|
||||
|
||||
* ``preCertificateValidation`` to process received certificate before validation.
|
||||
* ``preCertificateValidation`` to process received certificate before validation
|
||||
* ``onTimeout`` to process interest timeout
|
||||
* ``afterCheckPolicy`` to process validation requests.
|
||||
* ``afterCheckPolicy`` to process validation requests
|
||||
|
||||
+ Fix memory issues in ``SecPublicInfoSqlite3``
|
||||
|
||||
@@ -136,8 +136,8 @@ Updates and bug fixes:
|
||||
|
||||
- Other minor fixes and corrections
|
||||
|
||||
Deprecated:
|
||||
^^^^^^^^^^^
|
||||
Deprecated
|
||||
^^^^^^^^^^
|
||||
|
||||
- ``SignatureSha256`` class, use :ndn-cxx:`DigestSha256` instead.
|
||||
|
||||
@@ -145,7 +145,7 @@ Deprecated:
|
||||
|
||||
Use versions that accept reference to ``io_service`` object.
|
||||
|
||||
- ``Face::ioService`` method, use :ndn-cxx:`Face::getIoService` instead.
|
||||
- ``Face::ioService`` method, use ``Face::getIoService`` instead.
|
||||
|
||||
- :ndn-cxx:`Interest` constructor that accepts name, individual selectors, and individual
|
||||
guiders as constructor parameters.
|
||||
@@ -161,10 +161,10 @@ Deprecated:
|
||||
- ``CommandInterestGenerator`` and ``CommandInterestValidator`` utility classes.
|
||||
:ndn-cxx:`ValidatorConfig` should be used instead.
|
||||
|
||||
Removed:
|
||||
^^^^^^^^
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- support of ndnd-tlv (only NFD management protocol is supported now)
|
||||
- Support for ndnd-tlv (only NFD management protocol is supported now)
|
||||
|
||||
- ``SecPublicInfoMemory`` and ``SecTpmMemory`` classes that were no longer used
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Release date: February 2, 2015
|
||||
|
||||
Changes since version 0.2.0:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- **Build**
|
||||
|
||||
@@ -85,8 +85,8 @@ New features:
|
||||
|
||||
+ New NetworkMonitor helper to detect network state changes (:issue:`2443`)
|
||||
|
||||
Updates and bug fixes:
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Updates and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- **Base**
|
||||
|
||||
@@ -198,8 +198,8 @@ Updates and bug fixes:
|
||||
|
||||
- Other minor fixes and corrections
|
||||
|
||||
Deprecated:
|
||||
^^^^^^^^^^^
|
||||
Deprecated
|
||||
^^^^^^^^^^
|
||||
|
||||
- ``ndn::ptr_lib`` and ``ndn::func_lib`` namespace aliases
|
||||
|
||||
@@ -216,8 +216,8 @@ Deprecated:
|
||||
|
||||
- ``EventEmitter`` is deprecated in favor of ``Signal``
|
||||
|
||||
Removed:
|
||||
^^^^^^^^
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- FaceFlags APIs (:issue:`1992`)
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Release date: March 3, 2015
|
||||
|
||||
Changes since version 0.3.0:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- **Management**
|
||||
|
||||
@@ -17,8 +17,8 @@ New features:
|
||||
|
||||
- Add CachingPolicy to ``LocalControlHeader`` (:issue:`2183`)
|
||||
|
||||
Updates and bug fixes:
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Updates and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- **Wire encoding**
|
||||
|
||||
@@ -51,8 +51,8 @@ Updates and bug fixes:
|
||||
- Explicitly define ``_GLIBCXX_USE_NANOSLEEP``, necessary for gcc < 4.8 in some environments
|
||||
(:issue:`2499`)
|
||||
|
||||
Removed:
|
||||
^^^^^^^^
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- Delete deprecated ``Block(std::istream&)`` constructor (:issue:`2241`)
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Release date: May 12, 2015
|
||||
|
||||
Changes since version 0.3.1:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Add Link abstraction (:issue:`2587`)
|
||||
|
||||
@@ -18,8 +18,8 @@ New features:
|
||||
* In-memory PIB implementation
|
||||
* Define new abstraction for identity, key, and certificate
|
||||
|
||||
Updates and bug fixes:
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Updates and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Enable decoding Exclude containing ImplicitSha256DigestComponent (:issue:`2629`)
|
||||
|
||||
@@ -35,13 +35,13 @@ Updates and bug fixes:
|
||||
|
||||
- Disable precompiled headers on OS X with clang < 6.1.0 (:issue:`2804`)
|
||||
|
||||
Deprecated:
|
||||
^^^^^^^^^^^
|
||||
Deprecated
|
||||
^^^^^^^^^^
|
||||
|
||||
- `Block::fromBuffer` overloads with output parameter (:issue:`2553`)
|
||||
|
||||
Removed:
|
||||
^^^^^^^^
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- Delete deprecated Controller functions:
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Release date: July 1, 2015
|
||||
|
||||
Changes since version 0.3.2:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Allow compilation of ndn-cxx as a shared library (:issue:`2243`)
|
||||
|
||||
@@ -41,8 +41,8 @@ New features:
|
||||
* ``makeStringBlock``
|
||||
* ``readString``
|
||||
|
||||
Improvements and bug fixes:
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Use C++11 lambda expression and smart pointers in Face implementation (:issue:`2112`)
|
||||
|
||||
@@ -72,8 +72,8 @@ Improvements and bug fixes:
|
||||
restrictive move operation (`move_if_noexcept`) is used (e.g., in STL library's containers)
|
||||
(:issue:`2966`)
|
||||
|
||||
Deprecated:
|
||||
^^^^^^^^^^^
|
||||
Deprecated
|
||||
^^^^^^^^^^
|
||||
|
||||
- The following ``KeyChain::sign*`` methods, in favor of generalized ``KeyChain::sign(..., SigningInfo)``
|
||||
|
||||
@@ -101,21 +101,21 @@ Deprecated:
|
||||
* ``CommandOptions::setSigningIdentity``
|
||||
* ``CommandOptions::setSigningCertificate``
|
||||
|
||||
Removed:
|
||||
^^^^^^^^
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- Remove SCOPE from Interests and all references to it in the related code (:issue:`2345`)
|
||||
|
||||
- Direct FIB management in Face class (:issue:`2533`)
|
||||
- Direct FIB management in Face class (:issue:`2533`).
|
||||
|
||||
``Face::register`` and ``Face::setInterestFilter`` methods now only support NFD RIB management
|
||||
protocol.
|
||||
|
||||
For special needs, FIB management can be implemented using ``nfd::Controller``
|
||||
(``start<FibAddNextHopCommand>``, and ``start<FibRemoveNextHopCommand>``)
|
||||
(``start<FibAddNextHopCommand>`` and ``start<FibRemoveNextHopCommand>``).
|
||||
|
||||
Upcoming features (partially finished in development branches):
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Upcoming features (partially finished in development branches)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- NDNLPv2 (https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2, :issue:`2520`,
|
||||
:issue:`2879`, :issue:`2763`, :issue:`2883`, :issue:`2841`, :issue:`2866`)
|
||||
|
||||
@@ -5,8 +5,8 @@ Release date: August 31, 2015
|
||||
|
||||
Changes since version 0.3.3:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- By default, library is now compiled as a shared library (:issue:`2867`)
|
||||
|
||||
@@ -26,8 +26,8 @@ New features:
|
||||
- New Dispatcher class to simplify server-side implementation of NFD management protocol
|
||||
(:issue:`2107`)
|
||||
|
||||
Improvements and bug fixes:
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fix compilation error with Boost 1.59 (:issue:`3128`)
|
||||
|
||||
@@ -44,8 +44,8 @@ Improvements and bug fixes:
|
||||
|
||||
- Add ability to create ``util::Digest`` object from ``std::istream&`` (:issue:`3022`)
|
||||
|
||||
Deprecated:
|
||||
^^^^^^^^^^^
|
||||
Deprecated
|
||||
^^^^^^^^^^
|
||||
|
||||
- The following methods of ``CommandOptions`` class in favor of ``getSigningInfo`` and
|
||||
``setSigningInfo`` methods (:issue:`2893`):
|
||||
@@ -61,8 +61,8 @@ Deprecated:
|
||||
- Overloads of ``Face::registerPrefix`` and ``Face::setInterestFilter`` that do not accept
|
||||
SigningInfo parameter (:issue:`2932`)
|
||||
|
||||
Upcoming features (partially implemented in development branches):
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Upcoming features (partially implemented in development branches)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Introduce new API to simplify security transformations (:issue:`3009`)
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ Release date: December 31, 2015
|
||||
|
||||
Changes since version 0.3.4:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- **(breaking change)** LocalControlHeader for special signaling between application and NFD has
|
||||
been replaced with NDNLPv2 signaling (:issue:`2879`, :issue:`2930`)
|
||||
@@ -32,8 +32,8 @@ New features:
|
||||
|
||||
- Ability to create Face with custom IO service and default transport (:issue:`2500`)
|
||||
|
||||
Improvements and bug fixes:
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- **(breaking change)** SegmentFetcher helper changed to use asynchronous data validation (:issue:`2734`)
|
||||
|
||||
@@ -46,8 +46,8 @@ Improvements and bug fixes:
|
||||
|
||||
- Minor documentation updates (:issue:`3207`, :issue:`3210`, :issue:`3221`)
|
||||
|
||||
Deprecated:
|
||||
^^^^^^^^^^^
|
||||
Deprecated
|
||||
^^^^^^^^^^
|
||||
|
||||
- Overloads of ``Face::registerPrefix`` and ``Face::setInterestFilter`` that do not accept
|
||||
SigningInfo parameter (:issue:`2932`)
|
||||
@@ -61,13 +61,13 @@ Deprecated:
|
||||
- ndn::util::DummyClientFace::sentDatas, use ndn::util::DummyClientFace.sentData instead
|
||||
(:issue:`3146`)
|
||||
|
||||
Removed:
|
||||
^^^^^^^^
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- Deprecated EventEmitter class (:issue:`2351`)
|
||||
|
||||
Planned features for future releases:
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Planned features for future releases
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Introduce new API to simplify security transformations (:issue:`3009`)
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Release date: March 25, 2016
|
||||
|
||||
Changes since version 0.4.0:
|
||||
|
||||
Improvements and bug fixes:
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Improved support for ECDSA signatures (:issue:`3438`, :issue:`3439`)
|
||||
|
||||
@@ -15,14 +15,14 @@ Improvements and bug fixes:
|
||||
- Use InMemoryStorage for StatusDataset and Notification produced by managers based on
|
||||
Dispatcher class (:issue:`2182`)
|
||||
|
||||
Removed:
|
||||
^^^^^^^^
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- Deprecated ``tlvdump`` command-line tool (use ``ndn-dissect`` tool from `NDN Essential Tools
|
||||
<https://github.com/named-data/ndn-tools>`__ instead
|
||||
|
||||
Planned features for future releases:
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Planned features for future releases
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Introduce new API to simplify security transformations (:issue:`3009`)
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ Release date: October 4, 2016
|
||||
|
||||
Changes since version 0.4.1:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- New transformation API (:issue:`3009`)
|
||||
|
||||
@@ -104,7 +104,7 @@ Deprecated
|
||||
- ``ndn::crypto::sha256`` in favor of ``ndn::crypto::computeSha256Digest``
|
||||
|
||||
- ``security/cryptopp.hpp`` header. Use ``security/v1/cryptopp.hpp`` when needed, avoid direct
|
||||
include as CryptoPP dependency may be removed from future versions of the library.
|
||||
include as CryptoPP dependency will be removed from future versions of the library.
|
||||
|
||||
- ``security/identity-certificate.hpp`` header. Use ``security/v1/identity-certificate.hpp`` instead.
|
||||
|
||||
@@ -112,8 +112,8 @@ Deprecated
|
||||
``ndn::CertificateExtension``, ``ndn::CertificateSubjectDescription``. When necessary, use
|
||||
``security::v1::PublicKey``, ``security::v1::Certificate``, ``security::v1::IdentityCertificate``,
|
||||
``security::v1::CertificateExtension``, ``security::v1::CertificateSubjectDescription`` instead.
|
||||
The next release will feature :doc:`a new version of NDN Certificate format
|
||||
<../specs/certificate-format>`.
|
||||
The next release will feature `a new version of the NDN Certificate format
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.3/certificate.html>`__.
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
@@ -10,22 +10,22 @@ Release date: January 25, 2017
|
||||
|
||||
Changes since version 0.5.0:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Add version 2 of the security framework (introduced in ``security::v2`` namespace)
|
||||
- Add version 2 of the security framework in ``security::v2`` namespace
|
||||
|
||||
* :ref:`NDN Certificate Format Version 2.0 <NDN Certificate Format Version 2.0>`
|
||||
(:issue:`3103`)
|
||||
* New Public Information Base (PIB) and Trusted Program Module (TPM) framework to manage
|
||||
* `NDN Certificate Format version 2.0
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.3/certificate.html>`__ (:issue:`3103`)
|
||||
* New Public Information Base (PIB) and Trusted Platform Module (TPM) framework to manage
|
||||
public/private keys and NDN Certificate version 2.0 (:issue:`2948`, :issue:`3202`)
|
||||
* New KeyChain implementation (:issue:`2926`)
|
||||
* New Validator implementation (:issue:`3289`, :issue:`1872`)
|
||||
* New security-supporting utilities: trust anchor container and certificate cache
|
||||
* Creation of `Command Interests
|
||||
<https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest>`__ delegated to
|
||||
:ndn-cxx:`CommandInterestSigner` class, while the new KeyChain only :ref:`signs Interests
|
||||
<Signed Interest>` (:issue:`3912`)
|
||||
``CommandInterestSigner`` class, while the new KeyChain only :doc:`signs Interests
|
||||
</specs/signed-interest>` (:issue:`3912`)
|
||||
|
||||
- Enable validator to fetch certificates directly from the signed/command interest sender
|
||||
(:issue:`3921`)
|
||||
@@ -63,27 +63,27 @@ Improvements and bug fixes
|
||||
Deprecated
|
||||
^^^^^^^^^^
|
||||
|
||||
- Old security framework. All old security framework classes are moved to
|
||||
- Old security framework. All old security framework classes are moved to the
|
||||
``ndn::security::v1`` namespace in this release and will be removed in the next release.
|
||||
|
||||
* ``v1::KeyChain``, use :ndn-cxx:`v2::KeyChain` instead
|
||||
* ``v1::KeyChain``; use ``v2::KeyChain`` instead.
|
||||
|
||||
* ``v1::Validator`` interface and all implementations of this interface (``ValidatorRegex``,
|
||||
``ValidatorConfig``, ``ValidatorNull``). Use :ndn-cxx:`v2::Validator` and the
|
||||
corresponding implementations of :ndn-cxx:`ValidationPolicy` interfaces (will be introduced
|
||||
before 0.6.0 release).
|
||||
``ValidatorConfig``, ``ValidatorNull``). Use ``v2::Validator`` and the corresponding
|
||||
implementations of :ndn-cxx:`ValidationPolicy` interfaces (will be introduced before
|
||||
the 0.6.0 release).
|
||||
|
||||
* ``v1::SecPublicInfo`` and its implementation (``SecPublicInfoSqlite``), ``SecTpm`` and its
|
||||
implementations (``SecTpmFile``, ``SecTpmOsx``). These classes are internal implementation
|
||||
and not intended to be used without ``v1::KeyChain``. :ndn-cxx:`v2::KeyChain` internally
|
||||
uses the newly introduced :ndn-cxx:`Pib` and :ndn-cxx:`Tpm` interfaces with their
|
||||
corresponding implementations.
|
||||
and not intended to be used without ``v1::KeyChain``. ``v2::KeyChain`` internally uses
|
||||
the newly introduced :ndn-cxx:`Pib` and :ndn-cxx:`Tpm` interfaces with their corresponding
|
||||
implementations.
|
||||
|
||||
* ``v1::Certificate``, ``v1::IdentityCertificate``, ``v1::CertificateExtension``,
|
||||
``v1::CertificateSubjectDescription``, use :ndn-cxx:`v2::Certificate` and
|
||||
:ndn-cxx:`AdditionalDescription`
|
||||
``v1::CertificateSubjectDescription``; use ``v2::Certificate`` and ``AdditionalDescription``
|
||||
instead.
|
||||
|
||||
* ``v1::SecuredBag``, use ``v2::SafeBag`` instead
|
||||
* ``v1::SecuredBag``; use :ndn-cxx:`SafeBag` instead.
|
||||
|
||||
- Constant ``io::BASE_64``, use ``io::BASE64`` instead (:issue:`3741`)
|
||||
|
||||
@@ -100,5 +100,3 @@ Deprecated
|
||||
``ndn::CertificateExtension``, ``ndn::CertificateSubjectDescription``. When necessary, use
|
||||
``security::v1::PublicKey``, ``security::v1::Certificate``, ``security::v1::IdentityCertificate``,
|
||||
``security::v1::CertificateExtension``, ``security::v1::CertificateSubjectDescription`` instead.
|
||||
The next release will feature :ref:`a new version of NDN Certificate format
|
||||
<NDN Certificate Format Version 2.0>`.
|
||||
@@ -5,18 +5,18 @@ Release date: October 16, 2017
|
||||
|
||||
Changes since version 0.5.1:
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- **breaking change** Security framework version 2 (:issue:`3098`, :issue:`3920`,
|
||||
:issue:`3644`, :issue:`4085`, :issue:`4323`, :issue:`4339`)
|
||||
- **(breaking change)** Security framework version 2 (:issue:`3098`, :issue:`3920`,
|
||||
:issue:`3644`, :issue:`4085`, :issue:`4323`, :issue:`4339`).
|
||||
|
||||
The released version of the library only supports the new version of the security (v2
|
||||
certificate format) and features a number of updates of KeyChain and Validator
|
||||
interfaces. At the same time, management APIs for :ndn-cxx:`ValidatorConfig` remained
|
||||
intact; transition to the new framework would require only adjusting
|
||||
:ndn-cxx:`Validator::validate` calls and updating configuration files to follow the new
|
||||
naming conventions of :ref:`NDN Certificate Format Version 2.0`.
|
||||
This release of the library supports only the new version of the security framework
|
||||
and features a number of updates to the KeyChain and Validator interfaces.
|
||||
At the same time, management APIs for :ndn-cxx:`ValidatorConfig` remained intact;
|
||||
transition to the new framework only requires adjusting :ndn-cxx:`Validator::validate`
|
||||
calls and updating configuration files to follow the naming conventions of the new
|
||||
`Certificate format <https://docs.named-data.net/NDN-packet-spec/0.3/certificate.html>`__.
|
||||
|
||||
- Integration of fetching certificates using Certificate Bundle as part of specialized
|
||||
``CertificateFetcher`` (:issue:`3891`)
|
||||
@@ -25,7 +25,7 @@ New features:
|
||||
to include ``ForwardingHint`` instead of ``LinkObject``, following the latest NDN
|
||||
specification updates (:issue:`4054`, :issue:`4055`)
|
||||
|
||||
- Fine-grained signals on interface/address changes in NetworkMonitor
|
||||
- Fine-grained signals on interface/address changes in :ndn-cxx:`NetworkMonitor`
|
||||
for all supported platforms (:issue:`3353`, :issue:`4025`, :issue:`3817`, :issue:`4024`)
|
||||
|
||||
- Addition of ``TxSequence`` field and ``Ack``, the first repeatable field in
|
||||
@@ -51,7 +51,7 @@ Improvements and bug fixes
|
||||
|
||||
- FaceUri now accepts link-local IPv6 addresses (:issue:`1428`)
|
||||
|
||||
- Rename variables in ``FaceStatus`` and ``ForwarderStatus`` ('datas' => 'data')
|
||||
- Rename fields in :ndn-cxx:`FaceStatus` and :ndn-cxx:`ForwarderStatus` ('datas' => 'data')
|
||||
(:issue:`3955`)
|
||||
|
||||
- Improve logging framework and its uses
|
||||
@@ -63,19 +63,19 @@ Improvements and bug fixes
|
||||
* Add logging capabilities to ``Face``, ``UnixTransport``, ``TcpTransport``, and the new
|
||||
security framework (:issue:`3563`)
|
||||
|
||||
To enable logging, set environment variable ``NDN_LOG`` to enable specific, subset, or all
|
||||
logging module at appropriate levels. Examples:
|
||||
To configure logging, set the environment variable :doc:`NDN_LOG </manpages/ndn-log>`.
|
||||
Examples:
|
||||
|
||||
::
|
||||
.. code-block:: sh
|
||||
|
||||
export NDN_LOG=*=ALL
|
||||
export NDN_LOG=ndn.*=ALL
|
||||
export NDN_LOG=ndn.security=DEBUG:ndn.TcpTransport=ALL
|
||||
export NDN_LOG="*=ALL"
|
||||
export NDN_LOG="ndn.*=ALL"
|
||||
export NDN_LOG="ndn.security=DEBUG:ndn.TcpTransport=ALL"
|
||||
|
||||
- Ensure that ``Face`` sends ``Nack`` only after every ``InterestCallback`` has responded
|
||||
(:issue:`4228`)
|
||||
- Ensure that :ndn-cxx:`Face` sends a ``Nack`` only after every ``InterestCallback`` has
|
||||
responded (:issue:`4228`)
|
||||
|
||||
- Fix potential overflow in ``time::toIsoString`` (:issue:`3915`)
|
||||
- Fix potential overflow in :ndn-cxx:`time::toIsoString` (:issue:`3915`)
|
||||
|
||||
- Fix potentially misaligned memory accesses (:issue:`4172`, :issue:`4097`, :issue:`4175`,
|
||||
:issue:`4190`, :issue:`4191`)
|
||||
@@ -86,20 +86,15 @@ Improvements and bug fixes
|
||||
|
||||
- Source/header reorganization (:issue:`3940`)
|
||||
|
||||
* Move network-related files to ``src/net``
|
||||
* Move network-related files to ``src/net``. Note the following namespace changes:
|
||||
|
||||
.. note::
|
||||
Namespace changes
|
||||
+ ``ndn::util::FaceUri`` is now ``ndn::FaceUri``
|
||||
+ ``ndn::util::ethernet`` is now ``ndn::ethernet``
|
||||
+ ``ndn::util::NetworkMonitor`` and related classes are now in ``ndn::net``
|
||||
|
||||
* ndn::util::FaceUri is now ndn::FaceUri
|
||||
* ndn::util::ethernet is now ndn::ethernet
|
||||
* ndn::util::NetworkMonitor and related classes are now in ndn::net
|
||||
|
||||
* Move signal-related files into ``src/util/signal/`` directory, except for
|
||||
* Move signal-related files into ``src/util/signal`` directory, except for
|
||||
the main include ``signal.hpp``
|
||||
|
||||
* Move InMemoryStorage to ``src/ims``
|
||||
|
||||
* Move :ndn-cxx:`InMemoryStorage` and related classes to ``src/ims``
|
||||
* Rename ``digest.hpp`` to ``sha256.hpp`` to match the ``Sha256`` class declared within
|
||||
|
||||
Removed
|
||||
@@ -107,23 +102,23 @@ Removed
|
||||
|
||||
- Old security framework.
|
||||
|
||||
* ``v1::KeyChain``, use :ndn-cxx:`v2::KeyChain` instead
|
||||
* ``v1::KeyChain``; use :ndn-cxx:`KeyChain` instead.
|
||||
|
||||
* ``v1::Validator`` interface and ``ValidatorRegex`` implementation of this
|
||||
interface. ``ValidatorConfig``, ``ValidatorNull`` implementation refactored to be based on
|
||||
the new validation framework.
|
||||
|
||||
* ``v1::SecPublicInfo`` and its implementation (``SecPublicInfoSqlite``), ``SecTpm`` and its
|
||||
implementations (``SecTpmFile``, ``SecTpmOsx``). These classes are internal implementation
|
||||
and not intended to be used without ``v1::KeyChain``. :ndn-cxx:`v2::KeyChain` internally
|
||||
implementations (``SecTpmFile``, ``SecTpmOsx``). These classes are internal implementation
|
||||
and not intended to be used without ``v1::KeyChain``. The new :ndn-cxx:`KeyChain` internally
|
||||
uses the newly introduced :ndn-cxx:`Pib` and :ndn-cxx:`Tpm` interfaces with their
|
||||
corresponding implementations.
|
||||
|
||||
* ``v1::Certificate``, ``v1::IdentityCertificate``, ``v1::CertificateExtension``,
|
||||
``v1::CertificateSubjectDescription``, use :ndn-cxx:`v2::Certificate` and
|
||||
:ndn-cxx:`AdditionalDescription`
|
||||
``v1::CertificateSubjectDescription``; use the new :ndn-cxx:`Certificate` and
|
||||
:ndn-cxx:`AdditionalDescription` instead.
|
||||
|
||||
* ``v1::SecuredBag``, use ``v2::SafeBag`` instead
|
||||
* ``v1::SecuredBag``; use :ndn-cxx:`SafeBag` instead.
|
||||
|
||||
- Constant ``io::BASE_64``, use ``io::BASE64`` instead (:issue:`3741`)
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ ndn-cxx version 0.6.1
|
||||
|
||||
Release date: February 19, 2018
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- (potentially breaking change) :ndn-cxx:`expressInterest` now by default loopbacks Interests to
|
||||
producer callbacks on the same :ndn-cxx:`Face`. When undesired, use
|
||||
@@ -13,50 +13,40 @@ New features:
|
||||
- New signal in :ndn-cxx:`SegmentFetcher` to notify retrieval of Data segments
|
||||
(:issue:`4438`)
|
||||
|
||||
- Initial support for the Content Store management protocol
|
||||
(:issue:`4050`)
|
||||
- Initial support for the Content Store management protocol (:issue:`4050`)
|
||||
|
||||
- Literal operators for ``time::duration`` types, such as ``1_s``, ``42_ms``, ``30_days``
|
||||
(:issue:`4468`)
|
||||
|
||||
- Support for BLAKE2 hash function (requires OpenSSL >= 1.1.0)
|
||||
|
||||
- A ``escape()`` helper function complementing the existing ``unescape()`` (:issue:`4484`)
|
||||
- An ``escape()`` helper function complementing the existing ``unescape()`` (:issue:`4484`)
|
||||
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- ``ndnsec key-gen`` command line now allows customization of key ID (:issue:`4294`)
|
||||
|
||||
- Fixed encoding of ``'~'`` and ``'+'`` in :ndn-cxx:`Component::toUri()`
|
||||
(:issue:`4484`)
|
||||
- Fixed encoding of ``'~'`` and ``'+'`` in ``name::Component::toUri()`` (:issue:`4484`)
|
||||
|
||||
- Fixed handling of large dates when converting to/from string
|
||||
(:issue:`4478`, :issue:`3915`)
|
||||
- Fixed handling of large dates when converting to/from string (:issue:`4478`, :issue:`3915`)
|
||||
|
||||
- Fixed error handling in :ndn-cxx:`KeyChain::importSafeBag()`
|
||||
(:issue:`4359`)
|
||||
- Fixed error handling in ``KeyChain::importSafeBag()`` (:issue:`4359`)
|
||||
|
||||
- Fixed parsing of IPv6 addresses with scope-id
|
||||
(:issue:`4474`)
|
||||
- Fixed parsing of IPv6 addresses with scope-id (:issue:`4474`)
|
||||
|
||||
- :ndn-cxx:`io::load()` now handles empty files properly
|
||||
(:issue:`4434`)
|
||||
- ``io::load()`` now handles empty files properly (:issue:`4434`)
|
||||
|
||||
- Switched to using `boost::asio::basic_waitable_timer`
|
||||
(:issue:`4431`)
|
||||
- Switched to using ``boost::asio::basic_waitable_timer`` (:issue:`4431`)
|
||||
|
||||
- Allow linking multiple :ndn-cxx:`DummyClientFace` instances together to emulate a broadcast medium
|
||||
(:issue:`3913`)
|
||||
- Allow linking multiple :ndn-cxx:`DummyClientFace` instances together to emulate a broadcast
|
||||
medium (:issue:`3913`)
|
||||
|
||||
- Fixed build when ``std::to_string`` is not available
|
||||
(:issue:`4393`)
|
||||
- Fixed build when ``std::to_string`` is not available (:issue:`4393`)
|
||||
|
||||
- Avoid undefined behavior when casting to :ndn-cxx:`tlv::SignatureTypeValue`
|
||||
(:issue:`4370`)
|
||||
- Avoid undefined behavior when casting to :ndn-cxx:`tlv::SignatureTypeValue` (:issue:`4370`)
|
||||
|
||||
- Fixed compilation with Boost 1.66.0
|
||||
(:issue:`4422`)
|
||||
- Fixed compilation with Boost 1.66.0 (:issue:`4422`)
|
||||
|
||||
- Various documentation updates
|
||||
(:issue:`3918`, :issue: `4184`, :issue: `4275`)
|
||||
@@ -64,6 +54,4 @@ Improvements and bug fixes
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- Removed obsolete TLV-TYPE constants
|
||||
(:issue:`4055`, :issue:`3098`, :issue: `3755`)
|
||||
|
||||
- Removed obsolete TLV-TYPE constants (:issue:`4055`, :issue:`3098`, :issue: `3755`)
|
||||
@@ -3,11 +3,11 @@ ndn-cxx version 0.6.2
|
||||
|
||||
Release date: May 4, 2018
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Initial support for [NDN packet format version
|
||||
0.3](https://named-data.net/doc/NDN-packet-spec/0.3/) (:issue:`4527`)
|
||||
- Initial support for `NDN packet format version 0.3
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
|
||||
|
||||
* Recognize typed name components, allow typed name component in ``FinalBlockId``
|
||||
(:issue:`4526`)
|
||||
@@ -41,7 +41,7 @@ Improvements and bug fixes
|
||||
- Logging system improvements (:issue:`4552`)
|
||||
|
||||
Deprecated
|
||||
~~~~~~~~~~
|
||||
^^^^^^^^^^
|
||||
|
||||
- Selectors (:issue:`4527`)
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ that use distribution-provided compilers and packages.
|
||||
|
||||
The compilation now uses the C++14 standard.
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- More support for `NDN packet format version
|
||||
0.3 <https://named-data.net/doc/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
|
||||
- More support for `NDN packet format version 0.3
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
|
||||
|
||||
- Allow applications to declare a default ``CanBePrefix`` setting (:issue:`4581`)
|
||||
|
||||
@@ -67,7 +67,7 @@ Improvements and bug fixes
|
||||
- Correct and improve documentation
|
||||
|
||||
Deprecated
|
||||
~~~~~~~~~~
|
||||
^^^^^^^^^^
|
||||
|
||||
- ``SegmentFetcher::fetch()`` static functions in favor of ``start()`` (:issue:`4464`)
|
||||
|
||||
@@ -83,6 +83,6 @@ Deprecated
|
||||
- ``Data::get/setFinalBlockId()`` in favor of ``Data::get/setFinalBlock()``
|
||||
|
||||
Removed
|
||||
~~~~~~~
|
||||
^^^^^^^
|
||||
|
||||
- Dependency on Boost.Regex in favor of ``std::regex``
|
||||
@@ -3,11 +3,11 @@ ndn-cxx version 0.6.5
|
||||
|
||||
Release date: February 4, 2019
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- More support for `NDN packet format version
|
||||
0.3 <https://named-data.net/doc/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
|
||||
- More support for `NDN packet format version 0.3
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
|
||||
|
||||
* Stop using ``ChildSelector`` in ``NotificationSubscriber`` (:issue:`4664`)
|
||||
|
||||
@@ -18,55 +18,56 @@ New features:
|
||||
- Scoped prefix registration, scoped Interest filter, and scoped pending Interest
|
||||
(:issue:`3919`, :issue:`4316`)
|
||||
|
||||
- Counters for satisfied and unsatisfied Interests in ``ForwarderStatus``
|
||||
- Counters for satisfied and unsatisfied Interests in :ndn-cxx:`ForwarderStatus`
|
||||
(:issue:`4720`)
|
||||
|
||||
- ``random::getRandomNumberEngine()`` in the public API
|
||||
- :ndn-cxx:`random::getRandomNumberEngine` in the public API
|
||||
|
||||
- ``MetadataObject`` class to encode/decode RDR-style metadata (:issue:`4707`)
|
||||
- :ndn-cxx:`MetadataObject` class to encode/decode RDR-style metadata (:issue:`4707`)
|
||||
|
||||
- ``SegmentFetcher::stop()`` (:issue:`4692`)
|
||||
- :ndn-cxx:`SegmentFetcher::stop` (:issue:`4692`)
|
||||
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Use openssl-based routines for the PKCS#8 decoding/decryption when exporting key from macOS
|
||||
Keychain (:issue:`4450`)
|
||||
|
||||
- Switch to AES-256 for private key encryption in PKCS #8 export
|
||||
|
||||
- Add exponential backoff in ``CertificateFetcherFromNetwork`` (:issue:`4718`, :issue:`4712`)
|
||||
- Use OpenSSL-based routines for PKCS #8 decoding/decryption when exporting keys from the
|
||||
macOS Keychain (:issue:`4450`)
|
||||
|
||||
- Forbid unrecognized TLVs before ``Name`` (:issue:`4667`)
|
||||
|
||||
- Stop accepting NonNegativeInteger as sequence number in NDNLP (:issue:`4598`)
|
||||
|
||||
- Add exponential backoff in :ndn-cxx:`CertificateFetcherFromNetwork` (:issue:`4718`,
|
||||
:issue:`4712`)
|
||||
|
||||
- Throw exception when loading an orphaned ``ValidationPolicyConfig`` (API violation)
|
||||
(:issue:`4758`)
|
||||
|
||||
- Forbid unrecognized TLVs before ``Name`` (:issue:`4667`)
|
||||
- Prevent memory pool size from becoming zero in :ndn-cxx:`InMemoryStorage` (:issue:`4769`)
|
||||
|
||||
- Prevent memory pool size from becoming zero in ``InMemoryStorage`` (:issue:`4769`)
|
||||
|
||||
- Clean up fetchers when destructing ``nfd::Controller`` (:issue:`4775`)
|
||||
- Clean up fetchers when destructing :ndn-cxx:`nfd::Controller` (:issue:`4775`)
|
||||
|
||||
- Fix ``SegmentFetcher`` undefined behavior caused by uncanceled pending interest
|
||||
(:issue:`4770`)
|
||||
|
||||
- Seed the PRNG with more entropy (:issue:`4808`)
|
||||
|
||||
- Stop accepting NonNegativeInteger as sequence number in NDNLP (:issue:`4598`)
|
||||
|
||||
- Backport C++17 ``std::any`` and ``std::variant`` as ``ndn::any`` and ``ndn::variant``
|
||||
|
||||
- Reimplement ``scheduler::EventId`` with ``CancelHandle`` (:issue:`4698`)
|
||||
|
||||
Deprecated
|
||||
~~~~~~~~~~
|
||||
^^^^^^^^^^
|
||||
|
||||
- ``ndn-cxx/util/scheduler-scoped-event-id.hpp`` header as it is now sufficient to use
|
||||
- ``ndn-cxx/util/scheduler-scoped-event-id.hpp`` header, as it is now sufficient to use
|
||||
``ndn-cxx/util/scheduler.hpp`` header (:issue:`4698`)
|
||||
|
||||
- Implicit conversion from nullptr to ``scheduler::EventId`` (:issue:`4698`)
|
||||
|
||||
Removed
|
||||
~~~~~~~
|
||||
^^^^^^^
|
||||
|
||||
- ``ndn::ip::address{,V6}FromString``
|
||||
|
||||
|
||||
@@ -3,16 +3,17 @@ ndn-cxx version 0.6.6
|
||||
|
||||
Release date: April 27, 2019
|
||||
|
||||
Note that this is the last release that encodes to `NDN packet format version 0.2.1
|
||||
<https://named-data.net/doc/NDN-packet-spec/0.2.1/>`__. A future release will continue to
|
||||
decode v0.2.1 format, but will encode to `v0.3 format
|
||||
<https://named-data.net/doc/NDN-packet-spec/0.3/>`__.
|
||||
.. note::
|
||||
This is the last release to support the `NDN packet format version 0.2.1
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.2.1/>`__.
|
||||
The next release will be able to encode and decode only the `v0.3 packet format
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.3/>`__.
|
||||
|
||||
New features:
|
||||
^^^^^^^^^^^^^
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- More support for `NDN packet format version
|
||||
0.3 <https://named-data.net/doc/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
|
||||
- More support for `NDN packet format version 0.3
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
|
||||
|
||||
* Support new naming conventions to encode/decode segment numbers, byte offsets, versions,
|
||||
timestamps, and sequence numbers based on typed name components (:issue:`4777`)
|
||||
@@ -22,7 +23,8 @@ New features:
|
||||
- ``NDN_THROW`` macro to throw exceptions including file position and runtime context of the
|
||||
throw statement (:issue:`4834`)
|
||||
|
||||
- Ensure that a ``Block`` with TLV-TYPE zero is treated as invalid (:issue:`4726`, :issue:`4895`)
|
||||
- Ensure that a :ndn-cxx:`Block` with TLV-TYPE zero is treated as invalid (:issue:`4726`,
|
||||
:issue:`4895`)
|
||||
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -34,7 +36,8 @@ Improvements and bug fixes
|
||||
``ApplicationParameters`` and to change its number to be a non-critical element type
|
||||
(:issue:`4658`, :issue:`4780`)
|
||||
|
||||
- Add option to disable infrastructure interest in ``CertificateFetcherDirectFetch`` (:issue:`4879`)
|
||||
- Add an option to disable the infrastructure Interest in ``CertificateFetcherDirectFetch``
|
||||
(:issue:`4879`)
|
||||
|
||||
- Fix compilation against recent versions of Boost libraries and issues with Xcode 10.2 and
|
||||
older versions of Boost libraries (:issue:`4890`, :issue:`4923`, :issue:`4860`)
|
||||
@@ -44,7 +47,7 @@ Improvements and bug fixes
|
||||
- Improve documentation
|
||||
|
||||
Deprecated
|
||||
~~~~~~~~~~
|
||||
^^^^^^^^^^
|
||||
|
||||
- ``PendingInterestId``, ``RegisteredPrefixId``, and ``InterestFilterId`` types in favor of
|
||||
``PendingInterestHandle``, ``RegisteredPrefixHandle``, and ``InterestFilterHandle``
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
ndn-cxx version 0.7.0
|
||||
---------------------
|
||||
|
||||
Release date: January 13, 2020
|
||||
|
||||
**Breaking Change**
|
||||
|
||||
This release features support of only `NDN packet format version 0.3
|
||||
<https://docs.named-data.net/NDN-packet-spec/0.3/>`__ (:issue:`4527`, :issue:`4567`,
|
||||
:issue:`4709`, :issue:`4913`). The library encodes and interprets Interest and Data
|
||||
packets only in 0.3 format; support for version 0.2 has been completely removed. In
|
||||
addition, the URI representation of Interest packets has been updated to follow the
|
||||
packet format changes.
|
||||
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- HMAC signing support (:issue:`3075`)
|
||||
|
||||
- Support for ``ParametersSha256DigestComponent`` in :ndn-cxx:`Name` and :ndn-cxx:`Interest`
|
||||
(:issue:`4658`)
|
||||
|
||||
- Encoding and decoding of ``HopLimit`` field in Interest (:issue:`4806`)
|
||||
|
||||
- Support for encoding and decoding PIT token as NDNLPv2 field (:issue:`4532`).
|
||||
|
||||
PIT token is a hop-by-hop header field that identifies an Interest-Data exchange. The
|
||||
downstream node can assign an opaque token to an outgoing Interest, and the upstream node
|
||||
is expected to return the same token on the Data or Nack in reply to that Interest. This
|
||||
would allow the downstream node to accelerate its processing, especially in PIT lookup.
|
||||
|
||||
- :ndn-cxx:`io::loadBuffer` and :ndn-cxx:`io::saveBuffer` helper functions
|
||||
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Various improvements in the Linux implementation of :ndn-cxx:`NetworkMonitor`
|
||||
|
||||
- Rework of ``RttEstimator`` class:
|
||||
|
||||
* split into two classes: :ndn-cxx:`RttEstimator` and :ndn-cxx:`RttEstimatorWithStats`
|
||||
(:issue:`4887`)
|
||||
* add a getter for the smoothed RTT value (:issue:`4892`)
|
||||
* switch to use ``time::nanoseconds`` (:issue:`4887`)
|
||||
|
||||
- Make use of attributes in logging facilities and generalize logger backend support
|
||||
(:issue:`4969`, :issue:`3782`)
|
||||
|
||||
- Silently accept an empty validation policy instead of throwing an exception (:issue:`5049`)
|
||||
|
||||
- Introduce alternative URI syntax for component types used in naming conventions, with
|
||||
ability to choose between canonical and alternate format (:issue:`4777`)
|
||||
|
||||
- Don't force the generation of an Interest nonce during decoding (:issue:`4685`)
|
||||
|
||||
- Various documentation improvements
|
||||
|
||||
Removals
|
||||
^^^^^^^^
|
||||
|
||||
- ``ndn::util::Scheduler`` (use ``ndn::Scheduler`` or ``ndn::scheduler::Scheduler``) and
|
||||
``ndn::EventId`` (use ``ndn::scheduler::EventId``) (:issue:`4883`)
|
||||
|
||||
- Unused ``KeyClass`` and ``AclType`` enums
|
||||
|
||||
- Unused ``v2::PublicKey`` alias of ``transform::PublicKey``
|
||||
|
||||
- ``HmacFilter`` class, use :ndn-cxx:`SignerFilter` and :ndn-cxx:`VerifierFilter` instead
|
||||
|
||||
- Ill-defined equality operators for ``Interest``, ``MetaInfo``, ``Signature`` (:issue:`4569`)
|
||||
|
||||
- Implicit conversion from the ``xyzHandle`` types to ``const xyzId*`` (where ``xyz`` is
|
||||
``PendingInterest``, ``RegisteredPrefixId``, and ``InterestFilterId``)
|
||||
|
||||
- Deprecated ``KeyLocator::Type`` enum
|
||||
|
||||
- Private header files of concrete PIB, TPM, and KeyHandle implementations are no longer
|
||||
installed (:issue:`4782`)
|
||||
|
||||
- Renamed ``util/backports-ostream-joiner.hpp`` to ``util/ostream-joiner.hpp``
|
||||
@@ -0,0 +1,78 @@
|
||||
ndn-cxx version 0.7.1
|
||||
---------------------
|
||||
|
||||
Release date: October 8, 2020
|
||||
|
||||
The build requirements have been increased to require Clang >= 4.0, Xcode >= 9.0, and Python >= 3.6.
|
||||
Meanwhile, it is *recommended* to use GCC >= 7.4.0 and Boost >= 1.65.1.
|
||||
This effectively drops official support for Ubuntu 16.04 when using distribution-provided Boost
|
||||
packages -- ndn-cxx may still work on this platform, but we provide no official support for it.
|
||||
Additionally, this release drops support for CentOS 7 and adds support for CentOS 8.
|
||||
|
||||
New features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- `Signed Interests <https://docs.named-data.net/NDN-packet-spec/0.3/signed-interest.html>`__
|
||||
according to Packet Specification v0.3 (:issue:`4804`)
|
||||
|
||||
- Add "in-order" mode to :ndn-cxx:`SegmentFetcher` and a corresponding signal that is emitted after
|
||||
each segment is received and validated in segment order. Segments that arrive out-of-order will be
|
||||
buffered internally until all earlier segments have arrived and passed validation.
|
||||
|
||||
- Allow ``KeyLocator`` to either identify the full name of a certificate, an unversioned certificate
|
||||
prefix, or the name of a public key (without issuer and version) (:issue:`5115`)
|
||||
|
||||
- Allow face MTU to be changed via management (:issue:`5056`)
|
||||
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Change default key type generated by ndnsec to ECDSA
|
||||
|
||||
- Use named curve when encoding ECDSA public keys (:issue:`5037`)
|
||||
|
||||
- Allow non-default key to be exported for an identity via ``ndnsec-export`` (:issue:`5043`)
|
||||
|
||||
- Fix spurious error message from ``ndnsec-key-gen`` when ``key-id`` is specified (:issue:`5057`)
|
||||
|
||||
- Provide more fine-grained choices for :ndn-cxx:`name::UriFormat` (:issue:`4777`)
|
||||
|
||||
- Allow automatic log flushing to be disabled (:issue:`3668`)
|
||||
|
||||
- Avoid unnecessarily invalidating cached wire encodings of Data packets
|
||||
|
||||
- Correct extraction of signed portion of Data packets to be compatible with Packet Specification
|
||||
v0.3 (:issue:`4583`)
|
||||
|
||||
- Fix regression in ``CertificateBundleFetcher`` with ``FinalBlockId`` handling
|
||||
|
||||
- Improve error handling during TPM signing (:issue:`4585`, :issue:`5086`)
|
||||
|
||||
- Correctly handle non-existent identity in ``PibImpl::setDefaultIdentity``
|
||||
|
||||
- Fix incompatibility with Boost 1.73.0+ in :ndn-cxx:`time::toIsoString`
|
||||
|
||||
- Fix incompatibility with ``<version>`` header in C++20
|
||||
|
||||
- Various fixes for Android
|
||||
|
||||
- Various improvements to documentation, test suite structure, and authors list
|
||||
|
||||
Deprecations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Deprecate old Signed Interest and Command Interest formats (:issue:`4804`)
|
||||
|
||||
- Deprecate ``Signature`` in favor of ``SignatureInfo`` in Data packets and certificates (:issue:`4804`)
|
||||
|
||||
- ``SignatureInfo::unsetKeyLocator`` and ``SignatureInfo::unsetValidityPeriod`` have been deprecated
|
||||
|
||||
- Header files under ``ndn/security/v2`` have been moved into the main ``ndn/security`` directory
|
||||
|
||||
Removals
|
||||
^^^^^^^^
|
||||
|
||||
- Remove deprecated ``PendingInterestId``, ``InterestFilterId``, and ``RegisteredPrefixId``
|
||||
(:issue:`4885`)
|
||||
|
||||
- Remove a number of long-deprecated functions and enums
|
||||
@@ -0,0 +1,84 @@
|
||||
ndn-cxx version 0.8.0
|
||||
---------------------
|
||||
|
||||
Release date: February 15, 2022
|
||||
|
||||
Important changes
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Flip default value of ``CanBePrefix`` to **false** (:issue:`4582`). This means that
|
||||
Interests created without explicitly specifying ``CanBePrefix`` option will be treated
|
||||
as Interests for exact Data name.
|
||||
|
||||
- Change default name component encoding convention to ``TYPED`` (:issue:`5044`)
|
||||
|
||||
- Update TLV-TYPE numbers to revision 3 of the `naming conventions`_
|
||||
|
||||
.. _naming conventions:
|
||||
https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
|
||||
|
||||
- Change TLV-TYPE number of ``IncomingFaceId`` field in NDNLP (:issue:`5185`)
|
||||
|
||||
- Update Interest ``ForwardingHint`` format (:issue:`5187`)
|
||||
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Support certificate name, versionless certificate name, and key name options for
|
||||
KeyLocator name in ``ValidatorConfig`` (:issue:`5142`)
|
||||
|
||||
- Generalize signature verification to allow ``digest-sha256``, effectively adding
|
||||
support of digest integrity verification in ``ValidatorConfig``
|
||||
|
||||
- Enforce ``sig-type`` check in ``ValidatorConfig`` (:issue:`4524`)
|
||||
|
||||
- Fix ``ValidatorConfig`` rule processing bug (:issue:`5145`)
|
||||
|
||||
- Prevent potential dereferencing of past-the-end iterator in ``Block::value()``
|
||||
|
||||
- Fail early in :ndn-cxx:`Block::blockFromValue` if TLV length is zero
|
||||
|
||||
- Refactor and cleanup of :ndn-cxx:`StatusDatasetContext`, including increase of maximum
|
||||
payload size of each produced segment to 8000 bytes
|
||||
|
||||
- Improve error reporting when loading a ``Certificate`` or ``SafeBag`` fails
|
||||
|
||||
- Add API to get the keyword name component for Metadata and Prefix Announcements
|
||||
|
||||
- Backport C++20 ``std::span`` and convert most APIs to use it
|
||||
|
||||
- Introduce ``time::{to,from}IsoExtendedString()`` utility functions
|
||||
|
||||
- Add support for OpenSSL 3.0. Note that because of the API changes, HMAC implementation
|
||||
does not currently work when compiled with OpenSSL 3.0+, use older version of OpenSSL
|
||||
when needed.
|
||||
|
||||
- Various build system and documentation extension and fixes
|
||||
|
||||
Deprecations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- ``Interest::setDefaultCanBePrefix()``
|
||||
|
||||
- ``Name::append(Block)`` overload, as it has confusing semantics (:issue:`5186`)
|
||||
|
||||
- ``ndnsec`` tool aliases: ``ndnsec-certgen``, ``ndnsec-dump-certificate``,
|
||||
``ndnsec-install-cert``, ``ndnsec-keygen``, ``ndnsec-ls-identity``
|
||||
|
||||
Removals
|
||||
^^^^^^^^
|
||||
|
||||
- Previously deprecated ``Signature`` class, its subclasses, and deprecated methods from
|
||||
``Data``, ``KeyChain``, ``SignatureInfo``, and ``SigningInfo``
|
||||
|
||||
- Redundant overloads of ``verifySignature()`` and ``verifyDigest()``
|
||||
|
||||
- Previously deprecated ``security/v2`` headers
|
||||
|
||||
- Previously deprecated ``CommandInterestSigner``
|
||||
|
||||
- Unused ``Transport::send()`` overload
|
||||
|
||||
- Remove HTTP download feature in ``ndnsec cert-install``, as it does not support HTTPS
|
||||
retrieval. The recommended way of installing certificates published over HTTP/HTTPS has
|
||||
been changed to use ``curl`` or ``wget`` (:issue:`4506`)
|
||||
@@ -0,0 +1,102 @@
|
||||
ndn-cxx version 0.8.1
|
||||
---------------------
|
||||
|
||||
Release date: December 31, 2022
|
||||
|
||||
.. note::
|
||||
This is the last release of ndn-cxx to support the C++14 standard.
|
||||
Future versions will require C++17 to build.
|
||||
|
||||
Important changes and new features
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- The minimum build requirements have been increased as follows:
|
||||
|
||||
- Either GCC >= 7.4.0 or Clang >= 6.0 is required on Linux
|
||||
- On macOS, Xcode 11.3 or later is recommended; older versions may still work but are not
|
||||
officially supported
|
||||
- Boost >= 1.65.1 and OpenSSL >= 1.1.1 are required on all platforms
|
||||
- Sphinx 4.0 or later is required to build the documentation
|
||||
|
||||
- CentOS Stream 9 is now officially supported; CentOS 8 has been dropped (:issue:`5181`)
|
||||
|
||||
- macOS 12 (Monterey) and 13 (Ventura) running on arm64 are now officially supported
|
||||
(:issue:`5135`)
|
||||
|
||||
- Add the initial version of a :ndn-cxx:`Segmenter` API that applications can use to simplify
|
||||
the process of chunking a large object into multiple signed Data packets (:issue:`5247`)
|
||||
|
||||
- Add ``KeyChain::makeCertificate()`` to simplify the creation of certificates
|
||||
|
||||
- Put the full certificate name in the ``KeyLocator`` field, instead of just the key name
|
||||
(:issue:`5112`)
|
||||
|
||||
- NFD management commands sent by :ndn-cxx:`nfd::Controller` now use the `new signed Interest
|
||||
format <https://docs.named-data.net/NDN-packet-spec/0.3/signed-interest.html>`__ (:issue:`4804`)
|
||||
|
||||
Improvements and bug fixes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Several enhancements and cleanups in :ndn-cxx:`Name` and :ndn-cxx:`Component` to make
|
||||
the API more consistent and simpler to use (:issue:`5186`)
|
||||
|
||||
- Various improvements in the validation framework and policies
|
||||
|
||||
- Avoid redundant TLV decoding during Interest validation
|
||||
- Fix validation of signed Interests with malformed ``InterestSignatureInfo``
|
||||
- More accurate validation error codes are returned in several cases
|
||||
- Rename ``ValidationError::NO_SIGNATURE`` to ``MALFORMED_SIGNATURE``
|
||||
|
||||
- Optimize parsing of PIB and TPM locators in :ndn-cxx:`KeyChain`
|
||||
|
||||
- Major cleanup and modernization of PIB implementation
|
||||
|
||||
- Gracefully handle invalid or unsupported public keys stored in the PIB
|
||||
|
||||
- Fix OpenSSL 3.0 deprecation warnings in private key generation routines (:issue:`5154`)
|
||||
|
||||
- Change ``Certificate::getPublicKey()`` to return a ``span``
|
||||
|
||||
- Make :ndn-cxx:`Block` convertible to ``span<const uint8_t>``
|
||||
|
||||
- Avoid assertion failure in :ndn-cxx:`OBufferStream` under certain conditions (:issue:`5240`)
|
||||
|
||||
- Allow customizing the FaceId in :ndn-cxx:`DummyClientFace` (:issue:`5011`)
|
||||
|
||||
- Improve pretty-printing of certificates, e.g., in ``ndnsec list`` and ``ndnsec cert-dump``
|
||||
|
||||
- Relax restrictions on KeyId component type in ``ndnsec key-gen``
|
||||
|
||||
- Fix handling of ``--without-osx-keychain`` configure option (:issue:`3338`)
|
||||
|
||||
- Stop using the ``gold`` linker on Linux; prefer instead linking with ``lld`` if installed
|
||||
|
||||
- Update waf build system to version 2.0.24
|
||||
|
||||
- Various documentation improvements
|
||||
|
||||
Deprecations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- ``Name::append()`` overloads and :ndn-cxx:`Component` constructors that take a
|
||||
``const uint8_t*``. Use the ``span``-based overloads instead.
|
||||
|
||||
- ``Component::fromImplicitSha256Digest()`` and ``Component::fromParametersSha256Digest()``.
|
||||
Use one of the constructors directly instead.
|
||||
|
||||
Removals
|
||||
^^^^^^^^
|
||||
|
||||
- Obsolete TLV-TYPE definitions
|
||||
|
||||
- Many previously deprecated functions that take raw byte buffers as ``uint8_t*`` + ``size_t``,
|
||||
replaced by equivalent functions that take a ``span``. These include ``Data::setContent()``,
|
||||
``Interest::setApplicationParameters()``, ``Block::fromBuffer()``, ``verifySignature()``,
|
||||
``PublicKey::loadPkcs8()``, ``transform::bufferSource()``, ``random::generateSecureBytes()``,
|
||||
``printHex()``, ``toHex()``, and so on.
|
||||
|
||||
- Previously deprecated ``Name::append(Block)`` overload
|
||||
|
||||
- Previously deprecated ``Interest::setDefaultCanBePrefix()``
|
||||
|
||||
- ``ndn::any`` and related functionality
|
||||
+63
-53
@@ -1,125 +1,135 @@
|
||||
All ndn-cxx Releases
|
||||
++++++++++++++++++++
|
||||
====================
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
:reversed:
|
||||
|
||||
release-notes/release-notes-0.6.6
|
||||
release-notes/release-notes-0.6.5
|
||||
release-notes/release-notes-0.6.3
|
||||
release-notes/release-notes-0.6.2
|
||||
release-notes/release-notes-0.6.1
|
||||
release-notes/release-notes-0.6.0
|
||||
release-notes/release-notes-0.5.1
|
||||
release-notes/release-notes-0.5.0
|
||||
release-notes/release-notes-0.4.1
|
||||
release-notes/release-notes-0.4.0
|
||||
release-notes/release-notes-0.3.4
|
||||
release-notes/release-notes-0.3.3
|
||||
release-notes/release-notes-0.3.2
|
||||
release-notes/release-notes-0.3.1
|
||||
release-notes/release-notes-0.3.0
|
||||
release-notes/release-notes-0.2.0
|
||||
release-notes/release-notes-0.1.0
|
||||
release-notes/*
|
||||
|
||||
* **ndn-cxx version 0.8.1**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.8.1>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.8.1/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.8.1>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.8.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.8.1.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.8.0**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.8.0>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.8.0/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.8.0>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.8.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.8.0.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.7.1**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.7.1>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.7.1/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.7.1>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.7.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.7.1.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.7.0**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.7.0>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.7.0/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.7.0>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.7.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.7.0.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.6.6**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.6>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.6.6/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.6>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.6.6/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.6.6>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.6.6.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.6.6.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.6.6.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.6.6.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.6.5**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.5>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.6.5/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.5>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.6.5/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.6.5>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.6.5.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.6.5.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.6.5.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.6.5.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.6.4 was skipped**
|
||||
* **ndn-cxx version 0.6.4** was skipped
|
||||
|
||||
* **ndn-cxx version 0.6.3**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.3>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.6.3/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.3>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.6.3/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.6.3>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.6.3.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.6.3.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.6.3.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.6.3.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.6.2**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.2>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.6.2/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.2>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.6.2/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.6.2>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.6.2.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.6.2.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.6.2.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.6.2.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.6.1**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.1>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.6.1/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.1>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.6.1/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.6.1>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.6.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.6.1.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.6.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.6.1.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.6.0**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.0>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.6.0/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.6.0>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.6.0/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.6.0>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.6.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.6.0.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.6.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.6.0.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.5.1**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.5.1>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.5.1/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.5.1>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.5.1/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.5.1>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.5.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.5.1.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.5.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.5.1.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.5.0**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.5.0>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.5.0/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.5.0>`, `Documentation <https://docs.named-data.net/ndn-cxx/0.5.0/>`__)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.5.0>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.5.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.5.0.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.5.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.5.0.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.4.1**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.4.1>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.4.1/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.4.1>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.4.1>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.4.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.4.1.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.4.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.4.1.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.4.0**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.4.0>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.4.0/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.4.0>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.4.0>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.4.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.4.0.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.4.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.4.0.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.3.4**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.4>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.3.4/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.4>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.3.4>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.3.4.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.3.4.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.3.4.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.3.4.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.3.3**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.3>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.3.3/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.3>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.3.3>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.3.3.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.3.3.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.3.3.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.3.3.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.3.2**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.2>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.3.2/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.2>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.3.2>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.3.2.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.3.2.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.3.2.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.3.2.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.3.1**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.1>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.3.1/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.1>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.3.1>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.3.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.3.1.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.3.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.3.1.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.3.0**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.0>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.3.0/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.3.0>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.3.0>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.3.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.3.0.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.3.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.3.0.tar.bz2.sha256>`__)
|
||||
|
||||
* **ndn-cxx version 0.2.0**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.2.0>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.2.0/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.2.0>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.2.0>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.2.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.2.0.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.2.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.2.0.tar.bz2.sha256>`__)
|
||||
|
||||
- ndn-cxx version 0.2.0-rc1
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.2.0-rc1>`__
|
||||
@@ -128,10 +138,10 @@ All ndn-cxx Releases
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.2.0-rc2>`__
|
||||
|
||||
* **ndn-cxx version 0.1.0**
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.1.0>`, `Documentation <https://named-data.net/doc/ndn-cxx/0.1.0/>`__)
|
||||
(:doc:`Release Notes <release-notes/release-notes-0.1.0>`)
|
||||
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.1.0>`__,
|
||||
`src (tarball) <https://named-data.net/downloads/nfd-0.1.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.1.0.tar.bz2.sha256>`__)
|
||||
`src (tarball) <https://named-data.net/downloads/ndn-cxx-0.1.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/ndn-cxx-0.1.0.tar.bz2.sha256>`__)
|
||||
|
||||
- ndn-cxx version 0.1.0-rc1
|
||||
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.1.0-rc1>`__
|
||||
+1
-3
@@ -4,7 +4,5 @@ Specifications
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
specs/signed-interest
|
||||
specs/certificate-format
|
||||
specs/safe-bag
|
||||
specs/validation-error-code
|
||||
specs/signed-interest
|
||||
@@ -1,213 +0,0 @@
|
||||
.. _NDN Certificate Format Version 2.0:
|
||||
|
||||
NDN Certificate Format Version 2.0
|
||||
==================================
|
||||
|
||||
.. contents::
|
||||
|
||||
Since signature verification is a common operation in NDN applications, it is
|
||||
important to define a common certificate format to standardize the public key
|
||||
authentication procedure. As every NDN data packet is signed, a data packet
|
||||
that carries a public key as content is conceptually a certificate. However,
|
||||
the specification of a data packet is not sufficient to be the specification of
|
||||
a common certificate format, as it requires additional components. For example,
|
||||
a certificate may follow a specific naming convention and may need to include
|
||||
validity period, revocation information, etc. This specification defines
|
||||
naming and structure of the NDN certificates and is complementary to NDN packet
|
||||
specification.
|
||||
|
||||
::
|
||||
|
||||
Overview of NDN certificate format
|
||||
+--------------------------+
|
||||
| Name |
|
||||
+--------------------------+
|
||||
| MetaInfo |
|
||||
|+------------------------+|
|
||||
|| ContentType: KEY(2) ||
|
||||
|+------------------------+|
|
||||
|+------------------------+|
|
||||
|| FreshnessPeriod: >~ 1h ||
|
||||
|+------------------------+|
|
||||
+--------------------------+
|
||||
| Content |
|
||||
|+------------------------+|
|
||||
|| Public Key ||
|
||||
|+------------------------+|
|
||||
+--------------------------+
|
||||
| SignatureInfo |
|
||||
|+------------------------+|
|
||||
|| SignatureType: ... ||
|
||||
|| KeyLocator: ... ||
|
||||
|| ValidityPeriod: ... ||
|
||||
|| ... ||
|
||||
|+------------------------+|
|
||||
+--------------------------+
|
||||
| SignatureValue |
|
||||
+--------------------------+
|
||||
|
||||
|
||||
CertificateV2 ::= DATA-TLV TLV-LENGTH
|
||||
Name (= /<NameSpace>/KEY/[KeyId]/[IssuerId]/[Version])
|
||||
MetaInfo (.ContentType = KEY,
|
||||
.FreshnessPeriod >~ 1h))
|
||||
Content (= X509PublicKeyContent)
|
||||
SignatureInfo (= CertificateV2SignatureInfo)
|
||||
SignatureValue
|
||||
|
||||
X509PublicKeyContent ::= CONTENT-TLV TLV-LENGTH
|
||||
BYTE+ (= public key bits in PKCS#8 format)
|
||||
|
||||
CertificateV2SignatureInfo ::= SIGNATURE-INFO-TYPE TLV-LENGTH
|
||||
SignatureType
|
||||
KeyLocator
|
||||
ValidityPeriod
|
||||
... optional critical or non-critical extension blocks ...
|
||||
|
||||
|
||||
Name
|
||||
----
|
||||
|
||||
The name of a certificate consists of five parts as shown below:
|
||||
|
||||
::
|
||||
|
||||
/<SubjectName>/KEY/[KeyId]/[IssuerId]/[Version]
|
||||
|
||||
A certificate name starts with the subject to which a public key is bound. The following parts
|
||||
include the keyword ``KEY`` component, KeyId, IssuerId, and version components.
|
||||
|
||||
``KeyId`` is an opaque name component to identify an instance of the public key for the
|
||||
certificate namespace. The value of `Key ID` is controlled by the namespace owner and can be
|
||||
an 8-byte random number, SHA-256 digest of the public key, timestamp, or a simple numerical
|
||||
identifier.
|
||||
|
||||
``Issuer Id`` is an opaque name component to identify issuer of the certificate. The value is
|
||||
controlled by the certificate issuer and, similar to KeyId, can be an 8-byte random number,
|
||||
SHA-256 digest of the issuer's public key, or a simple numerical identifier.
|
||||
|
||||
|
||||
For example,
|
||||
|
||||
::
|
||||
|
||||
/edu/ucla/cs/yingdi/KEY/%03%CD...%F1/%9F%D3...%B7/%FD%d2...%8E
|
||||
\_________________/ \___________/ \___________/\___________/
|
||||
Certificate Namespace Key Id Issuer Id Version
|
||||
(Identity)
|
||||
|
||||
|
||||
MetaInfo
|
||||
--------
|
||||
|
||||
The ``ContentType`` of certificate is set to ``KEY`` (2).
|
||||
|
||||
The ``FreshnessPeriod`` of certificate must be explicitly specified. The
|
||||
recommended value is 1 hour (3,600,000 milliseconds).
|
||||
|
||||
Content
|
||||
-------
|
||||
|
||||
By default, the content of a certificate is the public key encoded in
|
||||
`X509PublicKey <https://tools.ietf.org/html/rfc5280#section-4.1.2.7>`__ format.
|
||||
|
||||
SignatureInfo
|
||||
-------------
|
||||
|
||||
The SignatureInfo block of a certificate is required to include the ``ValidityPeriod`` field.
|
||||
``ValidityPeriod`` includes two sub TLV fields: ``NotBefore`` and ``NotAfter``, which carry two
|
||||
UTC timestamps in ISO 8601 compact format (``yyyymmddTHHMMSS``, e.g., "20020131T235959").
|
||||
``NotBefore`` indicates when the certificate takes effect while ``NotAfter`` indicates when the
|
||||
certificate expires.
|
||||
|
||||
.. note::
|
||||
Using ISO style string is the convention of specifying the validity period of certificate,
|
||||
which has been adopted by many certificate systems, such as X.509, PGP, and DNSSEC.
|
||||
|
||||
::
|
||||
|
||||
ValidityPeriod ::= VALIDITY-PERIOD-TYPE TLV-LENGTH
|
||||
NotBefore
|
||||
NotAfter
|
||||
|
||||
NotBefore ::= NOT-BEFORE-TYPE TLV-LENGTH
|
||||
BYTE{15}
|
||||
|
||||
NotAfter ::= NOT-AFTER-TYPE TLV-LENGTH
|
||||
BYTE{15}
|
||||
|
||||
For each TLV, the TLV-TYPE codes are assigned as below:
|
||||
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| TLV-TYPE | Assigned code | Assigned code |
|
||||
| | (decimal) | (hexadecimal) |
|
||||
+=============================================+===================+================+
|
||||
| ValidityPeriod | 253 | 0xFD |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| NotBefore | 254 | 0xFE |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| NotAfter | 255 | 0xFF |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
|
||||
Extensions
|
||||
~~~~~~~~~~
|
||||
|
||||
A certificate may optionally carry some extensions in SignatureInfo. An extension
|
||||
could be either critical or non-critical depends on the TLV-TYPE code convention. A
|
||||
critical extension implies that if a validator cannot recognize or parse the
|
||||
extension, the validator must reject the certificate. A non-critical extension
|
||||
implies that if a validator cannot recognize or cannot parse the extension, the
|
||||
validator may ignore the extension.
|
||||
|
||||
The TLV-TYPE code range [256, 512) is reserved for extensions. The last bit of a
|
||||
TLV-TYPE code indicates whether the extension is critical or not: ``1`` for critical
|
||||
while ``0`` for non-critical. If an extension could be either critical or
|
||||
non-critical, the extension should be allocated with two TLV-TYPE codes which only
|
||||
differ at the last bit.
|
||||
|
||||
Extensions
|
||||
----------
|
||||
|
||||
We list currently defined extensions:
|
||||
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| TLV-TYPE | Assigned code | Assigned code |
|
||||
| | (decimal) | (hexadecimal) |
|
||||
+=============================================+===================+================+
|
||||
| AdditionalDescription (non-critical) | 258 | 0x0102 |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
|
||||
AdditionalDescription
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``AdditionalDescription`` is a non-critical extension that provides additional
|
||||
information about the certificate. The information is expressed as a set of
|
||||
key-value pairs. Both key and value are UTF-8 strings, e.g.,
|
||||
``("Organization", "UCLA")``. The issuer of a certificate can specify arbitrary
|
||||
key-value pair to provide additional description about the certificate.
|
||||
|
||||
::
|
||||
|
||||
AdditionalDescription ::= ADDITIONAL-DESCRIPTION-TYPE TLV-LENGTH
|
||||
DescriptionEntry+
|
||||
|
||||
DescriptionEntry ::= DESCRIPTION-ENTRY-TYPE TLV-LENGTH
|
||||
DescriptionKey
|
||||
DescriptionValue
|
||||
|
||||
DescriptionKey ::= DESCRIPTION-KEY-TYPE TLV-LENGTH
|
||||
BYTE+
|
||||
|
||||
DescriptionValue ::= DESCRIPTION-VALUE-TYPE TLV-LENGTH
|
||||
BYTE+
|
||||
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| TLV-TYPE | Assigned code | Assigned code |
|
||||
| | (decimal) | (hexadecimal) |
|
||||
+=============================================+===================+================+
|
||||
| DescriptionEntry | 512 | 0x0200 |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| DescriptionKey | 513 | 0x0201 |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| DescriptionValue | 514 | 0x0202 |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
+23
-21
@@ -1,27 +1,29 @@
|
||||
Export/Import Credentials
|
||||
=========================
|
||||
SafeBag Format for Exported Credentials
|
||||
=======================================
|
||||
|
||||
Sometimes, one may need to export credentials (e.g., certificate and private key) from
|
||||
one machine, and import them into another machine. This requires a secured container for
|
||||
sensitive information. We define **SafeBag**, which contains both an NDN certificate
|
||||
(:doc:`version 2.0 <certificate-format>`) and the corresponding private
|
||||
key which is encrypted in `PKCS#8 format <https://tools.ietf.org/html/rfc5208>`_.
|
||||
Sometimes it may be necessary to export an identity's credentials (i.e., private key and associated
|
||||
certificate) from one machine and import them into another. This requires a secure container to
|
||||
carry the sensitive information. For this purpose, we define the **SafeBag** format, which contains
|
||||
an `NDN certificate <https://docs.named-data.net/NDN-packet-spec/0.3/certificate.html>`__ and the
|
||||
corresponding private key in encrypted form. The private key is formatted as a DER-encoded
|
||||
:rfc:`EncryptedPrivateKeyInfo <5208#section-6>` structure as described in PKCS #8.
|
||||
|
||||
The format of **SafeBag** is defined as:
|
||||
The TLV encoding of ``SafeBag`` is defined as follows:
|
||||
|
||||
::
|
||||
.. code-block:: abnf
|
||||
|
||||
SafeBag ::= SAFE-BAG-TYPE TLV-LENGTH
|
||||
Certificate ; a data packet following certificate format spec
|
||||
EncryptedKeyBag ; private key encrypted in PKCS#8 format
|
||||
SafeBag = SAFE-BAG-TYPE TLV-LENGTH
|
||||
Certificate
|
||||
EncryptedKey
|
||||
|
||||
All TLV-TYPE codes are application specific:
|
||||
EncryptedKey = ENCRYPTED-KEY-TYPE TLV-LENGTH
|
||||
*OCTET ; PKCS #8 EncryptedPrivateKeyInfo
|
||||
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| TLV-TYPE | Assigned code | Assigned code |
|
||||
| | (decimal) | (hexadecimal) |
|
||||
+=============================================+===================+================+
|
||||
| SafeBag | 128 | 0x80 |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
| EncryptedKeyBag | 129 | 0x81 |
|
||||
+---------------------------------------------+-------------------+----------------+
|
||||
+---------------------------------------------+------------------+-----------------+
|
||||
| Type | Assigned number | Assigned number |
|
||||
| | (decimal) | (hexadecimal) |
|
||||
+=============================================+==================+=================+
|
||||
| SafeBag | 128 | 0x80 |
|
||||
+---------------------------------------------+------------------+-----------------+
|
||||
| EncryptedKey | 129 | 0x81 |
|
||||
+---------------------------------------------+------------------+-----------------+
|
||||
@@ -1,7 +1,10 @@
|
||||
.. _Signed Interest:
|
||||
Signed Interest Version 0.2 (DEPRECATED)
|
||||
========================================
|
||||
|
||||
Signed Interest
|
||||
===============
|
||||
.. warning::
|
||||
This document describes a deprecated format for signed Interest packets. The current format can
|
||||
be found in the
|
||||
`NDN Packet Specification <https://docs.named-data.net/NDN-packet-spec/current/signed-interest.html>`__.
|
||||
|
||||
**Signed Interest** is a mechanism to issue an authenticated interest.
|
||||
|
||||
@@ -13,7 +16,7 @@ penultimate name component TLV:
|
||||
|
||||
+-------------+----------+-----------------------------------------------------------------------------------+
|
||||
| Interest | Interest | +------+--------+--------------------------------------------------+ +----------+ |
|
||||
| Type (0x01) | length | | Name | Name | +---------+-- --+---------+---------+---------+| | Other | |
|
||||
| Type (0x05) | length | | Name | Name | +---------+-- --+---------+---------+---------+| | Other | |
|
||||
| | | | Type | Length | |Component| ... |Component|Component|Component|| | TLVs ... | |
|
||||
| | | | | | | TLV 1 | | TLV n-2 | TLV n-1 | TLV n || | in | |
|
||||
| | | | | | +---------+-- --+---------+---------+---------+| | Interest | |
|
||||
@@ -27,14 +30,12 @@ penultimate name component TLV:
|
||||
|
||||
More specifically, the SignedInterest is defined to have four additional components:
|
||||
|
||||
- ``<timestamp>``
|
||||
- ``<nonce>``
|
||||
- ``<SignatureInfo>``
|
||||
- ``<SignatureValue>``
|
||||
- ``timestamp``
|
||||
- ``nonce``
|
||||
- ``SignatureInfo``
|
||||
- ``SignatureValue``
|
||||
|
||||
For example, for ``/signed/interest/name`` name, CommandInterest will be defined as:
|
||||
|
||||
::
|
||||
For example, for ``/signed/interest/name`` name, CommandInterest will be defined as::
|
||||
|
||||
/signed/interest/name/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
|
||||
|
||||
@@ -51,21 +52,21 @@ Timestamp component (n-3 *th*)
|
||||
|
||||
The value of the n-3 *th* component is the interest's timestamp (in terms of millisecond offset
|
||||
from UTC 1970-01-01 00:00:00) encoded as
|
||||
`nonNegativeInteger <http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding>`__.
|
||||
`NonNegativeInteger <https://docs.named-data.net/NDN-packet-spec/0.2.1/tlv.html#non-negative-integer-encoding>`__.
|
||||
The timestamp may be used to protect against replay attack.
|
||||
|
||||
Nonce component (n-2 *th*)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The value of the n-2 *th* component is random value (encoded as
|
||||
`nonNegativeInteger <http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding>`__)
|
||||
`NonNegativeInteger <https://docs.named-data.net/NDN-packet-spec/0.2.1/tlv.html#non-negative-integer-encoding>`__)
|
||||
that adds additional assurances that the interest will be unique.
|
||||
|
||||
SignatureInfo component (n-1 *th*)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The value of the n-1 *th* component is actually a
|
||||
`SignatureInfo <http://named-data.net/doc/ndn-tlv/signature.html>`__ TLV.
|
||||
`SignatureInfo <https://docs.named-data.net/NDN-packet-spec/0.2.1/signature.html>`__ TLV.
|
||||
|
||||
::
|
||||
|
||||
@@ -83,7 +84,7 @@ SignatureValue component (n *th*)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The value of the n *th* component is actually a
|
||||
`SignatureValue <http://named-data.net/doc/ndn-tlv/signature.html>`__ TLV.
|
||||
`SignatureValue <https://docs.named-data.net/NDN-packet-spec/0.2.1/signature.html>`__ TLV.
|
||||
|
||||
::
|
||||
|
||||
@@ -108,7 +109,7 @@ be signed, it will be treated as invalid in the following three cases:
|
||||
missing or cannot be parsed correctly;
|
||||
- the key is not trusted for signing the Interest;
|
||||
- the signature cannot be verified with the public key pointed by the
|
||||
`KeyLocator <http://named-data.net/doc/ndn-tlv/signature.html#keylocator>`__ in
|
||||
`KeyLocator <https://docs.named-data.net/NDN-packet-spec/0.2.1/signature.html#keylocator>`__ in
|
||||
SignatureInfo.
|
||||
|
||||
Recipients of a signed interest may further check the timestamp and the uniqueness of the
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
Validation Error Code
|
||||
=====================
|
||||
|
||||
The following table defines a list of known codes and their description, which can be returned from the :ndn-cxx:`v2::Validator` interface.
|
||||
Other error codes can be returned by validator implementations outside ndn-cxx codebase.
|
||||
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| Error code | Short ID | Description |
|
||||
+============+==========================+=====================================================+
|
||||
| 0 | NO_ERROR | No error |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 1 | INVALID_SIGNATURE | Invalid signature |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 2 | NO_SIGNATURE | Missing signature |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 3 | CANNOT_RETRIEVE_CERT | Cannot retrieve certificate |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 4 | EXPIRED_CERT | Certificate expired |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 5 | LOOP_DETECTED | Loop detected in certification chain |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 6 | MALFORMED_CERT | Malformed certificate |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 7 | EXCEEDED_DEPTH_LIMIT | Exceeded validation depth limit |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 8 | INVALID_KEY_LOCATOR | Key locator violates validation policy |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| .. | ... | ... |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
| 255 | IMPLEMENTATION_ERROR | Internal implementation error |
|
||||
+------------+--------------------------+-----------------------------------------------------+
|
||||
|
||||
Specialized validator implementations can use error codes >= 256 to indicate a specialized error.
|
||||
@@ -51,8 +51,7 @@ configuration file containing two rules and a trust anchor.
|
||||
file-name "testbed-trust-anchor.cert"
|
||||
}
|
||||
|
||||
.. note::
|
||||
**ATTENTION: The order of rules MATTERS!**
|
||||
.. attention:: **The order of rules MATTERS!**
|
||||
|
||||
A rule can be broken into two parts:
|
||||
|
||||
@@ -97,8 +96,7 @@ rule. The filter property is not required in a rule; if omitted, the rule will c
|
||||
packets passed to it. A rule may contain multiple filters, in this case, a packet
|
||||
is captured by the rule only if all filters are satisfied.
|
||||
|
||||
.. note::
|
||||
**ATTENTION: A packet that satisfies all the filters may not be valid**.
|
||||
.. attention:: **A packet that satisfies all the filters may not be valid.**
|
||||
|
||||
The **checker** property defines the conditions that a matched packet must fulfill to be
|
||||
treated as a valid packet. A rule must have at least one **checker** property. A packet is
|
||||
@@ -201,31 +199,38 @@ checkers:
|
||||
Customized Checker
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The customized checker requires two properties: **sig-type**, **key-locator**. Both must
|
||||
appear exactly once and are related to the ``SignatureInfo`` of a packet.
|
||||
The customized checker can include optional **sig-type** property, which specifies the acceptable signature
|
||||
type. If not specified, the checker will only accept ECDSA signature. Possible values for **sig-type** are:
|
||||
|
||||
- **ecdsa-sha256**: ECDSA signature required (default if **sig-type** not specified)
|
||||
- **rsa-sha256**: RSA signature required
|
||||
- **sha256** (not recommended, as it is not a real signature): SHA256 digest is required
|
||||
|
||||
If sig-type is **rsa-sha256** or **ecdsa-sha256**, the customized checker requires
|
||||
**key-locator** property. If sig-type is **sha256**, **key-locator** property can be
|
||||
specified, but is optional.
|
||||
|
||||
::
|
||||
|
||||
checker
|
||||
{
|
||||
type customized
|
||||
sig-type ...
|
||||
sig-type rsa-sha256
|
||||
key-locator
|
||||
{
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
The property **sig-type** specifies the acceptable signature type and can be
|
||||
**rsa-sha256**, **ecdsa-sha256** (strong signature types), or **sha256** (weak signature
|
||||
type). If sig-type is sha256, **key-locator** is ignored, and the validator will simply
|
||||
calculate the digest of a packet and compare it with the one in ``SignatureValue``. If
|
||||
sig-type is rsa-sha256 or ecdsa-sha256, you have to further customize the checker with
|
||||
**key-locator**.
|
||||
checker
|
||||
{
|
||||
type customized
|
||||
sig-type sha256
|
||||
}
|
||||
|
||||
The property **key-locator** specifies the conditions on ``KeyLocator``. If the
|
||||
**key-locator** property is specified, it requires the existence of the ``KeyLocator``
|
||||
field in ``SignatureInfo``. **key-locator** property only supports one type: **name**:
|
||||
The **key-locator** property is a nested configuration property that can appear exactly once
|
||||
and specifies conditions on ``KeyLocator``. It requires **type** property that currently
|
||||
supports only one value: **name**.
|
||||
|
||||
::
|
||||
|
||||
@@ -235,9 +240,9 @@ field in ``SignatureInfo``. **key-locator** property only supports one type: **
|
||||
...
|
||||
}
|
||||
|
||||
This key-locator property specifies the conditions on the certificate name of the signing
|
||||
key. Since the conditions are about name, they can be specified in the same way as the
|
||||
name filter. For example, a checker can be:
|
||||
``KeyLocator`` conditions can be specified in the same way as the name filter. For example, a
|
||||
checker that requires ``SignatureSha256WithRsa`` signature type with ``KeyLocator`` to be exactly
|
||||
``/ndn/edu/ucla/yingdi/KEY/1234`` can be written as follows:
|
||||
|
||||
::
|
||||
|
||||
@@ -253,13 +258,27 @@ name filter. For example, a checker can be:
|
||||
}
|
||||
}
|
||||
|
||||
This checker property requires that the packet must have a ``rsa-sha256`` signature that
|
||||
can be verified with ``/ndn/edu/ucla/yingdi/KEY/1234`` key.
|
||||
Similarly, a checker that requires ``SignatureSha256WithEcdsa`` signature with ``KeyLocator``
|
||||
that follows a regular expression pattern ``<ndn><>*<KEY><>{1,3}`` can be written as follows:
|
||||
|
||||
Besides the two ways to express conditions on the ``KeyLocator`` name (name and regex),
|
||||
you can further constrain the ``KeyLocator`` name using the information extracted from the
|
||||
packet name. This third type of condition is expressed via a property
|
||||
**hyper-relation**. The **hyper-relation** property consists of three parts:
|
||||
::
|
||||
|
||||
checker
|
||||
{
|
||||
type customized
|
||||
sig-type ecdsa-sha256
|
||||
key-locator
|
||||
{
|
||||
type name
|
||||
regex <ndn><>*<KEY><>{1,3}
|
||||
relation equal
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
In addition, ``KeyLocator`` can be further constrained using information extracted from the
|
||||
packet name using the **hyper-relation** property.
|
||||
The **hyper-relation** property consists of three parts:
|
||||
|
||||
- an NDN regular expression that extracts information from the packet name
|
||||
- an NDN regular expression that extracts information from the ``KeyLocator`` name
|
||||
@@ -279,7 +298,7 @@ For example, a checker:
|
||||
type name
|
||||
hyper-relation
|
||||
{
|
||||
k-regex ^(<>*)<KEY><>$
|
||||
k-regex ^(<>*)<KEY><>{1,3}$
|
||||
k-expand \\1
|
||||
h-relation is-prefix-of
|
||||
p-regex ^(<>*)$
|
||||
@@ -319,7 +338,7 @@ is equivalent to a customized checker:
|
||||
type name
|
||||
hyper-relation
|
||||
{
|
||||
k-regex ^(<>*)<KEY><>$
|
||||
k-regex ^(<>*)<KEY><>{1,3}$
|
||||
k-expand \\1
|
||||
h-relation is-prefix-of
|
||||
p-regex ^(<>*)$
|
||||
@@ -377,9 +396,9 @@ period, such as
|
||||
There is also a special trust anchor **any**. As long as such a trust-anchor is defined
|
||||
in config file, packet validation will be turned off.
|
||||
|
||||
.. note::
|
||||
**ATTENTION: This type of trust anchor is dangerous. You should used it only when you
|
||||
want to disable packet validation temporarily (e.g, debugging code, building a demo).**
|
||||
.. danger::
|
||||
This type of trust anchor is dangerous. You should used it only when you
|
||||
want to disable packet validation temporarily (e.g., debugging code, building a demo).
|
||||
|
||||
::
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ NDN Regular Expression
|
||||
NDN regular expression is a kind of regular expression that can match NDN names. Matching is
|
||||
performed at two levels: the name level and the name component level.
|
||||
|
||||
A name component matcher, enclosed in ``<`` and ``>``, specifies the pattern of a name component. The
|
||||
component pattern is expressed with the `Perl Regular Expression Syntax
|
||||
<https://www.boost.org/doc/libs/1_58_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html>`__.
|
||||
A name component matcher, enclosed in ``<`` and ``>``, specifies the pattern of a name component.
|
||||
The component pattern is expressed using the `Modified ECMAScript Regular Expression Syntax
|
||||
<https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
|
||||
For example, ``<ab*c>`` matches the 1st, 3rd, and 4th components of ``/ac/dc/abc/abbc``, but does
|
||||
not match the 2nd component. A special case is that ``<>`` denotes a wildcard matcher that can match
|
||||
**ANY** name component.
|
||||
not match the 2nd component. A special case is that ``<>`` denotes a wildcard matcher that can
|
||||
match **ANY** name component.
|
||||
|
||||
A component matcher can match only one name component. To match a name, you need to compose an NDN
|
||||
regular expression with zero or more name component matchers. For example, ``<ndn><edu><ucla>``
|
||||
@@ -31,8 +31,8 @@ name: ``/ndn/edu``.
|
||||
Repetition
|
||||
~~~~~~~~~~
|
||||
|
||||
A component matcher can be followed by a repeat quantifier to indicate how many times the preceding
|
||||
component may appear.
|
||||
A component matcher can be followed by a **repeat quantifier** to indicate how many times the
|
||||
preceding component may appear.
|
||||
|
||||
The ``*`` quantifier denotes "zero or more times". For example, ``^<A><B>*<C>$`` matches ``/A/C``,
|
||||
``/A/B/C``, ``/A/B/B/C``, and so on.
|
||||
@@ -43,44 +43,44 @@ The ``+`` quantifier denotes "one or more times". For example, ``^<A><B>+<C>$``
|
||||
The ``?`` quantifier denotes "zero or one time". For example, ``^<A><B>?<C>`` matches ``/A/C`` and
|
||||
``/A/B/C``, but does not match ``/A/B/B/C``.
|
||||
|
||||
A bounded quantifier specifies a minimum and maximum number of permitted matches: ``{n}`` denotes
|
||||
"exactly ``n`` times"; ``{n,}`` denotes "at least ``n`` times"; ``{,n}`` denotes "at most ``n``
|
||||
times"; ``{n, m}`` denotes "between ``n`` and ``m`` times (inclusive)". For example,
|
||||
``^<A><B>{2, 4}<C>$`` matches ``/A/B/B/C`` and ``/A/B/B/B/B/C``.
|
||||
A **bounded quantifier** specifies either a minimum or a maximum number of permitted matches, or
|
||||
both. ``{n}`` means "exactly ``n`` times"; ``{n,}`` means "at least ``n`` times"; ``{,n}`` means
|
||||
"at most ``n`` times"; ``{m,n}`` (with ``m ≤ n``) means "between ``m`` and ``n`` times (inclusive)".
|
||||
For example, ``^<A><B>{2,4}<C>$`` matches ``/A/B/B/C`` and ``/A/B/B/B/B/C``.
|
||||
|
||||
Note that the quantifiers are **greedy**, which means it will consume as many matched components as
|
||||
possible. NDN regular expressions currently do not support non-greedy repeat matching and possessive
|
||||
repeat matching. For example, for the name ``/A/B/C/C/C``, ``^<A><B><C>+$`` will match the entire
|
||||
name instead of only ``/A/B/C``.
|
||||
Note that the quantifiers are *greedy*, meaning that they will consume as many matching components
|
||||
as possible. For example, for the name ``/A/B/C/C/C``, ``^<A><B><C>+`` will match the entire name
|
||||
instead of only ``/A/B/C``. NDN regular expressions do not currently support non-greedy quantifiers
|
||||
and possessive quantifiers.
|
||||
|
||||
Sets
|
||||
~~~~
|
||||
|
||||
A name component set, denoted by a bracket expression starting with ``[`` and ending with ``]``,
|
||||
A **name component set**, denoted by a bracket expression starting with ``[`` and ending with ``]``,
|
||||
defines a set of name components. It matches any single name component that is a member of that set.
|
||||
|
||||
Unlike standard regular expressions, NDN regular expression only supports **Single Components Set**,
|
||||
Unlike standard regular expressions, NDN regular expressions support only single components sets,
|
||||
that is, you have to list all the set members one by one between the brackets. For example,
|
||||
``^[<ndn><localhost>]`` matches any names starting with either ``ndn"`` or ``localhost`` component.
|
||||
``^[<ndn><localhost>]`` matches any names starting with either ``ndn`` or ``localhost`` component.
|
||||
|
||||
When a name component set starts with a ``'^'``, the set becomes a **Negation Set**. It matches the
|
||||
When a name component set starts with a ``'^'``, the set becomes a **negation set**. It matches the
|
||||
complement of the contained name components. For example, ``^[^<ndn>]`` matches any non-empty name
|
||||
that does not start with ``ndn`` component.
|
||||
that does *not* start with ``/ndn``.
|
||||
|
||||
Some other types of sets, such as Range Set, will be supported later.
|
||||
Some other types of sets, such as range sets, will be supported later.
|
||||
|
||||
Note that component sets may be repeated in the same way as component matchers.
|
||||
|
||||
Sub-pattern and Back Reference
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
A section beginning ``(`` and ending ``)`` acts as a marked sub-pattern. Whatever matched the
|
||||
A section beginning ``(`` and ending ``)`` acts as a **marked sub-pattern**. Whatever matched the
|
||||
sub-pattern is split out in a separate field by the matching algorithm. For example
|
||||
``^<A>(<>{2})<B>(<>)`` matches the name ``/A/C/D/B/E``, and the first sub-pattern captures ``C/D``.
|
||||
|
||||
Marked sub-patterns can be referred to by a back-reference ``\N``, which references one or more
|
||||
capturing groups. In the example above, a back reference ``\1\2`` extracts ``/C/D/E`` out of the
|
||||
name.
|
||||
Marked sub-patterns can be referred to by a **back-reference** of the form ``\N``, which references
|
||||
one or more capturing groups. In the example above, a back reference ``\1\2`` extracts ``/C/D/E``
|
||||
out of the name.
|
||||
|
||||
Marked sub-patterns can also be repeated. The regex engine does not permanently substitute
|
||||
back-references in a regular expression, but will use the last match saved into the back-reference.
|
||||
|
||||
+37
-24
@@ -1,22 +1,22 @@
|
||||
ndn-cxx examples
|
||||
================
|
||||
# ndn-cxx examples
|
||||
|
||||
By default, examples in `examples/` folder are not built. To enable them, use
|
||||
By default, the examples in `examples/` folder are not built. To enable them, use
|
||||
`--with-examples` configure option. For example:
|
||||
|
||||
./waf configure --with-examples
|
||||
./waf
|
||||
|
||||
There are two ways to add new examples, depending on their complexity:
|
||||
There are two ways to add new examples, depending on their complexity.
|
||||
|
||||
1. Examples with a single translation unit
|
||||
1. **Examples with a single translation unit**
|
||||
|
||||
For simple examples that have a single translation unit, the `.cpp` file can be directly put
|
||||
in `examples/` folder and it will be automatically compiled on the next run of `./waf`. Name
|
||||
of the compiled binary will be determined by the base name of the `.cpp` file. For example,
|
||||
`examples/foo.cpp` will be compiled into binary `foo` in `<build>/examples` folder:
|
||||
For simple examples that have a single translation unit, the `.cpp` file can be directly put
|
||||
in the `examples/` folder and it will be automatically compiled on the next run of `./waf`.
|
||||
The name of the compiled executable will be determined by the base name of the `.cpp` file.
|
||||
For instance, `examples/foo.cpp` will be compiled into an executable named `foo` inside the
|
||||
`build/examples` folder:
|
||||
|
||||
echo "int main() { return 0; }" > examples/foo.cpp
|
||||
echo 'int main() { return 0; }' > examples/foo.cpp
|
||||
./waf
|
||||
# ... Compiling examples/foo.cpp
|
||||
# ... Linking build/examples/foo
|
||||
@@ -24,25 +24,23 @@ There are two ways to add new examples, depending on their complexity:
|
||||
# To run the example
|
||||
./build/examples/foo
|
||||
|
||||
2. Examples with multiple translation units
|
||||
2. **Examples with multiple translation units**
|
||||
|
||||
For more complex examples that contain multiple translation units, one can use
|
||||
the following directory structure:
|
||||
For more complex examples that contain multiple translation units, one can use
|
||||
the following directory structure:
|
||||
|
||||
- Create a directory under `examples/` folder (e.g., `examples/bar`).
|
||||
The name of this directory will determine the name of the compiled binary
|
||||
(`<build>/examples/bar/bar`)
|
||||
- Create a directory under the `examples/` folder (e.g., `examples/bar`). The name of this
|
||||
directory will determine the name of the compiled executable (`build/examples/bar/bar`).
|
||||
- Place any number of translation units (e.g., `examples/bar/a.cpp`, `examples/bar/b.cpp`,
|
||||
...) in this directory. All `.cpp` files in this directory will be compiled and linked
|
||||
together to produce the binary executable of the example. One of the .cpp files must
|
||||
contain the `main()` function.
|
||||
|
||||
- Place any number of translation units (e.g., `examples/bar/a.cpp`, `examples/bar/b.cpp`,
|
||||
...) in this directory. All `.cpp` files in this directory will be compiled and linked
|
||||
together to produce the binary of the example. One of the .cpp files should contain
|
||||
the `main()` function.
|
||||
|
||||
For example:
|
||||
For example:
|
||||
|
||||
mkdir examples/bar
|
||||
echo "int bar(); int main() { return bar(); }" > examples/bar/a.cpp
|
||||
echo "int bar() { return 10; } " > examples/bar/b.cpp
|
||||
echo 'int bar(); int main() { return bar(); }' > examples/bar/a.cpp
|
||||
echo 'int bar() { return 10; }' > examples/bar/b.cpp
|
||||
./waf
|
||||
# ... Compiling examples/bar/a.cpp
|
||||
# ... Compiling examples/bar/b.cpp
|
||||
@@ -50,3 +48,18 @@ There are two ways to add new examples, depending on their complexity:
|
||||
|
||||
# To run the example
|
||||
./build/examples/bar/bar
|
||||
|
||||
## Security configuration for example apps
|
||||
|
||||
In order for the ``consumer`` example app to be able to properly authenticate data packets
|
||||
created by the ``producer`` app, you must configure the following parameters.
|
||||
|
||||
1. Generate example trust anchor:
|
||||
|
||||
ndnsec key-gen /example
|
||||
ndnsec cert-dump -i /example > example-trust-anchor.cert
|
||||
|
||||
2. Create a key for the producer and sign it with the example trust anchor:
|
||||
|
||||
ndnsec key-gen /example/testApp
|
||||
ndnsec sign-req /example/testApp | ndnsec cert-gen -s /example -i example | ndnsec cert-install -
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2019 Regents of the University of California.
|
||||
* Copyright (c) 2013-2023 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -17,49 +17,43 @@
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*
|
||||
* @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
|
||||
*/
|
||||
|
||||
#include <ndn-cxx/face.hpp>
|
||||
#include <ndn-cxx/util/scheduler.hpp>
|
||||
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <iostream>
|
||||
|
||||
// Enclosing code in ndn simplifies coding (can also use `using namespace ndn`)
|
||||
namespace ndn {
|
||||
// Additional nested namespaces can be used to prevent/limit name conflicts
|
||||
// Additional nested namespaces should be used to prevent/limit name conflicts
|
||||
namespace examples {
|
||||
|
||||
class ConsumerWithTimer
|
||||
{
|
||||
public:
|
||||
ConsumerWithTimer()
|
||||
: m_face(m_ioService) // Create face with io_service object
|
||||
, m_scheduler(m_ioService)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
run()
|
||||
{
|
||||
Interest interest(Name("/example/testApp/randomData"));
|
||||
interest.setInterestLifetime(2_s); // 2 seconds
|
||||
Name interestName("/example/testApp/randomData");
|
||||
interestName.appendVersion();
|
||||
|
||||
Interest interest(interestName);
|
||||
interest.setMustBeFresh(true);
|
||||
interest.setInterestLifetime(2_s);
|
||||
|
||||
std::cout << "Sending Interest " << interest << std::endl;
|
||||
m_face.expressInterest(interest,
|
||||
bind(&ConsumerWithTimer::onData, this, _1, _2),
|
||||
bind(&ConsumerWithTimer::onNack, this, _1, _2),
|
||||
bind(&ConsumerWithTimer::onTimeout, this, _1));
|
||||
|
||||
std::cout << "Sending " << interest << std::endl;
|
||||
std::bind(&ConsumerWithTimer::onData, this, _1, _2),
|
||||
std::bind(&ConsumerWithTimer::onNack, this, _1, _2),
|
||||
std::bind(&ConsumerWithTimer::onTimeout, this, _1));
|
||||
|
||||
// Schedule a new event
|
||||
m_scheduler.schedule(3_s, [this] { delayedInterest(); });
|
||||
|
||||
// m_ioService.run() will block until all events finished or m_ioService.stop() is called
|
||||
m_ioService.run();
|
||||
// m_ioCtx.run() will block until all events finished or m_ioCtx.stop() is called
|
||||
m_ioCtx.run();
|
||||
|
||||
// Alternatively, m_face.processEvents() can also be called.
|
||||
// processEvents will block until the requested data received or timeout occurs.
|
||||
@@ -68,22 +62,22 @@ public:
|
||||
|
||||
private:
|
||||
void
|
||||
onData(const Interest& interest, const Data& data)
|
||||
onData(const Interest&, const Data& data) const
|
||||
{
|
||||
std::cout << data << std::endl;
|
||||
std::cout << "Received Data " << data << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
onNack(const Interest& interest, const lp::Nack& nack)
|
||||
onNack(const Interest& interest, const lp::Nack& nack) const
|
||||
{
|
||||
std::cout << "received Nack with reason " << nack.getReason()
|
||||
<< " for interest " << interest << std::endl;
|
||||
std::cout << "Received Nack with reason " << nack.getReason()
|
||||
<< " for " << interest << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
onTimeout(const Interest& interest)
|
||||
onTimeout(const Interest& interest) const
|
||||
{
|
||||
std::cout << "Timeout " << interest << std::endl;
|
||||
std::cout << "Timeout for " << interest << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -91,23 +85,25 @@ private:
|
||||
{
|
||||
std::cout << "One more Interest, delayed by the scheduler" << std::endl;
|
||||
|
||||
Interest interest(Name("/example/testApp/randomData"));
|
||||
interest.setInterestLifetime(2_s); // 2 seconds
|
||||
Name interestName("/example/testApp/randomData");
|
||||
interestName.appendVersion();
|
||||
|
||||
Interest interest(interestName);
|
||||
interest.setMustBeFresh(true);
|
||||
interest.setInterestLifetime(2_s);
|
||||
|
||||
std::cout << "Sending Interest " << interest << std::endl;
|
||||
m_face.expressInterest(interest,
|
||||
bind(&ConsumerWithTimer::onData, this, _1, _2),
|
||||
bind(&ConsumerWithTimer::onNack, this, _1, _2),
|
||||
bind(&ConsumerWithTimer::onTimeout, this, _1));
|
||||
|
||||
std::cout << "Sending " << interest << std::endl;
|
||||
std::bind(&ConsumerWithTimer::onData, this, _1, _2),
|
||||
std::bind(&ConsumerWithTimer::onNack, this, _1, _2),
|
||||
std::bind(&ConsumerWithTimer::onTimeout, this, _1));
|
||||
}
|
||||
|
||||
private:
|
||||
// Explicitly create io_service object, which can be shared between Face and Scheduler
|
||||
boost::asio::io_service m_ioService;
|
||||
Face m_face;
|
||||
Scheduler m_scheduler;
|
||||
// Explicitly create io_context object, which will be shared between Face and Scheduler
|
||||
boost::asio::io_context m_ioCtx;
|
||||
Face m_face{m_ioCtx};
|
||||
Scheduler m_scheduler{m_ioCtx};
|
||||
};
|
||||
|
||||
} // namespace examples
|
||||
@@ -116,12 +112,13 @@ private:
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
ndn::examples::ConsumerWithTimer consumer;
|
||||
try {
|
||||
ndn::examples::ConsumerWithTimer consumer;
|
||||
consumer.run();
|
||||
return 0;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "ERROR: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+37
-22
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2018 Regents of the University of California.
|
||||
* Copyright (c) 2013-2022 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -17,62 +17,76 @@
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*
|
||||
* @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
|
||||
*/
|
||||
|
||||
#include <ndn-cxx/face.hpp>
|
||||
#include <ndn-cxx/security/validator-config.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// Enclosing code in ndn simplifies coding (can also use `using namespace ndn`)
|
||||
namespace ndn {
|
||||
// Additional nested namespaces can be used to prevent/limit name conflicts
|
||||
// Additional nested namespaces should be used to prevent/limit name conflicts
|
||||
namespace examples {
|
||||
|
||||
class Consumer : noncopyable
|
||||
class Consumer
|
||||
{
|
||||
public:
|
||||
Consumer()
|
||||
{
|
||||
m_validator.load("trust-schema.conf");
|
||||
}
|
||||
|
||||
void
|
||||
run()
|
||||
{
|
||||
Interest interest(Name("/example/testApp/randomData"));
|
||||
interest.setInterestLifetime(2_s); // 2 seconds
|
||||
Name interestName("/example/testApp/randomData");
|
||||
interestName.appendVersion();
|
||||
|
||||
Interest interest(interestName);
|
||||
interest.setMustBeFresh(true);
|
||||
interest.setInterestLifetime(6_s); // The default is 4 seconds
|
||||
|
||||
std::cout << "Sending Interest " << interest << std::endl;
|
||||
m_face.expressInterest(interest,
|
||||
bind(&Consumer::onData, this, _1, _2),
|
||||
bind(&Consumer::onNack, this, _1, _2),
|
||||
bind(&Consumer::onTimeout, this, _1));
|
||||
std::bind(&Consumer::onData, this, _1, _2),
|
||||
std::bind(&Consumer::onNack, this, _1, _2),
|
||||
std::bind(&Consumer::onTimeout, this, _1));
|
||||
|
||||
std::cout << "Sending " << interest << std::endl;
|
||||
|
||||
// processEvents will block until the requested data received or timeout occurs
|
||||
// processEvents will block until the requested data is received or a timeout occurs
|
||||
m_face.processEvents();
|
||||
}
|
||||
|
||||
private:
|
||||
void
|
||||
onData(const Interest& interest, const Data& data)
|
||||
onData(const Interest&, const Data& data)
|
||||
{
|
||||
std::cout << data << std::endl;
|
||||
std::cout << "Received Data " << data << std::endl;
|
||||
|
||||
m_validator.validate(data,
|
||||
[] (const Data&) {
|
||||
std::cout << "Data conforms to trust schema" << std::endl;
|
||||
},
|
||||
[] (const Data&, const security::ValidationError& error) {
|
||||
std::cout << "Error authenticating data: " << error << std::endl;
|
||||
});
|
||||
}
|
||||
|
||||
void
|
||||
onNack(const Interest& interest, const lp::Nack& nack)
|
||||
onNack(const Interest&, const lp::Nack& nack) const
|
||||
{
|
||||
std::cout << "received Nack with reason " << nack.getReason()
|
||||
<< " for interest " << interest << std::endl;
|
||||
std::cout << "Received Nack with reason " << nack.getReason() << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
onTimeout(const Interest& interest)
|
||||
onTimeout(const Interest& interest) const
|
||||
{
|
||||
std::cout << "Timeout " << interest << std::endl;
|
||||
std::cout << "Timeout for " << interest << std::endl;
|
||||
}
|
||||
|
||||
private:
|
||||
Face m_face;
|
||||
ValidatorConfig m_validator{m_face};
|
||||
};
|
||||
|
||||
} // namespace examples
|
||||
@@ -81,12 +95,13 @@ private:
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
ndn::examples::Consumer consumer;
|
||||
try {
|
||||
ndn::examples::Consumer consumer;
|
||||
consumer.run();
|
||||
return 0;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "ERROR: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+44
-32
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2018 Regents of the University of California.
|
||||
* Copyright (c) 2013-2023 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -17,76 +17,87 @@
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*
|
||||
* @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
|
||||
*/
|
||||
|
||||
#include <ndn-cxx/face.hpp>
|
||||
#include <ndn-cxx/security/key-chain.hpp>
|
||||
#include <ndn-cxx/security/signing-helpers.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// Enclosing code in ndn simplifies coding (can also use `using namespace ndn`)
|
||||
namespace ndn {
|
||||
// Additional nested namespaces can be used to prevent/limit name conflicts
|
||||
// Additional nested namespaces should be used to prevent/limit name conflicts
|
||||
namespace examples {
|
||||
|
||||
class Producer : noncopyable
|
||||
class Producer
|
||||
{
|
||||
public:
|
||||
void
|
||||
run()
|
||||
{
|
||||
m_face.setInterestFilter("/example/testApp",
|
||||
bind(&Producer::onInterest, this, _1, _2),
|
||||
RegisterPrefixSuccessCallback(),
|
||||
bind(&Producer::onRegisterFailed, this, _1, _2));
|
||||
m_face.setInterestFilter("/example/testApp/randomData",
|
||||
std::bind(&Producer::onInterest, this, _2),
|
||||
nullptr, // RegisterPrefixSuccessCallback is optional
|
||||
std::bind(&Producer::onRegisterFailed, this, _1, _2));
|
||||
|
||||
auto cert = m_keyChain.getPib().getDefaultIdentity().getDefaultKey().getDefaultCertificate();
|
||||
m_certServeHandle = m_face.setInterestFilter(security::extractIdentityFromCertName(cert.getName()),
|
||||
[this, cert] (auto&&...) {
|
||||
m_face.put(cert);
|
||||
},
|
||||
std::bind(&Producer::onRegisterFailed, this, _1, _2));
|
||||
m_face.processEvents();
|
||||
}
|
||||
|
||||
private:
|
||||
void
|
||||
onInterest(const InterestFilter& filter, const Interest& interest)
|
||||
onInterest(const Interest& interest)
|
||||
{
|
||||
std::cout << "<< I: " << interest << std::endl;
|
||||
|
||||
// Create new name, based on Interest's name
|
||||
Name dataName(interest.getName());
|
||||
dataName
|
||||
.append("testApp") // add "testApp" component to Interest name
|
||||
.appendVersion(); // add "version" component (current UNIX timestamp in milliseconds)
|
||||
|
||||
static const std::string content = "HELLO KITTY";
|
||||
std::cout << ">> I: " << interest << std::endl;
|
||||
|
||||
// Create Data packet
|
||||
shared_ptr<Data> data = make_shared<Data>();
|
||||
data->setName(dataName);
|
||||
data->setFreshnessPeriod(10_s); // 10 seconds
|
||||
data->setContent(reinterpret_cast<const uint8_t*>(content.data()), content.size());
|
||||
auto data = std::make_shared<Data>();
|
||||
data->setName(interest.getName());
|
||||
data->setFreshnessPeriod(10_s);
|
||||
data->setContent("Hello, world!");
|
||||
|
||||
// In order for the consumer application to be able to validate the packet, you need to setup
|
||||
// the following keys:
|
||||
// 1. Generate example trust anchor
|
||||
//
|
||||
// ndnsec key-gen /example
|
||||
// ndnsec cert-dump -i /example > example-trust-anchor.cert
|
||||
//
|
||||
// 2. Create a key for the producer and sign it with the example trust anchor
|
||||
//
|
||||
// ndnsec key-gen /example/testApp
|
||||
// ndnsec sign-req /example/testApp | ndnsec cert-gen -s /example -i example | ndnsec cert-install -
|
||||
|
||||
// Sign Data packet with default identity
|
||||
m_keyChain.sign(*data);
|
||||
// m_keyChain.sign(data, <identityName>);
|
||||
// m_keyChain.sign(data, <certificate>);
|
||||
// m_keyChain.sign(*data, signingByIdentity(<identityName>));
|
||||
// m_keyChain.sign(*data, signingByKey(<keyName>));
|
||||
// m_keyChain.sign(*data, signingByCertificate(<certName>));
|
||||
// m_keyChain.sign(*data, signingWithSha256());
|
||||
|
||||
// Return Data packet to the requester
|
||||
std::cout << ">> D: " << *data << std::endl;
|
||||
std::cout << "<< D: " << *data << std::endl;
|
||||
m_face.put(*data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
onRegisterFailed(const Name& prefix, const std::string& reason)
|
||||
{
|
||||
std::cerr << "ERROR: Failed to register prefix \""
|
||||
<< prefix << "\" in local hub's daemon (" << reason << ")"
|
||||
<< std::endl;
|
||||
std::cerr << "ERROR: Failed to register prefix '" << prefix
|
||||
<< "' with the local forwarder (" << reason << ")\n";
|
||||
m_face.shutdown();
|
||||
}
|
||||
|
||||
private:
|
||||
Face m_face;
|
||||
KeyChain m_keyChain;
|
||||
ScopedRegisteredPrefixHandle m_certServeHandle;
|
||||
};
|
||||
|
||||
} // namespace examples
|
||||
@@ -95,12 +106,13 @@ private:
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
ndn::examples::Producer producer;
|
||||
try {
|
||||
ndn::examples::Producer producer;
|
||||
producer.run();
|
||||
return 0;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "ERROR: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
rule
|
||||
{
|
||||
id "Example rule"
|
||||
for data
|
||||
filter
|
||||
{
|
||||
type name
|
||||
name /example/testApp
|
||||
relation is-prefix-of
|
||||
}
|
||||
checker
|
||||
{
|
||||
type customized
|
||||
sig-type ecdsa-sha256
|
||||
key-locator
|
||||
{
|
||||
type name
|
||||
hyper-relation
|
||||
{
|
||||
k-regex ^(<>*)<KEY><><>?<>?$
|
||||
k-expand \\1
|
||||
h-relation is-prefix-of
|
||||
p-regex ^(<>*)<>*$
|
||||
p-expand \\1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
trust-anchor
|
||||
{
|
||||
type file
|
||||
file-name "example-trust-anchor.cert"
|
||||
}
|
||||
+2
-2
@@ -6,7 +6,7 @@ def build(bld):
|
||||
# List all .cpp files (whole example in one .cpp)
|
||||
for ex in bld.path.ant_glob('*.cpp'):
|
||||
name = ex.change_ext('').path_from(bld.path.get_bld())
|
||||
bld.program(name='example-%s' % name,
|
||||
bld.program(name=f'example-{name}',
|
||||
target=name,
|
||||
source=[ex],
|
||||
use='ndn-cxx',
|
||||
@@ -15,7 +15,7 @@ def build(bld):
|
||||
# List all directories (example can have multiple .cpp in the directory)
|
||||
for subdir in bld.path.ant_glob('*', dir=True, src=False):
|
||||
name = subdir.path_from(bld.path)
|
||||
bld.program(name='example-%s' % name,
|
||||
bld.program(name=f'example-{name}',
|
||||
target=name,
|
||||
source=subdir.ant_glob('**/*.cpp'),
|
||||
use='ndn-cxx',
|
||||
|
||||
+199
-79
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2019 Regents of the University of California.
|
||||
* Copyright (c) 2013-2023 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -20,21 +20,12 @@
|
||||
*/
|
||||
|
||||
#include "ndn-cxx/data.hpp"
|
||||
#include "ndn-cxx/encoding/block-helpers.hpp"
|
||||
#include "ndn-cxx/util/sha256.hpp"
|
||||
|
||||
namespace ndn {
|
||||
|
||||
BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Data>));
|
||||
BOOST_CONCEPT_ASSERT((WireEncodable<Data>));
|
||||
BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Data>));
|
||||
BOOST_CONCEPT_ASSERT((WireDecodable<Data>));
|
||||
static_assert(std::is_base_of<tlv::Error, Data::Error>::value,
|
||||
"Data::Error must inherit from tlv::Error");
|
||||
|
||||
Data::Data(const Name& name)
|
||||
: m_name(name)
|
||||
, m_content(tlv::Content)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -47,34 +38,52 @@ template<encoding::Tag TAG>
|
||||
size_t
|
||||
Data::wireEncode(EncodingImpl<TAG>& encoder, bool wantUnsignedPortionOnly) const
|
||||
{
|
||||
// Data ::= DATA-TLV TLV-LENGTH
|
||||
// Name
|
||||
// MetaInfo?
|
||||
// Content?
|
||||
// SignatureInfo
|
||||
// SignatureValue
|
||||
// Data = DATA-TYPE TLV-LENGTH
|
||||
// Name
|
||||
// [MetaInfo]
|
||||
// [Content]
|
||||
// SignatureInfo
|
||||
// SignatureValue
|
||||
// [ServiceClass]
|
||||
// [TargetRate]
|
||||
// (elements are encoded in reverse order)
|
||||
|
||||
size_t totalLength = 0;
|
||||
|
||||
// TargetRate
|
||||
if (getTargetRate()) {
|
||||
uint64_t targetRate = *getTargetRate();
|
||||
totalLength += prependNonNegativeIntegerBlock(encoder, tlv::TargetRate, targetRate);
|
||||
// totalLength += encoder.prependByteArrayBlock(tlv::TargetRate, reinterpret_cast<uint8_t*>(&targetRate), sizeof(targetRate));
|
||||
}
|
||||
// ServiceClass
|
||||
if (getServiceClass()) {
|
||||
uint8_t serviceClass = *getServiceClass();
|
||||
totalLength += prependNonNegativeIntegerBlock(encoder, tlv::ServiceClass, serviceClass);
|
||||
// totalLength += encoder.prependByteArrayBlock(tlv::ServiceClass, reinterpret_cast<uint8_t*>(&serviceClass), sizeof(serviceClass));
|
||||
}
|
||||
|
||||
// SignatureValue
|
||||
if (!wantUnsignedPortionOnly) {
|
||||
if (!m_signature) {
|
||||
if (!m_signatureInfo) {
|
||||
NDN_THROW(Error("Requested wire format, but Data has not been signed"));
|
||||
}
|
||||
totalLength += encoder.prependBlock(m_signature.getValue());
|
||||
totalLength += prependBlock(encoder, m_signatureValue);
|
||||
}
|
||||
|
||||
// SignatureInfo
|
||||
totalLength += encoder.prependBlock(m_signature.getInfo());
|
||||
totalLength += m_signatureInfo.wireEncode(encoder, SignatureInfo::Type::Data);
|
||||
|
||||
// Content
|
||||
totalLength += encoder.prependBlock(getContent());
|
||||
if (hasContent()) {
|
||||
totalLength += prependBlock(encoder, m_content);
|
||||
}
|
||||
|
||||
// MetaInfo
|
||||
totalLength += getMetaInfo().wireEncode(encoder);
|
||||
totalLength += m_metaInfo.wireEncode(encoder);
|
||||
|
||||
// Name
|
||||
totalLength += getName().wireEncode(encoder);
|
||||
totalLength += m_name.wireEncode(encoder);
|
||||
|
||||
if (!wantUnsignedPortionOnly) {
|
||||
totalLength += encoder.prependVarNumber(totalLength);
|
||||
@@ -90,10 +99,12 @@ template size_t
|
||||
Data::wireEncode<encoding::EstimatorTag>(EncodingEstimator&, bool) const;
|
||||
|
||||
const Block&
|
||||
Data::wireEncode(EncodingBuffer& encoder, const Block& signatureValue) const
|
||||
Data::wireEncode(EncodingBuffer& encoder, span<const uint8_t> signature) const
|
||||
{
|
||||
size_t totalLength = encoder.size();
|
||||
totalLength += encoder.appendBlock(signatureValue);
|
||||
totalLength += encoder.appendVarNumber(tlv::SignatureValue);
|
||||
totalLength += encoder.appendVarNumber(signature.size());
|
||||
totalLength += encoder.appendBytes(signature);
|
||||
|
||||
encoder.prependVarNumber(totalLength);
|
||||
encoder.prependVarNumber(tlv::Data);
|
||||
@@ -121,28 +132,34 @@ Data::wireEncode() const
|
||||
void
|
||||
Data::wireDecode(const Block& wire)
|
||||
{
|
||||
// Data ::= DATA-TLV TLV-LENGTH
|
||||
// Name
|
||||
// MetaInfo?
|
||||
// Content?
|
||||
// SignatureInfo
|
||||
// SignatureValue
|
||||
|
||||
if (wire.type() != tlv::Data) {
|
||||
NDN_THROW(Error("Data", wire.type()));
|
||||
}
|
||||
m_wire = wire;
|
||||
m_wire.parse();
|
||||
|
||||
// Data = DATA-TYPE TLV-LENGTH
|
||||
// Name
|
||||
// [MetaInfo]
|
||||
// [Content]
|
||||
// SignatureInfo
|
||||
// SignatureValue
|
||||
// [ServiceClass]
|
||||
// [TargetRate]
|
||||
|
||||
auto element = m_wire.elements_begin();
|
||||
if (element == m_wire.elements_end() || element->type() != tlv::Name) {
|
||||
NDN_THROW(Error("Name element is missing or out of order"));
|
||||
}
|
||||
m_name.wireDecode(*element);
|
||||
int lastElement = 1; // last recognized element index, in spec order
|
||||
|
||||
m_metaInfo = MetaInfo();
|
||||
m_content = Block(tlv::Content);
|
||||
m_signature = Signature();
|
||||
m_metaInfo = {};
|
||||
m_content = {};
|
||||
m_signatureInfo = {};
|
||||
m_signatureValue = {};
|
||||
m_fullName.clear();
|
||||
|
||||
int lastElement = 1; // last recognized element index, in spec order
|
||||
for (++element; element != m_wire.elements_end(); ++element) {
|
||||
switch (element->type()) {
|
||||
case tlv::MetaInfo: {
|
||||
@@ -165,7 +182,7 @@ Data::wireDecode(const Block& wire)
|
||||
if (lastElement >= 4) {
|
||||
NDN_THROW(Error("SignatureInfo element is out of order"));
|
||||
}
|
||||
m_signature.setInfo(*element);
|
||||
m_signatureInfo.wireDecode(*element);
|
||||
lastElement = 4;
|
||||
break;
|
||||
}
|
||||
@@ -173,22 +190,51 @@ Data::wireDecode(const Block& wire)
|
||||
if (lastElement >= 5) {
|
||||
NDN_THROW(Error("SignatureValue element is out of order"));
|
||||
}
|
||||
m_signature.setValue(*element);
|
||||
m_signatureValue = *element;
|
||||
lastElement = 5;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (tlv::isCriticalType(element->type())) {
|
||||
NDN_THROW(Error("unrecognized element of critical type " + to_string(element->type())));
|
||||
case tlv::ServiceClass: {
|
||||
if (lastElement >= 6) {
|
||||
break; // ServiceClass is non-critical, ignore out-of-order appearance
|
||||
}
|
||||
if (element->value_size() != 1) {
|
||||
NDN_THROW(Error("ServiceClass element is malformed"));
|
||||
}
|
||||
m_serviceClass = *element->value();
|
||||
lastElement = 6;
|
||||
break;
|
||||
}
|
||||
case tlv::TargetRate: {
|
||||
if (lastElement >= 7) {
|
||||
break; // TargetRate is non-critical, ignore out-of-order appearance
|
||||
}
|
||||
uint64_t targetRate = 0;
|
||||
if (element->value_size() != 8) {
|
||||
NDN_THROW(Error("TargetRate element is malformed"));
|
||||
}
|
||||
std::memcpy(&targetRate, element->value(), sizeof(targetRate));
|
||||
m_targetRate = targetRate;
|
||||
lastElement = 7;
|
||||
break;
|
||||
}
|
||||
default: { // unrecognized element
|
||||
// if the TLV-TYPE is critical, abort decoding
|
||||
if (tlv::isCriticalType(element->type())) {
|
||||
NDN_THROW(Error("Unrecognized element of critical type " + to_string(element->type())));
|
||||
}
|
||||
// otherwise, ignore it
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_signature) {
|
||||
if (!m_signatureInfo) {
|
||||
NDN_THROW(Error("SignatureInfo element is missing"));
|
||||
}
|
||||
if (!m_signatureValue.isValid()) {
|
||||
NDN_THROW(Error("SignatureValue element is missing"));
|
||||
}
|
||||
}
|
||||
|
||||
const Name&
|
||||
@@ -199,7 +245,7 @@ Data::getFullName() const
|
||||
NDN_THROW(Error("Cannot compute full name because Data has no wire encoding (not signed)"));
|
||||
}
|
||||
m_fullName = m_name;
|
||||
m_fullName.appendImplicitSha256Digest(util::Sha256::computeDigest(m_wire.wire(), m_wire.size()));
|
||||
m_fullName.appendImplicitSha256Digest(util::Sha256::computeDigest(m_wire));
|
||||
}
|
||||
|
||||
return m_fullName;
|
||||
@@ -215,32 +261,27 @@ Data::resetWire()
|
||||
Data&
|
||||
Data::setName(const Name& name)
|
||||
{
|
||||
resetWire();
|
||||
m_name = name;
|
||||
if (name != m_name) {
|
||||
m_name = name;
|
||||
resetWire();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setMetaInfo(const MetaInfo& metaInfo)
|
||||
{
|
||||
resetWire();
|
||||
m_metaInfo = metaInfo;
|
||||
resetWire();
|
||||
return *this;
|
||||
}
|
||||
|
||||
const Block&
|
||||
Data::getContent() const
|
||||
{
|
||||
if (!m_content.hasWire()) {
|
||||
const_cast<Block&>(m_content).encode();
|
||||
}
|
||||
return m_content;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setContent(const Block& block)
|
||||
{
|
||||
resetWire();
|
||||
if (!block.isValid()) {
|
||||
NDN_THROW(std::invalid_argument("Content block must be valid"));
|
||||
}
|
||||
|
||||
if (block.type() == tlv::Content) {
|
||||
m_content = block;
|
||||
@@ -248,63 +289,137 @@ Data::setContent(const Block& block)
|
||||
else {
|
||||
m_content = Block(tlv::Content, block);
|
||||
}
|
||||
|
||||
m_content.encode();
|
||||
resetWire();
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setContent(const uint8_t* value, size_t valueSize)
|
||||
Data::setContent(span<const uint8_t> value)
|
||||
{
|
||||
m_content = makeBinaryBlock(tlv::Content, value);
|
||||
resetWire();
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setContent(std::string_view value)
|
||||
{
|
||||
m_content = makeStringBlock(tlv::Content, value);
|
||||
resetWire();
|
||||
m_content = makeBinaryBlock(tlv::Content, value, valueSize);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setContent(ConstBufferPtr value)
|
||||
{
|
||||
resetWire();
|
||||
if (!value) {
|
||||
NDN_THROW(std::invalid_argument("Content buffer cannot be null"));
|
||||
}
|
||||
|
||||
m_content = Block(tlv::Content, std::move(value));
|
||||
resetWire();
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setSignature(const Signature& signature)
|
||||
Data::unsetContent()
|
||||
{
|
||||
resetWire();
|
||||
m_signature = signature;
|
||||
if (m_content.isValid()) {
|
||||
m_content = {};
|
||||
resetWire();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setSignatureValue(const Block& value)
|
||||
Data::setSignatureInfo(const SignatureInfo& info)
|
||||
{
|
||||
m_signatureInfo = info;
|
||||
resetWire();
|
||||
m_signature.setValue(value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setSignatureValue(span<const uint8_t> value)
|
||||
{
|
||||
m_signatureValue = makeBinaryBlock(tlv::SignatureValue, value);
|
||||
resetWire();
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setSignatureValue(ConstBufferPtr value)
|
||||
{
|
||||
if (!value) {
|
||||
NDN_THROW(std::invalid_argument("SignatureValue buffer cannot be null"));
|
||||
}
|
||||
|
||||
m_signatureValue = Block(tlv::SignatureValue, std::move(value));
|
||||
resetWire();
|
||||
return *this;
|
||||
}
|
||||
|
||||
InputBuffers
|
||||
Data::extractSignedRanges() const
|
||||
{
|
||||
InputBuffers bufs;
|
||||
bufs.reserve(1); // One range containing data value up to, but not including, SignatureValue
|
||||
|
||||
wireEncode();
|
||||
auto lastSignedIt = std::prev(m_wire.find(tlv::SignatureValue));
|
||||
// Note: we assume that both iterators point to the same underlying buffer
|
||||
bufs.emplace_back(m_wire.value_begin(), lastSignedIt->end());
|
||||
|
||||
return bufs;
|
||||
}
|
||||
|
||||
const Data&
|
||||
Data::setServiceClass(std::optional<uint8_t> serviceClass) const
|
||||
{
|
||||
if (m_serviceClass != serviceClass) {
|
||||
m_serviceClass = serviceClass;
|
||||
m_wire.reset();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
const Data&
|
||||
Data::setTargetRate(std::optional<uint64_t> targetRate) const
|
||||
{
|
||||
if (m_targetRate != targetRate) {
|
||||
m_targetRate = targetRate;
|
||||
m_wire.reset();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setContentType(uint32_t type)
|
||||
{
|
||||
resetWire();
|
||||
m_metaInfo.setType(type);
|
||||
if (type != m_metaInfo.getType()) {
|
||||
m_metaInfo.setType(type);
|
||||
resetWire();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setFreshnessPeriod(time::milliseconds freshnessPeriod)
|
||||
{
|
||||
resetWire();
|
||||
m_metaInfo.setFreshnessPeriod(freshnessPeriod);
|
||||
if (freshnessPeriod != m_metaInfo.getFreshnessPeriod()) {
|
||||
m_metaInfo.setFreshnessPeriod(freshnessPeriod);
|
||||
resetWire();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Data&
|
||||
Data::setFinalBlock(optional<name::Component> finalBlockId)
|
||||
Data::setFinalBlock(std::optional<name::Component> finalBlockId)
|
||||
{
|
||||
resetWire();
|
||||
m_metaInfo.setFinalBlock(std::move(finalBlockId));
|
||||
if (finalBlockId != m_metaInfo.getFinalBlock()) {
|
||||
m_metaInfo.setFinalBlock(std::move(finalBlockId));
|
||||
resetWire();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -312,22 +427,27 @@ bool
|
||||
operator==(const Data& lhs, const Data& rhs)
|
||||
{
|
||||
return lhs.getName() == rhs.getName() &&
|
||||
lhs.getMetaInfo() == rhs.getMetaInfo() &&
|
||||
lhs.getMetaInfo().wireEncode() == rhs.getMetaInfo().wireEncode() &&
|
||||
lhs.getContent() == rhs.getContent() &&
|
||||
lhs.getSignature() == rhs.getSignature();
|
||||
lhs.getSignatureInfo() == rhs.getSignatureInfo() &&
|
||||
lhs.getSignatureValue() == rhs.getSignatureValue();
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& os, const Data& data)
|
||||
{
|
||||
os << "Name: " << data.getName() << "\n";
|
||||
os << "MetaInfo: " << data.getMetaInfo() << "\n";
|
||||
os << "Content: (size: " << data.getContent().value_size() << ")\n";
|
||||
os << "Signature: (type: " << data.getSignature().getType()
|
||||
<< ", value_length: "<< data.getSignature().getValue().value_size() << ")";
|
||||
os << std::endl;
|
||||
os << "Name: " << data.getName() << "\n"
|
||||
<< "MetaInfo: [" << data.getMetaInfo() << "]\n";
|
||||
|
||||
if (data.hasContent()) {
|
||||
os << "Content: [" << data.getContent().value_size() << " bytes]\n";
|
||||
}
|
||||
|
||||
os << "Signature: [type: " << static_cast<tlv::SignatureTypeValue>(data.getSignatureType())
|
||||
<< ", length: "<< data.getSignatureValue().value_size() << "]\n";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace ndn
|
||||
|
||||
+234
-88
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2018 Regents of the University of California.
|
||||
* Copyright (c) 2013-2023 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -19,18 +19,21 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_DATA_HPP
|
||||
#define NDN_DATA_HPP
|
||||
#ifndef NDN_CXX_DATA_HPP
|
||||
#define NDN_CXX_DATA_HPP
|
||||
|
||||
#include "ndn-cxx/meta-info.hpp"
|
||||
#include "ndn-cxx/name.hpp"
|
||||
#include "ndn-cxx/signature.hpp"
|
||||
#include "ndn-cxx/detail/packet-base.hpp"
|
||||
#include "ndn-cxx/encoding/block.hpp"
|
||||
#include "ndn-cxx/meta-info.hpp"
|
||||
#include "ndn-cxx/name.hpp"
|
||||
#include "ndn-cxx/security/security-common.hpp"
|
||||
#include "ndn-cxx/signature-info.hpp"
|
||||
|
||||
namespace ndn {
|
||||
|
||||
/** @brief Represents a Data packet.
|
||||
/**
|
||||
* @brief Represents a %Data packet.
|
||||
* @sa https://docs.named-data.net/NDN-packet-spec/0.3/data.html
|
||||
*/
|
||||
class Data : public PacketBase, public std::enable_shared_from_this<Data>
|
||||
{
|
||||
@@ -42,162 +45,276 @@ public:
|
||||
};
|
||||
|
||||
/** @brief Construct an unsigned Data packet with given @p name and empty Content.
|
||||
* @warning In certain contexts that use `Data::shared_from_this()`, Data must be created
|
||||
* using `make_shared`. Otherwise, `shared_from_this()` will trigger undefined behavior.
|
||||
* @warning In certain contexts that use `Data::shared_from_this()`, Data must be created using
|
||||
* `std::make_shared`. Otherwise, `shared_from_this()` may trigger undefined behavior.
|
||||
* One example where this is necessary is storing Data into a subclass of InMemoryStorage.
|
||||
*/
|
||||
explicit
|
||||
Data(const Name& name = Name());
|
||||
|
||||
/** @brief Construct a Data packet by decoding from @p wire.
|
||||
* @param wire @c tlv::Data element as defined in NDN Packet Format v0.2 or v0.3.
|
||||
* It may be signed or unsigned.
|
||||
* @warning In certain contexts that use `Data::shared_from_this()`, Data must be created
|
||||
* using `make_shared`. Otherwise, `shared_from_this()` will trigger undefined behavior.
|
||||
* @param wire TLV block of type tlv::Data; may be signed or unsigned.
|
||||
* @warning In certain contexts that use `Data::shared_from_this()`, Data must be created using
|
||||
* `std::make_shared`. Otherwise, `shared_from_this()` may trigger undefined behavior.
|
||||
* One example where this is necessary is storing Data into a subclass of InMemoryStorage.
|
||||
*/
|
||||
explicit
|
||||
Data(const Block& wire);
|
||||
|
||||
/** @brief Prepend wire encoding to @p encoder in NDN Packet Format v0.2.
|
||||
* @param encoder EncodingEstimator or EncodingBuffer instance
|
||||
* @param wantUnsignedPortionOnly If true, only prepends Name, MetaInfo, Content, and
|
||||
* SignatureInfo to @p encoder, but omit SignatureValue and outmost Type-Length of Data
|
||||
* element. This is intended to be used with wireEncode(encoder, signatureValue).
|
||||
* @throw Error SignatureBits are not provided and wantUnsignedPortionOnly is false.
|
||||
/**
|
||||
* @brief Prepend wire encoding to @p encoder.
|
||||
* @param encoder EncodingEstimator or EncodingBuffer instance.
|
||||
* @param wantUnsignedPortionOnly If true, prepend only Name, MetaInfo, Content, and
|
||||
* SignatureInfo to @p encoder, but omit SignatureValue and the outermost TLV
|
||||
* Type and Length of the %Data element. This is intended to be used with
|
||||
* wireEncode(EncodingBuffer&, span<const uint8_t>) const.
|
||||
* @throw Error Signature is not present and @p wantUnsignedPortionOnly is false.
|
||||
*/
|
||||
template<encoding::Tag TAG>
|
||||
size_t
|
||||
wireEncode(EncodingImpl<TAG>& encoder, bool wantUnsignedPortionOnly = false) const;
|
||||
|
||||
/** @brief Finalize Data packet encoding with the specified SignatureValue
|
||||
* @param encoder EncodingBuffer containing Name, MetaInfo, Content, and SignatureInfo, but
|
||||
* without SignatureValue or outmost Type-Length of Data element
|
||||
* @param signatureValue SignatureValue element
|
||||
/**
|
||||
* @brief Finalize Data packet encoding with the specified signature.
|
||||
* @param encoder EncodingBuffer containing Name, MetaInfo, Content, and SignatureInfo, but
|
||||
* without SignatureValue and the outermost Type-Length of the %Data element.
|
||||
* @param signature Raw signature bytes, without TLV Type and Length; this will become the
|
||||
* TLV-VALUE of the SignatureValue element added to the packet.
|
||||
*
|
||||
* This method is intended to be used in concert with Data::wireEncode(encoder, true)
|
||||
* @code
|
||||
* Data data;
|
||||
* ...
|
||||
* EncodingBuffer encoder;
|
||||
* data.wireEncode(encoder, true);
|
||||
* ...
|
||||
* Block signatureValue = <sign_over_unsigned_portion>(encoder.buf(), encoder.size());
|
||||
* data.wireEncode(encoder, signatureValue)
|
||||
* @endcode
|
||||
* This method is intended to be used in concert with `wireEncode(encoder, true)`, e.g.:
|
||||
* @code
|
||||
* Data data;
|
||||
* ...
|
||||
* EncodingBuffer encoder;
|
||||
* data.wireEncode(encoder, true);
|
||||
* ...
|
||||
* auto signature = create_signature_over_signed_portion(encoder.data(), encoder.size());
|
||||
* data.wireEncode(encoder, signature);
|
||||
* @endcode
|
||||
*/
|
||||
const Block&
|
||||
wireEncode(EncodingBuffer& encoder, const Block& signatureValue) const;
|
||||
wireEncode(EncodingBuffer& encoder, span<const uint8_t> signature) const;
|
||||
|
||||
/** @brief Encode to a @c Block.
|
||||
* @pre Data is signed.
|
||||
*
|
||||
* Normally, this function encodes to NDN Packet Format v0.2. However, if this instance has
|
||||
* cached wire encoding (\c hasWire() is true), the cached encoding is returned and it might
|
||||
* be in v0.3 format.
|
||||
/**
|
||||
* @brief Encode into a Block.
|
||||
* @pre Data must be signed.
|
||||
*/
|
||||
const Block&
|
||||
wireEncode() const;
|
||||
|
||||
/** @brief Decode from @p wire in NDN Packet Format v0.2 or v0.3.
|
||||
/**
|
||||
* @brief Decode from @p wire.
|
||||
*/
|
||||
void
|
||||
wireDecode(const Block& wire);
|
||||
|
||||
/** @brief Check if this instance has cached wire encoding.
|
||||
/**
|
||||
* @brief Check if this instance has cached wire encoding.
|
||||
*/
|
||||
bool
|
||||
hasWire() const
|
||||
hasWire() const noexcept
|
||||
{
|
||||
return m_wire.hasWire();
|
||||
}
|
||||
|
||||
/** @brief Get full name including implicit digest
|
||||
* @pre hasWire() == true; i.e. wireEncode() must have been called
|
||||
* @throw Error Data has no wire encoding
|
||||
/**
|
||||
* @brief Get the full name (including implicit digest).
|
||||
* @pre hasWire() == true, i.e., wireEncode() must have been called.
|
||||
* @throw Error Data has no wire encoding
|
||||
*/
|
||||
const Name&
|
||||
getFullName() const;
|
||||
|
||||
public: // Data fields
|
||||
/** @brief Get name
|
||||
/**
|
||||
* @brief Get the %Data name.
|
||||
*/
|
||||
const Name&
|
||||
getName() const
|
||||
getName() const noexcept
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
/** @brief Set name
|
||||
* @return a reference to this Data, to allow chaining
|
||||
/**
|
||||
* @brief Set the %Data name.
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
*/
|
||||
Data&
|
||||
setName(const Name& name);
|
||||
|
||||
/** @brief Get MetaInfo
|
||||
/**
|
||||
* @brief Get the `MetaInfo` element.
|
||||
*/
|
||||
const MetaInfo&
|
||||
getMetaInfo() const
|
||||
getMetaInfo() const noexcept
|
||||
{
|
||||
return m_metaInfo;
|
||||
}
|
||||
|
||||
/** @brief Set MetaInfo
|
||||
* @return a reference to this Data, to allow chaining
|
||||
/**
|
||||
* @brief Set the `MetaInfo` element.
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
*/
|
||||
Data&
|
||||
setMetaInfo(const MetaInfo& metaInfo);
|
||||
|
||||
/** @brief Get Content
|
||||
/**
|
||||
* @brief Return whether this Data has a `Content` element.
|
||||
*/
|
||||
bool
|
||||
hasContent() const noexcept
|
||||
{
|
||||
return m_content.isValid();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the `Content` element.
|
||||
*
|
||||
* The Content value is accessible through value()/value_size() or value_begin()/value_end()
|
||||
* methods of the Block class.
|
||||
* If the element is not present (hasContent() == false), an invalid Block will be returned.
|
||||
*
|
||||
* The value of the returned Content Block (if valid) can be accessed through
|
||||
* - Block::value_bytes(), or
|
||||
* - Block::value() and Block::value_size(), or
|
||||
* - Block::value_begin() and Block::value_end().
|
||||
*
|
||||
* @sa hasContent()
|
||||
* @sa Block::value_bytes(), Block::blockFromValue(), Block::parse()
|
||||
*/
|
||||
const Block&
|
||||
getContent() const;
|
||||
getContent() const noexcept
|
||||
{
|
||||
return m_content;
|
||||
}
|
||||
|
||||
/** @brief Set Content from a block
|
||||
/**
|
||||
* @brief Set `Content` from a Block.
|
||||
* @param block TLV block to be used as Content; must be valid
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
*
|
||||
* If block's TLV-TYPE is Content, it will be used directly as Data's Content element.
|
||||
* If block's TLV-TYPE is not Content, it will be nested into a Content element.
|
||||
*
|
||||
* @return a reference to this Data, to allow chaining
|
||||
* If the block's TLV-TYPE is tlv::Content, it will be used directly as this Data's
|
||||
* Content element. Otherwise, the block will be nested into a Content element.
|
||||
*/
|
||||
Data&
|
||||
setContent(const Block& block);
|
||||
|
||||
/** @brief Copy Content value from raw buffer
|
||||
* @param value pointer to the first octet of the value
|
||||
* @param valueSize size of the raw buffer
|
||||
* @return a reference to this Data, to allow chaining
|
||||
/**
|
||||
* @brief Set `Content` by copying from a contiguous sequence of bytes.
|
||||
* @param value buffer with the TLV-VALUE of the content
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
*/
|
||||
Data&
|
||||
setContent(const uint8_t* value, size_t valueSize);
|
||||
setContent(span<const uint8_t> value);
|
||||
|
||||
/** @brief Set Content from wire buffer
|
||||
* @param value Content value, which does not need to be a TLV element
|
||||
* @return a reference to this Data, to allow chaining
|
||||
/**
|
||||
* @brief Set `Content` by copying from a string.
|
||||
* @param value string with the TLV-VALUE of the content
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
*/
|
||||
Data&
|
||||
setContent(std::string_view value);
|
||||
|
||||
/**
|
||||
* @brief Set `Content` from a shared buffer.
|
||||
* @param value buffer with the TLV-VALUE of the content; must not be null
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
*/
|
||||
Data&
|
||||
setContent(ConstBufferPtr value);
|
||||
|
||||
/** @brief Get Signature
|
||||
Data&
|
||||
setContent(std::nullptr_t) = delete;
|
||||
|
||||
/**
|
||||
* @brief Remove the `Content` element.
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
* @post hasContent() == false
|
||||
*/
|
||||
const Signature&
|
||||
getSignature() const
|
||||
Data&
|
||||
unsetContent();
|
||||
|
||||
/**
|
||||
* @brief Get the `SignatureInfo` element.
|
||||
*/
|
||||
const SignatureInfo&
|
||||
getSignatureInfo() const noexcept
|
||||
{
|
||||
return m_signature;
|
||||
return m_signatureInfo;
|
||||
}
|
||||
|
||||
/** @brief Set Signature
|
||||
* @return a reference to this Data, to allow chaining
|
||||
/**
|
||||
* @brief Set the `SignatureInfo` element.
|
||||
*
|
||||
* This is a low-level function that should not normally be called directly by applications.
|
||||
* Instead, provide a SignatureInfo to the SigningInfo object passed to KeyChain::sign().
|
||||
*
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
* @warning SignatureInfo is overwritten when the packet is signed via KeyChain::sign().
|
||||
* @sa SigningInfo
|
||||
*/
|
||||
Data&
|
||||
setSignature(const Signature& signature);
|
||||
setSignatureInfo(const SignatureInfo& info);
|
||||
|
||||
/** @brief Set SignatureValue
|
||||
* @return a reference to this Data, to allow chaining
|
||||
/**
|
||||
* @brief Get the `SignatureValue` element.
|
||||
*/
|
||||
const Block&
|
||||
getSignatureValue() const noexcept
|
||||
{
|
||||
return m_signatureValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set `SignatureValue` by copying from a contiguous sequence of bytes.
|
||||
* @param value buffer from which the TLV-VALUE of the SignatureValue will be copied
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
*
|
||||
* This is a low-level function that should not normally be called directly by applications.
|
||||
* Instead, use KeyChain::sign() to sign the packet.
|
||||
*
|
||||
* @warning SignatureValue is overwritten when the packet is signed via KeyChain::sign().
|
||||
*/
|
||||
Data&
|
||||
setSignatureValue(const Block& value);
|
||||
setSignatureValue(span<const uint8_t> value);
|
||||
|
||||
/**
|
||||
* @brief Set `SignatureValue` from a shared buffer.
|
||||
* @param value buffer containing the TLV-VALUE of the SignatureValue; must not be null
|
||||
* @return A reference to this Data, to allow chaining.
|
||||
*
|
||||
* This is a low-level function that should not normally be called directly by applications.
|
||||
* Instead, use KeyChain::sign() to sign the packet.
|
||||
*
|
||||
* @warning SignatureValue is overwritten when the packet is signed via KeyChain::sign().
|
||||
*/
|
||||
Data&
|
||||
setSignatureValue(ConstBufferPtr value);
|
||||
|
||||
Data&
|
||||
setSignatureValue(std::nullptr_t) = delete;
|
||||
|
||||
/**
|
||||
* @brief Extract ranges of Data covered by the signature.
|
||||
* @throw Error Data cannot be encoded or is missing ranges necessary for signing
|
||||
* @warning The returned pointers will be invalidated if wireDecode() or wireEncode() are called.
|
||||
*/
|
||||
[[nodiscard]] InputBuffers
|
||||
extractSignedRanges() const;
|
||||
|
||||
std::optional<uint8_t>
|
||||
getServiceClass() const noexcept
|
||||
{
|
||||
return m_serviceClass;
|
||||
}
|
||||
const Data&
|
||||
setServiceClass(std::optional<uint8_t> serviceClass) const;
|
||||
|
||||
std::optional<uint64_t>
|
||||
getTargetRate() const noexcept
|
||||
{
|
||||
return m_targetRate;
|
||||
}
|
||||
const Data&
|
||||
setTargetRate(std::optional<uint64_t> targetRate) const;
|
||||
|
||||
public: // MetaInfo fields
|
||||
uint32_t
|
||||
@@ -218,18 +335,42 @@ public: // MetaInfo fields
|
||||
Data&
|
||||
setFreshnessPeriod(time::milliseconds freshnessPeriod);
|
||||
|
||||
const optional<name::Component>&
|
||||
const std::optional<name::Component>&
|
||||
getFinalBlock() const
|
||||
{
|
||||
return m_metaInfo.getFinalBlock();
|
||||
}
|
||||
|
||||
Data&
|
||||
setFinalBlock(optional<name::Component> finalBlockId);
|
||||
setFinalBlock(std::optional<name::Component> finalBlockId);
|
||||
|
||||
public: // SignatureInfo fields
|
||||
/**
|
||||
* @brief Get the `SignatureType`.
|
||||
* @return tlv::SignatureTypeValue, or -1 to indicate the signature is invalid.
|
||||
*/
|
||||
int32_t
|
||||
getSignatureType() const noexcept
|
||||
{
|
||||
return m_signatureInfo.getSignatureType();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the `KeyLocator` element.
|
||||
*/
|
||||
std::optional<KeyLocator>
|
||||
getKeyLocator() const noexcept
|
||||
{
|
||||
if (m_signatureInfo.hasKeyLocator()) {
|
||||
return m_signatureInfo.getKeyLocator();
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
protected:
|
||||
/** @brief Clear wire encoding and cached FullName
|
||||
* @note This does not clear the SignatureValue.
|
||||
/**
|
||||
* @brief Clear wire encoding and cached FullName.
|
||||
* @note This does not clear the SignatureValue.
|
||||
*/
|
||||
void
|
||||
resetWire();
|
||||
@@ -238,10 +379,14 @@ private:
|
||||
Name m_name;
|
||||
MetaInfo m_metaInfo;
|
||||
Block m_content;
|
||||
Signature m_signature;
|
||||
SignatureInfo m_signatureInfo;
|
||||
Block m_signatureValue;
|
||||
// Add for QSCCP
|
||||
mutable std::optional<uint8_t> m_serviceClass;
|
||||
mutable std::optional<uint64_t> m_targetRate;
|
||||
|
||||
mutable Block m_wire;
|
||||
mutable Name m_fullName; ///< cached FullName computed from m_wire
|
||||
mutable Name m_fullName; // cached FullName computed from m_wire
|
||||
};
|
||||
|
||||
#ifndef DOXYGEN
|
||||
@@ -266,4 +411,5 @@ operator!=(const Data& lhs, const Data& rhs)
|
||||
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_DATA_HPP
|
||||
#endif // NDN_CXX_DATA_HPP
|
||||
|
||||
@@ -1,236 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2019 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 "ndn-cxx/delegation-list.hpp"
|
||||
|
||||
namespace ndn {
|
||||
|
||||
BOOST_CONCEPT_ASSERT((boost::EqualityComparable<DelegationList>));
|
||||
BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<DelegationList>));
|
||||
BOOST_CONCEPT_ASSERT((WireDecodable<DelegationList>));
|
||||
|
||||
DelegationList::DelegationList()
|
||||
: m_isSorted(true)
|
||||
{
|
||||
}
|
||||
|
||||
DelegationList::DelegationList(std::initializer_list<Delegation> dels)
|
||||
: m_isSorted(true)
|
||||
{
|
||||
for (const Delegation& del : dels) {
|
||||
this->insert(del, INS_REPLACE);
|
||||
}
|
||||
}
|
||||
|
||||
DelegationList::DelegationList(const Block& block, bool wantSort)
|
||||
{
|
||||
this->wireDecode(block, wantSort);
|
||||
}
|
||||
|
||||
bool
|
||||
DelegationList::isValidTlvType(uint32_t type)
|
||||
{
|
||||
switch (type) {
|
||||
case tlv::Content:
|
||||
case tlv::ForwardingHint:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template<encoding::Tag TAG>
|
||||
size_t
|
||||
DelegationList::wireEncode(EncodingImpl<TAG>& encoder, uint32_t type) const
|
||||
{
|
||||
if (!isValidTlvType(type)) {
|
||||
NDN_THROW(std::invalid_argument("Unexpected TLV-TYPE " + to_string(type) +
|
||||
" while encoding DelegationList"));
|
||||
}
|
||||
|
||||
if (this->size() == 0) {
|
||||
NDN_THROW(Error("Empty DelegationList"));
|
||||
}
|
||||
|
||||
// LinkContent ::= (type) TLV-LENGTH
|
||||
// Delegation+
|
||||
|
||||
// Delegation ::= LINK-DELEGATION-TYPE TLV-LENGTH
|
||||
// Preference
|
||||
// Name
|
||||
|
||||
// Preference ::= LINK-PREFERENCE-TYPE TLV-LENGTH
|
||||
// nonNegativeInteger
|
||||
|
||||
size_t totalLen = 0;
|
||||
for (auto i = m_dels.rbegin(); i != m_dels.rend(); ++i) {
|
||||
size_t delLen = 0;
|
||||
delLen += i->name.wireEncode(encoder);
|
||||
delLen += prependNonNegativeIntegerBlock(encoder, tlv::LinkPreference, i->preference);
|
||||
delLen += encoder.prependVarNumber(delLen);
|
||||
delLen += encoder.prependVarNumber(tlv::LinkDelegation);
|
||||
totalLen += delLen;
|
||||
}
|
||||
totalLen += encoder.prependVarNumber(totalLen);
|
||||
totalLen += encoder.prependVarNumber(type);
|
||||
return totalLen;
|
||||
}
|
||||
|
||||
template size_t
|
||||
DelegationList::wireEncode<encoding::EncoderTag>(EncodingBuffer&, uint32_t) const;
|
||||
|
||||
template size_t
|
||||
DelegationList::wireEncode<encoding::EstimatorTag>(EncodingEstimator&, uint32_t) const;
|
||||
|
||||
void
|
||||
DelegationList::wireDecode(const Block& block, bool wantSort)
|
||||
{
|
||||
if (!isValidTlvType(block.type())) {
|
||||
NDN_THROW(Error("Unexpected TLV-TYPE " + to_string(block.type()) + " while decoding DelegationList"));
|
||||
}
|
||||
|
||||
m_isSorted = wantSort;
|
||||
m_dels.clear();
|
||||
|
||||
block.parse();
|
||||
for (const auto& del : block.elements()) {
|
||||
if (del.type() != tlv::LinkDelegation) {
|
||||
NDN_THROW(Error("Unexpected TLV-TYPE " + to_string(del.type()) + " while decoding Delegation"));
|
||||
}
|
||||
del.parse();
|
||||
|
||||
auto val = del.elements_begin();
|
||||
if (val == del.elements_end() || val->type() != tlv::LinkPreference) {
|
||||
NDN_THROW(Error("Missing Preference field in Delegation"));
|
||||
}
|
||||
uint64_t preference = 0;
|
||||
try {
|
||||
preference = readNonNegativeInteger(*val);
|
||||
}
|
||||
catch (const tlv::Error&) {
|
||||
NDN_THROW_NESTED(Error("Invalid Preference field in Delegation"));
|
||||
}
|
||||
|
||||
++val;
|
||||
if (val == del.elements_end() || val->type() != tlv::Name) {
|
||||
NDN_THROW(Error("Missing Name field in Delegation"));
|
||||
}
|
||||
Name name;
|
||||
try {
|
||||
name.wireDecode(*val);
|
||||
}
|
||||
catch (const tlv::Error&) {
|
||||
NDN_THROW_NESTED(Error("Invalid Name field in Delegation"));
|
||||
}
|
||||
|
||||
this->insertImpl(preference, name);
|
||||
}
|
||||
|
||||
if (this->size() == 0) {
|
||||
NDN_THROW(Error("Empty DelegationList"));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DelegationList::sort()
|
||||
{
|
||||
if (m_isSorted) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<Delegation> dels;
|
||||
dels.swap(m_dels);
|
||||
|
||||
m_isSorted = true;
|
||||
for (const Delegation& del : dels) {
|
||||
this->insertImpl(del.preference, del.name);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
DelegationList::insert(uint64_t preference, const Name& name,
|
||||
InsertConflictResolution onConflict)
|
||||
{
|
||||
switch (onConflict) {
|
||||
case INS_REPLACE:
|
||||
this->eraseImpl(nullopt, name);
|
||||
this->insertImpl(preference, name);
|
||||
return true;
|
||||
case INS_APPEND:
|
||||
this->insertImpl(preference, name);
|
||||
return true;
|
||||
case INS_SKIP:
|
||||
if (!std::any_of(m_dels.begin(), m_dels.end(),
|
||||
[name] (const Delegation& del) { return del.name == name; })) {
|
||||
this->insertImpl(preference, name);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
BOOST_ASSERT_MSG(false, "Unknown onConflict");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
DelegationList::insertImpl(uint64_t preference, const Name& name)
|
||||
{
|
||||
if (!m_isSorted) {
|
||||
m_dels.push_back({preference, name});
|
||||
return;
|
||||
}
|
||||
|
||||
Delegation del{preference, name};
|
||||
auto pos = std::upper_bound(m_dels.begin(), m_dels.end(), del);
|
||||
m_dels.insert(pos, del);
|
||||
}
|
||||
|
||||
size_t
|
||||
DelegationList::eraseImpl(optional<uint64_t> preference, const Name& name)
|
||||
{
|
||||
size_t nErased = 0;
|
||||
for (auto i = m_dels.begin(); i != m_dels.end();) {
|
||||
if ((!preference || i->preference == *preference) &&
|
||||
i->name == name) {
|
||||
++nErased;
|
||||
i = m_dels.erase(i);
|
||||
}
|
||||
else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
return nErased;
|
||||
}
|
||||
|
||||
bool
|
||||
operator==(const DelegationList& lhs, const DelegationList& rhs)
|
||||
{
|
||||
return lhs.m_dels == rhs.m_dels;
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& os, const DelegationList& dl)
|
||||
{
|
||||
os << '[';
|
||||
std::copy(dl.begin(), dl.end(), make_ostream_joiner(os, ','));
|
||||
return os << ']';
|
||||
}
|
||||
|
||||
} // namespace ndn
|
||||
@@ -1,259 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2019 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.
|
||||
*/
|
||||
|
||||
#ifndef NDN_DELEGATION_LIST_HPP
|
||||
#define NDN_DELEGATION_LIST_HPP
|
||||
|
||||
#include "ndn-cxx/delegation.hpp"
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
namespace ndn {
|
||||
|
||||
/** \brief represents a list of Delegations
|
||||
* \sa https://named-data.net/doc/ndn-tlv/link.html
|
||||
*
|
||||
* Delegations are stored in an std::vector, under the assumption that there is usually only a
|
||||
* small number of Delegations, so that copying is acceptable when they are modified.
|
||||
*/
|
||||
class DelegationList
|
||||
{
|
||||
public:
|
||||
class Error : public tlv::Error
|
||||
{
|
||||
public:
|
||||
using tlv::Error::Error;
|
||||
};
|
||||
|
||||
/** \brief construct an empty DelegationList
|
||||
*/
|
||||
DelegationList();
|
||||
|
||||
/** \brief construct a sorted DelegationList with specified delegations
|
||||
*
|
||||
* This is equivalent to inserting each delegation into an empty DelegationList with INS_REPLACE
|
||||
* conflict resolution.
|
||||
*/
|
||||
DelegationList(std::initializer_list<Delegation> dels);
|
||||
|
||||
/** \brief decode a DelegationList
|
||||
* \sa wireDecode
|
||||
*/
|
||||
explicit
|
||||
DelegationList(const Block& block, bool wantSort = true);
|
||||
|
||||
/** \brief encode into wire format
|
||||
* \param encoder either an EncodingBuffer or an EncodingEstimator
|
||||
* \param type TLV-TYPE number, either Content (for \p Link) or ForwardingHint
|
||||
* \throw std::invalid_argument \p type is invalid
|
||||
* \throw Error there is no Delegation
|
||||
*/
|
||||
template<encoding::Tag TAG>
|
||||
size_t
|
||||
wireEncode(EncodingImpl<TAG>& encoder, uint32_t type = tlv::ForwardingHint) const;
|
||||
|
||||
/** \brief decode a DelegationList
|
||||
* \param block either a Content block (from \p Link) or a ForwardingHint block
|
||||
* \param wantSort if true, delegations are sorted
|
||||
* \throw Error the block cannot be parsed as a list of Delegations
|
||||
*/
|
||||
void
|
||||
wireDecode(const Block& block, bool wantSort = true);
|
||||
|
||||
bool
|
||||
isSorted() const noexcept
|
||||
{
|
||||
return m_isSorted;
|
||||
}
|
||||
|
||||
using const_iterator = std::vector<Delegation>::const_iterator;
|
||||
|
||||
const_iterator
|
||||
begin() const noexcept
|
||||
{
|
||||
return m_dels.begin();
|
||||
}
|
||||
|
||||
const_iterator
|
||||
end() const noexcept
|
||||
{
|
||||
return m_dels.end();
|
||||
}
|
||||
|
||||
bool
|
||||
empty() const noexcept
|
||||
{
|
||||
return m_dels.empty();
|
||||
}
|
||||
|
||||
size_t
|
||||
size() const noexcept
|
||||
{
|
||||
return m_dels.size();
|
||||
}
|
||||
|
||||
/** \brief get the i-th delegation
|
||||
* \pre i < size()
|
||||
*/
|
||||
const Delegation&
|
||||
operator[](size_t i) const
|
||||
{
|
||||
BOOST_ASSERT(i < size());
|
||||
return m_dels[i];
|
||||
}
|
||||
|
||||
/** \brief get the i-th delegation
|
||||
* \throw std::out_of_range i >= size()
|
||||
*/
|
||||
const Delegation&
|
||||
at(size_t i) const
|
||||
{
|
||||
return m_dels.at(i);
|
||||
}
|
||||
|
||||
public: // modifiers
|
||||
/** \brief sort the delegation list
|
||||
* \post isSorted() == true
|
||||
* \post Delegations are sorted in increasing preference order.
|
||||
*
|
||||
* A DelegationList can be constructed as sorted or unsorted. In most cases, it is recommended
|
||||
* to use a sorted DelegationList. An unsorted DelegationList is useful for extracting the i-th
|
||||
* delegation from a received ForwardingHint or Link object.
|
||||
*
|
||||
* This method turns an unsorted DelegationList into a sorted DelegationList.
|
||||
* If access to unsorted DelegationList is not needed, it is more efficient to sort the
|
||||
* DelegationList in wireDecode.
|
||||
*/
|
||||
void
|
||||
sort();
|
||||
|
||||
/** \brief what to do when inserting a duplicate name
|
||||
*/
|
||||
enum InsertConflictResolution {
|
||||
/** \brief existing delegation(s) with the same name are replaced with the new delegation
|
||||
*/
|
||||
INS_REPLACE,
|
||||
|
||||
/** \brief multiple delegations with the same name are kept in the DelegationList
|
||||
* \note This is NOT RECOMMENDED by Link specification.
|
||||
*/
|
||||
INS_APPEND,
|
||||
|
||||
/** \brief new delegation is not inserted if an existing delegation has the same name
|
||||
*/
|
||||
INS_SKIP
|
||||
};
|
||||
|
||||
/** \brief insert Delegation
|
||||
* \return whether inserted
|
||||
*/
|
||||
bool
|
||||
insert(uint64_t preference, const Name& name,
|
||||
InsertConflictResolution onConflict = INS_REPLACE);
|
||||
|
||||
/** \brief insert Delegation
|
||||
* \return whether inserted
|
||||
*/
|
||||
bool
|
||||
insert(const Delegation& del, InsertConflictResolution onConflict = INS_REPLACE)
|
||||
{
|
||||
return this->insert(del.preference, del.name, onConflict);
|
||||
}
|
||||
|
||||
/** \brief delete Delegation(s) with specified preference and name
|
||||
* \return count of erased Delegation(s)
|
||||
*/
|
||||
size_t
|
||||
erase(uint64_t preference, const Name& name)
|
||||
{
|
||||
return this->eraseImpl(preference, name);
|
||||
}
|
||||
|
||||
/** \brief delete Delegation(s) with matching preference and name
|
||||
* \return count of erased Delegation(s)
|
||||
*/
|
||||
size_t
|
||||
erase(const Delegation& del)
|
||||
{
|
||||
return this->eraseImpl(del.preference, del.name);
|
||||
}
|
||||
|
||||
/** \brief erase Delegation(s) with specified name
|
||||
* \return count of erased Delegation(s)
|
||||
*/
|
||||
size_t
|
||||
erase(const Name& name)
|
||||
{
|
||||
return this->eraseImpl(nullopt, name);
|
||||
}
|
||||
|
||||
private:
|
||||
static bool
|
||||
isValidTlvType(uint32_t type);
|
||||
|
||||
void
|
||||
insertImpl(uint64_t preference, const Name& name);
|
||||
|
||||
size_t
|
||||
eraseImpl(optional<uint64_t> preference, const Name& name);
|
||||
|
||||
private:
|
||||
bool m_isSorted;
|
||||
|
||||
/** \brief delegation container; its contents are sorted when \p m_isSorted is true
|
||||
* \note This container is a member field rather than a base class, in order to ensure contents
|
||||
* are sorted when \p m_isSorted is true.
|
||||
* \note A vector is chosen instead of a std::set, so that the container can be unsorted when
|
||||
* \p m_isSorted is false. This container is expected to have less than seven items, and
|
||||
* therefore the overhead of moving items during insertion and deletion is small.
|
||||
*/
|
||||
std::vector<Delegation> m_dels;
|
||||
|
||||
friend bool operator==(const DelegationList&, const DelegationList&);
|
||||
};
|
||||
|
||||
#ifndef DOXYGEN
|
||||
extern template size_t
|
||||
DelegationList::wireEncode<encoding::EncoderTag>(EncodingBuffer&, uint32_t) const;
|
||||
|
||||
extern template size_t
|
||||
DelegationList::wireEncode<encoding::EstimatorTag>(EncodingEstimator&, uint32_t) const;
|
||||
#endif
|
||||
|
||||
/** \brief compare whether two DelegationLists are equal
|
||||
* \note Order matters! If two DelegationLists contain the same Delegations but at least one is
|
||||
* unsorted, they may compare unequal if the Delegations appear in different order.
|
||||
*/
|
||||
bool
|
||||
operator==(const DelegationList& lhs, const DelegationList& rhs);
|
||||
|
||||
inline bool
|
||||
operator!=(const DelegationList& lhs, const DelegationList& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& os, const DelegationList& dl);
|
||||
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_DELEGATION_LIST_HPP
|
||||
@@ -1,55 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2018 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 "ndn-cxx/delegation.hpp"
|
||||
|
||||
namespace ndn {
|
||||
|
||||
BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Delegation>));
|
||||
|
||||
bool
|
||||
operator==(const Delegation& lhs, const Delegation& rhs)
|
||||
{
|
||||
return lhs.preference == rhs.preference &&
|
||||
lhs.name == rhs.name;
|
||||
}
|
||||
|
||||
bool
|
||||
operator<(const Delegation& lhs, const Delegation& rhs)
|
||||
{
|
||||
return std::tie(lhs.preference, lhs.name) <
|
||||
std::tie(rhs.preference, rhs.name);
|
||||
}
|
||||
|
||||
bool
|
||||
operator<=(const Delegation& lhs, const Delegation& rhs)
|
||||
{
|
||||
return std::tie(lhs.preference, lhs.name) <=
|
||||
std::tie(rhs.preference, rhs.name);
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& os, const Delegation& del)
|
||||
{
|
||||
return os << del.name << '(' << del.preference << ')';
|
||||
}
|
||||
|
||||
} // namespace ndn
|
||||
@@ -1,70 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2018 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.
|
||||
*/
|
||||
|
||||
#ifndef NDN_DELEGATION_HPP
|
||||
#define NDN_DELEGATION_HPP
|
||||
|
||||
#include "ndn-cxx/name.hpp"
|
||||
|
||||
namespace ndn {
|
||||
|
||||
/** \brief represents a delegation
|
||||
* \sa https://named-data.net/doc/ndn-tlv/link.html
|
||||
*/
|
||||
struct Delegation
|
||||
{
|
||||
uint64_t preference;
|
||||
Name name;
|
||||
};
|
||||
|
||||
bool
|
||||
operator==(const Delegation& lhs, const Delegation& rhs);
|
||||
|
||||
inline bool
|
||||
operator!=(const Delegation& lhs, const Delegation& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
bool
|
||||
operator<(const Delegation& lhs, const Delegation& rhs);
|
||||
|
||||
bool
|
||||
operator<=(const Delegation& lhs, const Delegation& rhs);
|
||||
|
||||
inline bool
|
||||
operator>(const Delegation& lhs, const Delegation& rhs)
|
||||
{
|
||||
return !(lhs <= rhs);
|
||||
}
|
||||
|
||||
inline bool
|
||||
operator>=(const Delegation& lhs, const Delegation& rhs)
|
||||
{
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& os, const Delegation& del);
|
||||
|
||||
} // namespace ndn
|
||||
|
||||
#endif // NDN_DELEGATION_HPP
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2018 Regents of the University of California.
|
||||
* Copyright (c) 2013-2023 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -19,22 +19,11 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_DETAIL_ASIO_FWD_HPP
|
||||
#define NDN_DETAIL_ASIO_FWD_HPP
|
||||
#ifndef NDN_CXX_DETAIL_ASIO_FWD_HPP
|
||||
#define NDN_CXX_DETAIL_ASIO_FWD_HPP
|
||||
|
||||
#include <boost/version.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace asio {
|
||||
|
||||
#if BOOST_VERSION >= 106600
|
||||
namespace boost::asio {
|
||||
class io_context;
|
||||
using io_service = io_context;
|
||||
#else
|
||||
class io_service;
|
||||
#endif // BOOST_VERSION >= 106600
|
||||
} // namespace boost::asio
|
||||
|
||||
} // namespace asio
|
||||
} // namespace boost
|
||||
|
||||
#endif // NDN_DETAIL_ASIO_FWD_HPP
|
||||
#endif // NDN_CXX_DETAIL_ASIO_FWD_HPP
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2019 Regents of the University of California.
|
||||
* Copyright (c) 2013-2023 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -21,13 +21,7 @@
|
||||
|
||||
#include "ndn-cxx/detail/cancel-handle.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace detail {
|
||||
|
||||
CancelHandle::CancelHandle(function<void()> cancel)
|
||||
: m_cancel(std::move(cancel))
|
||||
{
|
||||
}
|
||||
namespace ndn::detail {
|
||||
|
||||
void
|
||||
CancelHandle::cancel() const
|
||||
@@ -38,42 +32,4 @@ CancelHandle::cancel() const
|
||||
}
|
||||
}
|
||||
|
||||
ScopedCancelHandle::ScopedCancelHandle(CancelHandle hdl)
|
||||
: m_hdl(std::move(hdl))
|
||||
{
|
||||
}
|
||||
|
||||
ScopedCancelHandle::ScopedCancelHandle(ScopedCancelHandle&& other)
|
||||
: m_hdl(other.release())
|
||||
{
|
||||
}
|
||||
|
||||
ScopedCancelHandle&
|
||||
ScopedCancelHandle::operator=(ScopedCancelHandle&& other)
|
||||
{
|
||||
cancel();
|
||||
m_hdl = other.release();
|
||||
return *this;
|
||||
}
|
||||
|
||||
ScopedCancelHandle::~ScopedCancelHandle()
|
||||
{
|
||||
m_hdl.cancel();
|
||||
}
|
||||
|
||||
void
|
||||
ScopedCancelHandle::cancel()
|
||||
{
|
||||
release().cancel();
|
||||
}
|
||||
|
||||
CancelHandle
|
||||
ScopedCancelHandle::release()
|
||||
{
|
||||
CancelHandle hdl;
|
||||
std::swap(hdl, m_hdl);
|
||||
return hdl;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace ndn
|
||||
} // namespace ndn::detail
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013-2019 Regents of the University of California.
|
||||
* Copyright (c) 2013-2023 Regents of the University of California.
|
||||
*
|
||||
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
|
||||
*
|
||||
@@ -19,23 +19,29 @@
|
||||
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
|
||||
*/
|
||||
|
||||
#ifndef NDN_DETAIL_CANCEL_HANDLE_HPP
|
||||
#define NDN_DETAIL_CANCEL_HANDLE_HPP
|
||||
#ifndef NDN_CXX_DETAIL_CANCEL_HANDLE_HPP
|
||||
#define NDN_CXX_DETAIL_CANCEL_HANDLE_HPP
|
||||
|
||||
#include "ndn-cxx/detail/common.hpp"
|
||||
|
||||
namespace ndn {
|
||||
namespace detail {
|
||||
/**
|
||||
* \brief Contains implementation details that are not part of the ndn-cxx public API.
|
||||
*/
|
||||
namespace ndn::detail {
|
||||
|
||||
/** \brief Handle to cancel an operation.
|
||||
/**
|
||||
* \brief Handle to cancel an operation.
|
||||
*/
|
||||
class CancelHandle
|
||||
{
|
||||
public:
|
||||
CancelHandle() noexcept = default;
|
||||
CancelHandle() noexcept;
|
||||
|
||||
explicit
|
||||
CancelHandle(function<void()> cancel);
|
||||
CancelHandle(std::function<void()> cancel) noexcept
|
||||
: m_cancel(std::move(cancel))
|
||||
{
|
||||
}
|
||||
|
||||
/** \brief Cancel the operation.
|
||||
*/
|
||||
@@ -43,19 +49,30 @@ public:
|
||||
cancel() const;
|
||||
|
||||
private:
|
||||
mutable function<void()> m_cancel;
|
||||
mutable std::function<void()> m_cancel;
|
||||
};
|
||||
|
||||
/** \brief Cancels an operation automatically upon destruction.
|
||||
inline
|
||||
CancelHandle::CancelHandle() noexcept = default;
|
||||
|
||||
/**
|
||||
* \brief Cancels an operation automatically upon destruction.
|
||||
*/
|
||||
template<typename HandleT>
|
||||
class ScopedCancelHandle
|
||||
{
|
||||
public:
|
||||
ScopedCancelHandle() noexcept = default;
|
||||
static_assert(std::is_convertible_v<HandleT*, CancelHandle*>,
|
||||
"HandleT must publicly derive from CancelHandle");
|
||||
|
||||
/** \brief Implicit constructor from CancelHandle.
|
||||
public:
|
||||
ScopedCancelHandle() noexcept;
|
||||
|
||||
/** \brief Implicit constructor from HandleT.
|
||||
*/
|
||||
ScopedCancelHandle(CancelHandle hdl);
|
||||
ScopedCancelHandle(HandleT hdl) noexcept
|
||||
: m_hdl(std::move(hdl))
|
||||
{
|
||||
}
|
||||
|
||||
/** \brief Copy construction is disallowed.
|
||||
*/
|
||||
@@ -63,7 +80,10 @@ public:
|
||||
|
||||
/** \brief Move constructor.
|
||||
*/
|
||||
ScopedCancelHandle(ScopedCancelHandle&& other);
|
||||
ScopedCancelHandle(ScopedCancelHandle&& other) noexcept
|
||||
: m_hdl(other.release())
|
||||
{
|
||||
}
|
||||
|
||||
/** \brief Copy assignment is disallowed.
|
||||
*/
|
||||
@@ -73,29 +93,50 @@ public:
|
||||
/** \brief Move assignment operator.
|
||||
*/
|
||||
ScopedCancelHandle&
|
||||
operator=(ScopedCancelHandle&& other);
|
||||
operator=(ScopedCancelHandle&& other)
|
||||
{
|
||||
m_hdl.cancel();
|
||||
m_hdl = other.release();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** \brief Cancel the operation.
|
||||
*/
|
||||
~ScopedCancelHandle();
|
||||
~ScopedCancelHandle()
|
||||
{
|
||||
m_hdl.cancel();
|
||||
}
|
||||
|
||||
/** \brief Cancel the operation.
|
||||
*/
|
||||
void
|
||||
cancel();
|
||||
cancel()
|
||||
{
|
||||
release().cancel();
|
||||
}
|
||||
|
||||
/** \brief Release the operation so that it won't be cancelled when this ScopedCancelHandle is
|
||||
* destructed.
|
||||
* \return the CancelHandle.
|
||||
*/
|
||||
CancelHandle
|
||||
release();
|
||||
HandleT
|
||||
release() noexcept
|
||||
{
|
||||
return std::exchange(m_hdl, HandleT{});
|
||||
}
|
||||
|
||||
explicit
|
||||
operator bool() const noexcept
|
||||
{
|
||||
return !!m_hdl;
|
||||
}
|
||||
|
||||
private:
|
||||
CancelHandle m_hdl;
|
||||
HandleT m_hdl;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace ndn
|
||||
template<typename T>
|
||||
ScopedCancelHandle<T>::ScopedCancelHandle() noexcept = default;
|
||||
|
||||
#endif // NDN_DETAIL_CANCEL_HANDLE_HPP
|
||||
} // namespace ndn::detail
|
||||
|
||||
#endif // NDN_CXX_DETAIL_CANCEL_HANDLE_HPP
|
||||
Loaded 100 of 753 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user