Compare commits

...
Author SHA1 Message Date
SunnyQjm 58b423fe00 feta(mgmt): Support set bandwith while create face by nfdc 2023-12-15 14:56:35 +00:00
SunnyQjm e72ce81d2b feat: Add qsccp tags 2023-12-03 19:02:32 +08:00
Eric Newberry bdfb53aa09 Prepare release 0.7.1
refs #5129

Change-Id: I3c86a1fb10e542f825c92bd0d935a2814fea1f04
2020-10-08 16:19:10 -07:00
Davide Pesavento 287a7faad9 tlv: introduce NullSignature signature type
Refs: #4900
Change-Id: Ib5ab76e1e7a4b0cbec09b945859fb30e9322dd6b
2020-10-01 22:46:43 -04:00
Davide Pesavento fa33f8d532 docs: refresh and improve the "named data" sphinx theme
Change-Id: I6c04bb94e33191a2b0d32e0d7bc61ab44af9d84d
2020-09-28 13:37:43 -07:00
Eric Newberry 1caa634dca security: add validator for signed Interests
refs #4804

Change-Id: Ie6b64e9758591b54639c67e565abb3fdf40fb652
2020-09-23 20:57:55 -07:00
Eric Newberry e36aae1eb8 security: fix extraction of signed portion during Data signature verification
refs #4583

Change-Id: Ia0fc93a6e2408bb5f0de16fd76fcb6d9f06a0398
2020-09-03 12:18:06 -07:00
Jeremy Clark 670a52f2a3 security: add certificate bundle decoder
Refs: #5004
Change-Id: I0f035caf8f6975ba2322a7f6629312d3dcab910d
2020-08-29 21:48:55 -04:00
Davide Pesavento 97ee811129 util: backport scope_exit & co. from the Library Fundamentals TS v3
Implementation taken from scope-lite by Martin Moene,
commit 197cd4240069b2b8c393ad0d9eabdee601b606b4

Change-Id: I872b6821504b3270ebdc4c48b7255731fb2efc57
2020-08-27 16:20:07 -04:00
Davide Pesavento 599623c303 ci: disable frames in lcov HTML coverage report
Change-Id: I0c24a412ca33be034fb27b7055a868112bede462
2020-08-07 21:00:45 -04:00
Davide Pesavento 483087f56d util: fix time::toIsoString with Boost 1.73.0
Change-Id: Id8d65db9020c3efefab0453c83e39e5e2771ce3a
2020-08-04 22:38:05 -04:00
Davide Pesavento 81bd696ed9 data: do not encode a Content element if not set
Add Data::hasContent() and Data::unsetContent().
Change the behavior of Interest::setApplicationParameters(Block{}) for
consistency with the corresponding getter and with Data::setContent().

Change-Id: I4cc9058912510db0dfe3da614adee727db149415
2020-07-27 10:50:54 -07:00
Eric Newberry 17d7c47ca9 security: support new signed Interest format in Validator
refs #4804

Change-Id: I0391709dc1486c8156c03cf8e9d94e6cfbe30303
2020-07-22 20:56:05 -07:00
Davide Pesavento 933a567c8a docs: fix syntax highlighting of code blocks
And various other cleanups

Change-Id: If945f5407036e73db980cafd2185359a488a0ff1
2020-07-10 17:54:12 -04:00
Davide Pesavento f2c4c53208 ci: add Xcode 11.6 and 12 to Travis CI build matrix
Change-Id: Ied88268107c94523ea651fae101274083d12f8fd
2020-07-01 14:44:53 -04:00
Eric Newberry 6b2cb79748 docs: deprecate signed Interest v0.2 specification
refs #4804

Change-Id: Ie7258b1ecce8ab88e6f902f268554a4be4f7bdd2
2020-06-30 23:15:46 -07:00
Eric Newberry b74bbdab84 security: sign and verify new signed Interest format
refs #4804

Change-Id: Ib819edb977fa06c670b04185a0d730203c7d7fdb
2020-06-22 17:22:27 -07:00
Eric Newberry 6d024bad65 security: add vectored API for verify and sign
Add vectored input for BufferSource transform

refs #4804

Change-Id: I4949afe5ddb5a49ce6a956da6bc7931cf3719021
2020-06-17 21:04:37 -07:00
Alexander Afanasyev 8afba42296 security: Support name options in the KeyLocator when using ValidationPolicySimpleHierarchy
Change-Id: I828e65a964d4d410e314f7bfc024ee749ac9757b
Refs: #5115
2020-06-17 10:36:48 -07:00
Davide Pesavento 2ca5e79633 security: fix inverted logic in CertificateBundleFetcher
Fixes regression introduced in ebfe4a207f

Change-Id: I9187a4f033be2705d5ad17c4dc221eaa28855192
2020-06-16 22:52:23 -04:00
Davide Pesavento 905d40fad9 data: avoid unnecessarily invalidating cached wire encoding
Also, improve unit testing of Interest and Data classes and
cleanup some doxygen comments.

Change-Id: Ia7ef0af88fc84976ae72f9b99a281300717ced3e
2020-06-13 00:00:33 -04:00
Alexander Afanasyev 355fd789c8 security: Correct behavior of PibImpl::setDefaultIdentity
The high level logic of Pib class ensures that an identity exists (i.e.,
creates when missing).  With this correction, specific realizations
of the low-level logic (PibSqlite and PibMemory) simply throw an error
if the caller attempts to set a non-existing identity as default.

Change-Id: I9d07ca8db4817b7938c04b05341444f1150948f8
Refs: #4136
2020-06-11 12:54:14 -04:00
Alexander Afanasyev 75c3af824a util: Introduce NDN_LOG_NOFLUSH env variable to disable auto-flushing logs
Change-Id: Id1699d044e318aac315a545e913d0fc80306939b
Refs: #3668
2020-06-10 17:05:43 -04:00
Davide Pesavento 46cdf909a5 Remove some long-deprecated functions and enums
Change-Id: Iae88534ce7d58a35217dfdb7d97b011b7905be19
2020-06-09 01:17:33 -04:00
Davide Pesavento 9d1089aa29 util: update bundled copies of {any,optional,variant}-lite
any-lite commit 56cdca9c94af84c6e643a05c9105cb1dc38c5d8c
optional-lite commit 5e8a82ac029aebfd2f5708f183a00eda2be132cc
variant-lite commit 1f79b88132687b0ab1efdcf6e4120724e813602b

Change-Id: I7149abedade21f91e673770169ab7cd6062f02c7
2020-06-09 01:16:58 -04:00
Eric Newberry 6e262f0f1e interest: add signature fields
refs #4804

Change-Id: I4c8ecf65a3616833020d8edf8ba3d0c2d8427e87
2020-06-08 18:28:13 -07:00
Alexander Afanasyev 09236c2b8d security: Rename security/v2/* to security/*
Security v1-v2 transition has been completed for a while and path
separation is no longer needed. However, this commit preserves
`ndn::security::v2` namespace, but makes it inline.

Some commonly used v2 headers are preserved, but are deprecated and
should be avoided in the dependent software.

Change-Id: I26056cb3d34bcdc0a16e06dea8c1a78c03da2d40
2020-06-06 16:15:38 -04:00
Alexander Afanasyev f601e1988b security: Add check for success of TPM signing
Change-Id: I5c0fc958f4d359354391a30c62791e877052b97e
Refs: #4585, #5086
2020-06-03 12:47:36 -04:00
Alexander Afanasyev ab9d7ed25a security: Create PIB implementation as shared_ptr
While existing code is valid, it caused strange crashes on Android/ARM
platform.

Change-Id: I29c4879c65b3c844abb2d75f267c44a0b959a6f7
2020-05-30 18:34:19 -04:00
Alexander Afanasyev 3de8aac22d Rename VERSION to VERSION.info to avoid conflicts with modern STL
On case-insensitive file systems (e.g., macOS), inclusion of the new
standard <version> header resulted in unexpected inclusion of VERSION
file.

Change-Id: Ie858b8966496d23f38f722d8115be988e6b4d048
2020-05-30 18:14:45 -04:00
Eric Newberry f165bb4e77 signature-info: add signed Interest elements
refs #4804

Change-Id: Ice910b7740212cf116ddac24e12634877f75c71e
2020-05-29 00:21:48 -07:00
Eric Newberry 78ffc635cc security: clean up KeyChain and SigningInfo APIs
refs #4804

Change-Id: I55ad2b61f05aec8c75d5f6bafc4eea8e1e1100e9
2020-05-24 15:06:12 -07:00
Davide Pesavento 14c56cd8bd data: add shortcuts to access SignatureType and KeyLocator
Also, modernize the API of SignatureInfo and deprecate
unsetKeyLocator() and unsetValidityPeriod()

Change-Id: I8b775a4deb185784a3dcc8bd96c8f5f0c2915854
2020-05-24 13:16:25 -04:00
Junxiao Shi bc2e78e074 tools: export non-default key/cert in ndnsec export
refs #5043

Change-Id: Ida6e3c041b850a132160660a58d1f219defedf22
2020-05-20 15:01:08 -06:00
Eric Newberry a3c8bd1772 signature: deprecate Signature in favor of SignatureInfo
The Signature in Data packets and Certificates
has been deprecated in favor of separate objects
representing the Signature info and value.

Also deprecate type-specific Signature helpers.

refs #4804

Change-Id: Iab5b5c618e75cc11d31801d86a89a550a6add7a0
2020-05-17 17:30:40 -07:00
jrclark2 40ebaad603 util: add "in order" mode to SegmentFetcher
This commit adds an option for the fetcher to emit a signal when a segment
has arrived in order. Out-of-order segments are maintained internally by
the fetcher and are deleted when the signal is emitted.

Change-Id: I84aec680774af3e3c07bb07c881eab8908b5c9c2
2020-05-09 23:30:32 -04:00
Eric Newberry 3ad8923060 docs: remove invalid option from ndnsec-cert-gen example
Change-Id: I2d51474c8293fd45e1998a4ea39d9ba7de7964cb
2020-05-01 12:16:14 -04:00
Davide Pesavento 25d4f1c95e build: add PCHs for ndnsec and unit tests, fine-tune the existing ones
A full debug+tests build now takes 10% less time with gcc-9 and 21% less
with clang-10. Release builds (without tests) are only marginally faster
with gcc and 7% faster with clang.

Change-Id: I494778fe44cecc6209819a49f48a03f4d16c36af
2020-04-29 23:31:04 -04:00
Davide Pesavento 71c622bb68 build: require clang >= 4.0, Xcode >= 9.0
Also, recommend using gcc 7.4.0 or later, and silence
an ABI-related diagnostic message from gcc on armv7

Refs: #5087, #5106
Change-Id: I4d9841bea9df19cbb9ba3b0865949b1d66e6ec3e
2020-04-27 20:02:56 -04:00
Davide Pesavento 394977c2f2 tests: rename integrated -> integration
And move benchmarks to their own subdir

Change-Id: I23460e1135b47d505eacf0571ced1cbf810b7680
2020-04-26 00:29:04 -04:00
Junxiao Shi fbb6990abc security: encode EC public key with named curve
refs #5037

Change-Id: I5d77782e347579fe6dffb188a92178f592bcd492
2020-04-24 08:39:18 +00:00
Davide Pesavento 702467b816 tools: in ndnsec-key-gen, change default key type to ECDSA
Change-Id: Ib80da42d2969bb6288ee7949e6588c260476ef39
2020-04-22 21:41:23 -04:00
Zhiyi Zhang 4c68b6e62c tools: fix a bug in ndnsec-key-gen when --keyid is specified
Refs: #5057
Change-Id: Iaa29b7670d9cb85373d87cae0f0be377e7e65a1d
2020-04-22 21:40:03 -04:00
Davide Pesavento 78338c5ee8 build: recommend boost >= 1.65.1
With this commit, Ubuntu 16.04 is no longer officially supported
and may require manual installation of a newer version of Boost.

Refs: #5087
Change-Id: I17197f72ee8f7cd4d0954658fe57c324076f1311
2020-04-22 17:09:24 -04:00
Eric Newberry 9603325ba6 build: link against libatomic if necessary
refs #5100

Change-Id: Ida51c0830d3f0ce5ea949745b879a65b3e446111
2020-04-10 15:37:55 -07:00
Davide Pesavento ab7300b747 ci+docs: minor cleanups
Change-Id: I280fd84d89061e34ad4e2aaa00ce63ad21b03565
2020-04-09 21:48:06 -04:00
Eric Newberry 52a803cb9d transport: use /run/nfd.sock on Linux
refs #5039

Change-Id: Ia81115676427db1ebdf4d72d9aadf2e34e2f0ae6
2020-04-07 18:10:04 -07:00
Davide Pesavento 2349e28c6d build: add CentOS 8 support; drop CentOS 7
Refs: #5040, #5087
Change-Id: I6dcc5e9ee6b4839a6b3f15f1ad6dabf140301ae4
2020-03-26 17:56:05 -04:00
Davide Pesavento d776a93c9c build: switch to python3
Refs: #5095
Change-Id: Iedc107d41d4832682071986678b015980354786d
2020-03-23 22:55:23 -04:00
Eric Newberry ce9c1952ff mgmt: add MTU to FaceUpdateCommand
refs #5056

Change-Id: I53d64c869b45d3d582eefd50b8161d90aaf90705
2020-03-12 13:47:33 -07:00
Davide Pesavento 53533947d1 interest: refactor nonce handling
Nonce is a sequence of 4 bytes, not a 32-bit unsigned integer.
This also fixes various endianness bugs in unit tests.

Refs: #3294
Change-Id: I057b7b771fecb0bc997b0b11a03e6660c9b7a826
2020-03-09 01:50:37 -04:00
Davide Pesavento 97242f78e9 ci: update Travis configuration
* Add testing on arm64, ppc64le, and s390x with select compiler versions
 * Allow disabling the headers check by setting DISABLE_HEADERS_CHECK
 * Drop all versions of gcc < 7 and clang < 5
 * Add clang 11 (development branch)
 * Reenable ASan on Linux with gcc 9 and clang 7, the upstream
   bugs have been fixed; ASan on clang 8 remains disabled
 * Drop Xcode 9.2 (macOS 10.12 is no longer supported)
 * Upgrade Xcode 11 to 11.3
 * Remove USE_OPENSSL_1_1 and always build with openssl 1.1.1,
   since that's the only version available on Homebrew now
 * Workaround issue with missing /usr/local/opt/openssl on macOS
 * Various cleanups

Change-Id: I90e7d61d176b60c1e6b90d2374a7a51dd1deabb3
2020-02-29 20:56:32 -05:00
Davide Pesavento bc17d950e0 name: provide more fine-grained choices for UriFormat
Refs: #4777
Change-Id: I967a3b522cbe0719dfc95123bb75517518c74c72
2020-02-15 20:10:52 -05:00
Davide Pesavento d247d49469 face: remove deprecated PendingInterestId, InterestFilterId, RegisteredPrefixId
Plus some refactoring in Face::Impl

Refs: #4885
Change-Id: I5c46aaef35eb618d6f4934d4629c473c7fdde456
2020-02-13 11:55:13 -05:00
Eric Newberry 8d6d10ae53 docs: restructure and update AUTHORS.md
refs #5078

Change-Id: Iac341c29560b183066f7d1892359d262787655bd
2020-02-05 15:35:53 -08:00
Davide Pesavento 9c8f00e3fb util: delete unused field in SegmentFetcher
Change-Id: I341278fdb620dd531980050eb03b372f4dbd0147
2020-01-20 20:04:29 -05:00
Davide Pesavento 3b9a2c8b74 build: upgrade waf to version 2.0.19
Change-Id: Ifd57ed4e4a3039906a36f3a14f6e71e45167e44e
2020-01-13 19:25:26 -05:00
Alexander Afanasyev cf8ffd495a Prepare release 0.7.0
Change-Id: Id6bba5f9b83c3f317f5ee81b170bc5ce50806a29
Refs: #5045
2020-01-13 13:22:16 -05:00
Junxiao Shi a39c0b5c48 name: select canonical vs alternate URI representation
refs #4777

Change-Id: Ic644593228bd155de9dcd7005e1b9dc5303a6e66
2019-12-31 15:13:15 -07:00
Davide Pesavento 21a4ea5ad7 tests: avoid deprecated boost headers
Change-Id: I05aa8d5fd22843415db09478f7b53f1810b38db3
2019-12-22 17:17:15 -05:00
Davide Pesavento 813ae5831b encoding: use boost::endian::endian_load() if available
Refs: #4612
Change-Id: I034f246848c5ae2c8e0ff02f7ec52d26ef8a73e0
2019-12-16 20:34:04 -05:00
Davide Pesavento 7c67ab5938 security: remove deprecated HmacFilter
Change-Id: I27e37724efe83e161ce5b012d83f8f6165a9c7d0
2019-12-10 00:04:52 -05:00
Davide Pesavento 39cb402377 util: partial support for abstract types in NDN_LOG_MEMBER_* macros
Change-Id: I6b2a0e8fb86cb83040d24e3d4d5ba8a872ca031c
2019-12-09 23:55:19 -05:00
Davide Pesavento 39570d9313 tests: fix Interest name in face integration test
Refs: #4567
Change-Id: I6886c93695c563dbcba2feb0706e6459d0176154
2019-12-09 23:52:46 -05:00
Davide Pesavento 009062db2e name: alternative URI syntax for component types used in naming conventions
Refs: #4777
Change-Id: I4647fee54dffe104ca3cc31d67b0ad44fcf0de76
2019-11-20 20:10:15 -05:00
Davide Pesavento a421c80b10 face+transport: minor code cleanup
Change-Id: Ibe7d4b7fafdc4848ae9b6ae1e0db7e8d79ea1015
2019-11-16 11:42:43 -05:00
Davide Pesavento 0a6456cbe7 security: don't throw when loading an empty validation policy
Refs: #5049
Change-Id: I44feff5f4c83995e7d9f848c3c0cd71825920606
2019-11-14 13:04:24 -05:00
Davide Pesavento 4fb35d8a35 security: stop installing headers of concrete PIB, TPM, and KeyHandle implementations
Refs: #4782
Change-Id: I23bb75c485034140f29b10bd3a103f4aa480be4b
2019-11-01 11:07:48 -04:00
Davide Pesavento 12cef87c0c security: make BackEnd::Error an alias of Tpm::Error
Change-Id: Id38011529907e1dacdcb6107ab52ae273d302a1e
2019-11-01 11:07:06 -04:00
laqinfan bc997e5ddd security: add HMAC support in verification helpers
Add two more verifySignature() overloads with tpm and keyname as parameters

Change-Id: I53ef8f15c8764b17a26df3216c25f6b19f7c1719
2019-10-29 19:43:46 -05:00
Davide Pesavento 73940c93a6 security: avoid potential undefined behavior in const_cast
Change-Id: I24cee635d5a3da95bdfd2566f2e4232e4b9ac358
2019-10-17 14:58:01 -04:00
laqinfan 56a812d633 security: add HMAC support in KeyChain and SigningInfo
Refs: #3075
Change-Id: Ia1f557ca7c83f4df7f9f87bbe1b4fc214940dcd8
2019-10-17 14:56:44 -04:00
Davide Pesavento e6e125ea1b ci: output Travis folding markers for each build stage
Makes build logs vastly more readable on Travis web UI

Change-Id: I00ebf48f80d73d7aad00b890d9c16c2254cb609c
2019-10-09 01:00:14 -04:00
Davide Pesavento 5e494c0c3b security: accept HMAC keys shorter than the hash function's output length
Refs: #3075
Change-Id: Id4798a420f2f75cbc3269e3629c397b8fb729d21
2019-09-29 16:33:36 -04:00
Davide Pesavento cb672523a5 ci: upgrade Travis config to Ubuntu 18.04
Also in this commit:

 * Disable ASan with gcc 9 due to a compiler bug
 * Drop clang 3.8 (no easy way to install it on 18.04)
 * Add clang 10 (trunk)
 * Drop Xcode 8.3
 * Upgrade Xcode 10.2 to 10.3

Change-Id: I424d189e037d82d1230a12e72bea479f42dd680c
2019-09-23 18:08:22 -04:00
Davide Pesavento 835f027df8 interest: don't force the generation of a nonce during decoding
Refs: #4685
Change-Id: If6402fba79ccb3e2434278e646b1b034597bec29
2019-09-22 15:52:15 -04:00
Davide Pesavento 28a5bf107b interest: minor cleanups
Refs: #4567
Change-Id: I4e2428cc7f64cc9fceaae5c8f928fe4fc52e4cc7
2019-09-22 15:51:57 -04:00
Davide Pesavento 75c56016a9 util: make overload() function public
Rename backports-ostream-joiner.hpp to ostream-joiner.hpp
and deprecate its inclusion from backports.hpp

Change-Id: I1df03506e92da97a98871a56787e346ae328323d
2019-09-22 15:51:10 -04:00
Davide Pesavento 2fdb274627 interest: update toUri() for packet format v0.3
Refs: #4709
Change-Id: Id8c6fee0e8d2ad4e9d267854cdf0f41bb46f453a
2019-08-29 00:23:17 -04:00
Davide Pesavento 0e0b389c80 interest: drop support for packet format v0.2
Interests are now always encoded into v0.3 format and decoding
from v0.2 format is no longer supported. Deprecated Exclude and
Selectors are completely removed.

Refs: #4567
Change-Id: I977a833253e63e28ac6eea85be0a7b449c76584a
2019-08-29 00:16:34 -04:00
Davide Pesavento ef654dd3ba Remove ill-defined equality operators (part 1)
This removes overloaded operator== and operator!= from those classes
for which it is unclear what semantics such operators should have,
and whose current definitions are unsound or confusing for the user.

Refs: #4569
Change-Id: Ic385ac1e376a9916e762b1a0f790e4caae7c955b
2019-08-27 00:25:05 -04:00
Davide Pesavento 140e9cbc62 util: backport C++17 [[nodiscard]] attribute
Change-Id: I6bdeeaed09a4a5d36647ec967aead47e4461e583
2019-08-27 00:22:12 -04:00
Davide Pesavento 869b11e5c5 util: backport std::to_underlying()
Change-Id: I239ceb6be20d56343917cfcd7e1049fc852c1ced
2019-08-22 17:57:54 -04:00
Davide Pesavento 4c5b7b88d6 util: split RttEstimator into two classes
Also remove afterMeasurement signal, effectively reverting
commit 4ad933a757

Refs: #4887
Change-Id: I6c9b1620250992e07bed0773ee8f043e8e1e1f04
2019-08-22 17:57:20 -04:00
Ju Pan 92dbb008fe Revert "mgmt: add EndpointId field to NextHopRecord class"
This reverts commit ccce0bc969.

Refs: #4973
Change-Id: I21b5fc5f405e8856d5615d966911c6372c3f1d3b
2019-08-14 00:09:09 -04:00
Davide Pesavento 6c6e3854be util: add io::loadBuffer and io::saveBuffer
Change-Id: Ifa9d3bc44bba5dd8e2bd5d419629763936f355d4
2019-08-08 21:55:31 -04:00
Davide Pesavento b3f78b5db8 Introduce NDN_CXX_UNREACHABLE macro
Change-Id: I5549c436cfb8fb30da94cbbdbc221c622fca24c2
2019-08-08 12:07:14 -04:00
Junxiao Shi 43eac58ed6 lp: introduce PIT token
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.

This commit adds basic encoding and decoding support for
PIT token, as an NDNLPv2 header field as well as a Tag.

refs #4532

Change-Id: I633fc451393746ebe199f41e44e245361b058d5e
2019-08-01 12:14:46 -06:00
Davide Pesavento 5149350bb4 key-locator: reimplement using a sum type
Deprecate KeyLocator::Type enum. Improve test coverage.

Change-Id: I1bf13db9b174ea66c4e978eb20659af5f12b9633
2019-07-22 18:18:00 -04:00
Alexander Afanasyev 7b2f58c9df util: Generalize logger backend support
This commit introduces a public API change for changing log
destinations.

Refs: #3782
Change-Id: I329c60f510d9493af5959b34eea93b81e15fe698
2019-07-22 02:46:25 -07:00
Davide Pesavento fe407f2ddc ci: add Xcode 11 to Travis CI build matrix
Also reenable ASan on Linux with clang 9, it seems to be working now.

Change-Id: I65d3b6dc90303255f9cc16318d38aaa4d43efcfd
2019-07-16 23:03:08 -04:00
Davide Pesavento 65f697f5e8 ims: drop support for ChildSelector
Change-Id: I672d89884680cfb171e8314413bc57a08b0491aa
2019-07-14 17:36:17 -04:00
Davide Pesavento 2b0cc7bf01 interest: implement HopLimit encoding/decoding
Refs: #4806
Change-Id: I42ad15221575001d66747aa9f7eafcf3f00acf47
2019-07-14 16:50:04 -04:00
Davide Pesavento 720e25c294 detail: improve ScopedCancelHandle
This also removes deprecated implicit conversion operators
from 'FooHandle' types to 'const FooId*'

Change-Id: I5b412bf833bb106b8f5aa483dbe09b6c58736e19
2019-07-14 14:28:51 -04:00
Davide Pesavento adc9aa230c interest: add support for ParametersSha256DigestComponent
Add Name::set(), Name::appendParametersSha256Digest(),
Name::appendParametersSha256DigestPlaceholder(), Name::erase()

Refs: #4658
Change-Id: Ic688030504804158ef8627a5f751ebc8b2587611
2019-07-13 11:19:04 -04:00
Alexander Afanasyev 576b4ff50e util: Make use of attributes in logging facilities
Refs: #4969
Change-Id: Ib7e495629107d9ebe2105a7fe1f99d89ad92e244
2019-07-12 13:06:29 -04:00
Davide Pesavento ecfb391e20 Declare overloaded comparison operators as non-member functions
Change-Id: I4fd4638c29d01b39df69ad6d8cbc3a0dc9604db3
2019-07-04 18:43:00 -04:00
Davide Pesavento 700e12a0b8 util: import nonstd::get into namespace ndn, for use with variant
Change-Id: Ie2b608bf6f5d4d5a96c483243f390976bb6c8085
2019-07-04 18:42:40 -04:00
Junxiao Shi 9a04ddacb9 docs: write CertificateV2 and SafeBag syntax in ABNF
refs #4928

Change-Id: I80d8a37f609bfbccb5f73f7e1f442c1b35061123
2019-07-04 12:53:54 -07:00
laqinfan cf0baa2375 security: add signature verification support in TPM
Refs: #3075
Change-Id: Idb17ee0e3a071e133527b6e17d4ecc06d922a798
2019-07-02 11:42:45 -04:00
Zhiyi Zhang 8b0344d4bc examples: fix "CanBePrefix unset" warning and general cleanup
refs: #4581
Change-Id: Ia1955e1c1eb746221adc88bfde093d5eadbd88e5
2019-06-28 11:36:19 -04:00
Davide Pesavento 57a3276d44 util: use time::nanoseconds in RttEstimator
Refs: #4887
Change-Id: Ie6469732fec53cca4b274b36d7ec58eff7addc1b
2019-06-24 02:36:21 -04:00
Davide Pesavento c81637150c ci: add gcc-9 to Travis CI build matrix
Change-Id: I7b3a7306c92f355c7585ad49a7a2d9d9a402e2ea
2019-06-23 16:35:47 -04:00
Davide Pesavento 1bac111c3c security: make PrivateKey::getKeySize() work in all cases
Change-Id: I9c010d57220a27c5f2a248aca53e56ae6fe5a539
2019-06-19 20:54:54 -04:00
Ju Pan ccce0bc969 mgmt: add EndpointId field to NextHopRecord class
Refs: #4816
Change-Id: I1e0fb691ca520679f491502a62d827672ec53d8b
2019-06-14 17:27:20 -07:00
Ernest McCracken 3243c3dad3 util: Add a getter for the smoothed RTT value
Refs: #4892
Change-Id: Ic2efc6f80058cbdd0bdbe9a4047856d75b54d04e
2019-06-13 18:50:01 -04:00
laqinfan 48f97244b8 security: add PrivateKey::loadRaw() for HMAC keys
Refs: #3075
Change-Id: I535a0e1ec2a48fba0e1dccc4b77ea9900a61a464
2019-06-13 18:44:02 -04:00
Davide Pesavento 4ad933a757 util: add afterMeasurement signal to RttEstimator
Refs: #4887
Change-Id: Ie48871a346f2960a7894c45a9386c52f3e1d9af2
2019-06-06 14:03:42 -04:00
Davide Pesavento 77d9e815c5 security: remove unused KeyClass and AclType enums
Also remove v2::PublicKey alias of transform::PublicKey

Change-Id: I891ffca065613d37c5534b9729c1b6827d440f47
2019-06-03 22:05:54 -04:00
Laqin Fan 0fe72eacc6 security: add HMAC support to SignerFilter and VerifierFilter
Introduce HmacKeyParams
Add HMAC support to transform::PrivateKey
Deprecate HmacFilter

Refs: #3075
Change-Id: I16e24c1c4f278b08c7f51c91e9317b7820943536
2019-05-30 20:36:56 -04:00
Junxiao Shi 2ad2fbeb20 interest: drop Selectors from matching functions
matchesData and matchesInterest only consider Name, CanBePrefix,
and MustBeFresh. matchesName is deprecated.

refs #4913

Change-Id: I6f29a98f09f1b6f97e379f4c7d74d9b18da75d0e
2019-05-24 03:11:06 +00:00
Davide Pesavento 3510d299ba lp: add missing std::move to Nack constructor
Change-Id: I15a304caea4df2de1b804554e2cd60e74bd93c0d
2019-05-10 14:57:33 -04:00
Davide Pesavento e37ec7ded4 net: NetworkMonitor: set NETLINK_GET_STRICT_CHK on netlink socket
Change-Id: I1ce7750fa68e29dee20987e5cfd49e46e3a26a52
2019-05-02 20:02:45 -04:00
Davide Pesavento 530c10f523 net: use the correct netlink message payload to request an address dump
RTM_GETADDR wants an ifaddrmsg structure as payload, not ifinfomsg

Change-Id: I441d07f873668fac296085547458ef6ea077945b
2019-05-02 20:00:23 -04:00
Davide Pesavento 5223ea82f5 net: use generic::raw_protocol instead of posix::stream_descriptor for netlink
Netlink sockets are not stream-oriented

Change-Id: I8dfde18eba8403bce4a8ec6bffe1680233ec8dfc
2019-04-30 22:42:09 -04:00
Davide Pesavento c9650e4cb5 net: NetworkMonitor: use an enum to track the interface enumeration phase
Change-Id: Idf8e53025f9648f346c65bbf90007028a4f1b586
2019-04-30 17:57:26 -04:00
Davide Pesavento 2ec13ebc10 net: NetworkMonitor: improve handling of NLMSG_DONE
It can also include extended ACK TLVs after the payload, similar to
NLMSG_ERROR. Therefore, parse the attributes and log NLMSGERR_ATTR_MSG,
if present, which can be quite helpful for debugging.

Change-Id: Ic3bf95d76523a198fd4b57efe6d4ea74e512073f
2019-04-30 17:55:58 -04:00
Davide Pesavento fcdc873185 net: NetworkMonitor: set NETLINK_CAP_ACK on netlink socket
This allows the kernel to exclude the payload of the original
netlink message from a NLMSG_ERROR message. We use the sequence
number in nlmsghdr to keep track of replies, so we can safely
enable this (minor) optimization.

Change-Id: Ib02b36346fa20045ca4eb9f77c79688fd45c6525
2019-04-30 15:00:54 -04:00
Davide Pesavento f1bb38d3aa util: move Scheduler and related classes to ndn::scheduler
Remove deprecated header util/scheduler-scoped-event-id.hpp
Remove deprecated functions and type aliases

Refs: #4883
Change-Id: I83c6700c568db7fbbece98d9691ab3d75ff5d2f2
2019-04-29 18:48:02 -04:00
Alexander Afanasyev 0d748af32f Prepare release 0.6.6
Change-Id: I2896cf769547e7afbedcc4f00bf28b48e0729426
Refs: #4916
2019-04-27 15:00:06 -04:00
Davide Pesavento 0c31537e48 Fix compilation with Boost 1.70.0
Refs: #4923
Change-Id: Ic0cb78586cee1ad5e527f7d2a23fd2e1bdbd0bcb
2019-04-25 17:00:49 -04:00
Davide Pesavento 6b33040eae encoding: treat TLV-TYPE zero as invalid
* Use tlv::Invalid to indicate an invalid Block, instead of
   UINT32_MAX (which is a valid type), thus fixing bug #4726
 * Introduce Block::isValid as a replacement for Block::empty
   and soft-deprecate the latter
 * Improve test coverage of Block and tlv::readType

Refs: #4726, #4895
Change-Id: I1cd3336fcbfe83555f3111738da67041dfae64f3
2019-04-25 17:00:23 -04:00
Davide Pesavento 599ee3f242 ci: adapt to new repo layout for CentOS boost RPMs
Change-Id: I5fc9ed6f94887a4b6125e843474623d1a4ccac95
2019-04-20 16:32:49 -04:00
Davide Pesavento 78e3549c16 util: update bundled copies of {any,optional,variant}-lite
any-lite commit b210d89239c3ffa969bffe8731d287674901a7fb
optional-lite commit a08fda6c674ae4c9ff43dcad89f630da512c24d6
variant-lite commit 94e2844cae3bfe19ab3c0f3a9aaa13f69a43c026

Change-Id: I859eb3d2fca8a74899d887a14f4e1a4361b79a8e
2019-04-16 20:00:00 -04:00
Davide Pesavento b310efbdaa docs+ndnsec: improve description and parsing of command options, rewrite man pages
Replace custom redmine_issue extension with sphinx.ext.extlinks

Refs: #4907
Change-Id: Ib0cb94156ae4fc80cdcaf4c70d7c8d55c16fcbc3
2019-04-14 16:50:19 -04:00
Davide Pesavento fa995ac3d3 docs+tools: improve ndnsec help, error messages, and manual page
Exit with status code 2 on malformed command line

Refs: #3777
Change-Id: Id682a5d69c15c74cfa1903db38b5389936f5be58
2019-04-09 12:18:58 -04:00
Davide Pesavento 3891244ec3 interest: improve setApplicationParameters() behavior
Refs: #4658
Change-Id: Iecc476613d81b2958198a222717e9b5b522d72e2
2019-04-09 12:00:50 -04:00
Davide Pesavento 9c19a3900b interest: rename Parameters to ApplicationParameters
Refs: #4658
Change-Id: I7eee6366545e1832efa07d5503c52f35c3ca6ed0
2019-04-06 15:38:54 -04:00
Davide Pesavento 4bb06bcedf interest: improve the "CanBePrefix unset" warning
Refs: #4581
Change-Id: I4efd885ad4cd502e5fb1630239be08b8f2d39026
2019-04-06 13:59:10 -04:00
Davide Pesavento 46b04a5f84 docs: improve README.md
Change-Id: Iba7aea52bb67dd8ee788734e1141ab2459167090
2019-04-06 13:13:45 -04:00
Junxiao Shi e7b90e5575 face: rework list structures
refs #3919

Change-Id: Ib734923ef5f701d733d5b0f915183f10434ce30b
2019-03-27 13:29:33 -06:00
Davide Pesavento 5437aa2375 tests: fix compilation with Boost 1.69.0
Also fix flawed logic in the same test case

Refs: #4890
Change-Id: Id99e412a2316747e55539955b59d6f6a4c98be47
2019-03-25 23:33:03 -04:00
Alexander Afanasyev 1660d00046 security: Add option to disable infrastructure interest in CertificateFetcherDirectFetch
Refs: #4879
Change-Id: I4ee7f831fde1fe6e951857c279546f7b7433def0
2019-03-19 16:24:23 -04:00
Junxiao Shi a5f233e103 util: rename Scheduler::scheduleEvent to schedule
Deprecate Scheduler::scheduleEvent and Scheduler::cancelEvent

refs #4883

Change-Id: I2bb16922aff04300d92dfd276dd436958a96929a
2019-03-18 09:39:22 -06:00
Davide Pesavento fd6123173d util: add ndn::scheduler namespace alias
This is the new preferred way to refer to Scheduler and related
classes. The Scheduler class itself is also available as ndn::Scheduler
like before. ndn::util::Scheduler and ndn::EventId are deprecated.

Refs: #4883
Change-Id: I825c2a0911a959caa60d7d8a547ca7199c58f61e
2019-03-16 02:52:20 -04:00
Davide Pesavento 4fc9080417 ci: update Travis-CI configuration
* Drop clang 3.6 and 3.7
 * Add clang 9 (trunk)
 * Disable ASan on clang 7 and later due to a problem
   with the ubuntu binary packages from apt.llvm.org
 * Remove all OSX-10.11 configs (no longer supported)
 * Add Xcode 10.2 on macOS 10.14

Change-Id: Ie1baad933798e9c11332050c58a47393c1011615
2019-03-14 15:39:29 -04:00
Davide Pesavento fc27d3b659 Fix build with Xcode 10.2
Refs: #4860
Change-Id: I6a5ee5259185ac6311cc3ea75921a8d0ce522f1b
2019-03-09 15:49:26 -05:00
Davide Pesavento 77f1c7665e build: do not look for unneeded libraries
Change-Id: Ifcf45442b947bf23355e270f1f9bda298792d4a2
2019-02-19 15:06:16 -05:00
Junxiao Shi e209961817 name-component: encode/decode Convention rev2
Naming Conventions rev2 encode sequence numbers, version
numbers, segment numbers, byte offsets, and timestamps as
typed name components.
Markers as defined in Naming Conventions rev1 are still
supported.

The library by default recognizes both styles, and encodes as
markers. These defaults can be changed via
ndn::name::setConventionDecoding and
ndn::name::setConventionEncoding functions.

"segment offset" is renamed to "byte offset". Functions bearing
"SegmentOffset" in the name are deprecated in favor of their
"ByteOffset" counterparts.

refs #4777

Change-Id: I265d69af474ab27d274ee49619f5cae5fb2c429d
2019-02-15 14:46:27 +00:00
Davide Pesavento 923ba4415f Replace all uses of BOOST_THROW_EXCEPTION with NDN_THROW
Refs: #4834
Change-Id: I1f9a614c83954873888d13c7b2b17a4fbff81058
2019-02-14 13:25:48 -05:00
Davide Pesavento fccb2dc91c encoding+interest: change Parameters to use non-critical type 36
Refs: #4780
Change-Id: I2cde10da4586737bb5c687a8aa9589beff1a80e1
2019-02-11 20:13:07 -05:00
Junxiao Shi 4fdcb274a3 face: deprecate Id types in favor of Handles
This includes:
PendingInterestId => PendingInterestHandle
RegisteredPrefixId => RegisteredPrefixHandle
InterestFilterId => InterestFilterHandle

refs #4316, #3919

Change-Id: I3a2d2f813d36a2d6edbb8c460aaa6e2e380f41e3
2019-02-11 15:05:46 -07:00
Junxiao Shi da9761f8e6 face: don't use memory address as PendingInterestId
Using memory address as PendingInterestId may cause false
removal of PendingInterest record if the memory allocator places
a different Interest at the same position in the heap.

refs #2865

Change-Id: Icf4d11509ad5c2acd56f180a333a68aa96f31768
2019-02-11 15:05:33 -07:00
Davide Pesavento fd674016ab util: introduce NDN_THROW
Refs: #4834
Change-Id: I35ff77a1d4e96caa17523cbdbb6f169390975d1b
2019-02-10 19:32:18 -05:00
Alexander Afanasyev 8fdae8909d build: Propagate DEFINES of dependent libraries to libndn-cxx.pc
Refs: #3982
Change-Id: Id3c3bb219fe074c0e7427d34e0a0da4981952be3
2019-02-10 17:17:28 -05:00
Davide Pesavento d0fef21ce5 common: drop inclusion of unistd.h
Change-Id: I1d2a5038f1ecf568eb7ba5cbab28c04c7ca62199
2019-02-05 00:45:10 -05:00
Davide Pesavento 5c803b9b28 encoding: improve documentation of Block class
Also add missing test cases for two constructor overloads

Change-Id: Iab76867b12684481ff5fc2587a3ebc8f5d176e71
2019-02-04 18:58:39 -05:00
Davide Pesavento 459a653226 util: update bundled copies of {any,optional,variant}-lite
any-lite commit 27d4f7dbb853bd28d5324b984bb030d0c7c6eca6
optional-lite commit 6a96f5199c746ac862a2ae184a10f8800b86e20f
variant-lite commit 1051f91afd28fdfc05b2d2b8d1a0359090aabe3e

Change-Id: I8b644419c4e3c1668ae97666af11499db8c3d2b2
2019-02-04 18:58:09 -05:00
Alexander Afanasyev b72360faee Prepare release 0.6.5
Change-Id: Ifc28a3a32d572b2455353bf164427ca2d37aebf9
Refs: #4821
2019-02-04 13:30:04 -05:00
Junxiao Shi 80609d44c3 face: scoped pending Interest
refs #4316

Change-Id: I79f832ce599f09a4d5bbf8cd8c4656d677dd164c
2019-01-29 18:15:22 +00:00
Alexander Afanasyev 7c5bc1e218 build: Upgrade waf build system to version 2.0.14
Version 2.0.6 had some strange issues with Python 3.7.2 on macOS with
Homebrew.

Change-Id: I518659141477f0ca0deee8fbc4608408642bc619
2019-01-29 08:32:40 -05:00
Junxiao Shi 07115cc106 util: reimplement scheduler::EventId with CancelHandle
<ndn-cxx/util/scheduler-scoped-event-id.hpp> header is deprecated.
It has been combined into <ndn-cxx/util/scheduler.hpp>.

Implicit conversion from nullptr to EventId is also deprecated.

refs #4698

Change-Id: I0310d41ac9638cb5be02ae61b887538f562541b2
2019-01-23 19:00:59 +00:00
Alexander Afanasyev 4e0cc6cf21 security: Remove use of ChildSelector in CertificateBundleFetcher
This commit also removes (unused) references to ChildSelector in
CertificateCache and TrustAnchorContainer.

Change-Id: I556382e41442dae172c25cd2de60ccdc28da3876
Refs: #4665
2019-01-23 11:15:19 -05:00
Davide Pesavento 322e76e7ed Use Boost.Range to simplify some code
Change-Id: I8ea55e324205c3f13096be6037e82aaab302bb55
2019-01-18 17:22:08 -05:00
Chavoosh Ghasemi 6b99b6f185 Add MetadataObject class to encode/decode RDR-style metadata
Change-Id: I6688b630a4889614e7df5c1f91b91be370a350cd
Refs: #4707
2019-01-18 17:21:55 -05:00
Davide Pesavento ca48851110 tests: delete goodness-of-fit tests from Util/TestRandom
They're not implemented correctly and fail too frequently.

Change-Id: Ibb228ba3193cd4491b330e22f5d6d8502adf8d3c
2019-01-18 17:20:09 -05:00
Junxiao Shi c53df03ff3 lp: stop accepting NonNegativeInteger as sequence number
This commit also improves Lp/TestPacket/FieldAccess test case.

refs #4598

Change-Id: Iab480226da619a69bb5959c935c63f92d3bb3234
2019-01-14 23:33:25 +00:00
Junxiao Shi 60aaef0622 face: scoped Interest filter
refs #3919

Change-Id: I4e1aed63b2fabe463e9572b99bb3d97b278cabd6
2019-01-14 07:32:31 -08:00
Davide Pesavento 8db6152556 util: add random::getRandomNumberEngine() to the public API
Change-Id: I03d572e3c51a7256f53060e66c9eae0d1ab84c65
2019-01-13 18:08:33 -08:00
Junxiao Shi ec475a7da5 face: scoped prefix registration
refs #3919

Change-Id: I858bf38000014a295cf853635b9c2a4275267d32
2019-01-13 21:53:55 +00:00
Davide Pesavento c554551d96 Add git .mailmap
Change-Id: I949ca290b1a78fc7e2e7ec7659e1068f5348df0b
2019-01-09 17:44:07 -05:00
Davide Pesavento bfe3139ede util: seed the PRNG with more entropy
Change-Id: I0e54079bac039db0a10b2f443a3b02b85dd2bb68
2019-01-03 16:26:51 -05:00
Davide Pesavento 22f7bc3006 tests: don't throw if NetworkMonitor lacks CAP_ENUM
Gracefully handle this case by returning an empty list of interfaces

Change-Id: Ib07215c76dec60ec4bdc86358e1dbecd30a3ca62
Refs: #4796
2018-12-26 10:03:05 -08:00
Davide Pesavento 64ae55d781 build: ensure /usr/local/include is treated as system include path on FreeBSD
Also use the LLD linker by default on FreeBSD.

Change-Id: I42fc1b3688008e6fa40ee5f399501e54dba25a83
Refs: #4790
2018-12-26 10:03:05 -08:00
Davide Pesavento 534b841bc0 docs: refresh installation instructions and general cleanup
Change-Id: Ibfe945887e5cad979c1f9a78fd5a3062bb20a8b5
2018-12-26 10:03:05 -08:00
Ashlesh Gawande ebe156c92f util: fix SegmentFetcher undefined behavior caused by uncanceled pending interest
Change-Id: I4ca80ad00fc52024f35908b21d7c42bffc8a5396
Refs: #4770
2018-12-26 10:03:05 -08:00
Junxiao Shi 19b87de693 detail: move cf-*-osx.hpp to 'detail'
refs #4782

Change-Id: Ie00846ea0afad65ff0e10fb615163318832f127e
2018-12-18 13:24:36 -07:00
Junxiao Shi 70d76eb4da transport: move Impl templates into 'detail'
refs #4782

Change-Id: I011ed5b75430d4235eccdbd5e1b9270ed413cc31
2018-12-18 13:15:43 -07:00
Junxiao Shi 1d23ff9277 detail: move asio-fwd to 'detail'
refs #4782

Change-Id: I9e39e3776669a2b3f69d7a964c0caf6333d1d79c
2018-12-17 13:21:08 -07:00
Junxiao Shi 1e36ceb0ff detail: move packet-base|tag-host.hpp to 'detail'
refs #4782

Change-Id: I3e2e95a1286703bd1fea9c1a7abee9684b2fbd08
2018-12-17 13:20:26 -07:00
Junxiao Shi d1fc9a7104 detail: move common.hpp to 'detail'
common.hpp and config.hpp are implementation details that should be
installed to target system.

common-pch.hpp is moved to 'impl'.

This commit also adds README.md to 'detail' and 'impl'
directories to explain their semantics.

refs #4782

Change-Id: I4f3e607338b3bdccbaddaed735f6326adcc2fda0
2018-12-12 16:35:34 +00:00
Junxiao Shi 24c5a00073 impl: rename 'detail' to 'impl'
'impl' directory contains implementation-detail headers that are NOT
installed. 'detail' directory will be used for implementation-detail
headers that ARE installed.

refs #4782

Change-Id: I13428e032c93207753a6b856c693511c4fc3bbb8
2018-12-12 04:47:15 +00:00
Davide Pesavento 2c1d349bdb docs: display the full include path in doxygen
Change-Id: I15a670f1cd87c0760ba39fcc87129dc1a494c2d0
Refs: #4041
2018-12-08 17:35:24 -05:00
Davide Pesavento 7e78064871 Change #include style
Header files are now always included with their path from the
project's root directory rather than the path relative to
the includer.

Change-Id: If39b8510eef8da00baf5fe88337c45dbdf8c766e
Refs: #3084
2018-12-08 16:03:34 -05:00
Davide Pesavento cf8a3684c2 ci: install gcovr via apt
Change-Id: I017ec6e4281a0348eca0361643cb3af0167c420f
Refs: #4771
2018-11-24 20:33:52 -05:00
Junxiao Shi 946a51cc0e util: stop using ChildSelector in NotificationSubscriber
refs #4664

Change-Id: I9e6c39d49949f0b097c220eafbe4ce990549b54d
2018-11-24 00:25:57 +00:00
Davide Pesavento 74daf741cd Rename 'tests/unit-tests' directory to 'tests/unit'
Change-Id: I78ea29938259fac288781bed12fb2399ac7eba26
2018-11-23 18:27:50 -05:00
Davide Pesavento 1944281719 Rename 'src' directory to 'ndn-cxx'
Change-Id: I14394023680901a86977313ca87fb017333614dd
Refs: #3084
2018-11-23 18:27:19 -05:00
Ashlesh Gawande 3e3a989096 mgmt: Controller cleans up fetchers on destruction
refs: #4775

Change-Id: I795b1ee273d0cca6df23be6c87255fc6d33b3651
2018-11-23 12:26:27 -05:00
Ashlesh Gawande 1bbce6df87 ims: prevent memory pool size from becoming zero
refs: #4769

Change-Id: Id1c1dadf40db6f62bd684391066e7ad45ec8dcd1
2018-11-23 12:25:41 -05:00
Davide Pesavento 17b61b4101 util: backport C++17 std::any and std::variant
The backported implementations are taken from Martin Moene's any-lite
(commit a2ee2e1cc4a3fcfe42ab44c46a65467b76b58f25) and variant-lite
(commit ff251b02253ff28db49bb20a79200514d8267d87).

The bundled copy of optional-lite is updated to commit
9a370efe62e084729a171a407b017aa58dc954c1.

Change-Id: I4afe117e357c82d51002f96b083aed0ec5eeda35
2018-11-21 23:10:48 -05:00
Davide Pesavento 8dfd91367f data: remove deprecated {get,set}FinalBlockId()
Change-Id: Id2baaddae26d4afe0cb35b43f44f1eba9a311da6
2018-11-05 12:12:15 -08:00
Davide Pesavento 511712d863 ci: fix another issue with preinstalled homebrew packages on Travis
Change-Id: I7aa53d7ac0daadf8eb2b970ae0fe289899aa023d
2018-11-03 18:51:10 -04:00
Ju Pan dca56eacba mgmt: augment ForwarderStatus with counters for satisfied and unsatisfied Interests
refs: #4720

Change-Id: I9413aef59a9f4669beaaa214abd93c4bb40e622f
2018-10-28 15:33:51 -07:00
Ashlesh Gawande 679dbb006f util: add stop function to SegmentFetcher
refs: #4692

Change-Id: I8b7f0c52ac9dd22ed9a665daaa62ef130eac2e53
2018-10-28 15:33:18 -07:00
Tianxing Ma 241df42555 encoding: support floating point numbers in TLV-VALUE
refs #4612

Change-Id: I3ca5970b1559c6690826045a0955a26b93663f50
2018-10-26 11:54:06 -04:00
Junxiao Shi 8b753a2e54 interest+data: forbid unrecognized TLV before Name
Change-Id: Id052b02be0aa3e36064c40872cee37f9c8dd3a78
2018-10-24 01:51:40 +00:00
Alexander Afanasyev 7b1124674a security: Throw exception when loading on orphaned ValidationPolicyConfig
ValidationPolicyConfig must be assigned to a Validator instance prior to
loading and it is an API violation to load configuration otherwise.

Change-Id: Ib372cd3b6ab7c7ce1e37039f25b97e1d2f1511f9
Refs: #4758
2018-10-18 14:50:54 -04:00
Davide Pesavento f714d1b520 ci: workaround homebrew issues with python and numpy on Travis's macOS 10.12
Change-Id: I772e13c5395c1fd3467f8405baadd0bb4f795104
2018-10-13 22:50:27 -04:00
Davide Pesavento ee77ca017a security: use AES-256 for private key encryption in PKCS #8 export
Change-Id: Ibe8bb7270017bf9b5241044c983b4df359d73185
2018-10-13 22:49:29 -04:00
Ashlesh Gawande 3e39a4d6a3 security: use exponential backoff in CertificateFetcherFromNetwork
refs: #4718, #4712

Change-Id: I8def533528b82ea00096e9d87897acf31dff24a4
2018-10-13 22:47:34 -04:00
Davide Pesavento 13fffa38f5 security: in tpm::BackEndOsx, unwrap the key before importing it
We use our own openssl-based routines for the PKCS#8 decoding/decryption,
as they support a much wider range of algorithms than macOS's Keychain.

Change-Id: Ia841e7681a47563c696d054d46fe523f427c99cb
Refs: #4450
2018-10-02 23:57:36 -04:00
Ashlesh Gawande 279f366d3f util: remove deprecated SegmentFetcher::fetch
refs: #4464

Change-Id: I1733cf06c8ae30b4aef547e2d9324e8776c39903
2018-09-21 23:05:36 -04:00
Davide Pesavento 2cb33fa5ed net: remove deprecated ndn::ip::address{,V6}FromString
Change-Id: I79974cc06abda11f7e6bbbd307bbe1db1672522a
2018-09-21 22:24:12 -04:00
Alexander Afanasyev a3bf4319ed Prepare release 0.6.3
Change-Id: Ie4bc2812544224110eb371e4dd096fc1681ab1f0
Refs: #4727
2018-09-17 23:50:23 -04:00
Davide Pesavento d2c750b37a util: update bundled copy of optional-lite
This updates optional.hpp to upstream git commit
063af3ed2e830f3fcb77c635c6391e5d65c51fe5

Change-Id: Ie390b2818fa4dff8c600b777b77104b7f0c11f9d
2018-09-16 12:54:42 -04:00
Teng Liang e3ecad7bc7 lp: remove lp::PrefixAnnouncement in favor of ndn::PrefixAnnouncement
refs: #4280

Change-Id: I09847adaeb000ff4b305fb42dd2a1eb2572aff42
2018-09-12 16:59:25 -07:00
Md Ashiqur Rahman 8bd3b8a305 ci: add support for CentOS 7
refs: #4610

Change-Id: I458ee0c2bbe54722cf5874c8725b8126629a4d98
2018-09-10 21:58:13 -04:00
Davide Pesavento cdb5d8f646 ci: introduce helper to preserve select env variables under sudo
Change-Id: I0217b8fbb005a43dddaf0010aa85130411d20813
Refs: #4610
2018-09-09 19:21:54 -07:00
Davide Pesavento e80d1167d4 security: add support for SHA-3
Requires openssl >= 1.1.1-pre1

Change-Id: I8d91ca30425129694f3b0fc40daa891b58ded065
2018-09-08 19:23:09 -04:00
Davide Pesavento 648ae9ef8e security: forbid RSA keys shorter than 2048 bits
Change-Id: Ib4a90c32d8d6065093b01ab3d28e119a232ca638
2018-09-08 15:40:02 -04:00
Davide Pesavento 3c7969fa9d security: support 224-bit and 521-bit NIST elliptic curves
Change-Id: I28d2e5162e1e8fd7261828d435b059093b6989ea
2018-09-08 15:31:35 -04:00
Junxiao Shi 1748b1e817 prefix-ann: provide ==, !=, << operators
Also, ensure toData() adds correct ContentType.

refs #4650

Change-Id: I60956948766190cd713b58c85ba30b3701180b25
2018-09-06 04:13:42 +00:00
Davide Pesavento fbda933b7b security: improve error handling in tpm::BackEndOsx
Change-Id: I1899d9fa622e8379fc38dde914c1c8a9f6fcb77f
2018-09-02 21:29:28 -04:00
Davide Pesavento 4b8eab72f3 build: drop dependency on unused CoreServices framework
Change-Id: I91df33fafbcf275f7b41394112f8c002bc98af97
2018-09-02 12:38:25 -04:00
Davide Pesavento 5ee8ec032a security: code cleanup and doxygen improvements in tpm::BackEndOsx
Change-Id: I6d6d77ab315a10c280e7643d4cec5269ed10fe5e
2018-09-02 12:37:43 -04:00
Teng Liang 502b47956c encoding: replace the route origin selflearning with prefixann
refs: #4280

Change-Id: I9db6b92f681650c21e82251f17f03f4ae2834b24
2018-08-29 14:10:11 -07:00
Sepehr Abdous 4fc6db23b6 docs: Fix a typo
refs: #4232

Change-Id: Ibe4d07fb459ba5052a58cbe6c78cdaa8a2cd423d
2018-08-26 17:17:31 -07:00
Davide Pesavento 474c3b2f33 build: check for linux/genetlink.h
Change-Id: Id18fcc81a49e769a05c4416cdce03022a2179051
Refs: #4020
2018-08-25 16:31:17 -04:00
Junxiao Shi 8127d1ab65 mgmt: encode and decode prefix announcement object
refs #4650

Change-Id: Ie8de492aac1ea9fd51ddc6b50f239913989abe72
2018-08-24 15:29:21 -06:00
Davide Pesavento 755f8a89eb net: NetworkMonitor: gracefully handle backend initialization failure
Change-Id: I1a22fd53e9905b6e5892573d1473d1f4e8969522
Refs: #4668
2018-08-24 12:32:59 -07:00
Davide Pesavento 52bc4e918c build: disable -Wmissing-braces with clang < 6.0
Also remove some -Wno-error= flags that are no longer needed.

Change-Id: I0e0ad52c69fd42b815f5b20f45311d0c9b8cdef3
Refs: #4721
2018-08-24 12:32:41 -07:00
Junxiao Shi 2b322eb8c6 encoding: provide _block literal operator
_block literal operator is moved from tests and becomes public API.

refs #4722

Change-Id: I07cc040af3c4288104b66f11d91830dc9f28835a
2018-08-24 10:43:27 -06:00
Junxiao Shi 426d500681 encoding: update number assignments
This commit declares:

* TLV-TYPEs for typed name components in NDN naming conventions
* SignatureType number for HMAC
* ContentType numbers for Prefix Announcement and FLIC

This commit also:

* Improves stream insertion operator for SignatureTypeValue
* Adds stream insertion operator for ContentTypeValue
* Corrects several references to certificate format spec

refs #4577, #4649

Change-Id: Ibfd5cc1408cf892e38a2be93bf17e76f628f255d
2018-08-23 10:52:29 +00:00
Davide Pesavento 107749982a net: initial support for generic netlink (genl)
Change-Id: Iaea67d08c835b856d2928eb49003ad214de824ca
Refs: #4020
2018-08-20 19:20:30 -04:00
Davide Pesavento dc5bb96988 net: support multiple concurrent netlink requests
In preparation for generic netlink support

Change-Id: I3f648518800176015cf7435b4e61e6e73c83e796
Refs: #4020
2018-08-20 19:20:11 -04:00
Davide Pesavento a0b2a2c1d4 net: refactor netlink socket handling
In preparation for generic netlink support

Change-Id: I69d93b69c08d4c3f7fd0dabbf3e51dbd49f9ef06
Refs: #4020
2018-08-20 19:19:28 -04:00
Junxiao Shi 4053bd525f name: recognize ParametersSha256DigestComponent
refs #4658, #4570

Change-Id: I8001f6aa7a406e9e8eb10fc365bd84bc711cda07
2018-08-16 13:39:25 -06:00
Junxiao Shi d2e6063788 name-component: recognize plain URI syntax
refs #4690

Change-Id: I6e88d88cc62a025edc30b545f1044a225c20213f
2018-08-10 10:48:44 -06:00
Arthi Padmanabhan b38664e317 interest: support Parameters element
Add getter/setters for Parameters, encode as packet format v0.3 if
Parameters are present, have decode03 save Parameters element, and
add encode/decode unit tests for v0.3

Refs: #4658

Change-Id: I70c1072f0003a1b757b8dc484a93ef91bac74496
2018-07-28 09:36:36 -07:00
Junxiao Shi 68b5385cb0 docs: update code-style rule 2.24
This commit also updates existing code to use the new format.

refs #4681

Change-Id: I88e62a34fc55a69cd01d74e80a7000c6cf4d7c2d
2018-07-25 13:56:38 -06:00
Davide Pesavento 3b101d0682 Use std::move in more places
Plus various code simplifications

Change-Id: I19805e4a635e4c74afaff68f9d8968475217ec6e
2018-07-24 15:17:34 -07:00
Junxiao Shi cf0aff8a03 name: accommodate typed components in getSuccessor
refs #4570

Change-Id: I8dae1c983663f1d04fbb2e2b82d9fe1e9b4aabda
2018-07-23 06:42:13 -06:00
Junxiao Shi b55e5d39e2 interest: declare default CanBePrefix setting
refs #4581

Change-Id: I82de3b13c3010242fa7999a2564d4a5442dfd14b
2018-07-18 13:32:00 -06:00
Junxiao Shi 54d74c25a0 security: correct ValidationPolicy docs
refs #4390

Change-Id: I416f8773c9d52e0e7f61edb30d0476f9542fbf2b
2018-07-18 13:30:08 -06:00
Junxiao Shi 643b7f5ddf mgmt: use platform-independent counter type
refs #4229

Change-Id: I147205cceeb84dc7c36be9614f15a9e9a1c880f9
2018-07-18 13:29:42 -06:00
Junxiao Shi 5c1c444c6c security: Improve reliability of TPM BackEnd RandomKeyId test case
refs #4092

Change-Id: I58c6f3efbbbf31a826a7c41ede2494f0fbe313f1
2018-07-18 12:29:06 -07:00
Davide Pesavento 3a3e188d0e encoding+util: ensure move constructors are properly declared
This also fixes a race condition in scheduler::EventId::operator bool()

Change-Id: I468f0c46039a3d1a38c69c419ae45b4445d8205a
Refs: #3414
2018-07-17 18:01:06 -04:00
Davide Pesavento bc76da1fa4 util: update optional-lite to version 3.0.0
Change-Id: Icdc0117234404465a3facb802795a66f27467065
2018-07-17 17:55:54 -04:00
Davide Pesavento 570b20dd9d encoding+lp: declare constexpr and noexcept where possible
Change-Id: Icf708af0b77d62d7d8e75527aaf51c7178e47125
2018-07-15 22:00:21 -04:00
Davide Pesavento 14883ad4c8 encoding: use Boost.Endian for endianness conversions
Change-Id: I1ecaa4c4efa7cc50486b1e8403f049a9ee33156f
2018-07-15 22:00:00 -04:00
Davide Pesavento 2aec97a1d0 net: filter netlink messages based on sender pid and destination group
Change-Id: Ib3f580df63974f7d4e2f009d1f4f9d87662d0832
2018-07-15 14:48:49 -04:00
Davide Pesavento 50b9226465 net: refactor netlink message parsing, add extack support
Change-Id: Iaa132d8cb1aece6cfc608cc1c3b4478982ac706e
2018-07-15 14:48:35 -04:00
Junxiao Shi 4c45fd8906 ims: correct inaccurate comment
refs #4657

Change-Id: I73cf070ac97be4b2beec094b2a8f8a05894c408b
2018-07-13 13:53:24 -04:00
Eric Newberry 2b765f8ae7 util: eliminate selector usage in SegmentFetcher
refs #4555

Change-Id: I61c28a916ca92d30538bfc7a917f0c44c3854722
2018-06-25 21:22:24 -07:00
Eric Newberry 33063399fc docs: unregister prefixes instead of calling Face::shutdown
refs #4636

Change-Id: I15944bcb544bdbf0c253fe390c4ff459735d64a6
2018-06-24 13:20:50 -07:00
Eric Newberry e345baa02a util: augment SegmentFetcher with congestion control
refs #4364

Change-Id: Ibfebc1f173382d1faf88e0d3d707b8ab2dae5e43
2018-06-24 13:13:41 -07:00
Eric Newberry 71a2f03d72 mgmt: fix compilation error on Xcode 8 and earlier
refs #4639

Change-Id: I3c2af9e60f3a9c0c959bd6a52d65c308c234efac
2018-06-19 10:06:34 -07:00
Davide Pesavento ca660f116a build: require clang >= 3.6
3.5 fails with "error: debug information for auto is not yet supported"

Change-Id: I77ac4a064959b26796a4bf3f1dea7c3c08ea60a3
2018-06-18 08:37:00 -07:00
Alexander Afanasyev 31fd46714e security: Correctly handle Sha256-signed Command Interests
Change-Id: Ibcda11627a4be0498dfd894df8b976cb65da308a
Refs: #4635
2018-06-18 11:29:06 -04:00
Alexander Afanasyev 57d02b65ef security: Fix bug preventing customization of KeyChain's TPM on macOS
Implementation incorrectly assumed that default PIB and TPM locators are
in canonical form, potentially leading to an wrong decision to reset
contents of PIB every time KeyChain is initialized.

Change-Id: I8b30f3aa2ac74e859e9225cf03b2b43af27d7d76
Refs: #4297
2018-06-17 17:04:03 -04:00
Davide Pesavento db4da5e4fb Improve and simplify code with modern C++ features
Change-Id: I28d84df3087492ab2ecbeb91169a2cde12c9e31e
2018-06-17 09:29:34 -07:00
Alexander Afanasyev 634a62bb74 tools: Allow specifying passphrase for ndnsec import/export in command line
Change-Id: Ic389249e017df27b0246cdd1fcd3a1431607246b
Refs: #4633
2018-06-15 18:56:47 -04:00
Eric Newberry 3c9bc042f3 mgmt: add Mtu to faces/create and FaceStatus
refs #4005

Change-Id: I26c02aa088dc59aecd331cd579036177fef0f64c
2018-06-14 16:15:57 -07:00
Davide Pesavento 90db7eeafc net+util: remove dependency on Boost.Regex
Use std::regex instead.

Change-Id: I6c53edf177b7861d47a1f256aa975e4100e00d45
2018-06-11 20:28:13 -04:00
Eric Newberry 436e46f73e docs: allow use of "Num" and "No" in entity number variable names
refs #4621

Change-Id: Ibd85f965561d85beef5b4fbb6e05efd9b2657296
2018-06-10 21:45:57 -07:00
Davide Pesavento 59e266ad15 net: deprecate ndn::ip::address{,V6}FromString
Change-Id: I32b26b70ab35e5f365bdb3fbfaad3c4e5f9d6a99
2018-05-28 07:16:28 -04:00
Davide Pesavento 1fd00240e0 build: switch to C++14
Replace our homegrown implementation of optional (based
on Boost.Optional) with optional-lite by Martin Moene.

Change-Id: I4632cbc7c705a94af0b85a335515e3430bf3cb1f
Refs: #3076
2018-05-24 21:41:56 -04:00
Ashlesh Gawande e24042225f face: use post instead of dispatch to avoid re-entrancy issues
This fixes a segfault in satisfyPendingInterests when Face::put is
called in DataCallback. Other functions are also safeguarded
against similar situations.

refs: #4596

Change-Id: I8d1564b0d28d1ee7b80c50712d888f874804823a
2018-05-24 16:05:29 -05:00
Eric Newberry cc910cd0aa util: use signals instead of callbacks in SegmentFetcher
Deprecate fetch() static functions in favor of start()

refs #4464

Change-Id: I8632790e6151ad019b19c89ceae1944d37871da2
2018-05-17 14:07:05 -07:00
Davide Pesavento 21be81676f build: ignore OSError raised by subprocess.check_output()
For example, when git is not installed.

Change-Id: I2a44b9c647e2b2e0344e2c831217db1595a9db68
2018-05-10 20:37:18 -04:00
Davide Pesavento 844b09331b build: require gcc >= 5.3, boost >= 1.58, openssl >= 1.0.2
This effectively drops support for all versions of Ubuntu older than 16.04

Change-Id: Ie3ab7df9147e97f6467658a6399a4f9379f089c1
Refs: #4462
2018-05-08 21:00:00 -04:00
Alexander Afanasyev d9b083e825 Prepare release 0.6.2
Change-Id: Ia5fefd6729fdf9cb5887a5165ba60614ab931280
Refs: #4564
2018-05-03 09:25:10 -04:00
Davide Pesavento 7c4ad512a3 docs: update list of supported platforms
Change-Id: Ib0aca834a90a9efd403d3357f94e482f1bbe82f0
2018-04-30 19:26:00 -04:00
Teng Liang c93c2ce269 encoding: add route origin for self-learning
Change-Id: I2f652ac889095ee9bb7c752e715cfecb41459fa4
refs: #4279
2018-04-29 18:29:03 -07:00
Davide Pesavento d89f002da8 ci: add gcc-8 to Travis-CI build matrix
Change-Id: I6301f06f4d43219da5ff7117708ed896b2dae3eb
2018-04-28 14:48:25 -04:00
Davide Pesavento 1c9c96c3d3 util: fix Logging::getLoggerNames()
Change-Id: Ia243b7eeb7aae69427526e23e7eff4896506871a
2018-04-26 01:02:51 -04:00
Junxiao Shi 974b81aeed lp: encode sequence number as fixed-width integer
refs #4403

Change-Id: I37daeaf3d60dbaf81a8f38ec5deb72eea6dd89c2
2018-04-21 01:37:03 +00:00
Junxiao Shi 72c0c64751 encoding: provide FormattedOutputFunction for Block
refs #2225

Change-Id: Ie38539ff93293b3919789043b01e09b573fb619a
2018-04-20 15:41:09 +00:00
Junxiao Shi 9c9672e230 name: don't strip whitespace when parsing URI
refs #4560

Change-Id: I88d2ba28623b051929a50043c0a46e6a4c6ac7fb
2018-04-18 12:55:08 +00:00
Davide Pesavento 6d43393669 tools: fix compilation with Boost 1.67
Change-Id: I0f4bae23f26eca07044990ce6dd01da750cfb569
Refs: #4584
2018-04-17 21:30:09 -04:00
Junxiao Shi 7d9039bef9 data: recognize Data in Packet Format v0.3
Data::wireDecode accepts both v0.2 and v0.3 formats,
but Data::wireEncode only encodes into v0.2 format.

refs #4568

Change-Id: I287d12c599f44d802a2a2cd2f13132c9f98a842a
2018-04-14 15:56:28 +00:00
Junxiao Shi 6efa3b7124 interest: recognize Interest in Packet Format v0.3
Interest::wireDecode accepts both v0.2 and v0.3 formats,
but Interest::wireEncode only encodes into v0.2 format.

refs #4527

Change-Id: I784b6f1d5c0d93db33155efddc0180359d8cab74
2018-04-14 15:54:08 +00:00
Davide Pesavento d95274bda8 util: let consumers decide the visibility of member loggers
Change-Id: I5d4a2fd1c0dfdea9e93ae411e8c1f1e0f534a5e6
Refs: #4552
2018-04-12 17:45:29 -04:00
Davide Pesavento 0c145ec508 util: support declaring loggers as class members
Change-Id: If6373023d27cf655c1a7f29009edaee0ae21d5b7
Refs: #4552
2018-04-10 22:12:04 -04:00
Junxiao Shi a2550a9d41 encoding: declare TLV-TYPE constants for Packet Format v0.3
refs #4527

Change-Id: I54a260971c6f3b82df53f5c387b132737f567a34
2018-04-10 05:07:48 +00:00
Junxiao Shi 3688d72de5 util: backport optional::reset
refs #3753

Change-Id: I17e77d7b7e3c450fc86aec06f5c2d3ecfcc1444a
2018-04-10 05:04:45 +00:00
Eric Newberry 25038f3034 build: find Boost lib architecture automatically
refs #4573

Change-Id: Id28188a98d710c15f06391d89d13fed91e0ad73f
2018-04-07 16:35:37 -07:00
Junxiao Shi 8d3f834c6c interest: deprecate selectors
NDN Packet Format v0.3 replaces Selectors with CanBePrefix
and MustBeFresh elements.
This commit deprecates getter/setter for Selectors in Interest
class. Getter/setter for CanBePrefix and MustBeFresh are mapped
to the closest v0.2 semantics and encoded as selectors.

refs #4527

Change-Id: Ie3d58d3d73f3bf1d8db3327943e6850a867465b0
2018-04-04 12:46:37 +00:00
Junxiao Shi a36f15d667 name: allow appending typed name components
This commit also adds test coverage for Name::isPrefixOf and
Name comparison operators.

refs #4526

Change-Id: I93996adb97408cbeec0a8b0fd06c3a12cbf5a78f
2018-04-04 02:22:12 +00:00
Junxiao Shi ebfe4a207f meta-info: allow typed name component in FinalBlockId
refs #4526

Change-Id: I3b6667928fa47c631e45ff5f0ca2c5030c5cc2ad
2018-04-01 23:53:40 +00:00
Junxiao Shi b849f61b6b util: give examples for NDN_CXX_DEPRECATED
refs #4566

Change-Id: Iaaebf31d52b9000d0e2ed279b4b8c9a69d0c399b
2018-04-01 23:52:54 +00:00
Junxiao Shi 4ffbb9d937 interest+exclude: rename NameComponent to GenericNameComponent
refs #4526

Change-Id: I8300f68b504ec959ca482759eaa4f7cbf566d729
2018-03-31 17:16:35 +00:00
Junxiao Shi cf4ac5b0c7 name-component: recognize typed name components
refs #4526

Change-Id: I9d32a5dc216c6b0921d181573a4e043fccc2814e
2018-03-28 22:46:06 +00:00
Eric Newberry c6500a9e00 docs: only use sphinxcontrib-doxylink on Python 3
refs #4553

Change-Id: I54fead17b17a835046af73ef6b5e0b169b30654e
2018-03-25 14:34:50 -07:00
Davide Pesavento 92e4d5c170 ci: fix clang-7 (trunk) build job on Travis-CI
The final ".0" was dropped from the package name.

Change-Id: I650f10c17bee2d561da7c8275a556a3a746798ba
2018-03-11 20:05:48 -04:00
Davide Pesavento 8a8c01bb0c tests: fix several instances of the most vexing parse
Change-Id: I6195bb5cd3ea0fb85e4e10a78319936f0fe5f3f3
Refs: #4545
2018-03-11 00:07:52 -05:00
Davide Pesavento 5df42a893d security: minor cleanup
Change-Id: Ibedce96a5f1fecc61149f354384194fae4fa39cb
Refs: #4542
2018-03-09 10:51:14 -08:00
Alexander Afanasyev 5560fd40ae build: update waf to version 2.0.6
Cleanup in most build scripts

Change-Id: Ib024e95fb6f80e72b0c00e1dc8bb9300d6c5f191
2018-03-08 21:49:25 -05:00
Davide Pesavento 5e2ccca06f mgmt: fix conflicting TLV-TYPE assignment
Amends df5053824f

Change-Id: Ifba9fcac63528594c6442973adce313a95116c75
Refs: #4318, #4538
2018-03-06 19:02:07 -05:00
Junxiao Shi df5053824f mgmt: declare cs/erase command
refs #4318

Change-Id: If34ba8d55a4d46d53f552f4edd748623d4c0e55e
2018-03-04 13:40:49 +00:00
Davide Pesavento 3c8a8b08f1 mgmt: Dispatcher: minor code cleanups
Change-Id: I0b092611caaf9f11e42a21061a50d4a3f3834903
2018-03-01 16:00:51 -05:00
susmit f47cef64a2 Prepare for 0.6.1 release
Change-Id: Iaf148b70c3e30a0cd6737239a769d54c24e43a80
Refs: #4497
2018-02-19 09:39:50 -05:00
Davide Pesavento 38a061d1a0 util: introduce escape() and use it in Component::toUri()
Change-Id: Ie476ca0fc909fb275631c60195fb1aa5640cff10
Refs: #4484
2018-02-15 22:47:59 -05:00
Teng Liang 5b323d16c8 lp: wrap Data in PrefixAnnouncement field
Change-Id: I47e33518cec60a29d4518433245f22283b96b747
refs: 4280
2018-02-10 10:23:46 -07:00
Davide Pesavento 08378cb4e3 name: fix encoding of "+" and "~" in Component::toUri()
Change-Id: I101ad74f555ee2738fac73d0e0a022fdd66f8e86
Refs: #4484
2018-02-07 19:28:42 -05:00
Junxiao Shi be86d989cd mgmt: fix CsInfo.Capacity decoding
refs #4050

Change-Id: Icc6d3cc45f1c7ea042b6c0a8c03d70e89852fcee
2018-02-07 14:20:29 +00:00
Junxiao Shi a7ab06d616 mgmt: add capacity and enablement flags to CsInfo
refs #4050

Change-Id: I9363f6735c6917591e0907b3d94f36d7263d10e7
2018-01-29 22:28:47 +00:00
Teng Liang 8b6eda9998 lp: add PrefixAnnouncement field and tag
refs #4280

Change-Id: I05b1f300d188388d60b3ed364f04d03de3fefccb
2018-01-28 11:45:33 -08:00
Davide Pesavento c5ba65bb6a util: fix Y2038 problem in time::toString()
Avoid using time_t, which cannot correctly represent
dates after 19 January 2038 on 32-bit systems.

Change-Id: I04e8d31a1c04a112cbc81810143fe2233e6dcc22
Refs: #3915
2018-01-28 14:30:22 -05:00
Eric Newberry d567aab38e mgmt: make congestion marking parameters optional
refs #4465

Change-Id: I5ab07ecd4f1b7f4c948ba359513e65ac2e96c943
2018-01-27 20:28:24 -07:00
Davide Pesavento b984e3248b net: parse interface names more loosely in FaceUri
Only ':', '/', and whitespace are illegal.

Change-Id: I2c017682d299a12885c96c9b212c503319ca4f08
Refs: #4474
2018-01-27 13:55:11 -05:00
Eric Newberry 07d05c97b4 mgmt: add congestion marking parameters
refs #4465

Change-Id: I5090d93b59fe3fc425e5ce529c4f66b8211155dd
2018-01-26 11:21:13 -07:00
Alexander Afanasyev e66040efa6 util: Fix conversion of large dates from strings to internal type
Change-Id: I13f8d41892dedd0d2feef131a0f09ae5939d124b
Refs: #4478
2018-01-26 13:00:52 -05:00
Junxiao Shi 22f856821a mgmt: declare cs/config command
refs #4050

Change-Id: I779d425d0ca89750cf923c84009c19b37eecc9cf
2018-01-22 19:23:22 +00:00
Junxiao Shi 1534b3dab6 encoding: delete obsolete TLV-TYPE constants
This includes:

* SelectedDelegation
* security v1 KeyBag
* LocalControlFeature

refs #4055, #3098, #3755

Change-Id: I63e5ff423baccf698ec53838d41a0626d61bdf3b
2018-01-22 08:47:03 +00:00
Davide Pesavento 233f67c51f util: silence truncation warning in LoggerTimestamp's operator<<
Change-Id: I681d550f6a9538308146d76804bff8850928ad58
Refs: #4365
2018-01-21 17:23:21 -05:00
Davide Pesavento 0f8308012b util: add literal operators for duration types
Change-Id: I007fa61c80e535c6e4b12e85a32eeeee62fecc3c
Refs: #4468
2018-01-18 21:23:05 -05:00
Muktadir Chowdhury 1c109b4bbd util: add signals to SegmentFetcher for segment retrieval/validation
refs #4438

Change-Id: I5a92e89c733cf49790807edefa1e6c39178de438
2018-01-15 13:19:09 -05:00
Zhiyi Zhang 457f09a1ae tools: Allow 'ndnsec key-gen' to customize KeyId
Change-Id: I9cf8f52ce49088808289fe98760e059cca8ce2ff
refs: #4294
2018-01-09 08:28:52 -08:00
Davide Pesavento 9412d12678 ci: update Travis-CI configuration
* Re-enable ASan with gcc-7
 * Add clang-6.0 to the build matrix (allowed to fail)
 * Remove unsupported OSX-10.10 configuration
 * Upgrade xcode9 to xcode9.2
 * Add testing of openssl 1.1 on osx (allowed to fail)
 * Various simplifications

Change-Id: I3cdfcf78e6a9be66d1063fee710528698ad90bca
2018-01-07 15:25:34 -05:00
Davide Pesavento 5afbb0b3dd util: switch to boost::asio::basic_waitable_timer
Change-Id: I2724befc86482adf84f59063e65509a116bb1b46
Refs: #4431
2018-01-06 12:21:22 -05:00
Ashlesh Gawande e84d1eb0ef util/io: catch invalid_argument generated by trying to load empty file
refs: #4434

Change-Id: I884a5fba25fc5140ef00b492ba655aac87600426
2018-01-04 21:00:28 -06:00
Davide Pesavento 720f3ba262 security: add support for BLAKE2 hash function
Requires openssl >= 1.1.0

Change-Id: I680c948d23561cee8cb62eb8bf757e55bf70abca
2017-12-29 22:07:25 -05:00
Davide Pesavento 82d6a4cf1a security: fix error handling in KeyChain::importSafeBag()
Tpm::importPrivateKey() now throws on error instead of
returning false, for consistency with similar functions.

Change-Id: Id07c2be3809e32d1779c0b5977232e4728528e3c
Refs: #4359
2017-12-25 18:32:05 -08:00
Nick Gordon fe13f56bc7 docs: mention the contributing guide
Change-Id: I9b39d3f01f2973de6cf312e60dee8b6249e7805e
refs: #4414
2017-12-25 18:16:02 -08:00
Zhiyi Zhang 34429cc4f5 util: Add BroadcastLink to DummyClientFace
Change-Id: I2bfe3156016a098b91ff375f2bb83b5e4351317c
Refs: #3913
2017-12-25 17:57:56 -08:00
Ashlesh Gawande 7dffab6f6b Fix missing 'typename' prior to dependent type name error
On Ubuntu 17.10 with gcc 7.2 or clang 3.9,
compiler threw the error when trying to
use the append(Iterator) method on a name

Change-Id: I5252280cfc9021d81d6bb996012255e226006a45
2017-12-25 17:57:15 -08:00
Davide Pesavento 7429390ec7 regex: use a vector in RegexComponentSetMatcher
Change-Id: Iec466b477144a7332d2f1992691601c738dfc3df
Refs: #4120
2017-12-23 18:50:06 -05:00
Davide Pesavento 4d0d096b2e Fix compilation with boost 1.66.0
Change-Id: Ibf2883a974c834a5281c39a551e6d467d4454501
2017-12-19 22:37:15 -05:00
Junxiao Shi 7f01247b5b mgmt: encode/decode CS Information Dataset
refs #4219

Change-Id: Ia51b455fc9b16f8f3c468de2847ced6d73a87bdc
2017-12-07 20:40:47 +00:00
Alexander Afanasyev 130076fd99 build: Fix build when std::to_string is not available
This commit also adds a missing header include

Change-Id: I60857a488031f447c63308600052b1d2e9e3958b
Refs: #4393
2017-12-05 11:29:10 -05:00
Junxiao Shi b6828918cd face: Interest loopback
refs #3979

Change-Id: I6f65b30451939397975a7af40c59002e330afc25
2017-11-20 14:06:32 +00:00
Teng Liang 0296074a34 lp: add NonDiscovery field and tag
refs #4355

Change-Id: Ib3a64589d7ea3bbf204e295a75d91748ef9c85b9
2017-11-15 02:48:26 -07:00
Davide Pesavento 19745dc335 regex: move method definitions to .cpp files
Change-Id: Ifa66c886bd3f920821b0a498f714da24d51b042e
2017-11-12 15:30:50 -05:00
Davide Pesavento 45ab9a9462 regex: modernize and simplify code
Change-Id: Ia4a3046d409ab1e5d8507da4d369dfee203f6256
2017-11-12 15:10:43 -05:00
Davide Pesavento af1d6cfa64 docs: remove GNU-style indentation of braces from code-style
Plus other misc cleanups.

Change-Id: I04917339c80a960a09f77c20af972daa2f888005
2017-11-12 14:09:49 -05:00
Davide Pesavento 7e6f6f8ee3 encoding: avoid UB when casting to tlv::SignatureTypeValue
Change-Id: I52ec0bef8527b6a52208dc07be75e790e504c47e
Refs: #4370
2017-11-05 13:28:08 -05:00
Davide Pesavento e245b055a8 encoding: don't call memcmp() with null pointer
It's undefined behavior.

Change-Id: Id2fd5cbc0483af2bf9857e81fb6cac8163da3474
Refs: #4368
2017-11-04 00:56:57 -04:00
Davide Pesavento 9ced9e690b security: don't call front() on empty vector
Change-Id: Ie267005f2ecc8c57d847ad35095a6df283e146b9
2017-11-03 00:39:45 -04:00
Zhiyi Zhang a1302f64eb security: enable direct fetch for data sig validation
Change-Id: Icae66769cf980a20bc637caca46f381b29361047
2017-11-01 11:30:54 -07:00
Eric Newberry 935d7fe420 docs: update supported platforms for Ubuntu 17.10 and macOS 10.13
Change-Id: Ie073ba5b6f56510a9fac355d77a34c0fb44bcac1
2017-10-29 15:09:36 -07:00
dmcoomes 57e238f8d6 docs: add a manpage for ndn-log
This commit also removes reference to non-existing ndnsec-validator.conf

refs: #3918, #4184

Change-Id: I0413a2418db18db07ed9803ed6c9789374a56ded
2017-10-19 12:48:01 -05:00
Alexander Afanasyev 3647af06a1 docs: Fix wrong version number in the release notes
Change-Id: I7d00c2fd95c7363bcc95497d34f3e4ac140cbc11
Refs: #4275
2017-10-16 16:29:49 -04:00
Alexander Afanasyev c381bca7f6 Prepare 0.6.0 release
Change-Id: I4cea28b09b20f5359f0e2ddaf188b234b2b102f9
Refs: #4275
2017-10-15 22:25:00 -04:00
Davide Pesavento 49650bef43 ci: add Xcode 9.0 to Travis-CI build matrix
Change-Id: Id8ff59b9ccd1dfa5abd56db28fede02b6aae8d36
2017-10-15 22:03:57 -04:00
Davide Pesavento 35de339b94 encoding: don't inherit constructors from std::vector
This is a partial revert of commit 5d0b0106df,
which caused the following build failure with gcc-7:

./libndn-cxx.so: error: undefined reference to 'std::allocator<unsigned char>::allocator()'

Change-Id: I58136eb1901425158e529e37b6fa288b72fc46f6
2017-10-15 22:00:07 -04:00
Davide Pesavento bdcedf4def security+util: remove overloaded operator!()
Identity, Key, and EventId already provide an operator bool(),
which covers all valid use cases.

Change-Id: I57b11db6997e6f537873f41c6ca1c22140b894c3
2017-10-15 17:44:47 -04:00
Davide Pesavento 2520371449 net: NetworkMonitor: set scope_id on link-local IPv6 addresses
Change-Id: I20854d1e1eb7f823a1808cc98e7e5f79a0b78aca
Refs: #1428
2017-10-15 13:40:30 -04:00
Davide Pesavento 5d0b0106df encoding: remove duplicate buf() and get() methods from Buffer class
Change-Id: If885d4199d6c9df9b9b46664c3641c9a14a77eab
2017-10-15 13:39:35 -04:00
Junxiao Shi 5759be36ad security: Identity/Key comparison operators
This commit adds ==, !=, and stream insertion operators to
Identity and Key types, so that `ndnsec list` can display
default identity and key properly.

Also, a missing assignment is added to `ndnsec list` routine.

refs #4085

Change-Id: I025af1d6281acb9e9261461520bbd74af53b811e
2017-10-15 10:38:42 -07:00
Junxiao Shi 478206eea1 tools: print correct certificate in ndnsec cert-dump
refs #4323

Change-Id: I28a044b79a461c58acb5855ac32e1bfb649edd56
2017-10-15 00:22:35 +00:00
Zhiyi Zhang c4a0176704 security: fix bugs in keylocator checker of validator config
refs: #4339
Change-Id: Icfd7314e5c6d244f558c6a7362c547d4fe1ce80c
2017-10-13 13:47:59 -07:00
Davide Pesavento a52eb1f404 Reimplement DEPRECATED macro with C++ attributes
And prefix it with NDN_CXX_ to avoid name clashes.

Change-Id: I18fd99bbc04a414cbee668936272769dbc4ea761
2017-10-06 20:39:17 -04:00
Davide Pesavento 1c597a1a64 net+util: fix build with gcc-7
Introduce an NDN_CXX_FALLTHROUGH macro to simplify
annotating switch cases that fall through.

Update code-style to recommend using NDN_CXX_FALLTHROUGH.

Change-Id: I80e4ff8d16a09f6ec9343f0480bc57ae0fcd1be4
2017-10-06 15:49:57 -04:00
Davide Pesavento 864e8e8c47 security: remove default argument from transform::digestFilter
The choice of algorithm to use should be an informed and conscious
decision by the application developer. Moreover, no other transform
filter provides a default.

Change-Id: I92081ec802ef6a7158d620e6d9359f22bcca0d41
2017-10-06 13:45:49 -04:00
Davide Pesavento ff3bf2cfb8 security: make some functions static in BackEndOsx, simplify KeyHandleOsx
Change-Id: I178a5fe4bbffe6a5337b546653a90724f3ef41f5
Refs: #4075
2017-10-06 13:20:16 -04:00
Davide Pesavento 3ce6d4e75a security: remove dead code in KeyChain::setDefaultCertificate
Change-Id: Ic38e5337a4d9526863dcb728f96f1c19f036182d
Refs: #4273
2017-10-06 09:58:39 -04:00
Junxiao Shi 476200b785 tools: delete -p in ndnsec-export/import help
ndnsec-export and ndnsec-import man pages are also updated.

refs #4313

Change-Id: I1ba41123c5fb46f2e408da3d55dfe9bef56d5b27
2017-10-05 12:16:27 +00:00
Davide Pesavento f0c827eaac net: NetworkMonitorImplOsx: various minor cleanups
Change-Id: Ie56bb6897018d93cb3f431c98cf8df8c97706e51
Refs: #3817
2017-10-03 23:10:15 -04:00
Yanbiao Li ac8b4ca202 net: support link-local IPv6 addresses in FaceUri
Change-Id: Ia986847e60b0a21a94bf2e4ce99d4a5a688a2006
Refs: #1428
2017-10-03 23:00:39 -04:00
Davide Pesavento c33e1c2578 security: remove unused parameter from CertificateRequest constructor
Change-Id: Id0ddff7626e30b46492c8f6378a8835d574ec7e1
Refs: #4302
2017-10-03 12:55:18 -04:00
Junxiao Shi b3d0a8ef7f util: add missing assignment in Regex test case
refs #4241

Change-Id: I1398f82851227e2793ac87fba1d6625c05023a3a
2017-10-01 12:43:01 -04:00
Eric Newberry c3a4679205 base: add PacketBase to provide wrappers for congestion tags
refs #3797

Change-Id: I8747bb4fcbc11bfd1731516896b8aef1ec181c36
2017-10-01 12:42:59 -04:00
Davide Pesavento b10024cebc encoding: delete deprecated overload of Block::Block
Change-Id: I5e7a702e6cf7ea7389a923bc0b62f523f46ab229
2017-09-22 18:58:49 -04:00
Davide Pesavento 4a036152d2 encoding: delete deprecated NInDatas and NOutDatas
Change-Id: Id112d298914232c1ce2f7bfda078633d3810bd99
Refs: #3955
2017-09-22 18:31:48 -04:00
Alexander Afanasyev b82d8c3a1b build: Add -isystem and set specialized flags as a last configuration step
This change prevents global flags from interacting with library/feature
detection scripts.

Change-Id: Ic0dba06a9afd66a810172d4a512f35f6df6b25b6
Refs: #4296
2017-09-22 12:30:57 -04:00
Davide Pesavento def60f1647 security: support more SHA2 hash functions
Change-Id: Ibbe4f02054ae9028899e8408c331ae8e704df9b8
2017-09-18 19:06:29 -04:00
Davide Pesavento 3504cc4405 security: deduplicate RAII wrapper class for EVP_MD_CTX
Change-Id: I256588a8bc601b06548f7ec45aee020ddabb9597
2017-09-18 19:05:56 -04:00
Davide Pesavento 9219f5885d security: use high-level EVP routines in HmacFilter
Change-Id: I58aabf111193d3b554c8777b4ec41e3f761be263
2017-09-18 19:05:05 -04:00
Davide Pesavento eaa93f438e security: fix AES IV length check in transform::BlockCipher
AES in CBC mode requires the IV length to be equal to the
block size (which is always 128 bits), not to the key size.

Change-Id: I7b8479f84317ddd2cf758271cc50c1af6c936780
2017-09-18 19:03:00 -04:00
Davide Pesavento 8a14b9b93c security: use EVP_DigestVerify* routines in VerifierFilter
Change-Id: I2f5323fee86dd08c16552c2310b3181a620013b5
2017-09-18 19:02:46 -04:00
Davide Pesavento 8aad372379 security: add missing out-of-line destructors for transform classes
Change-Id: I8306b8e10953e55e056b4eb5fcb76ec8f395f5c4
2017-09-18 19:02:17 -04:00
Davide Pesavento 06f1bdf9c4 security: use EVP_DigestSign* routines in SignerFilter
Change-Id: Ib87c4681084bf0389de527450a2248fe2161e6ee
2017-09-18 19:01:43 -04:00
Davide Pesavento 87039537fc security: consistently use EVP_MD conversion helper
Change-Id: Icd95009fba223c461988fe7b341be55972d30f91
2017-09-18 18:50:08 -04:00
Davide Pesavento c21979d3ba security: deduplicate getting the key type from an EVP_PKEY structure
Change-Id: Idba7ddcdd10672a0305fe16b1e278f397ff094fe
2017-09-16 14:53:34 -04:00
Davide Pesavento cafa4026ec security: use DES-EDE3-CBC to encrypt private keys in PKCS #8 format
Change-Id: Ib05f8790fdc446eea6c0a8c4f6956aaf059741c6
2017-09-15 23:20:20 -04:00
Davide Pesavento c3dfc24ea6 security: move {Rsa,Ec,Aes}KeyParamsInfo into namespace detail
Change-Id: I06fb1f7dfc809551c5533a185ada1b8dce8ee03e
2017-09-15 20:46:09 -04:00
Davide Pesavento 1c31a7144f security: simplify/cleanup PublicKey implementation
Change-Id: I9ead8916d0c6d9264e087f594b8d3aaf07366c29
2017-09-15 00:52:03 -04:00
Davide Pesavento f45fa21ccf security: simplify PrivateKey implementation and improve error handling
Change-Id: I3270e4e9fe3dd942caab6bbe0b17db678b64648b
2017-09-15 00:48:50 -04:00
Davide Pesavento bcf23a3b99 ci: add clang-5.0 build job to Travis-CI
Change-Id: Ib941bfe8bd19825a589bef3509faf11dffa7e525
2017-09-14 11:25:24 -04:00
Junxiao Shi 859888f53e face: retain PendingInterest during Interest processing
When an incoming Interest matches multiple InterestFilters,
if one of them replies immediately, the PendingInterest
instance could be prematurely destructed and cause memory
access errors. This commit retains the PendingInterest with
a shared_ptr to avoid this bug.

refs #4228

Change-Id: I4767f294711edda3b75f8dfcac085ede88f3cdef
2017-09-12 14:29:16 +00:00
Davide Pesavento b88c6bf5ce tests: fix build with clang-5.0
Change-Id: Id032651e3954dc124088e39a0bc84ec9a58aaeba
Refs: #4277
2017-09-11 20:15:28 -04:00
Junxiao Shi 79a7a16304 face: send Nack after every InterestCallback has responded
refs #4228

Change-Id: I3b1ef58c70d34c2099249216a3600efe01b79f71
2017-09-09 08:33:57 +00:00
Junxiao Shi f9b880ba42 transport: add logging to TcpTransport
refs #3563

Change-Id: I510ae330b0baa46c4101b26f0f8087b7424376a4
2017-09-08 13:05:06 +00:00
Alexander Afanasyev 22ee089ada tools: Disable unnecessary confirmation during ndnsec-import
Change-Id: I75113483a343bbe06cf0af85a08695b0a9ae9aeb
Refs: #3644
2017-09-03 00:31:33 -04:00
Alexander Afanasyev 464da53017 tools: Fix bugs in cert-gen
Change-Id: I13ed1d71b4970166135e32e2196ac9c67ad60fd3
Refs: #4202
2017-09-02 13:04:11 -04:00
Davide Pesavento 0f5078e9e6 security: use high-level EVP routines in DigestFilter
Change-Id: Iac47c1024a9fcbd96e988a110aadb52d59178d3d
2017-09-01 22:45:09 -04:00
Luca Keidel 941fd8c9b8 security: insert OpenSSL initialization call in PrivateKey::loadPkcs8
Change-Id: I71dc0c3ac71fa5db4f3be8ce51aea06e4cf7c088
Refs: #4204
2017-09-01 22:44:27 -04:00
dmcoomes e062a18359 util: Advanced filtering of the logging modules
refs: #3918

Change-Id: I766deb5ccd0d7f4472679d9955c8e55bad41f375
2017-09-01 19:39:55 -07:00
Alexander Afanasyev 6fd26cf09a security: Allow key for root namespace identity
Change-Id: Ie50b3db37acbf10b5a70397222d9a1c94f5fc2c0
2017-08-31 18:32:43 -04:00
Alexander Afanasyev 6aff024492 security: Allow reloading ValidationPolicyConfig / ValidatorConfig
Change-Id: Idba53c0b4e2cf645d3d0e6c76c57a1b54995462a
Refs: #4261
2017-08-29 19:40:57 -04:00
Junxiao Shi 605671de01 signature: disallow encoding invalid SignatureInfo
Also, check integer range when decoding SignatureInfo.

refs #3200

Change-Id: I1af4833211c9468ac7ecab48f7d0e88e9423b378
2017-08-26 13:41:06 +00:00
Junxiao Shi 1ad0b4bad3 face: insert pending Interest records for Interests from forwarder
refs #4228

Change-Id: Id039f62496c6289aec8a36964b25c1f25c52eda8
2017-08-25 14:01:22 -07:00
Davide Pesavento 006b7cedeb ci+docs: remove all references to cryptopp/crypto++
Change-Id: I58c5edb4fc783c46831af878e5479ffe3255be85
Refs: #3946
2017-08-24 09:37:03 -07:00
Alexander Afanasyev adc71845c5 security: Remove old security framework
This commit also finalizes removal of CryptoPP dependency.

Change-Id: Ia670cbeaf21b28d3b93fd36bb3781da3ac822662
Refs: #4246, #3946
2017-08-24 09:30:24 -07:00
Alexander Afanasyev e5a19b8d86 security: Convert ValidatorConfig to ValidationPolicyConfig
The security API also provides a convenience ValidatorConfig helper.

Change-Id: Ic86dec4904b917361cb4740204de4b6710d2a386
Refs: #3920
2017-08-24 09:30:17 -07:00
Davide Pesavento 0daa92bdfd encoding: use an enum for EncoderTag and EstimatorTag
Avoids two static constants.

Change-Id: I5e95d07c7f2600c422c115c928b3031b40a27e35
2017-08-23 22:51:22 -04:00
Davide Pesavento 88a0d816b8 Add -Wextra-semi -Wundefined-func-template to the default CXXFLAGS
And fix the resulting compilation errors.

Change-Id: I16f679836a0cf2a3ff5dfcf6f6b67bfbfe4cdbd7
Refs: #4248
2017-08-23 22:50:43 -04:00
Davide Pesavento a84f464e10 Cleanup iostream includes
Change-Id: I16dd945998463975b140c7a010d64a112f95d8ba
2017-08-23 22:50:18 -04:00
Davide Pesavento cdcde90588 Fix compilation with Boost 1.65.0
Change-Id: I6f56d6bf135d9c862b04cb086340301ee98ef0ed
Refs: #4256
2017-08-23 22:24:40 -04:00
Davide Pesavento e87156e008 ci: enable LeakSanitizer
Change-Id: I097be7743f8541bf06bae1449449a903552ef3f6
2017-08-16 22:41:48 -04:00
Junxiao Shi b38e6d49c0 util: ignore NextHopFaceId on Nack in DummyClientFace
refs #4224

Change-Id: Ic2e78eabc83fbeeea8283412c44b10a04c3acd86
2017-08-16 16:15:28 +00:00
Junxiao Shi 2bea5c4fe0 tests: revamp Face integrated tests
* Categorize tests into consumer, producer, IO routines.
* Split expressInterest tests.
* Add route toward null face when Interest timeout is expected.
* Merge similar setInterestFilter tests.
* Add test for oversized Data.
* Move InterestFilter-convert-to-Name test into unit tests.

refs #4031

Change-Id: I3356ae7fc9eec942ec7f2fb8b2277fa039464750
2017-08-14 20:10:32 +00:00
Junxiao Shi b6e276f277 face: move packet encoding to Impl class
Practical limit of packet size is now enforced on encoded
NDNLPv2 packets instead of network-layer packets.

If a packet exceeds size limit, the face throws a
Face::OversizedPacketError exception. Since packet encoding may
be asynchronous, this exception could be thrown by
Face::processEvents instead of Face::expressInterest and
Face::put.

refs #4228

Change-Id: Ib68cf80b3b8967fdd0ba040bd8ee595a0eff740e
2017-08-14 20:10:04 +00:00
Junxiao Shi 2ed9e07e2a face: pass processEvents duration by value
refs #3284

Change-Id: I146417f49c73fe93c6b38bb0dcd1b45bb949511f
2017-08-13 19:05:49 -04:00
Junxiao Shi 5c9ee28a15 encoding: disallow bool in Encoder::prependRange etc
bool type is no longer allowed in Encoder::prependRange,
Encoder::appendRange, and encoding::makeBinaryBlock.

refs #4225

Change-Id: I1b3b7d171e8c2baa04dc4ef4617de80e6220e586
2017-08-13 17:06:09 +00:00
Junxiao Shi 5174232342 Check integer range during decoding
This commit also moves ControlResponse test suite to the correct
place under mgmt/ instead of mgmt/nfd/.

refs #3200

Change-Id: I1a0578b3e68b8c36c84a6af03d0c47bebe598fe1
2017-08-13 17:04:52 +00:00
Junxiao Shi a9181d7bc8 signature: reorganize code
In SignatureInfo, Signature, and its subclasses:

* Improve Doxygen.
* Improve error messages.
* Make comparison operators non-member functions.

refs #4171

Change-Id: I9395a72594702255b41e3700ee145f35fc1a41f2
2017-08-13 16:47:45 +00:00
Davide Pesavento 6158f4739a tests: eliminate cryptopp use from Test{Signer,Verifier}Filter
Change-Id: Id6781ce2636c9803b601e26b8847b76a029e3b99
Refs: #3946
2017-08-12 14:51:40 -04:00
Davide Pesavento b6355e8a2b lp: fold field-info.{cpp,hpp} into packet.cpp
Change-Id: I1a328cb12bb3d1755d440e490c4d00c222d5e873
2017-08-10 21:27:08 -04:00
Davide Pesavento 3cf9078a82 ci: use two parallel build jobs on Travis-CI
Change-Id: I0d37709bd81bbff890c932b77dc5be696ac35569
2017-08-10 01:21:20 -04:00
Davide Pesavento 364eeeeba0 ci: preserve PATH when running waf under sudo
Change-Id: Id178dba19d34b8f5f76de34cfe8407078e2f3409
Refs: #4186
2017-08-10 01:20:11 -04:00
Junxiao Shi 5d75fd9473 mgmt: check enum range during decoding
This commit also makes use of prependStringBlock and readString
functions in encode/decode routines.

refs #3974

Change-Id: I86a4f16ea6f50fffeff72c8b416878740e65ef2a
2017-08-08 17:16:19 -04:00
Junxiao Shi d9153ce792 link: delete deprecated functions
refs #4055

Change-Id: I322debdbf55263d0de3208d8fa9eea2164737e86
2017-08-08 17:16:09 -04:00
Junxiao Shi 020123afed transport: add logging statements in UnixTransport
refs #3563

Change-Id: Id8fee87530fd8dded2b7d7471bea47b42915aeb1
2017-08-08 14:33:48 +00:00
Junxiao Shi 4460e82998 face: add logging statements in Face
refs #3563

Change-Id: Idd59a87badb1f05003f8a53802e13cec8d02b1ec
2017-08-07 22:02:45 +00:00
Junxiao Shi 9da07c5e01 encoding: reorganize block-helpers code
* Improve Doxygen.
* Declare 'extern template' where necessary.
* Simplify prependStringBlock and makeStringBlock.
* Move helpers of makeBinaryBlock into detail namespace.

refs #4171

Change-Id: Ib3f81a20297973115a2b6c53b1894233d6f98a9c
2017-08-06 16:59:31 +00:00
Junxiao Shi 7d3c14b3ae Refer to TLV-TYPE as "number" instead of "code"
refs #2880

Change-Id: Ie3bd9dc4cb5ca4c3f7aafeed37266adba88b82fb
2017-08-05 16:34:39 +00:00
Junxiao Shi d2777fa4ed encoding: optimize Block::encode
refs #4159

Change-Id: I1436e8211262d19195ac630b4c37c5d5c20b41ff
2017-07-27 18:35:34 +00:00
Junxiao Shi baab7325e2 tests: avoid misaligned memory access in InMemoryStorage test
refs #4191

Change-Id: I2b5255c70e07a36fdd6601f24e4468e3d8c00346
2017-07-27 10:30:10 -07:00
Junxiao Shi d701e5bebc interest: delete Link and SelectedDelegation fields
They have been replaced by ForwardingHint.

refs #4055

Change-Id: I1d5b5c0f4530af3d8ba2d9a624bb62cf341ccf39
2017-07-26 01:30:41 +00:00
Junxiao Shi 4f92d873c0 docs: amend code-style rule 3.4
refs #4203

Change-Id: Ic86e2326738723adf4b4132a535c4c747f3a3e74
2017-07-25 22:04:48 +00:00
Junxiao Shi 6938e3461b util: rename digest.hpp to sha256.hpp
The new file name matches the Sha256 class included within.

This commit also deletes deprecated crypto.hpp.

refs #3940

Change-Id: Ib9bbcd0ba087b812bb0886ceaea116689d4633f5
2017-07-25 21:56:58 +00:00
Junxiao Shi 9b845359f9 data: mark constructor explicit
refs #4164

Change-Id: I4c723606643d88abe48ea540a554b9ef36a59808
2017-07-24 05:04:56 +00:00
Junxiao Shi 81206d580d data: reorganize code and test cases
* Categorize class methods.
* Make comparison operators non-member functions.
* Improve Doxygen.
* Reorder test cases.
* Add test coverage for default constructor.
* Move Signature equality tests to TestSignature test suite.

refs #4171

Change-Id: Ib4f27fc8a9b56ce604363460279cfbaa4e1095f5
2017-07-23 12:43:22 +00:00
Junxiao Shi 760cc7b45f encoding: Block::fromStream properly handles TLV-LENGTH=0
Block::fromStream implementation is also optimized to reduce
memory copying.

refs #4180

Change-Id: I7cc073330b9ec4a9af4863db62e6c108d220066b
2017-07-22 19:17:49 +00:00
Alexander Afanasyev 6dfeffed54 mgmt: Switch nfd::Controller to use v2::Validator interface
The conversion also includes relevant changes in SegmentFetcher and
tests.

Change-Id: Ie2f55bac650e3689f4971ab814a8bd51068a2a40
Refs: #3920
2017-07-22 14:48:10 +03:00
Junxiao Shi 2dd711d0a3 interest: setNonce resets wire buffer
Prior to this commit, Interest::setNonce overwrote part of the wire
buffer, which could lead to unexpected behavior: when two Interest
instances are sharing the same wire buffer, setting the Nonce on one
instance affects the other instance.

refs #4168

Change-Id: Ia90ed54d91845575504ca53071ea356e3854eba5
2017-07-21 13:40:52 +00:00
Junxiao Shi c542f63d03 ims: move InMemoryStorage from util/
refs #3940

Change-Id: I4468fe9b65ef6263a62800701eb6b03df28fa274
2017-07-18 14:20:32 +00:00
Davide Pesavento 4ab3be28d0 encoding: generalize and simplify shouldSelectContiguousReadNumber()
Change-Id: Icb91ce3791f5093fbe5207e3be7e13d9d805243b
Refs: #4172
2017-07-18 01:59:20 -04:00
Junxiao Shi 4f756900af exclude: avoid undefined behavior in Exclude::Range
refs #4190

Change-Id: Ib5b6a1cf8bb8d792c805fc42a1e14ef41c9680c1
2017-07-18 03:05:02 +00:00
Junxiao Shi c2ac5d27fd interest: avoid misaligned memory access in getNonce()
refs #4175

Change-Id: Ib42a48d0da4ff4e2c0bd5fe33b01eee927be3138
2017-07-17 22:18:31 +00:00
Davide Pesavento c008798266 net: NetworkMonitorImplOsx: minimize number of calls to getifaddrs()
Change-Id: I952d68bea780d2a237bffee29adea00dbf8d128a
Refs: #3817
2017-07-17 10:28:55 -04:00
Davide Pesavento f35c4270f2 net: NetworkMonitorImplOsx: optimize conversion from CFString
Change-Id: I82abccb01997aa53fe9b30ea4edbe23d8ac9158a
Refs: #3817
2017-07-17 10:26:36 -04:00
Junxiao Shi dc4277a03c tests: improve Block test suite
* Reorder test cases to follow function order in block.hpp.
* Move prependVarNumber and prependNonNegativeInteger tests
  to EncodingBuffer test suite.
* Add test for Block() default constructor.
* Add test for Block(uint32_t) constructor.
* Add test for Block::parse function.

refs #4171

Change-Id: Ia4eaf36f6ced9c2dabc7531ba541a5a2f92bae89
2017-07-17 11:34:02 +00:00
Junxiao Shi b501b121b3 encoding: delete LocalControlHeader constants
refs #3755

Change-Id: I1c5adf79a3cb4725b5157dfdb52826c35b657b7a
2017-07-17 01:23:28 -07:00
Junxiao Shi 5bcab5621a util: hide MonotonicDeadlineTimer into detail
refs #3940

Change-Id: Ied9ebf58812ade64b13f7647b8e2cafc4c383997
2017-07-16 17:19:14 +00:00
Junxiao Shi f0bf99960b name: don't dereference past-the-end iterator
refs #4181

Change-Id: Ic3b430e264d0dce017e3514c6501ac18117f7868
2017-07-15 15:51:52 +00:00
Junxiao Shi adc334e434 name: ensure Name is a RandomAccessRange
refs #2425

Change-Id: I9ef5fdadb81281e9a82dc8ff1654cc7cbfe20508
2017-07-14 20:28:28 +00:00
Junxiao Shi 46a9bd3219 encoding: avoid misaligned memory accesses in TLV decoding
ndn::tlv::readVarNumber and ndn::tlv::readNonNegativeInteger
now properly support InputIterator, and have efficient
implementations for ContiguousIterator that do not rely on
unsafe misaligned memory accesses.

refs #4172, #4097

Change-Id: Ib02b8d908ad5cfec474679b5b3b5ccd95ba07549
2017-07-14 19:12:11 +00:00
Davide Pesavento b2ae336a4b net: NetworkMonitor: fix address scope on macOS
Change-Id: I99df052afdced4b557926365314f17530f3ac744
Refs: #3817
2017-07-14 11:16:59 -04:00
Davide Pesavento 10b24be850 util: deprecate crypto::computeSha256Digest()
Use Sha256::computeDigest() instead.

Change-Id: I9db5b4839559c9c7930cdc24c78f35ca76b25b52
2017-07-14 11:16:32 -04:00
Junxiao Shi 770f904735 tests: add ndn::tlv::readVarNumber benchmark
refs #4097

Change-Id: Ib19f55366850a91ac3232ee27810a7258fce47ce
2017-07-13 13:30:53 +00:00
Junxiao Shi db7464d93b encoding: reorganize Block class code
* Improve Doxygen.
* Consolidate and simplify constructors.
* Reorder class methods in cpp file to match hpp.
* Make operator== and operator!= non-member functions.
* Improve exception messages.
* Update code style.

refs #4171

Change-Id: I4cc0393f43a24a500b0efff90108ad1b42f5fa47
2017-07-13 03:11:17 +00:00
Junxiao Shi bb8d4a31c3 delegation-list: add DelegationList::empty()
Also, add 'noexcept' where applicable.

refs #4055

Change-Id: I3e0ae671541a6bb55079bf13990ba5ca15f312a5
2017-07-13 02:40:09 +00:00
Eric Newberry 251e5f7d1b encoding: add reliability Face management flag
refs #4003

Change-Id: Ied674c9681947713d6cc9cc57982996a10dcbbd3
2017-07-12 19:29:17 -07:00
Junxiao Shi 71ff231d94 name: reorganize Name class
* Categorize class methods.
* Make append component methods inline.
* Make comparison operators non-member functions.
* Improve Doxygen.
* Simplify Name::at implementation.
* Reorder test cases.
* Add test coverage for Name::empty() and iterators.
* Make naming convention test case more readable,
  and move it to TestNameComponent test suite.

refs #4171

Change-Id: I5f7deff2535f8265ac4942f892879dd7e56f6414
2017-07-12 13:32:50 +00:00
Junxiao Shi 8609bf2dcc name: remove enable_shared_from_this
Name class is typically not created with make_shared, and
there is no known usage of Name::shared_from_this.

refs #4173

Change-Id: I24723076d694b359f01f77c09527a49911147556
2017-07-12 13:02:55 +00:00
Davide Pesavento c2e12b418b tests: eliminate cryptopp use from TestData
Change-Id: I1a7b125def882471a1ba705d3a4d955b779adde0
Refs: #3946
2017-07-11 00:30:53 -04:00
Davide Pesavento 6717fbdc1c util: remove Digest class template
Change-Id: I4e718fb7369df0963cc2e1e9b23b0c5e0c9d03f8
Refs: #3886
2017-07-11 00:30:28 -04:00
Davide Pesavento 9436831c30 util: reimplement Sha256 using security::transform
Change-Id: I4d01638a19867f39380dd0bee922c58148741506
Refs: #3924
2017-07-10 20:12:48 -04:00
Junxiao Shi b2a70338e1 interest: add Interest::modifyForwardingHint
refs #4055

Change-Id: I3e245bcb5091659e0e9d89b18de604e42c906694
2017-07-07 22:15:03 +00:00
Junxiao Shi 9c154cb8cf interest: encode and decode ForwardingHint field
refs #4055

Change-Id: I1e62b160af9fa0e1a94b996cbcf2e9f5c387cb97
2017-07-07 22:14:54 +00:00
Junxiao Shi 909ffef5e7 interest: mark constructor explicit
refs #4164

Change-Id: Ie99c86379c9677fb81e0940eba2bce135942c926
2017-07-07 22:12:27 +00:00
Junxiao Shi 899277a653 interest: reorganize code and test cases
* Sort functions to generally follow the order of fields in wire format.
* Merge similar constructors.
* Sort tests to follow the code order.
* Split InterestFilter to its own test suite.
* Add test coverage for Interest::getNonce() and
  Interest::refreshNonce().
* Move Link and SelectedDelegation tests to a sub test suite.
* Delete tests of malformed Link, which are already covered by
  Link test suite.

refs #4171

Change-Id: Ia7115f0be479e301673897115d112b0544a47f9e
2017-07-07 22:12:12 +00:00
Junxiao Shi 13d85e0947 util: InMemoryStorage::insert requires Data wire encoding
refs #2639

Change-Id: Ie151c8e05623ea73d3b2f2cd9343a4c3f0bacb53
2017-07-07 07:34:02 +00:00
Junxiao Shi c18aa19535 encoding: write nonNegativeInteger 253-255 as one octet
This commit also updates code-style and improves Doxygen in tlv.hpp

refs #4167

Change-Id: I8657feb1bfe96bfc88202d55eb7432d7ff1d5538
2017-07-07 06:06:38 +00:00
Junxiao Shi 5722cfe59e util: move signal-*.* into util/signal/ directory
refs #3940

Change-Id: I36e3420846959f39bb51a3ce7ef7f03e7c2c22aa
2017-07-05 18:52:01 +00:00
Junxiao Shi bd2cedbefd docs: start license boilerplate with /*
refs #4163

Change-Id: I08097e68802a3393494427927c28af58dc7f052b
2017-07-05 18:51:52 +00:00
Davide Pesavento 4346290491 net: improve NetworkMonitor documentation
Change-Id: Icff6aeffd1c4878c234edd8b22c572fa7fa18a49
2017-07-05 10:27:12 -07:00
Junxiao Shi 9bf5581530 ensure default-constructed Selectors is empty
refs #3944

Change-Id: Iaf5b6176529c4533214c4e27069734f8bdb7e556
2017-07-05 15:04:37 +00:00
Davide Pesavento ba4fbbefbb docs: update doxygen configuration
Most notably:
 - disable OPTIMIZE_OUTPUT_FOR_C, this is a C++ project
 - enable sorting of brief descriptions of class members
 - stop generating documentation for detail headers (not installed)

Change-Id: Ie0608888f53f9b38f0a6e09cf198981cd7474109
2017-07-04 14:32:33 -04:00
Junxiao Shi 6824783077 interest: fix Doxygen and comment typo in matchesData function
refs #1707

Change-Id: Id56132d51af79ed89a75908ce72567db44a17194
2017-07-03 22:06:49 +00:00
Junxiao Shi 0b1b4678d8 util: move CFReleaser from security/tpm
CFReleaser is used by both TPM backend and NetworkMonitor.

refs #3940

Change-Id: I39222bb4dec686d9338e6c4cb71108dd67f6cca1
2017-07-02 22:02:31 -07:00
Junxiao Shi 2dc416d5a1 net: add NetworkMonitorStub
refs #4024

Change-Id: I20da6f3351f51667b045987dc07e88ba814a4456
2017-07-03 04:46:16 +00:00
Junxiao Shi d21abd3f0d link: simplify with DelegationList
refs #4055

Change-Id: Id8280037beb7d128cda8faa8ed1ed21e2209ba97
2017-06-30 02:56:40 +00:00
Junxiao Shi 25467941b9 net: move network-related files to src/net
Some namespaces are changed:

* 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

refs #3940

Change-Id: Ia4754caef9726efc73f5a303cec46fc95c744d70
2017-06-30 02:53:14 +00:00
Eric Newberry 2a890771d2 lp: keep LpPacket parsed at all times
refs #4156

Change-Id: I21701ab0da2abacc8a84d6ee1a72c2b414e6669a
2017-06-28 19:18:02 -07:00
Junxiao Shi 830ba9719c security: provide getKeyLocatorName helper function
refs #3920

Change-Id: Iba8fa7776ca63445608f4eb6fa2e4c54307cc99f
2017-06-23 23:59:02 -07:00
Davide Pesavento 71430486d7 ci: greatly expand Travis-CI build matrix
Change-Id: I1bc50c12799e1452694920acc061dd575f7a24a0
2017-06-23 20:00:40 -04:00
Davide Pesavento 724d65ae2f build: explicitly require clang >= 3.4
Change-Id: I4647163a4e20a9684c698a1d94ae576cd7cb63bf
2017-06-23 17:14:08 -04:00
Davide Pesavento 37271c5b48 build: use gold linker and enable linker optimizations
On Linux, gold is more than 2x faster than traditional bfd-based ld

Change-Id: I8b1c3275b542d60e976bad05dac522ca49e921cb
2017-06-23 15:43:14 -04:00
Junxiao Shi 688a64121c Introduce Delegation and DelegationList
DelegationList will become the payload structure of ForwardingHint
and LinkContent in a later commit.

refs #4055

Change-Id: If29a39c47b779aafdd4aebb104092403f28e6653
2017-06-22 10:12:07 +00:00
Alexander Afanasyev 5bcee10c84 util: Add detection whether WiFi interface is ad hoc on macOS
This commit only introduces framework to detect WiFi interface type.
This function is not yet integrated in any other code.

Change-Id: I072d654f7fdbd89fe5fee00b0400133d5cea19cf
Refs: #4019
2017-06-20 17:47:02 -07:00
Alexander Afanasyev 7cd43abee3 build: Allow Objective-C++ code to be used
Change-Id: I63e5d866dd1dd04987572941d1c842e09c4494b4
2017-06-20 17:47:02 -07:00
Alexander Afanasyev 3b3355cc07 util: NetworkMonitor: macOS version of fine-grained signals on interface state changes
Change-Id: I6da12356baa0038d08ff256d0d3ff726023d804b
Refs: #3817
2017-06-20 17:47:02 -07:00
Alexander Afanasyev 0cf887df3d build: Change HAVE_OSX_SECURITY to a more general HAVE_OSX_FRAMEWORKS
We are starting to use more macOS frameworks and define/build
environment constant name needs to be more general.

Change-Id: I893d436a34c3370a7f12ac681d1796ef5631cc0e
2017-06-20 17:47:02 -07:00
Alexander Afanasyev e387423942 src: Avoid use of detail folder for installable headers
This commit moves `lp/detail/*` to `lp/`, as `detail` folders should
include only private APIs that are only used during the build and cannot
be used (header files not installed) by external applications.

Change-Id: I370592819c4bc5f4016689ef7c9c5bd2cdd0eaa2
2017-06-20 17:46:59 -07:00
Davide Pesavento b1a2a4b4b4 ci: speed up Travis-CI osx jobs by upgrading only the packages we need
Change-Id: I7d6c427eacb132d5faad5ceb50aa2f1347ef912c
2017-06-19 15:40:18 -07:00
Davide Pesavento 2063952229 ci: simplify and improve 40-standalone-header-compilation.sh
Change-Id: Ifab7a20edf84a69932bd81c4e86ca8e4daa439ce
2017-06-19 15:39:05 -07:00
Alexander Afanasyev 9333887a8d security: Add ValidationPolicyCommandInterest
Refs: #3920

Change-Id: I978e68979e4f9cfb58561054b9f87f8d65083d5d
2017-06-19 13:15:42 -07:00
Alexander Afanasyev b54aa57d7b security: Add general interface to chain validation policies
Change-Id: I1a0d47aeb847455a2d7d6d48185f6edd9024d298
Refs: #3920
2017-06-19 11:41:10 -07:00
Muktadir Chowdhury cab16964be Wrong exception message in security::v2::KeyChain
Change-Id: I8974d89b4f9270b0a192c11ae37e53dad28c3c9e
2017-06-12 12:19:43 -05:00
Alexander Afanasyev 35109a19d0 tools: Convert ndnsec to v2::KeyChain
This commit removes the following tools:
- cert-revoke (wasn't working properly before and need a new
  design)
- set-acl (wasn't working before)
- dsk-gen (no longer makes sense with the new certificate naming
  conventions, new tools for creating derivative certificates will
  be created later)

This commit also fixes Bug #3644 causing import command to ask for
unnecessary password confirmation.

ndnsec main now catch all exceptions logs the extended message

Change-Id: Ib50e0994970020bcf0a1840aca6bc3942818094b
Refs: #3098, #3644
2017-06-07 19:14:15 -07:00
Alexander Afanasyev 6bf48a07c4 security: Remove ValidatorRegex
This type of Validator is largely unused in known software (except an
experimental code in ChronoChat) and will be eventually replaced with a
more general ValidatorTrustSchema.

Change-Id: I82256818cf4ad3c3bda3e57859c5d1d9809585bd
Refs: #3920
2017-06-01 16:43:53 -07:00
Junxiao Shi f4c1eb3e9e util: no-op NetworkMonitor on unsupported platforms
NetworkMonitor::getCapabilities() function reports what functions
and signals are supported on current platform.

refs #4025

Change-Id: I2c2825e0f9919a734fb78b4699a483c837ee09af
2017-05-30 10:05:26 -07:00
Eric Newberry 71aecaecb7 util: don't resolve valid IP addresses when doing FaceUri canonization
refs #4095

Change-Id: Ide7835438268aa3219540d8b2ea4143355f6f8a0
2017-05-30 00:37:04 -07:00
Davide Pesavento 81bf95cc69 build: fix compilation with clang on Ubuntu 14.04
Change-Id: I0ce54ec0e42cfba8b5da129e8f81e84ef76254db
Refs: #4096
2017-05-27 14:23:08 -04:00
Alexander Afanasyev 82c359c10d tools: Refactor ndnsec tools and update code style
This commit also deletes unused (broken) `op-tool`

Change-Id: I6c45c293d9c22198efd9db8144e32097d73738e5
Refs: #3098
2017-05-25 15:13:24 -07:00
Davide Pesavento 2ea079316b util: NetworkInterface: pretty print FreeBSD-specific flags
Change-Id: I061e59150b4f274fdf17e4d12fd43a8588e6c116
2017-05-25 15:12:27 -07:00
Davide Pesavento a468ff5215 util: NetworkMonitor: fix build on unsupported platforms
Change-Id: I08ef2c3858e0aea35ec2de739ddd86734b40358d
Refs: #3353
2017-05-25 15:12:15 -07:00
Alexander Afanasyev 80782e06cd **breaking change**: Switch Face and related classes to v2::KeyChain
security::v2::KeyChain is now exposed as ndn::KeyChain, which should
ensure that dependent code can be mostly compiled.  However, expect code
that explicitly uses the old KeyChain interface to be broken.

Change-Id: I7330d0250d92f3f0f2570ab6d0214ab3dfdd18cc
Refs: #3098
2017-05-25 15:09:50 -07:00
Eric Newberry b555b00c28 change default FreshnessPeriod to 0 ms
set InterestLifetime to default value when not present

do not encode ChildSelector if at default value

refs #3944

Change-Id: I4a3ebf5512d0d2270798ed212eab7903ba8b8ed0
2017-05-25 00:22:49 -07:00
Alexander Afanasyev e6835fe12b Remove previously deprecated headers, methods, and constants
Change-Id: I3e809e25c8f2bc2ae0f027413d9e0161245353c6
Refs: #3988
2017-05-21 17:37:27 -07:00
Davide Pesavento 8e3cf0a091 mgmt: fix include guard
Change-Id: I9eabf8126af2ffe2d539e671606e61e4e5655a21
2017-05-17 01:34:53 -04:00
Davide Pesavento 794f687e16 security+util: mark all pimpl unique_ptrs const
Change-Id: I3966c4988dceb49c204e23967ba90729877bddf1
2017-05-17 01:32:20 -04:00
Davide Pesavento 9285686ef5 security: fix several inaccuracies in the API doc
Change-Id: Ib60487511863c3125337275bed3433cecd81e1ab
Refs: #4062, #4072
2017-05-17 01:22:10 -04:00
Davide Pesavento 50f6675183 security: move shared_ptr<PibImpl> when possible
Also rename m_impl to m_pib, since it's not a pimpl pointer.

Change-Id: I9e10ada54332318154374f61df6e387348ccc60a
2017-05-15 20:58:49 -04:00
Davide Pesavento 2bf35a6a37 util: NetworkMonitor: fine-grained signals on interface/address changes
Change-Id: I60d4cc6d673b920ba81d57502977f0340be0da48
Refs: #3353
2017-05-12 00:04:12 -04:00
Muktadir R Chowdhury 80fba6c52d security: Wrong exception message in transform::PublicKey::rsaEncrypt()
refs #4073

Change-Id: I9dde50e60ed24d35840fae195a39a4640ab3367f
2017-05-11 14:12:20 -05:00
Junxiao Shi 8c2ab2e0b8 mgmt: make Uri and LocalUri required in faces/create success response
refs #3956

Change-Id: I62e924c12476aab0f7b7300ba8ff730ae72cbd73
2017-05-05 20:26:34 +00:00
Junxiao Shi d97c95365c mgmt: fix Dispatcher::processControlCommandInterest memory error
refs #4059

Change-Id: I6655662f925bc5f40a2a2ec2b258a4accc29d58b
2017-04-27 16:17:04 +00:00
Junxiao Shi 144c7e36d0 mgmt: permit LocalUri in FaceCreateCommand response
refs #3956

Change-Id: If81c9b59fa52cb6d07539f9a2568721ec87dfcb9
2017-04-20 01:04:06 +00:00
Davide Pesavento e8e48c2644 mgmt: use RouteOrigin type in Route and ControlParameters
Change-Id: I1fb7e29efbb7ae9523ca294df03478498ef04322
Refs: #3903
2017-04-14 00:39:20 -04:00
Alexander Afanasyev 354f382f4b util: Add API to enumerate Logger modules
Change-Id: Ie1361b76305b4de9746e769212efa7b381c59f91
Refs: #4013
2017-04-13 10:45:57 -07:00
Davide Pesavento c44cc83c33 ci: improve lcov HTML output
In particular, demangle C++ symbols in the function coverage view.

Change-Id: Ib8fd78a75cd79795795a040816da839775a11f53
2017-04-13 00:28:39 -04:00
Davide Pesavento f714c1fd88 build: use -Og with clang as well
It is supported since 4.0

Change-Id: Ib454927e4052720fa21d004f64fa4d3699e72d73
2017-04-12 23:53:40 -04:00
Eric Newberry 1de6be6044 lp: add TxSequence field
refs #3931

Change-Id: Ie388ec48494b8ac506b31dc42de8777a8cd28989
2017-04-05 18:00:37 -07:00
Junxiao Shi 6336c5f2fd encoding: RouteOrigin stream extraction operator
refs #3987

Change-Id: I073984d6e2f158ff200a8bb8478896028993897f
2017-04-04 22:16:03 +00:00
Junxiao Shi 855eaa5818 util: avoid overflow in time::toIsoString
refs #3915

Change-Id: Ib1a1e7180a19984eb06fd5928430fa6a3b8c4e45
2017-04-04 20:10:43 +00:00
Junxiao Shi 9a53d786c2 mgmt: rename 'datas' to 'data' in FaceStatus and ForwarderStatus
Plural form of 'data' is 'data'.

refs #3955

Change-Id: I225a384c9a9ecf784f8cd55df19d391931619984
2017-04-04 20:09:57 +00:00
Junxiao Shi d5c2f0c471 util: FaceUri canonize dev scheme
refs #4027

Change-Id: Iee36b72c237824e8e2aed4a93786accc1464f62f
2017-04-04 09:52:11 +00:00
Teng Liang f4908b16fc mgmt: accept LocalUri in face create command
Change-Id: Ic567fdfdf3b6b43dd10073e08e489b16b03ad346
Refs: #4015
2017-03-30 10:13:25 -07:00
Eric Newberry d7f5b28582 mgmt: add LocalUri to ControlParameters
refs #4014

Change-Id: I474dc3f41021687b99804fc2d71dd6e72c5175c5
2017-03-28 23:30:35 -07:00
Teng Liang b4ecadcc4b encoding: add ad hoc link type to ndn::nfd::LinkType enum
refs: #3967

Change-Id: I443d3e43dc31dec2e2426c61b7a92d480871f34a
2017-03-26 10:45:19 -05:00
Davide Pesavento 156c1ea502 mgmt: add FaceStatus::unsetExpirationPeriod()
For consistency with Route.

Change-Id: Ieac12ebd7fc7270c03d331c48747bd913f79fef9
Refs: #3903
2017-03-19 16:09:33 -04:00
Davide Pesavento 6db1360806 util: alias ndn::optional to std{::experimental,}::optional if available
Change-Id: Ie83ece5ff94fa4422f5b5b55514e5d253ed9920e
Refs: #3753
2017-03-14 00:23:08 -04:00
Davide Pesavento cf4157658c util: backport std::experimental::ostream_joiner
Change-Id: I4d12269ac41f07d224772abc0e50039be519fdcc
Refs: #3962
2017-03-14 00:17:11 -04:00
Alexander Afanasyev 1709aa7099 security: Restore automatic key ID generation for symmetric keys
Change-Id: Ic846b02e347b85f0053495a76ebcf8746138d8cf
Refs: #3989
2017-03-08 13:22:49 -08:00
Alexander Afanasyev a10b2ffb39 security: Correct KeyChain::addCertificate semantics
The documentation of KeyChain::addCertificate was ambiguous.  On the one
hand, it stated that the certificate with the same name will be
overwritten. On the other hand, it stated that it will thrown an
exception if certificate with the same name exists.  This commit ensures
the former behavior, which is consistent with the old KeyChain.

Change-Id: I911f7c86c634caf260ecb9a5dbdf13b066f8711f
2017-03-08 13:22:49 -08:00
Alexander Afanasyev 5af04a71ff security: Fix certificate loop detection in v2::Validator
Change-Id: I0e55cd6ee9744df07fa13dcd8ee337909c49430f
2017-03-08 13:22:49 -08:00
Manika Mittal 95c8070b3e security: Integrate fetching certificates using Certificate Bundle
Change-Id: Iebac12a5cb9d1f4aa12aad09e8ef27f5b90a5d90
Refs: #3891
2017-03-01 13:10:26 -08:00
Davide Pesavento e78eeca5cc util: add printHex() overload that takes a uint64_t
And AsHex helper class.

Change-Id: If6fb6edea258ab281b5ea9cc30deffd2d8994dc5
Refs: #3006
2017-02-26 20:00:43 -05:00
Davide Pesavento 56bd3eef44 encoding: explicitly declare RouteFlags as uint64_t
It was always expected to be a 64-bit unsigned value,
but it was not declared as such.

Change-Id: I2648c115d0f8052d671946aa8f40e883b0ab449e
Refs: #3903
2017-02-26 19:59:46 -05:00
Davide Pesavento e17898926d src: minor updates to common.hpp and common-pch.hpp
Also remove redundant includes.

Change-Id: I0e1f55abcf852b95a4fd8c9a0e3a30aa153f892c
2017-02-26 19:59:07 -05:00
Davide Pesavento e55589cda6 encoding+mgmt: move FaceEventKind to nfd-constants
Change-Id: Iab98f9077d557027255434208f084c10ab96b1ef
2017-02-21 21:49:38 -05:00
Davide Pesavento 88eb748914 mgmt: FaceEventNotification equality operators and formatted output
Change-Id: I92aca47a2e3823592d1c0bef07a42dbba5c6cb91
Refs: #3903
2017-02-21 21:00:57 -05:00
Davide Pesavento 0a1afdf834 mgmt: avoid virtual methods in FaceTraits
Change-Id: Ic9d156eb98ca435993212d14662303e5dd2bad57
Refs: #3903
2017-02-21 21:00:20 -05:00
Davide Pesavento d1a415c840 mgmt: rename RibFlagsTraits to RouteFlagsTraits
Change-Id: Ide90020347d8eb5fec7d8cd4fb53b89e36d58e89
2017-02-21 20:59:55 -05:00
Davide Pesavento 484bbe5448 mgmt: RibEntry equality operators and formatted output
This commit also changes the return type of getRoutes()
from std::list to std::vector, and adds setRoutes(),
hasExpirationPeriod() and unsetExpirationPeriod().

Change-Id: I53f0ea846067c9087fa72273fc131826884ce12f
Refs: #3903
2017-02-19 01:28:27 -05:00
Davide Pesavento 6ad3d53a43 mgmt: move Route and RibEntry set methods out of line
Also add missing m_wire.reset() in RibEntry::clearRoutes().

Change-Id: I715d8d5a4f8fe2a4caf6dfce389a04d0d1d542b5
Refs: #3903
2017-02-19 01:06:42 -05:00
Davide Pesavento f8503d2ef5 encoding+mgmt: fix definition of INVALID_FACE_ID
Change-Id: I220b183a6f1d007d2c71fcb6491a2c4a487b7673
Refs: #3172
2017-02-19 01:05:24 -05:00
Davide Pesavento a6f32ca351 mgmt: FibEntry equality operators and formatted output
This commit also changes the return type of getNextHopRecords()
from std::list to std::vector, adds clearNextHopRecords(), and
simplifies exception throwing in wireDecode() methods.

Change-Id: I9eb93c5c6a9ead6d907c69bed4fbbdd23116a2c8
Refs: #3903
2017-02-18 22:49:49 -05:00
Junxiao Shi a341ae80b5 mgmt: add FaceQueryFilter::empty()
This commit also simplifies FaceQueryFilter with ndn::optional.

refs #3864

Change-Id: I7cd52101b83ca88df499ca4b507ce93ef6269fd4
2017-02-13 19:45:12 +00:00
Alexander Afanasyev a54d5a6d2c face: Avoid resuming transport after connect if the transmission queue empty
Change-Id: I53763b62a8fc12d1d2613daa8d4f9d2b5109b7aa
Refs: #3957
2017-02-13 10:18:14 -08:00
Davide Pesavento 25e3d8c738 mgmt: ForwarderStatus equality operators and formatted output
Change-Id: I6d814ef427a9db38ef46427888f3b3ba982bf641
Refs: #3903
2017-02-09 22:32:50 -05:00
Davide Pesavento 4ec7a5a1f9 mgmt: FaceStatus equality operators and formatted output
Change-Id: I724227cf82d254cc1caac8a68d8ba24e608d01be
Refs: #3903
2017-02-09 19:52:58 -05:00
Junxiao Shi 0eaf444b79 mgmt: fix typo in FaceQueryFilter operator==
refs #3864

Change-Id: I719eaa9dbbf5c2bad9d707a36e66b04d93cde908
2017-02-09 01:49:09 +00:00
Junxiao Shi a825d26977 mgmt: FaceQueryFilter equality operators
refs #3864

Change-Id: I823ae2f8660f14ab4fa9424edee3374520c012bf
2017-02-08 07:29:08 -08:00
Eric Newberry 8422f5780f lp: add repeatable fields to a packet in the order they were added
refs #3931

Change-Id: I832252712ff45928ab50ff93f5b37bd44807662d
2017-02-07 19:36:30 -08:00
Davide Pesavento 9f9bd8a3a3 mgmt: ChannelStatus equality operators and formatted output
Change-Id: I17745976af96d4dda3d6717eefd760fd52ebfb71
Refs: #3903
2017-02-07 00:44:56 -05:00
Davide Pesavento eba76ad8f6 util: introduce StatusDatasetItem concept
Change-Id: I909cf1ea61b3e941f1d8b809fa8c0167316cdd1e
Refs: #3903
2017-02-07 00:42:31 -05:00
Davide Pesavento b5f8bccc3b util+tests: fix copyright notices in files copied from NFD
Change-Id: I43fd6a6085cd5ffe99676e20d1cf55400577bdb7
2017-02-05 17:58:05 -05:00
Davide Pesavento 0fba51a13c mgmt: declare the constructor of FaceMonitor explicit
Also fix the copyright notice at the top of the header file.

Change-Id: I01f4da97109652a8b1540aa57a57f67fa56a193d
2017-02-05 16:54:05 -05:00
Davide Pesavento 791badbf04 util: reimplement computeSha256Digest using security::transform
Change-Id: I36401dbf9ecc74de42c76f6f78d9e25ad00ed4d8
Refs: #3946
2017-02-03 21:01:13 -05:00
Davide Pesavento 218e5be977 util: rewrite printHex using security::transform instead of iostreams
Change-Id: I84bebeb3b86d643c04ff3ee5a4df66b05ed6c9c6
Refs: #3006
2017-02-03 00:15:03 -05:00
Nick Gordon 2a6d45ae00 security: implement operator== for SigningInfo
refs: #3932

Change-Id: I64230ccafe260bfa8347c977c42f38b009b9bbf9
2017-01-31 14:57:54 -08:00
Davide Pesavento dd46143beb util: remove unnecessary trim/trimLeft/trimRight wrappers
When needed, use boost::algorithm::trim/trim_left/trim_right directly.

Change-Id: I854d89e553c70ab20679a38922cec306fc57824d
Refs: #3006
2017-01-30 09:35:48 -08:00
Davide Pesavento fdda2411ee util: rewrite toHex using security::transform instead of printHex
Change-Id: If07c434419f44decc866c97adf083051597e7ba6
Refs: #3006
2017-01-30 09:35:39 -08:00
Davide Pesavento 03115ce0c1 util: rewrite fromHex using security::transform instead of cryptopp
Change-Id: I487255d3c0944679d18de8c44978f9525db5e5bd
Refs: #3006
2017-01-30 09:35:27 -08:00
Junxiao Shi 7e693be4c2 util: use BOOST_SCOPE_EXIT in Scheduler::executeEvent
BOOST_SCOPE_EXIT_ALL segfaults when running in Docker container on
armhf architecture.

refs #3935

Change-Id: Ie9b86a485a78f66584cdb183ee16336353336107
2017-01-30 00:14:05 +00:00
Junxiao Shi fe1239a61f security: merge SIGNER_TYPE_PIB_* into SIGNER_TYPE_ID and SIGNER_TYPE_KEY
refs #3932

Change-Id: I73d2f479567e590fa3fa60d035b9275b69043b3e
2017-01-27 20:36:12 +00:00
Alexander Afanasyev aa8b3785d6 docs: Prepare release 0.5.1
Change-Id: I377269e4f510b720a4ab11e480c1d0551a32b56e
Refs: #3859
2017-01-25 09:13:35 -05:00
Eric Newberry 5fade68665 lp: add Ack field
refs #3931

Change-Id: I8c2803bfc2f4f5fb7ff5b1d4835cc97b3b4e01e1
2017-01-25 09:12:10 -05:00
Alexander Afanasyev ba2cf39469 security: Add CertificateFetcherDirectFetch
Change-Id: I3abaa0c264b8d93f9bba588d346477e7179f03e7
Refs: #3921
2017-01-24 10:52:27 -05:00
Alexander Afanasyev 7bc10fad91 security: Abstract certificate fetching from v2::Validator
Change-Id: Ia98d11ac67b0095f632818ac37a19a1e5a7656a8
Refs: #3921
2017-01-24 10:52:23 -05:00
Alexander Afanasyev 7e7214103e security: Add v2::Validator implementation
Based on the code originally written by Qiuhan Ding

Change-Id: Ib66e24f49d0b6fb2ae21ea1fca7b9ec62ecb753a
Refs: #3289, #1872
2017-01-22 10:42:09 -08:00
Alexander Afanasyev 3e2c3a0738 security+tests: Fix small bugs with uninitialized and leaked memory
Change-Id: I525ac8d284783ffff08e31dc7fe2a892bfc78307
2017-01-19 14:00:47 -08:00
Alexander Afanasyev e19643deed ci: Add generation of HTML coverage reports using lcov
Change-Id: I877b2c9cd5250f08fd94b2168ff61522aa4df62d
2017-01-18 23:35:12 -08:00
Davide Pesavento 7f20d6ec6c build+src: mark destructor virtual in classes with virtual functions
And to prevent similar mistakes in the future, add -Wnon-virtual-dtor
to the default build flags.

Change-Id: I28e2361341abab29fca134309288cd259736d67a
2017-01-16 14:48:06 -05:00
Alexander Afanasyev 574aa86e88 security: Add a set of signature verification helpers
This commit introduces a set of security::v2::verifySignature and
security::v2::verifyDigest overloads to simplify signature verification
operations.

This commit also updates operator== of util::Digest class to
constant-time `CRYPTO_memcmp` comparison to mitigate potential timing
attacks.

Change-Id: I30c5a315b612062a96b289c4a5292dd6eb3d410f
2017-01-12 16:27:47 -08:00
Spyridon Mastorakis 1ece2e3744 security: Renaming EcdsaKeyParams to EcKeyParams
Change-Id: If27faf095474f5be3f8f454925b389b97bf4425d
Refs: #3135
2017-01-12 10:24:33 -08:00
Qiuhan Ding 609f0615ac security: Add CertificateCache
Change-Id: If7008877e9956c4e8964c99feac7ba34685106d7
Refs: #3317
2017-01-12 10:24:33 -08:00
Qiuhan Ding 4caa0ccb6d security: Add trust anchor container
Change-Id: Ia527eee08b9e154eb2d3168182905ec082bd8441
Refs: #3292
2017-01-12 10:24:10 -08:00
Alexander Afanasyev f8379173cf security: Make self-signed certificate valid from 1970-01-01 to now()+20 years
Previously set now()+1000 years doesn't work because of the bug #3915

Change-Id: Ia83a0bc921f49424fc19bcd15aad642a87e76803
2017-01-12 09:54:37 -08:00
Alexander Afanasyev 414697588f signature-info: Fix encoding of type-specific TLV
This commit also introduces operator<< for SignatureInfo

Change-Id: Iddf5b77d9dab9f7b1764500726e6d5b1e13aedbb
Refs: #3914
2017-01-12 09:48:47 -08:00
Junxiao Shi bc6beb10e6 mgmt: StrategyChoice equality operators and formatted output
refs #3903

Change-Id: I458e80959b5a3ecdc1d0e55ec2ac361772a60e70
2017-01-11 23:20:39 +00:00
Alexander Afanasyev 70244f4018 Switch to new KeyChain where possible
signed_interest::POS_RANDOM_VAL and signed_interest::POS_TIMESTAMP
constants are deprecated. Use command_interest:: equivalents instead.

This commit also includes fix for the backward compatibility regression
due to move of deprecated TPM/PublicInfo header files.

Change-Id: Ic3b008fc6758f3ac83f191158b6ac0789483f90d
Refs: #3098
2017-01-10 18:43:51 -08:00
Alexander Afanasyev 1b58a03a9f security: Add CommandInterestSigner
v2::KeyChain::sign(Interest) does not add timestamp and nonce
components, required by CommandInterest specification
(https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest).
Whenever command interests are needed, CommandInterestSigner should be
used.

Change-Id: I3d573e6dd1bc686e42b0564add54173b7edf40f2
Refs: #3912
2017-01-10 18:43:51 -08:00
Alexander Afanasyev fc99b51355 tests: Implement IdentityManagementV2Fixture for v2::KeyChain
The old IdentityManagementFixture is renamed to IdentityManagementV1Fixture.

This commit also removes global KeyChainFixture, as it doesn't work with
TestKeyChain test suites.  Instead, IdentityManagementFixtures are
customizing PIB/TPM modules.

Change-Id: Iadc43b78523cd43bff4f454d6aea2fca8107a650
Refs: #2926
2017-01-10 18:43:18 -08:00
Alexander Afanasyev 4c9a3d59c4 security: Move KeyChain to security::v1 namespace and deprecated it
Change-Id: Ic4b6915ca15998a83b410f3f8fac027f797ee7ca
Refs: #3098
2017-01-09 13:20:55 -08:00
Alexander Afanasyev 83eb1cc88e security: Simplify (unify) implementation of v2::KeyChain::selfSign
Change-Id: Iec052adfe76fbaad6862caa4a61091aa5f6b10ac
Refs: #2926
2017-01-09 13:20:55 -08:00
Alexander Afanasyev d6d78aa0a4 security: Allow Identity and Key abstractions to be used in SigningInfo
Change-Id: Ic1c8d6925557ea5da2011ab68f16587eef2102f3
Refs: #3153
2017-01-09 13:20:55 -08:00
Yingdi Yu fe4733a160 security: Add new v2::KeyChain
Change-Id: I5fdf51ecd96b50db2a7cbf730c6e8b1d9fbe09e9
Refs: #2926
2017-01-09 13:20:52 -08:00
Alexander Afanasyev c95f564778 security: Return *this from SigningInfo setters
This change is to allow chaining of SigningInfo setters.

Change-Id: I6d37b6028cf4d94f17f574b5a0d5cc65482580f1
2017-01-08 12:59:02 -08:00
Alexander Afanasyev 5f1820e60f security: Implement operator<< for v2::Certificate
This commit also implements operator<< for SignatureInfoValue and
KeyLocator.

Change-Id: I71d3840ab63bacf1278d755b5eed9630c5a2f48f
2017-01-08 12:58:56 -08:00
Zhiyi Zhang 48becde5b4 security: Enable validator fetch cert directly from interest sender
Change-Id: I8fab50145a9a053c85c1b2c6be752ba71b0120ef
Refs: #2237
2017-01-06 13:30:12 -08:00
Yingdi Yu cbe72b07ac security: Change the ownership model of Pib and its related entities
Change-Id: I6816a0fd5c7af490f7e98db196e0214219f4b05c
Refs: #3349
2017-01-05 17:37:00 -08:00
Alexander Afanasyev 1013fd0d33 face: Invoke NackCallback on all matching Interests
Change-Id: I7fd2b6456f9d3b83dafde4348c90bad9acd500f6
Refs: #3908
2017-01-04 15:03:34 -08:00
Yingdi Yu 0399768e18 security: Make addKey/Cert behavior of PibImpl consistent
Change-Id: I30c6dd0007e9095ee07f7a8eda3b20db4c34c513
Refs: #3351
2017-01-03 15:10:03 -08:00
Zhiyi Zhang 1e164cc096 tests: Add ability to create sub-certificates in IdentityManagementFixture
Change-Id: Ie49a66c7a85d7e5639e69ed9ead31479fa8307f3
2017-01-03 11:30:43 -08:00
Zhiyi Zhang 9cbd010333 util: Avoid template implementation of DummyClientFace::receive
The method now can accept the derived classes (e.g.,
IdentityCertificate) without requiring them to be statically casted.

Change-Id: I9f6fc6c3bbec0abc8db3b2229ef07c5ca0c1d8ff
2017-01-03 11:29:34 -08:00
Yingdi Yu 7b3b5e9d02 security: Separate TPM locator modification and database resetting in PIB
Change-Id: I80c2805b6e1204b95d59a090a6a04e1ee62fb6e5
Refs: #3203
2017-01-02 11:11:17 -08:00
Yingdi Yu 6ee2d36cf4 security: Adapt PIB to NDN Certificate Format version 2.0
The certificate format can be found at docs/specs/certificate-format.rst

Change-Id: I5656837f09ce327e06a0cb1abdf16ac28fe0b823
Refs: #3202
2017-01-01 18:26:29 -08:00
Yingdi Yu 0b60e7a9aa security: Add new TPM framework
The TPM framework is separated into two parts:
1) The front end class Tpm provides the interface to KeyChain. The public
   interface of Tpm is read-only.
2) The back end classes represent concrete implementations, such as
   tpm::BackEndFile and tpm::BackEndOsx which may also provide
   implementation-specific management interfaces.

New TPM supports different key id type when generating new key.  The
default type is changed to 64-bit random number.

Change-Id: I41154c2ded4b65fb0bef2f4a0d2c5b77843be05d
Refs: #2948
2016-12-31 12:28:57 -08:00
Alexander Afanasyev 97709c0b6e security: Move PIB-related code into security/pib/
Change-Id: I94ea7ce646e66382f7c534ca1c8d6cbeeb87b1a4
2016-12-31 10:18:15 -08:00
Yingdi Yu c08d7d6c2c security: Add interface to request different key id generation
The option for key id include timestamp, random, and user-specified
value.

This commit only adds the interface, the support to honor the interface
will be implemented later.

Change-Id: I476381ff0fc56cd7906392cb7482b7458e386781
Refs: #2948
2016-12-31 10:18:14 -08:00
Zhiyi Zhang f4bb5c7b7e security: Add NDN Certificate 2.0
Change-Id: I7d779554f53a613e67f283ca44718e57f2f1c771
Refs: #3103
2016-12-31 10:18:11 -08:00
Yingdi Yu 10bf63ab61 security: Correct ValidityPeriod::isValid check
Change-Id: I235773470d838f5842cdf595f83d744935d304bd
Refs: #2868
2016-12-30 17:06:20 -08:00
Alexander Afanasyev 7399651ea8 ci: Update version of macOS slave for Travis-CI
Change-Id: I70908ca871ea258989ec4bf0acc8e42ea224c219
2016-12-29 11:10:50 -08:00
Eric Newberry 0669061ae8 tests: remove use of deprecated Face::expressInterest
refs #3699

Change-Id: I31c70b7fe1caefaa8ff013f57ab52fe4fefefe0e
2016-12-27 17:12:48 -07:00
Davide Pesavento e1081cdc0c util: FaceUri: modernize and simplify code with C++11 features
Change-Id: Ie6a59567a635b6c69b970e9e1e50eafff14ea7fa
2016-12-22 22:56:39 -05:00
Davide Pesavento f78cb705bc util: FaceUri: port numbers are 16 bits wide
Change-Id: I9568df121bac150bc98071820a5cd212fb22a458
2016-12-14 20:21:05 -05:00
Niv Sardi 8ac8754b88 docs: Fix typos in manpages
Change-Id: I06e90bcd74681b0fabd3c3f0d701267531b2b73f
2016-12-14 09:34:32 -08:00
Davide Pesavento 57c07df414 src: drop 'virtual' from functions marked 'final' or 'override'
Change-Id: Ieb6df864ab82f77b2bee9e83aa0bfa2005715950
Refs: #3857
2016-12-13 22:13:25 -05:00
Davide Pesavento de2a1c20f4 code-style: don't suggest to use virtual with final and override
Change-Id: I9f6b60cc6cb5679682916b5bee97598703b654f4
Refs: #3857
2016-12-13 22:12:59 -05:00
Eric Newberry 3ed6247de3 lp: correct rules for whether an unknown field can be ignored
Add TLV-TYPE to exception output for unignorable unknown and unrepeatable fields

refs #3884

Change-Id: I52c6cc2b6b5363432d8cc5bf60407ccf6ece7dc0
2016-12-11 23:49:11 -07:00
Junxiao Shi 70f95fa87e util: plug Regex memory leak
Previously, RegexMatcher::m_backrefManager and RegexBackrefManager::m_backrefs
own each other via shared_ptrs, causing a memory leak.
RegexBackrefManager::m_backrefs is now changed to weak_ptr.

refs #3673

Change-Id: I882a83ee1f29754721d9b3b9997b3bbc465df989
2016-12-05 17:21:57 -08:00
Junxiao Shi 18244e842b util: move notification type agnostic code to NotificationSubscriberBase
refs #3663

Change-Id: I732186fdd65320555740a3aa51b57d441e9acca4
2016-12-03 15:42:01 +00:00
Davide Pesavento eee3e823c2 tests: respect naming conventions and improve nesting of some test suites
Change-Id: I255c27b552b32570871a9d5f8bda814ba8723c80
Refs: #2497
2016-11-27 17:52:54 +01:00
Zhiyi Zhang 99832d4979 security: ValidatorConfig FacesFixture bugfix
Change-Id: I012250ca541f2f51a476ba4fc11b3b3a0a527798
Refs: #3845
2016-11-18 19:30:50 -08:00
Zhiyi Zhang 433686c0dd security: Clean up certfiles in ValidatorConfig test suite
refs #2418

Change-Id: I09ee1d1ca13f15f0f8f12e69a16c125c7fb58b6e
2016-11-18 10:18:30 -08:00
Zhiyi Zhang 7ba99e129c security: Update the code style in validator-config
Change-Id: I3ad02257b4e26deb0461d34952a4812ede54ca6f
2016-11-17 15:37:52 -08:00
Zhiyi Zhang 0a939b41ed security: Add certfile cleanup to IdentityManagementFixture
Change-Id: I7e2c779e7ae6006e7df0d810d5bbf1cc11dede3f
Refs: #3855
2016-11-17 13:13:38 -08:00
Eric Newberry 4d261b6a24 lp: add CongestionMark field and tag
refs #3797

Change-Id: I6ac6663c874abde1df2102af81fc03567ad87029
2016-11-16 16:15:25 -07:00
Weiwei Liu d7f4fda329 util: FaceUri: add syntax for NIC-associated permanent faces
refs #3522

Change-Id: Id2c9f751d7d1f65b2f0ef968aad660e95250d155
2016-11-10 09:31:53 -08:00
Davide Pesavento 0530b5bf86 ci: speed up code-coverage jobs
Plus some documentation updates

Change-Id: I6fd2b04e22bca6c3d6e36e78d1995220e261206b
Refs: #3809
2016-11-07 21:36:22 +01:00
Alexander Afanasyev ed1e99daa0 util: Allow customization of the logger
The customization is necessary for Android and NS-3 builds

Change-Id: I8f799bfae63bd97c566eade812c575a7397ae223
2016-11-05 10:01:57 -06:00
Eric Newberry a3973e0c8a build: load sanitizers last in wscript to prevent Boost link failure
refs #3828

Change-Id: Ia03ded8eddf116af228bb91f0fea295b28dd536b
2016-11-01 18:29:27 -07:00
Eric Newberry f64a7451a2 ci: set Travis CI Xcode version and update NODE_LABELS to 10.11
refs #3833

Change-Id: I11fb325ec84b4293897f408fe43b76368fdf94c8
2016-10-31 15:52:16 -07:00
Junxiao Shi 010f0868cd name-component: Component::compare performance improvement
refs #3807

Change-Id: I2ccdad9806d29f641db71127d9459581d93a148f
2016-10-14 09:43:44 -07:00
Davide Pesavento 69ec4549d8 ci: ensure XML test reports do not clobber the output of previous runs
Change-Id: I3be7022f3171fc56837bdd5c51c8684a5dda0ac4
Refs: #3750
2016-10-14 15:47:09 +02:00
Alexander Afanasyev 465c973274 build: Do not fail the build in debug mode when using deprecated declarations
The original motivation of this change was to avoid compilation failure
in debug mode on macOS 10.12.

Change-Id: I032b8d98d3aaf5602e10142a4d38e0b61b24b44e
Refs: #3795
2016-10-12 09:22:46 -07:00
Weiwei Liu ab9aad0d48 examples: handle Nack in consumer
refs #3701
Change-Id: Ia6cfcefcf5a9541b09a50d1e5edaa55227908191
2016-10-11 16:42:08 -07:00
Davide Pesavento 1cd9f6ebd6 util: use C++11 <random> instead of Boost.Random
Change-Id: Id0100a5ef14236f7e1d1f181af233e44bde3c1a2
Refs: #3599
2016-10-11 12:59:14 -07:00
Eric Newberry 1aa3e1ec67 mgmt: move Flags field from FaceStatus to FaceTraits
refs #3732

Change-Id: I20ce5b608b6238d2c0c05db125ce261edd846dab
2016-10-10 18:34:50 -07:00
Eric Newberry f767eba3d7 mgmt: Add UP and DOWN kinds to FaceEventNotification
refs #3794

Change-Id: I3676841c004e0861c45c2cb9e0669f2091b5b372
2016-10-07 21:37:24 -07:00
Alexander Afanasyev 4df2230ba3 docs+build: Prepare for version 0.5.0 release
Change-Id: I4bd90a5229bc010cdcfd7c77c32ccfc62d72ac53
Refs: #3762
2016-10-04 18:39:53 -07:00
Eric Newberry 1ce8ab2d0e mgmt: add Flags field to FaceStatus
refs #3732

Change-Id: I933c1471a185fd96777e6935c6810210868b0765
2016-09-26 22:52:25 -07:00
Davide Pesavento 50e20023cc ci: enable AddressSanitizer for unit tests
Change-Id: Iddac2075fe27d57cb8bf5c13846cfb1deceadcdd
Refs: #2589
2016-09-17 21:40:49 +02:00
Davide Pesavento 848a1e6f86 tools: delete deprecated ndncatchunks3 and ndnputchunks3
Change-Id: I34a30fe31416ff4207ac40707f0efc0228a4b2b8
Refs: #3700
2016-09-17 18:03:04 +02:00
Davide Pesavento ec2fe54d5e Add Travis CI badge to README
Change-Id: I30b316f408dd7929249b72bbb259b9450a5f8611
2016-09-17 02:56:14 +02:00
Davide Pesavento 0934888603 ci: sync jenkins script and travis config with NFD
This commit also adds support for "limited-build" job type to ndn-cxx,
and enables it for travis integrations.

Change-Id: I6960b1d683c94c433ad1bfe702c4273e01036a2c
2016-09-17 02:44:16 +02:00
Junxiao Shi c828dfc735 util: DummyClientFace can override processEvents
refs #3769

Change-Id: Idf8b674ed238f296c7c4293b19a6f769cbd7e332
2016-09-15 13:26:22 +00:00
Alexander Afanasyev 02948ecc83 security: Add support for OpenSSL 1.1.0 API
Change-Id: I8deb4c5c5cbc1755b492ccd12707d83764a91ad7
Refs: #3757
2016-09-12 19:48:38 -07:00
Junxiao Shi b8deee0eec security: initialize transform::Downstream::m_index
This avoids use of uninitialised value in Security/Transform/TestBoolSink/Basic
test case.

refs #3763

Change-Id: If24929d4c85d3a803d3901acb7cc4db6d7cd7798
2016-09-12 21:00:06 +00:00
Davide Pesavento 16cbc4fde2 encoding: optimize BufferAppendDevice::write
Change-Id: Idc610856431fe0a160923e826f06cfd0a55f3ae2
Refs: #3727
2016-09-10 13:27:03 -07:00
Junxiao Shi 1b0f486b4a security: plug memory leaks in transform
refs #3758

Change-Id: Id8e3aa33c76017c1662fbed9a1cafea5b39e9d6f
2016-09-10 17:45:04 +00:00
Junxiao Shi 67fba7fa32 docs: recommend not to share PIB/TPM directory between machines
refs #2009

Change-Id: Idc29262769cbf7cc883a31c7acc0ae9da4846eec
2016-09-09 13:40:05 +00:00
Junxiao Shi a1478db476 lp: delete deprecated LocalControlHeader
refs #3755

Change-Id: I98d8767fdaac058894371ddc52f5583b018691c6
2016-09-09 04:13:15 +00:00
Junxiao Shi 7357ef2dd7 mgmt: move management/nfd-* to mgmt/nfd/
refs #3760

Change-Id: Ib4bde3412b5c39b9f4f46113199cebe78704505e
2016-09-07 02:39:37 +00:00
Junxiao Shi 02b51259f0 encoding: OBufferStream closes stream in destructor
This avoids use-after-free error from base class destructor.

refs #3727

Change-Id: Ie9abde981fe98dcb1bc541858ed03afbaae56ad1
2016-09-04 04:30:31 +00:00
Junxiao Shi a88c9c7716 encoding: OBufferStream code style corrections
refs #3727

Change-Id: I501d16649b8079f58895b8f9350a4d5ea5fedb9a
2016-09-04 04:30:23 +00:00
Junxiao Shi 435bb558f5 util: don't require T::Error in io::load and io::save
If T::Error is declared, it must inherit from ndn::tlv::Error.

io::load now requires WireDecodable<T>;
io::save now requires WireEncodable<T>.

refs #3741

Change-Id: Iddfd2febc9c509c3e61cc9ad5da9d8694a302420
2016-09-04 03:14:47 +00:00
Junxiao Shi 4ce0bcf3f6 util: io::load accepts base64 encoding without newlines
This commit also renames io::BASE_64 to io::BASE64.

refs #3741

Change-Id: I46286c72d12e685902a72ce8dab4a1385dc0fceb
2016-09-03 07:09:03 +00:00
Alexander Afanasyev 5a67310e89 docs: Fix syntax for python3
Change-Id: I70125961a2382427328932a523cf1f29ac83bae4
2016-09-02 12:01:36 -07:00
Junxiao Shi 160701a0a4 util: ndn::io::loadBlock and saveBlock
refs #3741

Change-Id: I5eafc7ebe82e289efc74471ab5debf36786d3d74
2016-08-30 11:35:25 +00:00
Junxiao Shi 1aecae22d3 util: backport C++17 optional
This commit also makes code style of parameter packs consistent.

refs #3753

Change-Id: I1e301d25b73501b0b28678e6095bbb5619a0e760
2016-08-30 11:23:59 +00:00
Weiwei Liu cfaa1addf4 util: backport C++17 std::clamp
refs #3636

Change-Id: I04db89ed99424b1e35f7c4c611fd4c967d49ca46
2016-08-29 23:18:05 -07:00
Junxiao Shi 62204f4ff7 util: delete deprecated Command Interest classes
This commit deletes deprecated CommandInterestGenerator class,
which has been replaced with KeyChain::sign method.

This commit deletes deprecated ndn::util::CommandInterestValidator class,
which has been replaced with ndn::security::CommandInterestValidator class.

refs #2008

Change-Id: I8ba8692a1d2c03e7d8b1a470f76ccf57836b0634
2016-08-27 20:33:30 +00:00
Alexander Afanasyev 2fa5939375 security: Reorganizing source code to prepare for support of two version of NDN certificates
This commit also removes unused ndn_digestSha256 function and deprecates
crypto::sha256 in favor of crypto::computeSha256Digest in util/crypto.hpp.

Change-Id: I24ee50ff073a96b868633bdf2cfade412d3605f3
Refs: #3098
2016-08-25 18:28:29 -07:00
Alexander Afanasyev 667370f102 tests+ci: Customize unit test running for different versions of Boost
Change-Id: I1619c84653f82c2b0c00c379b8cb61bc43546d87
Refs: #3750
2016-08-24 13:05:20 -07:00
Junxiao Shi e7c7f154f4 management: Controller::CommandFailCallback exposes ControlResponse
refs #3739

Change-Id: Ib4b66cd99647ab930450fc3b472be565084be160
2016-08-20 22:36:22 +00:00
Eric Newberry 138ef2c900 management: correct behavior of FaceUpdateCommand::applyDefaultsToRequest and validateResponse
refs #3731

Change-Id: I37feb7a9c4002f723da8e65b40afe0242fd42bfc
2016-08-20 14:51:27 -07:00
Junxiao Shi ba6baaf687 security: StreamSource throws upon istream::fail()
refs #3741

Change-Id: I3742655ecfd93d47198c83b61664f8cea345d33e
2016-08-20 02:59:20 +00:00
Junxiao Shi f2515a772b util: implement ndn::io with ndn::security::transform
refs #3741

Change-Id: I0bc5e7757a1b59a817850024e2b156c283d36560
2016-08-19 02:21:59 +00:00
Junxiao Shi 2d4be252a3 util: code style corrections in ndn::io
refs #3741

Change-Id: I0d319be2a113715767166a6276c87cc2849500d8
2016-08-17 04:29:00 +00:00
Junxiao Shi c177988cb8 util: improve io::load and io::save test coverage
refs #3741

Change-Id: Iefb4ab1c627550fe9a8cf9b8675a796a03132d70
2016-08-17 01:59:23 +00:00
Eric Newberry da916d679d management: add Flags and Mask fields to faces/create and faces/update
refs #3731

Change-Id: I35fb84a875767649da0cb354be5e5c07de179198
2016-08-13 21:29:50 -07:00
Davide Pesavento aeeb3fc376 management+util: add 'override' specifier where applicable
Change-Id: Iafb9c2c59026e4268522120f405585ba35fac248
2016-08-14 05:32:40 +02:00
Davide Pesavento c152e6f5be security: add missing virtual destructor to Validator base class
Change-Id: I4a5aac178c3b61fdb898fdffe67f9271a37e729d
2016-08-13 19:14:02 -07:00
Junxiao Shi 198c381393 security: Validator::verifySignature don't throw on Interest with malformed signature
refs #3723

Change-Id: I7de6ab667ffbcc531a5ea8bccae1551e1699cefd
2016-08-12 19:24:18 +00:00
Yingdi Yu 7f8e8febfe docs: update spec of certificate format 2.0 with IssuerId
Change-Id: Ib8ee8331e4486321f0f02d9957167774a0726ae3
Refs: #3315
2016-08-11 13:01:06 -07:00
Zhiyi Zhang 387e57ba81 signature: Small API fixes
Change-Id: I1718dd5bdf702151e8125801a8f1dfc23cb680e4
2016-08-11 13:01:06 -07:00
Yingdi Yu 0b537b9250 util: generate random bytes using OpenSSL instead of CryptoPP
Change-Id: I68bdac565242432fa53a1f113d6f395bf3c6e982
Refs: #3010, #2949
2016-08-11 13:01:06 -07:00
Yingdi Yu b263f151d7 security: Add signing/verification support in transformation
Change-Id: I6364fa0e1ebcc7cc932b401eb50fc56251ea8c84
Refs: #3009
2016-08-11 13:01:06 -07:00
Yingdi Yu 202a2e9c43 security: Add wrapper for public/private key in transformation
Change-Id: I6610cccc8bb20b4e9e227895cf24b595a6e13698
Refs: #3009, #3010
2016-08-11 12:59:25 -07:00
Yingdi Yu 8751661059 security: Add BlockCipher in transformation
Change-Id: I2c09509acd69e7f9270ef8c9b6e5e16ede2a8042
Refs: #3009
2016-08-10 21:19:02 -07:00
Yingdi Yu 99b2a001df security: change enum to enum class in security-common.hpp
Change-Id: I5565c845cd57f3457c8120b11399a105fa83418d
Refs: #3083
2016-08-10 21:19:02 -07:00
Davide Pesavento 1349d2d72e build: add waf-tool to simplify building with AddressSanitizer & friends
Change-Id: I368fe5bbbe3a92a7e82c22f56f6784761d94118d
Refs: #2589
2016-08-10 21:13:23 -07:00
Teng Liang f8bf1b0aff util: handle NACK in NotificationSubscriber
refs #3662

Change-Id: Ia8023668c912e8ba827922f5c31880f903c362f6
2016-08-10 21:12:34 -07:00
Junxiao Shi 86dfa53fee util: keep Scheduler running if a callback throws
refs #3722

Change-Id: Icf19e1a59d67e351b210a60079b27b9b0a06fae6
2016-08-10 03:00:11 +00:00
Junxiao Shi d50f2b4746 util: redesign scheduler::EventId
refs #3691

Change-Id: I5bc49e6a15ae7364c654ca61bd2cf0f95a5c173b
2016-08-10 02:59:59 +00:00
Junxiao Shi 9f764b5aea tests: Scheduler benchmark
refs #3722

Change-Id: I52a9ef3bca3a458e4f397b50e104044e0fba2cf7
2016-08-10 02:59:48 +00:00
Junxiao Shi e7bb6c8c08 face: perform wire format encoding in frontend class
Face::put encodes Data and Nack into wire format before passing to Impl class,
so that Face::put(const Data&) doesn't require the Data to be managed by a
shared_ptr.
For the common case of sending Data without other NDNLPv2 headers, this commit
adds an optimization that the Data is not copied into an LpPacket, but directly
encodes into wire format.

refs #3678

Change-Id: I7ac7bb574a5cb3b07f6c62060809c94ff1cf3dee
2016-08-08 23:16:35 +00:00
Junxiao Shi ae0b418784 face: don't crash if Face is destroyed with outstanding io.post
refs #3248

Change-Id: Ifd46e46fb1df849cbb3651204cd5a72f476cb81e
2016-08-08 22:53:17 +00:00
Davide Pesavento 41abef8bc7 tests: plug memory leak in SecuritySecTpmFile/RandomGenerator
Change-Id: I97023e8bd880661ce6a38d76d2e9827737ece0be
Refs: #1660
2016-08-08 14:02:50 -07:00
Junxiao Shi 54f727dd0f management: Controller validates ControlCommand response
refs #3653

Change-Id: I70fd96075357840928bc813e64030b3e513f698a
2016-08-08 20:29:11 +00:00
Junxiao Shi f5b5ae2585 face: make Face test suite run faster
UnitTestTimeFixture::advanceClocks is invoked with less ticks of
larger duration when feasible, so that test cases run faster.

refs #3724

Change-Id: Ic0f27fa2374bd786cee9e3310b7d70d84300a21b
2016-08-08 05:54:41 +00:00
Junxiao Shi 76e0eb287b face: accommodate empty InterestCallback/DataCallback/NackCallback
refs #3724

Change-Id: Iebfeae48d37d6dedbbdbca2a05730247807675d5
2016-08-08 05:54:10 +00:00
Junxiao Shi 43a7932ed2 mgmt: Dispatcher uses library logging facility
refs #3725

Change-Id: Idfb9002cfa38b1baf7e9d0b144b8dfcb3b1d6dd3
2016-08-08 05:48:43 +00:00
Junxiao Shi 1fe7ce5850 util: rename NDN_CXX_LOG_* macros to NDN_LOG_*
refs #3562

Change-Id: I7366d20e064d483a852c39def523644950d2f2e3
2016-08-08 05:48:02 +00:00
Junxiao Shi 103d8ed2d6 face: minor refactoring and Doxygen improvements
refs #3248

Change-Id: I8c44b4342b9d7b9e896dbc96fbf671d3e29bcb3c
2016-08-07 20:34:11 +00:00
Alexander Afanasyev 750472b63d build: Fix detection of OpenSSL on OS X with HomeBrew
Change-Id: Ibcbc9516cf3b47eaab446bd51eb70917226c8104
Refs: #3697
2016-08-05 12:08:01 -07:00
Junxiao Shi 5537d13e56 util: fix clang 3.4 time::abs compilation error
This commit also adds a test case for time::abs function template.

refs #3698

Change-Id: I32c3d15362d5515841a95ce6d9804be11df632b5
2016-08-05 03:48:01 +00:00
Teng Liang 93adaff244 util: refactor NotificationSubscriber test suite
Change-Id: I9b4c80e407de16050e63583d04a1b83d1a8181bb
Refs: #3662
2016-08-04 14:21:36 -07:00
Teng Liang e6f87511e7 security: handle Nack in Validator
ref #3332

Change-Id: Ieb31ea4015ef3ae412ccbdd9f3eeade065f052ec
2016-08-04 14:21:12 -07:00
Yanbiao Li cbdacb29e2 management: FaceUpdateCommand
Change-Id: I5e3955ef3e15dff2e662786816cea7cb8e1a9bb8
refs: #3232
2016-08-04 14:21:00 -07:00
Junxiao Shi 7d05427cc1 util: logging facility
refs #3562

Change-Id: I61d934c5306e1a73b41c81aeb3524d6bf581af3c
2016-08-04 17:00:41 +00:00
Junxiao Shi dc2d6d254b security: CommandInterestValidator
refs #2376

Change-Id: Ia1d2231a4fb7ad130e11dd0d0dd52d8007149470
2016-08-04 14:30:23 +00:00
Junxiao Shi 85d9083b35 tests: move makeInterest/makeData/etc to ndn::tests namespace
refs #2376

Change-Id: If824388f1e2859d7d2199cd622db2aa1a3277798
2016-08-04 03:19:46 +00:00
Zhiyi Zhang 3e62a83f5c security: Add SafeBag
Change-Id: Iab7cdbdf391c4feedda731d81b75f028fedd366d
Refs: #3048
2016-08-03 11:56:41 -07:00
Yingdi Yu 55ea01adbe docs: spec of SafeBag format
This spec defines the TLV-based format of SafeBag, replacing the
previous SecureBag which uses DER-based encoding.

Change-Id: I001153bd3f4246a0f84656167b00c6387b2fea07
Refs: #3048
2016-08-03 11:54:53 -07:00
Yingdi Yu d12fb97dce security: Add hmac calculation support in transformation
Change-Id: Iab6e6fa03dc8582843d0de369b56a8faa4cb6eaa
Refs: #3009
2016-08-03 11:54:53 -07:00
Yingdi Yu ae734279c3 security: Add digest calculation support in transformation
Change-Id: I8326c19aff580289b5301687351d81fd74af8a83
Refs: #3009
2016-08-03 11:54:53 -07:00
Yingdi Yu 38317e5940 security: Add base64 and hex encoding/decoding support in transformation
Change-Id: I11d5c8921abcf04411aac38382dc285269f553ef
Refs: #3009
2016-08-03 11:54:53 -07:00
Yingdi Yu 3168c30134 security: Add transformation sink/source
Change-Id: I2698f79f639c2bd7c3ce2e00f48be634dc4c983d
Refs: #3009
2016-08-03 11:54:53 -07:00
Yingdi Yu b3015bdfb7 build: require minimum version of OpenSSL to be 1.0.1
Change-Id: I5d3fe907a7ab3159955e80a60cf0f011fd2b3154
Refs: #3007, #2949, #3089
2016-08-03 11:54:53 -07:00
Alexander Afanasyev 224044fc30 build: Force linking against the locally compiled ndn-cxx library
When ndn-cxx is configured to be linked against static libraries (e.g.,
a static version of boost libraries) while ndn-cxx library is being
compiled as a shared library, waf adds '-L<static/path>' before '-L.'.
This can result in compilation failure when the system has a different
version of the ndn-cxx library installed.

This commit also makes a minor improvement for cryptopp library
detection.

Change-Id: Ia42a21b51a51a867a1b455a95d1cf5de6b21881f
2016-08-03 11:48:27 -07:00
Zhiyi Zhang 044bb7e9e5 security: ValidatorConfig rule evaluates all checkers
Also fix bug when target cert is not in anchors and cert cache is empty

Refs #3645

Change-Id: Ifb39e474c74611897ea28a1b8f26ed70750a1990
2016-07-27 18:58:11 -07:00
Junxiao Shi cf9c6bb8d7 tests: fix "child has exited" error in Face integrated tests
refs #3684

Change-Id: I9f48c481b6d9a19ec9c90a8d220dfbbcbe41418a
2016-07-27 02:18:19 +00:00
Junxiao Shi 19d7a57248 encoding: delete deprecated Block::fromBuffer and block helpers
These deprecated APIs are deleted:
Block::fromBuffer overloads with output parameter
ndn::encoding::prependBlock
ndn::encoding::prependByteArrayBlock
ndn::encoding::nonNegativeIntegerBlock
ndn::encoding::prependBooleanBlock
ndn::encoding::booleanBlock
ndn::encoding::dataBlock
ndn::encoding::nestedBlock

refs #2950, #2636

Change-Id: Ic7a129f340b75b4d97620bbf8f63d3ff2e9ddb03
2016-07-26 12:55:09 +00:00
Junxiao Shi 8c56538c2a transport: StreamTransportImpl and StreamTransportWithResolverImpl segfault fix
refs #3136

Change-Id: I9cb4d5ff760cd8005ace699e82934c5951935b97
2016-07-25 23:04:49 +00:00
Junxiao Shi 446de3c52f transport: minor refactoring
Duplicate code in StreamTransportImpl<BaseTransport, Protocol>::send
overloads is split to another internal function.

This commit also corrects code style in transport directory.

refs #3136

Change-Id: I47958c4117b6d2c7dde356430e405da2505f942a
2016-07-25 22:38:16 +00:00
Junxiao Shi 3188c403b2 name: delete deprecated Name::set method
refs #2506

Change-Id: Iea44dcd8f39db4841d95ae62f79de0c8b642db38
2016-07-20 16:31:42 +00:00
Junxiao Shi b80e947432 exclude: excluded range enumeration
refs #3681

Change-Id: I4ed60636aca9f6e6c5963e60eb28efba31a32c30
2016-07-20 13:45:24 +00:00
Junxiao Shi 2b65d95938 util: delete deprecated makeDummyClientFace
refs #3383

Change-Id: I2f72dd04dea0d6bdd2a57789f788673f8994d64f
2016-07-19 01:52:59 +00:00
Junxiao Shi 09bcab5bb8 lp: fix typo
refs #2879

Change-Id: Iaa5aeb4caaecd835ae840038d703251ff950e66d
2016-07-18 02:43:34 +00:00
Junxiao Shi d4919b4311 waf-tools: remove FRIEND_TYPENAME check
It becomes unnecessary after dropping Ubuntu 12.04 build support.

refs #3599

Change-Id: I2b2ed8b38b8b7f5ec28dc32cb81bd04adfad4f88
2016-07-17 16:28:40 +00:00
Junxiao Shi 600f71185d management: Controller allows empty callbacks
refs #3653

Change-Id: Id112960fa3f9f52854687b798c4632a922297ff2
2016-07-16 11:57:18 +00:00
Junxiao Shi df4b24e3d5 exclude: ImplicitSha256Digest bugfix
This commit also improves name::Component test suite.

refs #3665

Change-Id: I8e9a575bf203f0983bacd1dbdb3491510e326d1f
2016-07-14 21:41:43 +00:00
Junxiao Shi d5827ce7d5 util: make SegmentFetcher test suite run faster
UnitTestTimeFixture::advanceClocks is invoked with less ticks of
larger duration when feasible, so that test cases run faster.

UnitTestTimeFixture is synchronized from NFD codebase.

refs #2734

Change-Id: Ifd338f1008af8662bb9ea8f798f6cc2a922fb865
2016-07-14 20:49:37 +00:00
Junxiao Shi 0f3f0b4356 management: Controller validates StatusDataset response
refs #3653

Change-Id: Id54026d7277fecf52b6443bf42d01b5e6d7e35a3
2016-07-14 13:26:37 +00:00
Junxiao Shi 6b872a93ba docs: ndn-tlv-ping => ndn-tools in README
refs #2525

Change-Id: I1042959c7989464bbab71e7525ac1584d855a283
2016-07-12 18:26:32 +00:00
Junxiao Shi 1eacb97e25 management: ChannelDataset
refs #3329

Change-Id: Ie11a19b4d3178f8e33b47557e3720ecc5c9b4e6e
2016-07-07 22:51:07 +00:00
Alexander Afanasyev cf490555ff tests: Extending Face test cases
Add previously removed test cases to check if config-file based
transport customization works.

Change-Id: I7e2235494f2ba7011423e743ab8e437c74d56d1f
2016-07-01 16:08:56 -07:00
Alexander Afanasyev e4f8c3bec2 tests: Enable isolation of KeyChain during run of unit/integrated tests
Change-Id: Ia136e4bb074c14e8d824f563594cbc0ad7592c3b
Refs: #3655
2016-06-30 14:08:36 -07:00
Alexander Afanasyev 8cf1c56dbb face: Enable KeyChain customization in DummyClientFace
This feature also required two new Face constructors

Change-Id: I25c6d9d0d94a065176ed348d25e7b99a6c7999c0
Refs: #3435
2016-06-30 14:02:48 -07:00
Alexander Afanasyev 57e003638d face+security: Introduce environment variables to set/override transport, pib, and tpm configurations.
- NDN_CLIENT_TRANSPORT: equivalent of transport in client.conf
- NDN_CLIENT_PIB: equivalent of pib in client.conf
- NDN_CLIENT_TPM: equivalent of tpm in client.conf

Whenever an environment variable is set, it takes precedence over any
values specified in the configuration file.

Change-Id: I44c2347168616387a0489b6bf5c2c3a12db29863
Refs: #2925, #2514
2016-06-29 12:29:19 -07:00
Junxiao Shi 034c188722 management: StatusDataset client
refs #3329

Change-Id: Icf755ba7ed1fd36f6ea09af97cb77f70757f84c7
2016-06-24 18:06:51 +00:00
Alexander Afanasyev 67cb75c7d8 ci: Add missing installation of openssl dependency
Change-Id: I8c515a87a2c70236214bc88e019b7f3a7bea7ebd
Refs: #3643
2016-06-20 10:23:54 -07:00
Muktadir R Chowdhury 2bc2df0fb3 util: SegmentFetcher don't restart from segment 0 upon Nack
Change-Id: I167186961a82a4349fab5b4431c26a3fdb904bb8
refs: #3554
2016-06-07 16:17:33 -05:00
Alexander Afanasyev 4f512fb24e name: Add Name::deepCopy to allow memory optimizations
Change-Id: I5c498d7524c497e8d7c8e2d89561ff51d1c64d35
Refs: #3618
2016-05-25 14:46:20 -07:00
Alexander Afanasyev 8e998e415f ci: On OS X, install openssl brew package to standard locations ("link" it)
Without "linking", ci scripts installs homebrew package into the 
customized location and does not create links in the standard places. 
As a result, the build will be using the system-provided openssl, which 
is old and does not support all features needed by ndn-cxx.

Change-Id: I3a7d4b7dbb8e00789846f6ec970039a5cf5368bc
2016-05-20 16:15:31 -08:00
Weiwei Liu 1e787c46fd tools: deprecate ndncatchunks3 and ndnputchunks3
refs #3547

Change-Id: I41162de742efa01fb0e38208088d8765f5f9dc63
2016-04-29 11:07:29 -07:00
Davide Pesavento aa82eb6adc common: remove NDN_CXX_DECL_FINAL/OVERRIDE macros; use C++11 keywords directly
Change-Id: I8a6bc25a17574093addb144e6cdcc21dd24bbce4
Refs: #3599
2016-04-22 19:08:40 +02:00
Davide Pesavento e6e6fde5bd build: require gcc >= 4.8.2 and boost >= 1.54.0
Change-Id: I230ac74f3fd1e7912c1645f36383913ff5bd3d2c
Refs: #3599
2016-04-22 02:16:27 +02:00
Davide Pesavento e11c8d85b8 docs+ci: Ubuntu 12.04 is no longer supported
Change-Id: Icff6724c9b76b7e85541b3dcc88408c07f7fd312
Refs: #3599, #3600
2016-04-22 02:16:13 +02:00
Alexander Afanasyev 2e52d7cab4 docs+build: Prepare release of version 0.4.1
Change-Id: Ib353b3b7b40cd77ff1bf4f6bd819124cc51e452e
Refs: #3385
2016-03-25 10:39:02 -07:00
Yanbiao Li 4b4f754fbd mgmt: Use InMemoryStorage for StatusDataset and Notification produced by managers
Change-Id: I2ed57061e25638c01df7a0323ed303cafe1be455
ref: #2182
2016-03-18 12:56:02 +08:00
Alexander Afanasyev 077862e7d8 ci: Fix travis-CI build matrix
Change-Id: Id44f23dba027559d8f96aca581840d325c5ca858
Refs: #3360
2016-03-15 12:56:18 -07:00
Davide Pesavento 606e665e61 tools: delete deprecated tlvdump
Superseded by ndn-dissect from ndn-tools repo.

Change-Id: I9e6a5e0c9bdcf36416ca3fc0557a4f4cf7ac4cc2
Refs: #2819
2016-03-10 12:38:48 -08:00
Yingdi Yu 404eafd9a7 util: Support MustBeFresh processing in InMemoryStorage
Change-Id: I8e8e647d7673e4e0fe8dd1c5025fbc8e5e524c70
Refs: #3274
2016-03-09 16:47:40 -08:00
Alexander Afanasyev 5d69550c8c tools: Fix broken ndnsec-op-tool
Change-Id: I058f5198c276246ee3d7392704b6579c107cdfa9
Refs: #3469
2016-03-03 10:50:19 -08:00
Alexander Afanasyev 8c6880f58e build: Fix compatibility with Python 3
Change-Id: I6e38315945a683a87bbeb4b4a352de3c7122ef7c
Refs: #3493
2016-03-03 10:50:19 -08:00
Davide Pesavento 9a8bae5bc4 util: split platform-specific NetworkMonitor backends into separate files
In preparation for a major overhaul of the rtnetlink implementation.

Change-Id: Iab660ab4bceb0f06db01a31f264cdfe0b7cdf077
Refs: #3353
2016-02-26 02:31:48 +01:00
Davide Pesavento 537dc3a262 Reduce inclusions of <boost/asio.hpp> in public headers
And especially, stop including it from the precompiled header
"common-pch.hpp". This is a necessary step in order to avoid
conflicts between net/if.h (pulled in by Asio) and linux/if.h
(required by future commits).

Change-Id: I0207be0d2be796d8ef369062a8d5195fedfef6b0
2016-02-19 20:47:39 +01:00
José Quevedo 699d2eab1e security: Set false as default isKsk value in KeyChain::generateEcdsaKeyPairAsDefault
Change-Id: I53162cc73fec9462b1e2ea6832a1041f9b6577e7
Refs: #3439
2016-02-02 16:58:06 -08:00
José Quevedo 641de4cec3 security: Fix signing by identity (ECDSA)
When signing by identity, if no certificate is available for the default
key and its type does not corresponds to the `DEFAULT_KEY_PARAMS` a new
pair of `DEFAULT_KEY_PARAMS` keys is created, set as default and used for
signing. Solved by checking the type of key of the default key pair for
the identity.

Change-Id: I75c117cea17cbbfda410da9a83dd16b92d345d21
Refs: #3438
2016-02-02 16:57:57 -08:00
Junxiao Shi 6617e49878 Update copyright notices for files modified in 2016
refs #3415

Change-Id: I821327abf9e6715de0d8516f5ffb87487236ee14
2016-01-19 07:33:00 -07:00
Alexander Afanasyev 1b6187ff70 ci: Fix unit test execution with boost 1.60
Change-Id: I8bdefd6d5e082f01c827fbe4a92ce5c7952b8bd1
Refs: #3417
2016-01-18 22:41:49 +01:00
susmit 8b156555fe Replace hardcoded values in ndn-cxx by MAX_NDN_PACKET_SIZE
Change-Id: I0e116cd2a39781f0d56e156ac517ecadd49b8741
Refs: #3407
2016-01-12 13:27:01 -07:00
Alexander Afanasyev ce7b062a6f util: Workaround for gcc-4.7 being unable to deduce noexcept specifications
Change-Id: Ib8b00ff7a6293c4f8596615c4f2af266eab28a1a
Refs: #3384
2016-01-05 10:36:01 -08:00
Alexander Afanasyev ed2aebafae docs+build: Prepare release of version 0.4.0
Change-Id: I84b7b2471e0c898229d204a00a2aa0e82c85678e
Refs: #3008
2015-12-30 17:52:15 -08:00
Alexander Afanasyev bb64c17b38 face: Allow creation of Face with custom IO service and default transport
Change-Id: I3f3a77c980d23f5ff53d21d4669582caff259a63
Refs: #2500
2015-12-30 17:51:18 -08:00
Alexander Afanasyev 9bdbb83022 tests: Replace usage of deprecated elements of ndn::util::DummyClientFace
Change-Id: I4aea29af101df1f9f63b16d1c49142deb89f182a
Refs: #3146
2015-12-30 17:50:55 -08:00
Alexander Afanasyev 3a6da36b4b face+util: Add protected Face::getTransport method and simplify DummyClientFace implementation
Change-Id: I42e7e5705f27b6823ed18107b374c9841d2a7500
Refs: #3146
2015-12-30 12:54:14 -08:00
Davide Pesavento bbca1b9ec1 docs: remove code style rule 3.11
Change-Id: I2ddc5d59970166511099b49f9375144997ff07d2
Refs: #3368
2015-12-25 20:06:00 +01:00
Alexander Afanasyev ce306cae09 ci: Update Travis-CI to use Ubuntu Linux 14.04 (trusty) and OS X 10.9 VMs
Travis-CI has the following build matrix:
- Ubuntu Linux 14.04, gcc 4.8.4
- Ubuntu Linux 14.04, clang 3.5.0
- OS X 10.9, clang 600.0.57 (based on LLVM 3.5svn)

Change-Id: I37f345f0dcd2b3712b2bd2db5f5cb87ddd7a628f
Refs: #3360
2015-12-24 12:52:09 -08:00
Alexander Afanasyev 3b5f4eae19 build: Improve cryptopp version detection
Change-Id: Ice7f69d0668e1943d2f27b5f15c0384854456d1a
2015-12-23 22:48:17 -08:00
Spencer Lee 48c291be07 security: Properly initialize state in SigningInfo(const std::string&) constructor
Change-Id: Ie5aad142ed6ab0545f6804677e9c8a537ddc9b97
refs: #3365
2015-12-21 13:05:42 -08:00
Alexander Afanasyev 9fae3dbbc2 tests+ci: Enable dual XML and HRF output of unit test results
Change-Id: I65e145e58cf94088bad0ca58f5ad4bc92d0b8c9d
Refs: #2252
2015-12-15 22:38:01 -08:00
Alexander Afanasyev efa22d6722 build: Do not fail build when -Winfinite-recursion warning is generated
Change-Id: I4f2a249073d050041f636b339ef0e3ba50ce9c07
Refs: #3358
2015-12-07 15:21:22 -07:00
Spencer Lee 308bc4470a security: string representation for SigningInfo
Change-Id: I92b227a0d0cb89654536043f703cea9e7b40fa64
refs: #3281
2015-12-07 12:13:02 -07:00
Alexander Afanasyev 66ca203453 src: Remove unnecessary std::move to allow copy elision
Change-Id: I1a83c762dfc51525affd5b01a3c4822b9579c57a
Refs: #3357
2015-12-04 13:17:02 -08:00
Junxiao Shi 4b4699897c lp: IncomingFaceId, NextHopFaceId, CachePolicy tags
LocalControlHeader is deprecated.

This commit also adjusts includes in some lp/ headers.

refs #3296

Change-Id: Icdc7b469d70739fe5c65da51817c92ff9136c923
2015-12-03 18:20:19 +00:00
Muktadir R Chowdhury f58f8f4539 util: Asynchronous data validation in SegmentFetcher
Change-Id: I407d3c1de49c86a6b4a0174baae6ed2e8be5c554
Refs: #2734
2015-11-30 12:05:21 -06:00
Eric Newberry e3e2505aa0 face: remove try-catch in DummyClientFace::construct
refs #2930

Change-Id: I2639c9c37eb8104d61a61ffc515caabee99807c5
2015-11-29 16:25:36 -07:00
Eric Newberry 664dc03fa6 util: add explicit specialization of DummyClientFace::receive<lp::Nack> to header
refs #3343

Change-Id: I20ec14f336eb06e86f0cf951033a54d5722e97fc
2015-11-24 13:02:10 -07:00
Marcin Juszkiewicz 1ddc13d462 name: Fix test cases for Name::compare
Previously, the test cases incorrectly assumed that Name::compare returns -1, 0, or 1

Change-Id: I8a68912ae4cd97144f5149159672434710dded99
Refs: #3347
2015-11-23 10:42:17 -08:00
Ilya Moiseenko 56b0bf8ff9 face: API to remove all pending Interests
Change-Id: Iac341689270698b66ec6228c27e23ea6cf3e5e59
Refs: #3300
2015-11-08 14:14:49 -05:00
Eric Newberry 82838beab5 lp: change return of LpPacket::wireEncode() to non-const
refs #3324

Change-Id: I0b178bc59f8107a947f5f500d7db4cdb9c1e2596
2015-11-07 13:00:35 -07:00
Junxiao Shi b1990df208 management: process Nack in nfd::Controller
refs #3264

Change-Id: Ifaa73ac04e8838a89708fc63a578941d700712c6
2015-11-05 13:45:09 +00:00
Eric Newberry 42db045d04 docs: update supported versions of Ubuntu
Change-Id: Ied9746692aabf26baa9a042912b85e99c6d1bf6b
2015-11-02 23:01:34 -07:00
Davide Pesavento 7c02b472c2 build: enable -Wextra by default
Also delete redundant 'return 0' from configure code snippets.

Change-Id: Ie3618db4abece6fb2d8ec8b52b88e84b4eb3a5b0
Refs: #3293
2015-11-01 20:28:48 +01:00
Davide Pesavento fd5de11497 util: fix heap-use-after-free in ndn::dns::Resolver
Change-Id: I063edba1b895da36ed4a17a0558e5df820b785a7
Refs: #2653
2015-10-28 02:54:36 +01:00
Davide Pesavento a2de7e4eab util: refactor and simplify ndn::dns
Change-Id: I356c37a56ec9241743c1ecc74e2c96ffea061c85
Refs: #2653
2015-10-28 02:46:04 +01:00
Davide Pesavento be7804f19c util: Signal: make handler self-disconnection safer
Change-Id: I15eeed19af2da23187d7700ee7729f397491eca0
Refs: #2333
2015-10-23 21:43:31 +02:00
Alexander Afanasyev 3507b553c8 docs+build: Prepare release of version 0.4.0 (beta2)
Change-Id: I2847efb35a21214c586a417d5d3ac58f11365908
Refs: #3252
2015-10-20 16:00:11 -05:00
Junxiao Shi 18ef4defaf encoding: add NONE to FaceScope, FacePersistency, LinkType
This commit also adds stream output operators for RouteOrigin, RouteFlags.

refs #3259

Change-Id: Ie8a16578d56ff1cdec1441a1ba9f7c54f769c3ce
2015-10-18 10:17:19 -07:00
Eric Newberry 43bf6bbfa3 lp: Packet::wireDecode checks TLV-TYPE of Block before decoding
refs #3256

Change-Id: Ia0fe8f88416eeecf969cc1a585e3625efe42e866
2015-10-09 23:58:54 -07:00
Junxiao Shi f8f63da234 tools: deprecate tlvdump
refs #3196

Change-Id: I7b3925158ec8883d202fcaec497c8c4a3f0cada4
2015-10-07 22:28:56 +00:00
Junxiao Shi b1ba3e0661 build: downgrade keyword-macro from an error to a warning with clang
refs #3235

Change-Id: If687229c721d41d7a06b9014c1d9130b798bca64
2015-10-05 16:42:14 -07:00
Davide Pesavento d06ea05070 build: disable clang's unused-local-typedef warning
This commit also enables color diagnostics on release builds.

Change-Id: Ifcdadba1bc31ce64779007e7b33f8d2fee5b04b6
Refs: #3209
2015-10-02 15:25:33 -07:00
Alexander Afanasyev 03c170eeb9 build: Fix compilation with boost 1.59
Change-Id: I1316c6d1151f8400f4370b68d098e61a25fd04c6
Refs: #3227
2015-10-01 16:21:12 -07:00
Alexander Afanasyev 45312f55c3 docs+build: Prepare release of version 0.4.0
Change-Id: Ie5dfb3a1c7674cd426b89721c91ad59327517764
Refs: #3178
2015-09-27 19:35:21 -07:00
Junxiao Shi 9697354490 lp: use ndn::to_string instead of std::to_string
refs #2930

Change-Id: Ib245e0a56f74eebed7f062ef2ced0313ef36a908
2015-09-27 10:18:26 -07:00
Eric Newberry 83872fd229 face: send and receive NACK
refs #2930

Change-Id: I70c969ac12b493d2c83fa892beffae936cc23791
2015-09-26 12:25:09 -07:00
Davide Pesavento cd183d2f37 docs: catch exceptions by reference-to-const in code style examples
Change-Id: I06c39dfb00c06a9e7dd04cda15d00a6f7f768ce3
Refs: #3221
2015-09-23 16:41:54 +02:00
Davide Pesavento 96b96afb70 Emulate std::to_string on platforms that do not provide it
Inspired by NFD commit ce81230b09583f9aec98a97653a047aa54fa2bef

This commit also fixes an important typo in the name of the macro
defined by the check_vector_const_iterators configure check.

Change-Id: I1b18066474145720570b5ecd6109b3f76eb262e8
Refs: #2743
2015-09-20 22:23:25 +02:00
Davide Pesavento 409cc20334 Backport make_unique
C++14 has std::make_unique, which is convenient for working with unique_ptrs.

It is sufficient to backport only the overload for non-array types, the
overload for array types isn't used in ndn-cxx.

Change-Id: I200ba24ace6ed25d695f0ebe5e9b459f5dfc7538
Refs: #3093
2015-09-20 22:21:24 +02:00
Davide Pesavento 8f5cbdcfac Fix int vs. ssize_t type confusion
Plus a typo in the target type of a static_cast.

Change-Id: Icb8288baeab20d470c334742d989ffe231fdca7c
2015-09-19 14:03:16 -07:00
Alexander Afanasyev f2a46228ef docs: API documentation fixes
Change-Id: I1088a156c9ac055f974900454647dcb9a7b7ec54
Refs: #3210
2015-09-18 10:40:32 -07:00
Davide Pesavento 1aafba46a9 build: Minor fix of default-compiler-flags tool
The default flags for the clang compiler included several flags that
make sense only during the debug-mode compilation.

Change-Id: I0720ff2980da81ef2978761aedda6989d8e6f38d
2015-09-17 17:24:41 -07:00
Davide Pesavento 18cf81bf6e docs: fix several doxygen errors
Change-Id: If86c628b2b794cba0e3697bfe1d88ce752104ce1
Refs: #3210
2015-09-17 17:22:03 -07:00
Alexander Afanasyev 73e3004470 docs: Correct copyright statements
Change-Id: Ie1a5a88a411e7d3893abeb5a810dff28ae3256b5
2015-09-17 17:09:51 -07:00
Alexander Afanasyev 80b68e17c4 docs: Correct errorneous license boilerplates
Change-Id: I1ba9c109f7c715a1bd462422a09e7c24b69f6547
Refs: #3207
2015-09-17 17:01:04 -07:00
Junxiao Shi 5df599235b util: add io_service warning to dns::asyncResolve
refs #2534

Change-Id: I4f3f8303caadbf9dd885e21109a7b09fd25dd802
2015-09-15 06:21:21 -07:00
Junxiao Shi f4cbe35bc7 util: delete deprecated EventEmitter
refs #2351

Change-Id: Iff0bbf82d31e6e74f238166f51bffc2e88007f46
2015-09-07 21:51:43 -07:00
Eric Newberry 95bd96a981 management: NACK counters
refs #3174

Change-Id: I647cddc777e079dce4b7c7574ec2cccb04da6630
2015-09-07 12:47:01 -07:00
Junxiao Shi f65a336fac mgmt: mark StatusDatasetContext as noncopyable
This commit also changes function-by-value to function-by-const-reference
in Dispatcher.

refs #2107

Change-Id: If7859579ea9cdd953476642c05104355acdf1620
2015-09-06 20:54:54 -07:00
Alexander Afanasyev cac0838771 interest: Cache Link object after the first call to getLink
Change-Id: I2625cdb665365cb3c1a69ec7d917d09ad621988d
Refs: #3158
2015-09-04 09:52:02 -07:00
Alexander Afanasyev e508f14dd5 face: Call Transport::connect within io_service thread
Previously, there was an indirect call to Transport::connect from within
Face constructor, causing in some cases false timeouts for connect operation.

Change-Id: I6358970e92ead94de977cfde94b5552c4fa24c63
Refs: #2742
2015-09-03 12:17:31 -07:00
Yukai Tu d93c5fcb11 management: FacePersistency field in ControlParameters
Change-Id: I3a93bd658d40f3d77f7790b72e8873646ecc7990
Refs: #2991
2015-09-02 09:16:56 +08:00
philo bb778e7419 face: add DEPRECATED macro on registerPrefix and setInterestFilter overloads
Change-Id: Ib6c2efc286c51f2ac127a5f75901fb20b44b013c
Refs: #2967
2015-09-01 14:07:30 -07:00
Alexander Afanasyev 6fa52970f3 docs+build: Prepare release of version 0.3.4
Change-Id: Ia4b5d8faf42244adb726683259f0df0dcaf565ec
Refs: #3132
2015-08-31 09:07:38 -07:00
Yanbiao Li 8ee37edb7e mgmt: Dispatcher
Change-Id: I92b3dc9daae75abac9d791632b6a0bec111b4573
refs: #2107
2015-08-30 23:25:16 -07:00
philo 7b187f5ed5 docs: Correct use of @example doxygen tag
Refs: #3102

Change-Id: I62c680e21fd050c85d79c78a23cfa29073b43aa7
2015-08-30 22:36:15 -07:00
Alexander Afanasyev fba1ac6983 transport: Fix segfault when transport is closed while multiple send operations are scheduled
Change-Id: Icf6158150c9b6c2c17a89c01fc883eaf003e356e
Refs: #3136
2015-08-26 15:19:13 -07:00
Alexander Afanasyev ae20525951 tools: Fix compilation error with Boost >=1.59
Change-Id: Icf35873f67ba41f5967672d98581db40cad6f761
Refs: #3128
2015-08-24 14:14:16 -07:00
Wentao Shang 3aa4f41b77 code-style: new style for switch statement
Change-Id: Id4729a328c84967ea888ad9137d92308e8ef6c30
Refs: #3099
2015-08-19 20:44:08 -07:00
Alexander Afanasyev 18846944ab ci: Fix code coverage reports in Jenkins-CI
Change-Id: I5ea2d5699b7c2eac78a49df904f25da7fef3c14b
Refs: #3116
2015-08-18 23:17:15 -07:00
Eric Newberry 6235aacbec encoding: Add test case for creating Block from Block using same underlying buffer
refs #3100

Change-Id: Ie0290939c6fbd844150a50d1d8c1e588c5e8409d
2015-08-14 11:02:35 -07:00
Alexander Afanasyev 4448d29637 block: Add constructor to create sub-blocks using the underlying buffer
Change-Id: Ic25f82526228dbe7aa3222bc6b1e68ac0e35cea1
Refs: #3100
2015-08-12 22:33:37 -07:00
Spyridon Mastorakis 0d2ed2ee77 Enhance exception throwing with Boost Exception library
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4962ba
Refs: #2997
2015-08-10 21:07:15 -07:00
Alexander Afanasyev 6f35a0f05b Merge feature branch 'feature-ndnlp'
Change-Id: Ifc0b5cd9242ed50c96c680f2d6e0888aa12ad921
2015-08-09 12:43:33 -07:00
Eric Newberry 261dbc2b2e lp: Packet and Fields
refs #2879

Change-Id: Ie450eb58d1176179efed8d1706d30ea4978b7b02
2015-08-07 09:59:22 -07:00
Eric Newberry 4b5a5cf823 lp: implement CachePolicy and CachePolicyType
refs #2963

Change-Id: I343ff95eb4ae61a4bc29603e63647b219661542c
2015-08-07 09:59:19 -07:00
Eric Newberry 3898262a2b lp: Nack abstraction
refs #2878

Change-Id: Id36c9f066ccc2e9e1807e37dc0bf6e308645f556
2015-08-07 09:58:53 -07:00
Eric Newberry 3abeeb811b lp: TLV-TYPE codes
refs #2875

Change-Id: I3d8f2938f857a3614bcfdb00b6098189fa314169
2015-08-06 21:38:36 -07:00
Alexander Afanasyev a1ffbc7a25 Merge feature branch 'feature-cert'
Change-Id: If708ba37e79d6c9c8e13941ce89be97a7f45b3cb
Refs: #2861, #2868, #3058
2015-08-04 10:51:39 -07:00
Yingdi Yu ea382942ac security: Add AdditionalInfo into SignatureInfo
Change-Id: I5e5c85b09b7a00ef4182bec3267e444f33a706ff
Refs: #3058
2015-08-04 10:40:03 -07:00
Yingdi Yu 6be43f301e signature: Add ValidityPeriod into SignatureInfo
Change-Id: I02571a4876e2f0ccd8cc088ecc6477d20dd701cb
Refs: #2868
2015-08-04 10:40:03 -07:00
Yingdi Yu 7a81389ae3 security: Add ValidityPeriod abstraction
Change-Id: I6fbe2541a2a8bb90513441f0ef8297d0c8007455
Refs: #2868
2015-08-04 10:40:03 -07:00
Yingdi Yu fba8a637c0 doc: certificate format
Change-Id: I9d6427ed5e5fab159b5f96fab8b977b4371f26c3
Refs: #2861
2015-08-04 10:40:03 -07:00
Spyridon Mastorakis 5ebfda6021 build: Compile as shared library by default
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4972ae
Refs: #2867
2015-07-27 13:18:36 -07:00
Eric Newberry a3d9fc0825 encoding: Block::remove now removes all subelements of type
refs #3070

Change-Id: Ife9cb9fe9ba7e0a79d5f759c9990cbe04b0b87c3
2015-07-26 20:14:32 -07:00
Joao Pereira 2096e18e35 ci: enable examples
refs #3046

Change-Id: Iee4c0f8a003fb0651c21024a14697a80ace72119
2015-07-21 16:31:08 -04:00
Joao Pereira 7476ebf8bd encoding: Block::insert
This commit also updates Block::erase to accept element_const_iterator

refs #2998

Change-Id: Ie09c99d14a065444b01abff72fd97a92387b9b91
2015-07-20 11:49:22 -04:00
Alexander Afanasyev 8828ca6183 util: Improvements of string helpers
Improvements include:
- test cases for every string helper
- a new `printHex` helper to output hex conversion directly to std::ostream
- new `toHex` and `printHex` helpers that accept Buffer as input parameter
- a new `fromHex` helper to convert the supplied string to shared_ptr<const Buffer>
- replaced uses of CryptoPP routines with `toHex` and `fromHex` helpers where applicable

Change-Id: I092c9fa8fd21c413b53ea5624b82f769287bb42c
Refs: #3006
2015-07-17 16:12:24 +08:00
Alexander Afanasyev b346ddbb2e ci: Updating Jenkins-CI and Travis-CI scripts
This commit makes use of has function from `util.sh` script, enables
dependency installation for Jenkins-CI, and unifies dependency
installation between Jenkins-CI and Travis-CI.

Change-Id: I5f4419ea48d4eb333e9d107115ef3df4123f76e5
Refs: #2805
2015-07-15 22:35:34 +08:00
Joao Pereira 9c2a9a8eb6 encoding: move Block methods to .cpp
refs #1694

Change-Id: I2fd7cc529093f06da676d7aa67519b1b73f1c9d2
2015-07-14 14:49:14 -04:00
Alexander Afanasyev d27334f4d6 util: Add constructor of Digest object from std::istream&
Change-Id: Ie3fa6511da751fe3b7b39d7a18b4909a28376d02
Refs: #3022
2015-07-09 11:40:51 +08:00
Alexander Afanasyev 069db08ac1 doc: Correction of a few typos in the release notes
Change-Id: Ie9e6e795eb8957b64b032476ed55d8c83c1abf02
Refs: #2812
2015-07-09 10:41:51 +08:00
Joao Pereira 0b3cac5b80 face: simplify prefix registration APIs with SigningInfo
refs #2932

Change-Id: I9a29cf2925272b9fc90b4fb69a14035a75291928
2015-07-08 03:50:36 -07:00
Junxiao Shi 35020caedf management: deprecate CommandOptions signing params
refs #2893

Change-Id: I07e53094cf598015456b666e1d0991b45452c900
2015-07-01 16:46:51 -07:00
Alexander Afanasyev 2d6954c574 docs+build: Prepare release of version 0.3.3
Change-Id: I67b433cbd51bd5f19951271befc352cdf36af047
Refs: #2812
2015-07-01 10:35:06 -07:00
Junxiao Shi 8868140aac Add noexcept to move constructors and move assignment operators
refs #2966

Change-Id: Ib87da2b8dc2d77fa9beb8bc6b5323498057b76a2
2015-06-30 16:31:38 -07:00
Junxiao Shi fa2128d63d docs: move Manpages to top-level of documentation hierarchy
refs #2730

Change-Id: I0b1d020b5b856498a50158d70f79ae6d9174e58c
2015-06-29 16:41:25 -07:00
Alexander Afanasyev d5c48e0e19 encoding: Improving structure and documentation of block helpers
This commit add several new helpers to simplify operations with
std::string:

- prependStringBlock
- makeStringBlock
- readString

The following functions are deprecated and their replacements:

- nonNegativeIntegerBlock (use makeNonNegativeIntegerBlock)
- prependBooleanBlock (use prependEmptyBlock)
- booleanBlock (use makeEmptyBlock)
- dataBlock (use makeBinaryBlock)
- nestedBlock (use makeNestedBlock)

Change-Id: Ic595ae64fc9c80c2c04e5fde1d8812e8b9debd60
Refs: #2951
2015-06-25 22:51:29 -07:00
Alexander Afanasyev 9d158f033c face: Refactor internal PIT to use scheduled events
The commit also changes how face is paused when there are no pending
interests left and there are no registered prefixes with local
forwarder: data structures for pending interests and registered prefixes
will fire up a signal when they become empty.

Change-Id: I6b87a44b0c8bc766865a51962ecacaec85b4adad
Refs: #1372, #2518
2015-06-23 14:12:15 -07:00
Junxiao Shi c6acc7a795 management: simplify CommandOptions with SigningInfo
Signing parameter in ndn::nfd::CommandOptions is now using
ndn::security::SigningInfo. Old signing parameter APIs are deprecated.

refs #2893

Change-Id: I81831fecd382efa369792218ac5457690d4c4046
2015-06-23 10:03:56 -07:00
Eric Newberry d82b07cb60 security: Helpers to create SigningInfo
refs #2922

Change-Id: Id132cc0667a112acee354095b79d0e60914bd619
2015-06-21 17:49:24 -07:00
Yingdi Yu c820989e09 security: Make public interface of Pib, Identity, and Key as read-only
Change-Id: I7b3fac583c00cce2fa09802fa4d0aff2ace4aca2
Refs: #2928
2015-06-19 23:12:51 -07:00
Mickey Sweatt 11314b7420 security: implement PibSqlite3 based on PibImpl
Change-Id: I47a61cf8ebe5f76d5ca492db52c2f4f2f5ac3c9b
Refs: #2807
2015-06-18 22:10:37 -07:00
Mickey Sweatt 7f17790b30 util: Sqlite3Statement helper
Change-Id: Ia555dff99efa7d217f0b6153b1333b6dd97dd610
2015-06-18 22:08:03 -07:00
Yingdi Yu 1b0311ce9a security: New generalized signing API in KeyChain
A new API in KeyChain introduces a general interface to sign interest
and data packets and supply necessary signing information, such as
signing identity name, signing key name, or signing certificate name.
In addition, the supplied signing information can include additional
information that signer wants to include in the SignatureInfo of the
signed packet.

Old sign methods `KeyChain::sign(Packet, Name)`, `KeyChain::sign(uint8_t*, size_t, Name)`,
`KeyChain::signByIdentity(Packet, Name)`, `KeyChain::signByIdentity(uint8_t*, size_t, Name)`,
`KeyChain::signWithSha256(Data)`, and `KeyChain::signWithSha256(Interest)`
are now deprecated and will be removed in the next release.

Change-Id: I086e6c6522f70bcb7799e7dfc4cc4b2f8a3816a0
Refs: #2871, #1705
2015-06-18 22:07:46 -07:00
Yingdi Yu 3bf91f5018 security: adjust description of PibImpl interfaces
1. Intialize default setting when there is no default setting
2. Removal method should be deep removal.

Change-Id: Id30947834a8002b6dc177ac18c6beae2600efa92
Refs: #2896, #2898
2015-06-16 17:46:41 -07:00
Joao Pereira 6f7cfd02d2 name: Allow negative start index in getSubName method
refs #1962

Change-Id: I2f1b77d95d534d837d925022934f9a6ccaa340d2
2015-06-16 13:58:25 -07:00
Yingdi Yu 281689ab2e security: Unify TPM creation
Change-Id: Id355abc852ed754efb718ac76893816f62cf8300
Refs: #2722
2015-06-15 14:32:43 -07:00
Junxiao Shi 8ca4325158 security: IdentityCertificate sets default FreshnessPeriod to 1 hour
refs #2872

Change-Id: Ib2af1a1c8a5bf99310132f55c0f8b5d80d7a2015
2015-06-11 21:29:43 -07:00
Joao Pereira ba1e3b9a73 face: drop direct FIB management
refs #2533

Change-Id: I33c1c8873498048970f7a485be9f6e021b286c8b
2015-06-11 11:03:21 -07:00
Alexander Afanasyev 117f5ef083 encoding: Remove SCOPE from Interests and all references to it in the related code
Change-Id: I2b19d0bb7ea5fdcea0da3996b946bb7797a9ea2d
Refs: #2345
2015-06-10 18:50:38 -07:00
Joao Pereira aa8fd16f0a name: don't restrict compare return value to {-1,0,1}
refs #2445

Change-Id: I58d75f397a70564f46a12f7f45d533057e9d1f76
2015-06-09 11:19:41 -07:00
Alexander Afanasyev 7ed294302b docs: Update installation instructions for shared library
Change-Id: I2c8b146b5f8aa73cbe9e9ded5b8359b646656148
Refs: #2243
2015-06-07 20:02:41 -07:00
Alexander Afanasyev 5519cc72e7 build: Allow compilation as a shared library
This commit introduces --enable-static, --disable-static,
--enable-shared, and --disable-shared to enable/disable compilation of
static and shared library versions (by default, only a static library is
enabled).

Building of both static and shared library versions results in
compilation of every source file twice: with and without PIC flag.

Change-Id: I64c6dc736c249b93b0c64cad15249f3b3f242c25
Refs: #2243
2015-06-07 15:27:03 -07:00
Alexander Afanasyev 09880d372e build: Update waf (a new custom patch)
https://github.com/cawka/waf/tree/2b3bb0af33c07b93a72803a332ea8286427006bc

Change-Id: I6168850b094dc90c748f81fca77761b1143c8cf9
Refs: #2243
2015-06-07 14:01:28 -07:00
Alexander Afanasyev 5208d0e1ce docs: Update client.conf manpage
Change-Id: I8b7bac4b327475a6f1c86a0418cc273855405cdf
Refs: #1906
2015-06-04 21:14:33 -07:00
Alexander Afanasyev 00f855ea86 build: Fix compilation failure on OS X 10.10 with cryptopp from MacPorts
The updated build scripts now check if application can successfully link
to CryptoPP library and re-try with extra `CRYPTOPP_DISABLE_ASM` define
if linking without the define fails.

Change-Id: I3ed3e7b43bfedde1166377fac72c697639d218f2
Refs: #2833
2015-05-28 14:59:44 -07:00
Joao Pereira 68c0d884a2 face: use lambda expression and smart pointers
Refs: #2112

Change-Id: I73aab91b0b6841c55ef2892493901a13b7382cdd
2015-05-26 08:42:38 -04:00
Davide Pesavento 9bd4d9832a data+name: don't uselessly increment totalLength in wireEncode
The variable was never used after being incremented.

Change-Id: Icdc16959004d9496ab06a43634eaceee798878d6
2015-05-13 10:41:48 -07:00
Alexander Afanasyev cbf054dd31 docs+build: Prepare release of version 0.3.2
Change-Id: I12ac7bcb711525dca18fa6847b43f37384fe4229
Refs: #2618
2015-05-12 13:39:41 -07:00
Yingdi Yu b8f8b34339 security: define new abstraction for identity, key, and certificate
Refs: #2451

Change-Id: I85dc7e0508bf10e2b73b0e9793dfc8e909e1a6e3
2015-05-12 00:33:42 -07:00
Alexander Afanasyev fc294aed9c build: Disable precompiled headers on OS X with clang < 6.1.0
Change-Id: Ie36ea54d4229239f3bbd87998dc2e2a45dad6a2b
Refs: #2804
2015-05-11 12:18:55 -07:00
Yingdi Yu adadb7108d security: Add in-memory pib
Refs: #2451

Change-Id: I943b0b51d8fe9a8911826b4f907c5f9fd94aeacc
2015-05-06 20:45:35 -07:00
Yingdi Yu 151b557f2c security: define pib-impl interface
Refs: #2451

Change-Id: I783c47a01cf541ac562511afabbb5bf0714d1ea7
2015-05-06 20:45:35 -07:00
Alexander Afanasyev ec8a53187b build: Update waf to version 1.8.9 (with custom patches)
https://github.com/cawka/waf/tree/2a098b1e9bc626c19cbd47c1f670758c17edf54c

Change-Id: I531be0d729b2413a94a77378aeaa7efba13a75fe
Refs: #2792
2015-05-06 14:49:08 -07:00
Spyridon Mastorakis c8188b3a2d interest: Add Link and SelectedDelegation fields
Change-Id: I1e4bafe8559ef87135de6cb6f209fc94dfa231b0
Refs: #2587
2015-05-05 15:55:34 -07:00
Spyridon Mastorakis 3b54e85598 link: add Link abstraction
Change-Id: I1e4bafe8559ef87135de6cb6f209fc94dfa231a3
Refs: #2587
2015-05-04 15:08:08 -07:00
Junxiao Shi ac1a653f70 common: fix NDN_CXX_DECL_FINAL macro
refs #2454

Change-Id: I0bc201fb82d2d44609d2b2b179d94488c8da541b
2015-04-30 17:34:31 -07:00
Junxiao Shi eaa15f7683 management: delete deprecated Controller functions
This commit delete to the following deprecated items:

* Controller::start overloads, except the overload taking CommandOptions
* Controller::Sign typedef
* Controller::getDefaultCommandTimeout
* ControlCommand::getPrefix
* ControlCommand::getRequestName(ControlParameters)
* Controller::Controller(Face&)

refs #2138

Change-Id: I1b632e24e83dd6044730596923ed979f3f8af365
2015-04-18 12:19:44 -07:00
Junxiao Shi f0da789bd2 encoding: Block::fromStream TLV-LENGTH bugfix
This commit fixes decoding errors when TLV-LENGTH is ASCII whitespace,
and when TLV-LENGTH is zero.

refs #2728 #2729

Change-Id: Ie1b3e9ee7068dd0a4f14fd51e97ceab1dd4d898b
2015-04-05 20:59:15 -07:00
Alexander Afanasyev c076e6d3e1 exclude: Allow excluding empty name component
Change-Id: I6eb835aec30db7dc0cd36a5b17f0a34693d34c42
Fixes: #2660
2015-04-03 13:07:34 -07:00
Alexander Afanasyev d7eacc75ed name: Make sure empty name component (...) is not skipped during URI decoding
Change-Id: I85f96711b335573156c2c00722847d187ecf194c
Refs: #2725
2015-04-03 13:07:34 -07:00
Alexander Afanasyev 17ef37d0e6 util: Avoid output duplication in IndentedStream
Change-Id: Ia530878068da89a1839574c9c5f1dc5d1de8b54e
Fixes: #2723
2015-04-02 12:17:26 -07:00
Alexander Afanasyev 0dcb6a217e build: Update waf to version 1.8.8-dev (with custom patches)
https://github.com/cawka/waf/tree/8f714a523d3b8c66f2949aaa8db91d6f7be55e55

This patch also ensures that unused-local-typedef warning does not
generate errors.

Change-Id: Ib0b2ebb745824a42770c955871b77de2f3ac0f33
Refs: #2209, #2657
2015-03-24 11:04:42 -05:00
Junxiao Shi a76bbc97ea code-style: override and final specifiers
refs #2454

Change-Id: Ia68e9a7d199df2aea8b12c340f3973cb9efd9a34
2015-03-23 11:05:37 -07:00
Davide Pesavento 50df562b4e tests: increase canonize timeout in FaceUri tests to avoid spurious failures
Also fix "succeed" vs "fail" in diagnostic message.

Change-Id: Id21baeb072a9c71caa0fd8b57ac4a00aa98a51cc
Refs: #2148
2015-03-19 22:12:00 +01:00
Junxiao Shi 895395f7f6 build: detect override & final specifiers support
refs #2454

Change-Id: I274fec7c5b6348e8b688eda2f2e13d04984d61e4
2015-03-13 11:45:33 -07:00
Ilya Moiseenko 741771f233 exclude: allow decoding Exclude containing ImplicitSha256DigestComponent
Change-Id: Ibd598adcd7a96740fe48f19cbb99e5a6e19fe121
Refs: #2629
2015-03-12 13:39:35 -07:00
Junxiao Shi 1a750b4389 encoding: mark DEPRECATED on Block::fromBuffer overloads with output parameter
refs #2553

Change-Id: I32dd0f497fcdff893d82cf41f456cfa272223dd6
2015-03-11 00:08:54 -07:00
Alexander Afanasyev a5c5a13470 build: Update version number to 0.3.1
Change-Id: Iebd1ef1cfdc95e9890e8a6017eb77be37aae6c93
Refs: #2588
2015-03-03 20:12:07 -08:00
Alexander Afanasyev ed545b3b78 docs: Prepare release notes for version 0.3.1
Change-Id: I1b2f1241af8e62d042547138f92fb2bc5f7c9265
Refs: #2588
2015-03-03 12:32:13 -08:00
Junxiao Shi bbb2435a18 util: disallow destruction of Signal from handler
refs #2313

Change-Id: Ifec8dcfe66873f88b8a39726be68f090b8c18fb3
2015-02-28 21:23:51 -07:00
Junxiao Shi 4427345833 util: fix use-after-free in UtilSignal/DisconnectSelfInHandler test case
refs #2523

Change-Id: I24e4ae6684ad5450f62cede48739b47cf57ad2b0
2015-02-28 16:35:52 -08:00
Alexander Afanasyev c89efb4d17 name: Deprecation of Name::set methods, move constructors to .cpp, and documentation update
Change-Id: Icc68cad2854130fbf99c7af3378516dce0585279
Refs: #2505
2015-02-25 21:26:43 -08:00
Junxiao Shi 02a4bf3f7f encoding: change Block::fromBuffer return type
Block::fromBuffer is changed from taking constructed Block as output parameter
to returning the constructed Block as part of returned tuple.

Old API becomes deprecated.

refs #2553

Change-Id: I64610353b8c0780ee09ebe9089c539fa27506a5e
2015-02-24 07:56:08 -08:00
Spyridon Mastorakis df5927eeaa encoding/meta-info: Delete deprecated MetaInfo::TYPE_*
Change-Id: I38c3ba68b701709a3a1b41cce327e030a391ba19
Refs: #2170
2015-02-23 18:33:27 -08:00
Spyridon Mastorakis 00fade2bc4 src: Delete deprecated ndn::ptr_lib, ndn::func_lib
Change-Id: I38c3ba68b701709a3a1b41cce327e030a391bb23
Refs: #2110
2015-02-22 21:01:43 -08:00
Spyridon Mastorakis 429634fb7d tests: Change to updated naming conventions
Change-Id: I9351c669282c3c02fd533237489beeb10fe7d16d
Refs: #2497
2015-02-21 17:35:25 -08:00
Jiewen Tan c759a20046 management: add CachingPolicy to LocalControlHeader
Breaks: NFD:commit:9cfeecaa2ffad1a1be79aed2321dcc7d042ecc5f
Breaks: ndnSIM:commit:ffe2586cfc466935c0632a5a64384f0fda709086

Change-Id: Idcce2b7ee9be31b55f9ec16c17e915d93974bff4
Refs: #2183
2015-02-16 11:39:47 -08:00
Junxiao Shi 190bee2f7d docs: remind user to reinstall ports after OSX upgrade
refs #2284

Change-Id: I7ffa654d0aa3b7215105b6012839d8443d62a15e
2015-02-16 10:42:53 -08:00
Junxiao Shi 6bf0adf52a name: fix global buffer overflow in ImplicitSha256Digest test case
refs #2307

Change-Id: I78d497094887c72db60a4a67c2b3c51227268350
2015-02-15 23:42:59 -08:00
Junxiao Shi e9c3db3e32 docs: correct function names in security library tutorial
refs #2474

Change-Id: If8ef1d715227d03d55dfd0fd46cb75ab9831a6c8
2015-02-14 19:51:28 -07:00
Alexander Afanasyev ea71967f81 util: Extend DummyClientFace to process LocalControlHeader
Change-Id: I5ab397ae585fcdc2a5e231e8ad9a819bccfb3baa
Refs: #2510
2015-02-10 21:38:36 -08:00
Alexander Afanasyev 3e7d2ac0b0 build: Explicitly define _GLIBCXX_USE_NANOSLEEP if gcc < 4.8 is used
Change-Id: I2f216ba8c602d1a81433a566318a49f17728a8dd
Refs: #2499
2015-02-10 21:30:29 -08:00
Alexander Afanasyev 746338985a encoding: Refactoring EncodingBuffer
Breaks: nfd:commit:c0273e3505ac2ccf843401be77a513d8eb663127
Breaks: ChronoSync:commit:e042f83a1df184a8e7a90ef00034d11026891cd1

Change-Id: I8275c6276c5ecfa280f87f584189907521febf5f
Refs: #2494, #2490
2015-02-10 19:00:01 -08:00
Junxiao Shi 94f21835e2 util: mark Digest<Hash>::operator== as unsuitable for security related context
refs #2395

Change-Id: Id03b89c42a3913aef5b9f18ac2b6936cf5f880e9
2015-02-07 21:31:14 -07:00
Chengyu Fan f46482c9c0 util: add isConnected() in signal::Connection and signal::ScopedConnection
Change-Id: Iddf2a084ccf137a691cd85c54003182acf0e5afd
Refs: #2308
2015-02-06 17:40:41 -08:00
Junxiao Shi 23989111a2 encoding: delete deprecated Block(std::istream&) constructor
refs #2241

Change-Id: Idf2d3ecc742a9f2e5822c401f07e88dceb649ee3
2015-02-02 20:53:22 -08:00
Alexander Afanasyev 5946ed104b docs: Prepare release notes for version 0.3.0
Change-Id: I25c1105546ac0c2108225cd578d88bbccec89cfc
Refs: #2463, #2209, #2352
2015-02-02 14:09:55 -08:00
Alexander Afanasyev cf3a667634 build: Fix conditional compilation on availability of getpass()
Change-Id: I3aa95c1b6afe2239f24642507da8090f7f58abac
Refs: #2419
2015-02-01 20:33:22 -08:00
Junxiao Shi 2586be40cb name-component: add test case for ZeroLengthComponent
refs #1933

Change-Id: I59791713c5523e10fd6aad45c5b3d3c1b32ab231
2015-02-01 18:40:36 -08:00
Alexander Afanasyev 8cf2f2cdfe tests: InMemoryStorage test cases for ImplicitSha256DigestComponent
Change-Id: I054eea2a25ce1d6c23fa10adab317b199b7d8b3d
Refs: #2194
2015-02-01 18:40:36 -08:00
Alexander Afanasyev 7b3080fcd4 util: rtnetlink-based implementation of NetworkMonitor
Change-Id: Ia25ddf14ba38181f3a831c1eaf9b417baba7c9d3
Refs: #2443
2015-02-01 18:40:26 -08:00
Alexander Afanasyev e6c65e2e58 util: NetworkMonitor helper to detect network state changes
This commit includes only OS X implementation using CoreFoundation framework

Change-Id: I8d5488ec5780e2a33bb20595391208a76b9e69dd
Refs: #2443
2015-01-29 18:04:14 -08:00
Alexander Afanasyev 9a9952f408 util: scheduler::ScopedEventId to automatically cancel scheduled events upon destruction
Change-Id: I3254983ab27480143c778baa28de7eb0409b26ce
Refs: #2442
2015-01-29 15:10:50 -08:00
Alexander Afanasyev 3188c40f8a build: Fix misdetection of getpass
Now detection uses an explicit code fragment

Change-Id: Ib5062a0ea8fcbe69914c14b3406eb5005353a2f2
Refs: #2419
2015-01-28 15:44:53 -08:00
Alexander Afanasyev 8fbcfc50b6 build: Update waf to fix function mis-detection when -Werror is present
The fix has been also submitted to waf issue tracker
(https://code.google.com/p/waf/issues/detail?id=1529)

Change-Id: I1afa7912b859942ce51aba4d7fe73f2e8a6ac912
Refs: #2419
2015-01-27 10:50:29 -08:00
Junxiao Shi a6452ac58e name: partial Name comparison
refs #2090

Change-Id: I8de11b7064a2da894f9ddb4b4b1623a7b6d5c0ae
2015-01-26 22:39:27 -08:00
Alexander Afanasyev 1286e02c15 util: Use default resolver behavior in util::dns::Resolver
As of this commit, we are using the default behavior of
boost::asio::ip::resolver (only return IPv4 addresses if a non-loopback
IPv4 address is configured for the system; only return IPv6 addresses if
a non-loopback IPv6 address is configured for the system).

Unit tests are now conditioned upon availability of IPv4/IPv6 and will
not fail if IPv4 or IPv6 addresses cannot be resolved.

Change-Id: I8d7fa9a205ad26a2ca85fd22d582ffe6b0a02a92
Refs: #2415
2015-01-26 15:07:09 -08:00
Alexander Afanasyev a2ada22022 src: Disable use of getpass() when it is not available
For example, getpass is not available on Android platform.

Change-Id: I4c3039a3fcf188fd9343d625a551d268a4a20a93
2015-01-25 12:38:38 -08:00
Alexander Afanasyev af99f4692b src: Update copyright notices for files modified in 2015
Change-Id: I44133f166a90e26887c1db8972aae651cdb72f01
Refs: #2352
2015-01-24 12:09:32 -08:00
Junxiao Shi 728873f595 util: replace EventEmitter with Signal in NotificationSubscriber
refs #2350

Breaks: nfd:commit:04cf5a99d93d8f64571753260e71ade90332f860
Breaks: nlsr:commit:c2e51f6b6b85a602275dd59bfaaa0fa0403e0978


Change-Id: I54e9b8b8f8d172826616b33e8363cd27a1c53917
2015-01-23 14:04:08 -08:00
Alexander Afanasyev c940f4bdc8 build: Update waf to 1.8.5-dev
This commit also fixes default debug mode flags for clang.

Change-Id: Icda2e7e66acaddff8678db260fd546295b9727ff
Refs: #2404
2015-01-22 13:45:21 -08:00
Alexander Afanasyev 52ec667fc3 util: Use C version of snprintf
Change-Id: I7b7240af9c6e77bce64c051d8489903456c860c1
Refs: #2299
2015-01-22 13:22:41 -08:00
Junxiao Shi 29ea8358e4 util: delete deprecated EventEmitter in DummyClientFace
refs #2319

Change-Id: Ic9f1b1c410bafc5bf079ed532f640145d0221778
2015-01-19 11:08:05 -08:00
Alexander Afanasyev 34a37630a1 security: Canonize PIB and TPM scheme names
Change-Id: I5e81b177a1047e1ede38c9f424ae34e78f7cf001
Refs: #2391
2015-01-17 11:13:08 -08:00
Stephen McQuistin e3d6266547 build: Fix bug in default-compiler-flags.py
Change-Id: I711df98863a5fef2472b583e40eb4480c8324016
2015-01-16 14:59:56 -08:00
Steve DiBenedetto 9fcc24fd75 docs: improve example applications
refs: #1976

Change-Id: I82e719ac497d3cb4eab74c1c6d02bcaa050388eb
2015-01-16 14:59:49 -08:00
Alexander Afanasyev 0711380b4c security: Refactoring creation of SecPublicInfo and SecTpm during KeyChain creation
The objective of this refactoring is to allow KeyChains with custom PIB
and TPM.  As of this commit, KeyChain no longer hard-codes PIB and TPM
instance creation.  Instead, creation is delegated to factory functions,
which need to be statically registered, e.g., using
`NDN_CXX_KEYCHAIN_REGISTER_PIB` and `NDN_CXX_KEYCHAIN_REGISTER_TPM`
macros.

Change-Id: I0d29b5ed8d74d99d8a56c4a6e9024f2587dd125e
Refs: #2384
2015-01-16 11:39:36 -08:00
Ivan Yeo ba1a4a92a9 docs: Documentation update
Update INSTALL.rst with Ubuntu 14.04 information and correct
spelling error of "Interest" in examples.rst.

Change-Id: I82a43983ca843420281eae503454ebf2dda72199
2015-01-14 08:06:15 -08:00
Yingdi Yu a90ba48259 security: improve SecPublicInfoSqlite3 error messages
Change-Id: I37f07dd4e50dde94e70c8299d60e18acf4b12449
Refs: #2274
2015-01-13 12:59:58 -08:00
Yingdi Yu 6147ef4068 tools: ndnsec-delete reports success or failure
Change-Id: I9b53fcc030fbca34acdf0c7dc3afc8ae8e8d523d
Refs: #2275
2015-01-13 12:59:58 -08:00
Yingdi Yu 4154634058 security: Pair-up Tpm and Pib in KeyChain
In this commit, we also change the HOME setting for test cases.

Change-Id: I7fa15461555b3519d9d2005c6956c167ed07d66f
Refs: #2242
Refs: #2260
2015-01-12 19:23:25 -08:00
Junxiao Shi 81a6c5dea6 encoding: ensure Block is move constructible and assignable
This commit also reorganizes function declarations in Block class,
and moves definition of some long functions into .cpp.

refs #2234

Change-Id: I2d13424b9a18fc4000af4f7350e623da9a031636
2015-01-12 16:19:47 -05:00
Junxiao Shi 316ea71a70 ci: verify every installed header compiles on its own
refs #2271

Change-Id: Ia81f7970a99342e51ef7611019dce343f25c62a2
2015-01-12 16:19:03 -05:00
Alexander Afanasyev 0151579147 build: Several updates of the build scripts
- Redesign the way default compile flags are determined.

  This includes a small semantical change with flag processing:
  * there are now "general" compiler and link flags. These are added (if
    supported) even if CXXFLAGS and/or LINKFLAGS environmental variables
    are set.
  * optimization/debug-mode flags that are applied only if CXXFLAGS
    and/or LINKFLAGS environmental variables are not set.

- Fix define constant for sqlite3.

  When pkg-config detection used, it requires `global_define` flag.
  Otherwise define is applied only when the module is included in the
  build target using 'use' statement.

- Remove openssl dependency

  This dependency was redundant for a long time

Change-Id: Icf66fb5300954893cc2d07e022b8a0998ec894e5
Refs: #2209
2015-01-11 19:34:21 -08:00
Alexander Afanasyev d7db8bfacb tools: ndnsec code reorganization
Change-Id: I94bc0e4904e90370724e8e7ccc56221e64b2ac24
2015-01-06 13:00:56 -08:00
Alexander Afanasyev 28d0d94a67 build: Support tools and examples with multiple translation units
Change-Id: I71a5690391464d8275b91f55e914c004eed4f360
Refs: #2344
2015-01-06 13:00:54 -08:00
Junxiao Shi ecc57b511e util: Signal::connectSingleShot
refs #2331

Change-Id: I96e6c362c07c8d962e59ebba2cf338761a4f110a
2015-01-03 23:32:22 -08:00
Junxiao Shi 27913b4584 util: use Signal in DummyClientFace
refs #2319

Change-Id: I99f3bfd4c0cd0179456070706b25e680d5a0827c
2015-01-03 23:32:09 -08:00
Alexander Afanasyev 4cd8d73f34 tools: Fix incorrect tag map in tlvdump
Due to a typo, tag map had incorrect number of entries.  In addition to
fixing the bug, this commit also changes map to use std::map instead of
std::vector.  This would allow us to include more known types without
the requirement of continuous numbering.

Change-Id: I9030f5ac3d2727d4af9c05fdf7fbbe9df27dfbf4
2015-01-03 23:25:48 -08:00
Alexander Afanasyev a3887ae596 base: Interest and Data packets can now be tagged with arbitrary information
This functionality is similar to StrategyInfoHost and StrategyInfo in
NFD.  Current usage will include ndnSIM, where Interest and Data ndn-cxx
packets need to be associated with ns3::Packet data structures.

Change-Id: I313e4be0f4b6eac80f3824e3fd725968e265fdce
Refs: #2336
2015-01-03 23:20:13 -08:00
Junxiao Shi a1ea50631c face: connect to Transport during construction
This allows DummyClientFace to receive packets without sending.

refs #2318

Change-Id: I7451d2c4a873e4680cfb380c9029b1edcd4af7fb
2015-01-01 11:03:38 -07:00
Junxiao Shi 018e30d6a7 util: allow emitSignal with non-zero arguments
refs #2329

Change-Id: I7708878343f87bceff3c52c9266afcfd388e8683
2014-12-30 06:54:41 -08:00
Junxiao Shi 2cec7072a3 util: fix segfault in UtilSignal/DisconnectSelfInHandler test case
refs #2302

Change-Id: I354c39b3ebdef2ed0f0403c15448e23856ab47b3
2014-12-29 12:26:53 -08:00
Junxiao Shi d27b0696c8 transport: fix includes in tcp-transport.hpp and unix-transport.hpp
refs #2332

Change-Id: I61a1f7c89f6341760bc14cef3c14b519c8eb2a28
2014-12-28 10:33:14 -07:00
Steve DiBenedetto a8659ff570 face: Make default transport configurable
This commit also removes support for the ndnd-tlv-0.7
protocol's default socket location from UnixTransport.

Test HOME environment changing has also been centralized
into a single fixture (util/test-home-environment-fixture.hpp)

refs #2189

Change-Id: Iac1a6c88d7a2d9fcfb91a20356ac21b75daf7d17
2014-12-16 22:01:41 -07:00
Alexander Afanasyev 8e131fd1d3 util: Fix incorrect iteration over entries in InMemoryStorage
Change-Id: I975b1160570ccf6f1d9f46b0e04bc6f5d04b4675
Refs: #2301, #2149
2014-12-15 23:10:15 -08:00
Junxiao Shi 0fa284566a wscript: don't install detail/*.hpp
This commit also fixes include paths in face-impl.hpp.

refs #2266

Change-Id: I1bbca6cdb6ffaab134f52a383fe3efe36106244f
2014-12-14 17:40:52 -08:00
Junxiao Shi b8901b2d85 common.hpp: mark as implementation detail
refs #2098

Change-Id: Ibe8690eab5663be961b503d57932d5a59a57b54c
2014-12-14 17:40:27 -08:00
Alexander Afanasyev e749003e88 ci: Avoid unnecessarily complicated use of find
Change-Id: I95e16732bb9fa22bb4a019ab549f38f6b7e09714
2014-12-14 16:12:08 -08:00
Junxiao Shi 8d71fdb94b util: Signal
Signal is an enhanced version of EventEmitter:

* only the owner can emit a signal (aka trigger an event)
* signal connection (aka event subscription) can be disconnected

EventEmitter is deprecated in favor of Signal.

refs #2279

Change-Id: I74ea5fef2e1e9b34776aa04f01170600b171152e
2014-12-12 09:25:56 -07:00
Junxiao Shi 71355d5dcc transport: ensure stream-transport.hpp compiles on its own
refs #2264

Change-Id: I6ab9e5968c425bf5f8413c16cde11c121cff0429
2014-12-11 09:20:44 -07:00
Junxiao Shi a4c5048a15 util: ensure concepts.hpp can compile on its own
This commit also adds comments and test cases for concept checks.

refs #2270

Change-Id: Ibc4239adf8980f5b0c0c2d73b6c4b22fb94cbf18
2014-12-07 09:57:25 +02:00
Alexander Afanasyev 24d4b93813 util: Workaround clang bug in IndentedStream implementation
Change-Id: I34771121e5193eae327d3052c2defe98295dd822
Refs: #2238
2014-12-06 23:33:35 -08:00
Hila Ben Abraham 23f9e78b6d management: change ForwarderStatus.NfdVersion to string
refs #2003
Breaks: nfd:commit:afbd74d9f18f73863927c503c0024c7e5b32ec9f
Change-Id: I195efa5633b643708165a4b1b2e60e56b8a6f17e
2014-12-06 18:05:08 -06:00
Junxiao Shi 1c69c2e0cd security: delete unused encryption-manager.hpp
refs #2268

Change-Id: Ie6d3d66a6e2cb6ea377a4c486acf35cbdcf083ff
2014-12-05 00:40:22 -08:00
Junxiao Shi 0e205cede4 security: delete deprecated signature-sha256.hpp
refs #2267

Change-Id: Ibd9cdb0fd2905da5615a89f6db01445752eabf2f
2014-12-04 12:23:43 -07:00
Junxiao Shi 08d0708901 interest: correct comment in matchesData
refs #2236

Change-Id: I8fba4d9d928103ddaa4a732721f002b85f6b9dd2
2014-12-04 11:47:20 +02:00
Junxiao Shi 2af905bf9d selectors/interest: delete deprecated constructors
Deprecated Selectors(int, int, Exclude, int, bool) and
Interest(Name, int, int, Exclude, int, bool, int, time::milliseconds, uint32_t)
constructors are deleted.

This commit also improves Doxygen documentation of Interest class.

Change-Id: Ifd6bd72a14ff97c3aea9e7dc826e7364f7c32158
2014-12-04 11:46:55 +02:00
Junxiao Shi be8d221c8c security: ensure SecuredBag::Error inherits from tlv::Error
This commit also moves definition of SecuredBag methods into .cpp.

refs #1983

Change-Id: I1a366518ed804cf19ceefa7bb5122d877fcc87c0
2014-12-04 11:40:42 +02:00
Junxiao Shi e30aaea4f8 wscript: don't install *-osx.hpp on non-OSX
refs #2269

Change-Id: Id653fdb7c5ef96e7921cc7afe7e0766ff2483768
2014-12-04 11:39:14 +02:00
Junxiao Shi 98acbb0873 security: fix memory leak in SecPublicInfoSqlite3
refs #2253

Change-Id: I8831bfa81498e9757e797218e83fd31010e2a186
2014-12-04 01:38:19 -08:00
Alexander Afanasyev bbb31f9dad util: Exposing IndentedStream class as part of public API
Change-Id: I2162a1c3e463f76e4192baf2eb618afd73082781
Refs: #2238
2014-12-03 11:44:16 -08:00
Yingdi Yu 7d8644a521 tools: Allow ndnsec-key-gen to generate ECDSA keys
Change-Id: I10bd91b1c13e180d4e6d6974431795e2e4e42fbd
Refs: #2248
2014-12-02 07:52:00 -08:00
Alexander Afanasyev 2a047eba95 tools: Allow generation of DSK using ndnsec-key-gen
Change-Id: I50ddc146bfadd6daeaba15cf34f73dcd1ac86494
Refs: #2247
2014-12-01 22:57:31 -08:00
Alexander Afanasyev ace7445592 tools: Enable ndnsec-dsk-gen
Change-Id: I079882b60924d71cad989492eb5650c36b24e413
Refs: #2246
2014-12-01 22:57:31 -08:00
Junxiao Shi e04bd83391 docs: memory needed for efficient compilation
refs #2171

Change-Id: Ibaff2c2d7c560c1efabfbf7b41a60060f137bc22
2014-11-29 23:02:38 -07:00
Junxiao Shi c97d5d41dd encoding: ensure Buffer is move constructible and assignable
refs #2234

Change-Id: Ic16914eff91bcbae89b6a66c5870a57086d9511a
2014-11-29 15:11:54 -08:00
Yingdi Yu 6ab6781b03 security: Allow KeyChain to sign interest using SHA256 digest
Change-Id: I729c5e32aeb1b9e78582becec1bc183aada6ee95
Refs: #2218
2014-11-27 22:41:05 -08:00
Yingdi Yu 3e8b52e5bd tools: Allow verbose option in ndnsec-list/ndnsec-ls-identity command line tools
Change-Id: I019ae8b8ee049529fbdc3c2ed42ffebddf664d78
Refs: #2197
2014-11-27 15:48:10 -08:00
Yingdi Yu 37339fd954 tools: Fix segmentation fault in ndnsec-sign-req
Change-Id: I586b7b366b8006723f8e892f8a23939653c73ecc
Refs: #2211
2014-11-27 13:58:19 -08:00
Junxiao Shi 8b12a5a4c6 code-style: list initialization
refs #2131

Change-Id: Ie465337d0995447a395547d77d10dd699545d618
2014-11-27 12:40:04 -08:00
Junxiao Shi 7007a3c458 interest: declare DEFAULT_INTEREST_LIFETIME as milliseconds type
In public API, this constant is described as unspecified duration type.

refs #2130

Change-Id: Ie85b6ced22461d8f6781e0a0628635c4f6a742d9
2014-11-26 20:55:13 -08:00
Qiuhan Ding 2c3cbe41e9 name: fix Component wireDecode logic error
Change-Id: Ie1c79dc256af0920f8f8ba58d6f69b0ba71a9791
Refs: #2227
2014-11-26 15:57:13 -08:00
Yingdi Yu 80979bacc4 security: Handle certificate decoding error in validation process
Change-Id: I6365db2d9fd58c4dd5d7e1f840cc85253381e03c
Refs: #2212
2014-11-26 12:03:08 -08:00
Davide Pesavento dfb8a61aa6 util: specialize std::hash<> for ethernet::Address
Change-Id: Id1263b8716d242f36e563b9aebbd2bb695fd4e5b
2014-11-25 23:34:23 +01:00
Alexander Afanasyev d3a55b29ec tests: Converting test cases to use UnitTestClock
Change-Id: I3ceaf048cc60f9cdbf98ace43f96d5c81047efd0
2014-11-21 17:00:46 -08:00
Junxiao Shi 65f1a71ebd management: ensure Element::Error inherits from tlv::Error
Add static asserts to ensure ndn::nfd::*::Error are subclasses of tlv::Error.

Add WireEncodable and WireDecodable concept checks to
ndn::nfd::* classes that represent TLV abstraction.

Move definition of ChannelStatus, FibEntry, ForwarderStatus,
StrategyChoice methods into .cpp.

Move declaration of FaceScope, FacePersistency, LinkType
into encoding/nfd-constants.hpp.

Eliminate duplicate RibFlags declaration.

refs #1983

Change-Id: I207bae479aa6da54a581a7cca5b2a13743827ff0
2014-11-21 14:39:35 -08:00
Yingdi Yu 3b4c314576 security: Display SignatureInfo when printing a certificate
Change-Id: Iba119beae6f3999159c78e2ced9130767f124372
Refs: #2196
2014-11-21 13:20:40 -08:00
Alexander Afanasyev 8b88160e94 ci: Add ability to generate unit test reports in XML format (for xUnit processing)
Change-Id: I67fdc579ed4562f7d9ac2c49f91892ddbb7c44c0
2014-11-21 12:51:01 -08:00
Alexander Afanasyev 8e15854eaf face: Reset io_service after io_service::poll()
In the case when after the io_service::poll call from the inside of
processEvents(<negative time>) there are no more handlers to dispatch,
io_service is moved to "stopped" state, which requires
io_service::reset() to be called in order for the future events to be
dispatched in subsequent poll/processEvents call.

Change-Id: I3dd4c44550a5cf6c6885f249ccfb7ba2fbf8198d
2014-11-20 19:53:28 -08:00
Junxiao Shi a464b922f1 meta-info: deprecate MetaInfo::TYPE_* constants
The following items are deprecated:

* tlv::ContentType_Default
* MetaInfo::TYPE_DEFAULT
* MetaInfo::TYPE_BLOB
* MetaInfo::TYPE_LINK
* MetaInfo::TYPE_KEY
* MetaInfo::TYPE_NACK

refs #2128

Change-Id: I01f0aa0dd27d32a18a9fff79401b5784d9ddcb10
2014-11-17 06:11:15 -08:00
Junxiao Shi 415b17cb89 management: mark Controller methods deprecated
This commit adds DEPRECATED attribute to the following items:

* Controller::start overloads, except the overload taking CommandOptions
* Controller::Sign typedef
* Controller::getDefaultCommandTimeout
* ControlCommand::getPrefix
* ControlCommand::getRequestName(ControlParameters)
* Controller::Controller(Face&)

refs #2039

Change-Id: Ib6cc81711948fa9874fe350364cd8d8613013e0d
2014-11-15 05:59:02 -08:00
Junxiao Shi a60d9363c8 util: make DummyClientFace public API
refs #2164

Change-Id: I4a21b70faab1fc1f5cde8430ef602f2425150df9
2014-11-14 12:33:11 -08:00
Alexander Afanasyev eabffdf2a9 tests: Fix issue with UnitTestClock-based event scheduling (extra sleep required)
Change-Id: I77f24f630697b6e41b3d935f0f1416e806516412
Refs: #2152
2014-11-14 11:12:55 -08:00
Alexander Afanasyev 72e4a5df3f tests: Rewrite SecurityTestCertificateCache test to use UnitTestClock
Change-Id: I592af5f6a0c8df9c074eed60475ecf5f13fe1301
Refs: #2152
2014-11-13 10:59:26 -08:00
Alexander Afanasyev 85b17b8bcd time: Add ability to specialize system and steady clocks
Default implementation is "optimized" to use boost::chrono clocks.  When
specialization is used, now() calls are redirected to the virtual
methods of the specified specialization.

This commit also includes an implementation of UnitTestClock that
can be used in unit tests to eliminate dependency on the wall clock.

Change-Id: I7ced774634d90ce32714a71e2a66129cba91b9ae
Refs: #2158
2014-11-13 10:55:22 -08:00
Junxiao Shi 95fdebe28b common.hpp: avoid conflict between std::placeholders and Boost placeholders
refs #2109

Change-Id: Ia231500e6adabd10179db4aeeaf799a28fee07dc
2014-11-12 21:41:15 -07:00
Junxiao Shi c0a8c3b9b1 code-style: auto type specifier
refs #2115

Change-Id: Ie07c8d1e3567d9b1ad395c5a74fb7bcb8cf718eb
2014-11-11 10:57:03 -07:00
Alexander Afanasyev 4c32e74886 ci: Build in debug mode for code coverage analysis
Change-Id: I3312cdf0da0a29638bb0e5223e081a805600ba6c
Refs: #2141
2014-11-10 12:27:32 -08:00
Alexander Afanasyev 56860f5cd1 interest: Updating Interest::matchesData to use ImplicitSha256DigestComponent
Change-Id: I36660cdacb73efd7f724317b247c8a07578b6fdf
Refs: #1640
2014-11-09 20:01:32 -08:00
Alexander Afanasyev afee0a5fe2 data: Enable use of ImplicitSha256Digest component in Data::getFullName
Change-Id: Ib02af6e9c40f447a1b8ab7418fecae82169ceeba
Refs: #1640
2014-11-09 20:01:20 -08:00
Alexander Afanasyev 6486d52312 name: Add support for ImplicitSha256DigestComponent
This support includes the following new API functions:

- name::Component::isImplicitSha256Digest()
- name::Component::fromImplicitSha256Digest(...)
- Name::appendImplicitSha256Digest(...)
- Updated toUri()/fromUri(...) to support "sha256digest=..." URI
  representation of the ImplicitSha256Digest component

Change-Id: I756c4b94196cf031da98b5689bd60630533dfeb3
Refs: #1640, #2088
2014-11-09 20:01:16 -08:00
Junxiao Shi eb6ddc7e6b encoding: delete deprecated tlv::ConentType
refs #2129

Change-Id: Id159f80c516ef1bd1a87b3c71c26929d7007970d
2014-11-09 11:43:39 -08:00
Junxiao Shi 2cced06cec face: delete deprecated shared_ptr<io_service> constructor and getter
refs #2097

Change-Id: I98c9875f7a8bb4decf8e7a28ee3c5c60d163f7b5
2014-11-08 06:16:22 -08:00
Junxiao Shi 28af1dc356 code-style: correct section 1 heading
Section 1 doesn't contain file naming rule, so its heading shall
be just "Code layout".

refs #2119

Change-Id: I204bdcd8443674b2fed7a8f4fd0345bdfa1ea47a
2014-11-07 14:38:40 -08:00
Junxiao Shi a93870d209 util: rewrite EventEmitter with C++11 features
This commit does not enhance the functionality of EventEmitter.

refs #2116

Change-Id: Iff1d5ae9fbd8e575773d71c7a93339045fcb8bc4
2014-11-06 21:44:45 -08:00
Yingdi Yu 90e23585a5 name: Add std::hash<Name> to support unordered_map container
Change-Id: I1edda483340fc5a891b6ae3a9cc4baf39b859621
Refs: #2147
2014-11-06 19:15:48 -08:00
Yingdi Yu 4e9b069bb8 security: Make Face optional in Validator
Change-Id: I75760e358878d8031439dd33a8200e21c69db3f8
Refs: #2124
2014-11-06 11:19:27 -08:00
Davide Pesavento 51dc2ef4df util: use C++11 features in ethernet::Address class.
Change-Id: I2740575c26d485ac13b1688cb8a74426145d8bae
2014-11-05 22:38:55 -08:00
Junxiao Shi 468abc38c3 encoding: move MAX_NDN_PACKET_SIZE constant
refs #2099

Change-Id: Ia52e32084ee7382c55d6ccc7ce71812c1854ba7f
2014-11-05 18:31:43 -08:00
Junxiao Shi cad32e3a84 meta-info: producer generated NACK
This feature is experimental, and not yet defined in NDN-TLV spec.

refs #2111

Change-Id: I93c77aedb14ba40c6ba5e3148ba355c436af6ac1
2014-11-05 18:31:31 -08:00
Junxiao Shi f4f541f183 build: disable assertions in release builds
refs #2135

Change-Id: I544725f2274d0f15b55a0c8de3acb2e801a2c993
2014-11-05 10:23:45 -08:00
Junxiao Shi c2b8d240cf base: ensure Element::Error inherits from tlv::Error
Adding static asserts to ensure (Name|name::Component|Interest|
Selectors|Exclude|KeyLocator|Data|MetaInfo|Signature|SignatureInfo)
::Error are subclasses of tlv::Error.

This commit also adds WireEncodable and WireDecodable concept checks
to Name,name::Component,Interest,Selectors,Exclude,KeyLocator,Data,
MetaInfo,SignatureInfo types.

This commit also moves definition of Selectors method into .cpp.

refs #1983

Change-Id: I15220b93437d4a624ae09df66defc91ceac2386c
2014-11-05 10:23:10 -08:00
Junxiao Shi cf69818ae5 code-style: add rule for lambda expression
refs #2114

Change-Id: I2f92b0abcf5d3a0a7d8ef95cd957a87b6e3a682a
2014-11-05 09:17:22 -08:00
Yingdi Yu e36322a8cf security: get KeyDigest from PublicKey.
Change-Id: Ibb7cf0aba262dbb80d5ea1d2da02318963c0f417
Refs: #1964
2014-11-04 18:52:04 -08:00
Junxiao Shi ae61aacbf3 code-style: prefer BOOST_ASSERT and static_assert
refs #2132

Change-Id: I203f22148fd52adcb611e8a219db18c0a8b9f2ef
2014-11-04 15:08:47 -07:00
Junxiao Shi 45c13841a3 code-style: add rule for range-based for
refs #2113

Change-Id: I0e9628892f4d2acff8d32f8e824b3481d23b97cd
2014-11-02 19:49:30 -08:00
Junxiao Shi 388ec2552c face: specify registerPrefix signing parameters with CommandOptions
refs #2039

Change-Id: I26a49f155a776e38bf04e1a797c1472f3d88178c
2014-11-02 15:37:05 -07:00
Alexander Afanasyev 6c63230ac8 build: Enable detailed version information when built from shallow clone or tarball
Change-Id: Ia2ec086dff822989ba54117678a41394e990f996
Refs: #1915
2014-11-02 13:18:53 -08:00
Junxiao Shi a034fa3044 common: deprecate ndn::ptr_lib and ndn::func_lib
refs #2095

Change-Id: Ia0db9cbea488fa2c52f2c83873167c584d1f40f1
2014-11-02 13:01:18 -08:00
Junxiao Shi edd834e01c face: internal KeyChain
refs #2039

This commit deprecates:

* nfd::Controller::Controller(Face&)

Change-Id: Iecc60c45ba6134dbcc34f58dcdf6a171e7b05253
2014-10-31 13:50:32 -07:00
Alexander Afanasyev 6f9ec931db build: Fix compilation with tests and precompiled headers enabled
Change-Id: I996c06e1340cc5d1e731daf879b209c2976fe0e0
Refs: #2102
2014-10-31 10:45:28 -07:00
Junxiao Shi 03b15b3fbb docs: amend code style rule for null pointers
refs #2101

Change-Id: Idc60c2a297a22c64186a3bb7f4a56f7e5445791f
2014-10-30 21:11:19 -07:00
Davide Pesavento dfe9c6b8c5 Always build in C++11 mode.
Change-Id: Ia25c738f63aee1b70e61f841ff52a151446ac220
Refs: #1930
2014-10-30 01:44:22 +01:00
955 changed files with 112574 additions and 54807 deletions

No files matched your search

+24 -9
View File
@@ -1,14 +1,29 @@
# Emacs temp files
# Emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
.\#*
# Mac OSX
.DS_*
# Visual Studio Code
.vscode/
# waf build system
.waf-1*
.waf3-*
.lock*
build/
# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
# Waf build system
/build/
.waf-*-*/
.waf3-*-*/
.lock-waf*
# Compiled python code
**/*.pyc
__pycache__/
*.py[cod]
# Other
/VERSION.info
+27 -4
View File
@@ -1,9 +1,32 @@
#!/usr/bin/env bash
set -e
source .jenkins.d/util.sh
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
export CACHE_DIR=${CACHE_DIR:-/tmp}
export WAF_JOBS=${WAF_JOBS:-1}
[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
for i in $( find "$DIR/.jenkins.d" -type f -perm +111 | sort ); do
echo "Run: $i"
"$i"
nanos() {
# Cannot use date(1) because macOS does not support %N format specifier
python3 -c 'import time; print(int(time.time() * 1e9))'
}
for file in .jenkins.d/*; do
[[ -f $file && -x $file ]] || continue
if [[ -n $TRAVIS ]]; then
label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
echo -ne "travis_fold:start:${label}\r"
echo -ne "travis_time:start:${label}\r"
start=$(nanos)
fi
echo "\$ $file"
"$file"
if [[ -n $TRAVIS ]]; then
finish=$(nanos)
echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
echo -ne "travis_fold:end:${label}\r"
fi
done
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -ex
if has OSX $NODE_LABELS; then
FORMULAE=(boost openssl pkg-config)
if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
FORMULAE+=(python)
fi
if [[ -n $TRAVIS ]]; then
# Travis images come with a large number of pre-installed
# brew packages, don't waste time upgrading all of them
brew list --versions "${FORMULAE[@]}" || brew update
for FORMULA in "${FORMULAE[@]}"; do
brew list --versions "$FORMULA" || brew install "$FORMULA"
done
# Ensure /usr/local/opt/openssl exists
brew reinstall openssl
else
brew update
brew upgrade
brew install "${FORMULAE[@]}"
brew cleanup
fi
elif has Ubuntu $NODE_LABELS; then
sudo apt-get -qq update
sudo apt-get -qy install g++ pkg-config python3-minimal \
libboost-all-dev libssl-dev libsqlite3-dev
if [[ $JOB_NAME == *"code-coverage" ]]; then
sudo apt-get -qy install gcovr lcov
fi
elif has CentOS-8 $NODE_LABELS; then
sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
boost-devel openssl-devel sqlite-devel
fi
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -ex
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
+40 -15
View File
@@ -1,23 +1,48 @@
#!/usr/bin/env bash
set -x
set -e
set -ex
# Cleanup
sudo ./waf distclean -j1 --color=yes
git submodule sync
git submodule update --init
COVERAGE=$( python -c "print '--with-coverage' if 'code-coverage' in '$JOB_NAME' else ''" )
if [[ -z $DISABLE_ASAN ]]; then
ASAN="--with-sanitizer=address"
fi
if [[ $JOB_NAME == *"code-coverage" ]]; then
COVERAGE="--with-coverage"
fi
if has CentOS-8 $NODE_LABELS; then
# https://bugzilla.redhat.com/show_bug.cgi?id=1721553
PCH="--without-pch"
fi
sudo rm -Rf /usr/local/include/ndn-cxx
sudo rm -f /usr/local/lib/libndn-cxx*
sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
# 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 -j$WAF_JOBS
# Configure
CXXFLAGS="-std=c++03 -pedantic -Wall -Wno-long-long -O2 -g -Werror" \
./waf -j1 configure --color=yes --with-tests --without-pch $COVERAGE
# Cleanup
./waf --color=yes distclean
# Build
./waf --color=yes -j1
# Build static and shared library in release mode without tests
./waf --color=yes configure --enable-static --enable-shared $PCH
./waf --color=yes build -j$WAF_JOBS
# Cleanup
./waf --color=yes distclean
fi
# 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 $PCH
./waf --color=yes build -j$WAF_JOBS
# (tests will be run against the debug version)
# Install
sudo ./waf -j1 --color=yes install
sudo ldconfig || true
sudo_preserve_env PATH -- ./waf --color=yes install
if has CentOS-8 $NODE_LABELS; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
if has Linux $NODE_LABELS; then
sudo ldconfig
fi
+20 -10
View File
@@ -1,19 +1,29 @@
#!/usr/bin/env bash
set -x
set -e
set -ex
# Prepare environment
rm -Rf ~/.ndnx ~/.ndn
rm -rf ~/.ndn
echo $NODE_LABELS
IS_OSX=$( python -c "print 'yes' if 'OSX' in '$NODE_LABELS'.strip().split(' ') else 'no'" )
if [[ $IS_OSX == "yes" ]]; then
echo "Unlocking OSX Keychain"
security unlock-keychain -p "named-data"
if has OSX $NODE_LABELS; then
security unlock-keychain -p named-data
fi
ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
# 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
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
# Run unit tests
./build/unit-tests -l test_suite
./build/unit-tests
+26 -6
View File
@@ -1,10 +1,30 @@
#!/usr/bin/env bash
set -x
set -e
set -ex
IS_COVR=$( python -c "print 'yes' if 'code-coverage' in '$JOB_NAME' else 'no'" )
if [[ $JOB_NAME == *"code-coverage" ]]; then
gcovr --object-directory=build \
--output=build/coverage.xml \
--exclude="$PWD/(examples|tests)" \
--root=. \
--xml
if [[ $IS_COVR == "yes" ]]; then
BASE="`pwd | sed -e 's|/|\\\/|g'`\\"
(cd build && gcovr -x -f $BASE/src -r ../ -o coverage.xml -b ./)
# Generate also a detailed HTML output, but using lcov (better results)
lcov --quiet \
--capture \
--directory . \
--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 \
--legend \
--output-directory build/coverage \
--title "ndn-cxx unit tests" \
build/coverage.info
fi
+43
View File
@@ -0,0 +1,43 @@
#!/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.
if [[ -n $DISABLE_HEADERS_CHECK ]]; then
echo 'Skipping headers check.'
exit 0
fi
if has CentOS-8 $NODE_LABELS; then
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
fi
CXX=${CXX:-g++}
STD=-std=c++14
CXXFLAGS="-O2 -Wall -Wno-unneeded-internal-declaration -Wno-unused-const-variable $(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 "Checking header ${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 headers 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
+28
View File
@@ -0,0 +1,28 @@
# CONTINUOUS INTEGRATION SCRIPTS
## Environment Variables Used in Build Scripts
- `NODE_LABELS`: space-separated list of platform properties. The included values are used by
the build scripts to select the proper behavior for different operating systems and versions.
The list should normally contain `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`.
Example values:
- `[OS_TYPE]`: `Linux`, `OSX`
- `[DISTRO_TYPE]`: `Ubuntu`, `CentOS`
- `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`, `CentOS-8`, `OSX-10.14`, `OSX-10.15`
- `JOB_NAME`: optional variable that defines the type of build job. Depending on the job type,
the build scripts can perform different tasks.
Possible values:
- empty: default build task
- `code-coverage`: debug build with tests and code coverage analysis (Ubuntu Linux is assumed)
- `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 threads used by waf, defaults to 1.
+39
View File
@@ -0,0 +1,39 @@
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}
}
export -f has
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[@]}" "$@"
}
export -f sudo_preserve_env
+9
View File
@@ -0,0 +1,9 @@
<jefft0@remap.ucla.edu> <jefft0@gmail.com>
<aa@cs.fiu.edu> <alexander.afanasyev@ucla.edu>
<davidepesa@gmail.com> <davide.pesavento@lip6.fr>
<enewberry@email.arizona.edu> <enewberry@cs.arizona.edu>
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>
+112 -7
View File
@@ -1,11 +1,116 @@
version: ~> 1.0
language: cpp
compiler:
- gcc
notifications:
email:
on_success: always
on_failure: always
os: linux
dist: bionic
arch:
- amd64
- arm64
- ppc64le
- s390x
env:
- COMPILER=g++-7
- COMPILER=g++-9
- COMPILER=clang++-6.0
- COMPILER=clang++-9
jobs:
include:
# Linux
- env: COMPILER=g++-5
- env: COMPILER=g++-6
- env: COMPILER=g++-8
- env: COMPILER=clang++-4.0
- env: COMPILER=clang++-5.0
- env: COMPILER=clang++-7
- env: COMPILER=clang++-8
- env: COMPILER=clang++-10
- env: COMPILER=clang++-11
- env: COMPILER=clang++-12
# macOS
- os: osx
osx_image: xcode9.4
env: # default compiler
- os: osx
osx_image: xcode10.1
env: # default compiler
- os: osx
osx_image: xcode10.3
env: # default compiler
- os: osx
osx_image: xcode11.3
env: # default compiler
- os: osx
osx_image: xcode11.6
env: # default compiler
- os: osx
osx_image: xcode12
env: # default compiler
allow_failures:
- env: COMPILER=g++-5
- env: COMPILER=g++-6
- env: COMPILER=clang++-4.0
- env: COMPILER=clang++-12
fast_finish: true
before_install:
- travis_retry sudo apt-get install -qq libboost1.48-all-dev libcrypto++-dev libsqlite3-dev
- |
: Adding apt repositories
case ${COMPILER} in
g++-9)
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/+packages
travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
travis_retry sudo apt-get -qq update
;;
clang++-1?)
# https://apt.llvm.org/
LLVM_REPO=${COMPILER/clang++/llvm-toolchain-${TRAVIS_DIST}}
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/${TRAVIS_DIST}/ ${LLVM_REPO%-12} main"
travis_retry sudo apt-get -qq update
;;
esac
install:
- |
: Installing C++ compiler
if [[ -n ${COMPILER} ]]; then
travis_retry sudo apt-get -qy install ${COMPILER/clang++/clang}
fi
before_script:
- |
: Setting environment variables
if [[ -n ${COMPILER} ]]; then
export CXX=${COMPILER}
fi
case ${TRAVIS_OS_NAME} in
linux) export NODE_LABELS="Linux Ubuntu Ubuntu-18.04" ;;
osx) export NODE_LABELS="OSX OSX-$(sw_vers -productVersion | cut -d . -f -2)" ;;
esac
export JOB_NAME=limited-build
export WAF_JOBS=2
- |
: Enabling workarounds
case "${TRAVIS_CPU_ARCH},${COMPILER}" in
arm64,g++*)
# Avoid exceeding the per-job time limit
export DISABLE_HEADERS_CHECK=yes
;;
ppc64le,g++-7)
# AddressSanitizer does not seem to be working
export DISABLE_ASAN=yes
;;
*,clang++-8)
# https://bugs.llvm.org/show_bug.cgi?id=40808
export DISABLE_ASAN=yes
;;
esac
- ${CXX:-c++} --version
script:
- ./.jenkins
+254 -102
View File
@@ -30,15 +30,15 @@ When using this tool, the wscript will look like:
Options are generated, in order to specify the location of boost includes/libraries.
The `check_boost` configuration function allows to specify the used boost libraries.
It can also provide default arguments to the --boost-static and --boost-mt command-line arguments.
It can also provide default arguments to the --boost-mt command-line arguments.
Everything will be packaged together in a BOOST component that you can use.
When using MSVC, a lot of compilation flags need to match your BOOST build configuration:
- you may have to add /EHsc to your CXXFLAGS or define boost::throw_exception if BOOST_NO_EXCEPTIONS is defined.
Errors: C4530
- boost libraries will try to be smart and use the (pretty but often not useful) auto-linking feature of MSVC
So before calling `conf.check_boost` you might want to disabling by adding:
conf.env.DEFINES_BOOST += ['BOOST_ALL_NO_LIB']
So before calling `conf.check_boost` you might want to disabling by adding
conf.env.DEFINES_BOOST += ['BOOST_ALL_NO_LIB']
Errors:
- boost might also be compiled with /MT, which links the runtime statically.
If you have problems with redefined symbols,
@@ -52,27 +52,60 @@ import sys
import re
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/local/lib', '/sw/lib', '/lib',
'/usr/lib/x86_64-linux-gnu', '/usr/lib/i386-linux-gnu',
'/usr/local/ndn/lib', '/opt/ndn/lib']
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include',
'/usr/local/ndn/include', '/opt/ndn/include']
BOOST_VERSION_FILE = 'boost/version.hpp'
BOOST_VERSION_CODE = '''
#include <iostream>
#include <boost/version.hpp>
int main() { std::cout << BOOST_LIB_VERSION << ":" << BOOST_VERSION << std::endl; }
'''
BOOST_SYSTEM_CODE = '''
BOOST_ERROR_CODE = '''
#include <boost/system/error_code.hpp>
int main() { boost::system::error_code c; }
'''
PTHREAD_CODE = '''
#include <pthread.h>
static void* f(void*) { return 0; }
int main() {
pthread_t th;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_create(&th, &attr, &f, 0);
pthread_join(th, 0);
pthread_cleanup_push(0, 0);
pthread_cleanup_pop(0);
pthread_attr_destroy(&attr);
}
'''
BOOST_THREAD_CODE = '''
#include <boost/thread.hpp>
int main() { boost::thread t; }
'''
BOOST_LOG_CODE = '''
#include <boost/log/trivial.hpp>
int main() { BOOST_LOG_TRIVIAL(info) << "boost_log is working"; }
'''
BOOST_LOG_SETUP_CODE = '''
#include <boost/log/trivial.hpp>
#include <boost/log/utility/setup/console.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
int main() {
using namespace boost::log;
add_common_attributes();
add_console_log(std::clog, keywords::format = "%Message%");
BOOST_LOG_TRIVIAL(info) << "boost_log_setup is working";
}
'''
# toolsets from {boost_dir}/tools/build/v2/tools/common.jam
PLATFORM = Utils.unversioned_sys_platform()
detect_intel = lambda env: (PLATFORM == 'win32') and 'iw' or 'il'
@@ -104,34 +137,37 @@ BOOST_TOOLSETS = {
def options(opt):
opt = opt.add_option_group('Boost Options')
opt.add_option('--boost-includes', type='string',
default='', dest='boost_includes',
help='''path to the directory where the boost includes are, e.g., /path/to/boost_1_55_0/stage/include''')
help='''path to the directory where the boost includes are,
e.g., /path/to/boost_1_55_0/stage/include''')
opt.add_option('--boost-libs', type='string',
default='', dest='boost_libs',
help='''path to the directory where the boost libs are, e.g., /path/to/boost_1_55_0/stage/lib''')
opt.add_option('--boost-static', action='store_true',
default=False, dest='boost_static',
help='link with static boost libraries (.lib/.a)')
help='''path to the directory where the boost libs are,
e.g., path/to/boost_1_55_0/stage/lib''')
opt.add_option('--boost-mt', action='store_true',
default=False, dest='boost_mt',
help='select multi-threaded libraries')
opt.add_option('--boost-abi', type='string', default='', dest='boost_abi',
help='''select libraries with tags (dgsyp, d for debug), see doc Boost, Getting Started, chapter 6.1''')
opt.add_option('--boost-linkage_autodetect', action="store_true", dest='boost_linkage_autodetect',
help='''select libraries with tags (gd for debug, static is automatically added),
see doc Boost, Getting Started, chapter 6.1''')
opt.add_option('--boost-linkage_autodetect', action='store_true', dest='boost_linkage_autodetect',
help="auto-detect boost linkage options (don't get used to it / might break other stuff)")
opt.add_option('--boost-toolset', type='string',
default='', dest='boost_toolset',
help='force a toolset e.g. msvc, vc90, gcc, mingw, mgw45 (default: auto)')
help='force a toolset e.g. msvc, vc90, \
gcc, mingw, mgw45 (default: auto)')
py_version = '%d%d' % (sys.version_info[0], sys.version_info[1])
opt.add_option('--boost-python', type='string',
default=py_version, dest='boost_python',
help='select the lib python with this version (default: %s)' % py_version)
help='select the lib python with this version \
(default: %s)' % py_version)
@conf
def __boost_get_version_file(self, d):
if not d:
return None
dnode = self.root.find_dir(d)
if dnode:
return dnode.find_node(BOOST_VERSION_FILE)
@@ -144,33 +180,30 @@ def boost_get_version(self, d):
if node:
try:
txt = node.read()
except (OSError, IOError):
Logs.error("Could not read the file %r" % node.abspath())
except EnvironmentError:
Logs.error('Could not read the file %r' % node.abspath())
else:
re_but1 = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.*)"', re.M)
re_but1 = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.+)"', re.M)
m1 = re_but1.search(txt)
re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+(\\d*)', re.M)
re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+(\\d+)', re.M)
m2 = re_but2.search(txt)
if m1 and m2:
return (m1.group(1), m2.group(1))
return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True).split(":")
return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True).split(':')
@conf
def boost_get_includes(self, *k, **kw):
includes = k and k[0] or kw.get('includes', None)
if includes and self.__boost_get_version_file(includes):
return includes
for d in Utils.to_list(self.environ.get('INCLUDE', '')) + BOOST_INCLUDES:
for d in self.environ.get('INCLUDE', '').split(';') + BOOST_INCLUDES:
if self.__boost_get_version_file(d):
return d
if includes:
self.end_msg('headers not found in %s' % includes)
self.end_msg('headers not found in %s' % includes, 'YELLOW')
self.fatal('The configuration failed')
else:
self.end_msg('headers not found, please provide a --boost-includes argument (see help)')
self.end_msg('headers not found, please provide a --boost-includes argument (see help)', 'YELLOW')
self.fatal('The configuration failed')
@@ -198,7 +231,9 @@ def __boost_get_libs_path(self, *k, **kw):
path = self.root.find_dir(libs)
files = path.ant_glob('*boost_*')
if not libs or not files:
for d in Utils.to_list(self.environ.get('LIB', [])) + BOOST_LIBS:
for d in self.environ.get('LIB', '').split(';') + BOOST_LIBS:
if not d:
continue
path = self.root.find_dir(d)
if path:
files = path.ant_glob('*boost_*')
@@ -211,10 +246,10 @@ def __boost_get_libs_path(self, *k, **kw):
break
if not path:
if libs:
self.end_msg('libs not found in %s' % libs)
self.end_msg('libs not found in %s' % libs, 'YELLOW')
self.fatal('The configuration failed')
else:
self.end_msg('libs not found, please provide a --boost-libs argument (see help)')
self.end_msg('libs not found, please provide a --boost-libs argument (see help)', 'YELLOW')
self.fatal('The configuration failed')
self.to_log('Found the boost path in %r with the libraries:' % path)
@@ -229,15 +264,10 @@ def boost_get_libs(self, *k, **kw):
according to the parameters
'''
path, files = self.__boost_get_libs_path(**kw)
t = []
if kw.get('mt', False):
t.append('mt')
if kw.get('abi', None):
t.append(kw['abi'])
tags = t and '(-%s)+' % '-'.join(t) or ''
files = sorted(files, key=lambda f: (len(f.name), f.name), reverse=True)
toolset = self.boost_get_toolset(kw.get('toolset', ''))
toolset_pat = '(-%s[0-9]{0,3})+' % toolset
version = '(-%s)+' % self.env.BOOST_VERSION
toolset_pat = '(-%s[0-9]{0,3})' % toolset
version = '-%s' % self.env.BOOST_VERSION
def find_lib(re_lib, files):
for file in files:
@@ -251,28 +281,109 @@ def boost_get_libs(self, *k, **kw):
name = name[3:]
return name[:name.rfind('.')]
libs = []
for lib in Utils.to_list(k and k[0] or kw.get('lib', None)):
py = (lib == 'python') and '(-py%s)+' % kw['python'] or ''
# Trying libraries, from most strict match to least one
for pattern in ['boost_%s%s%s%s%s' % (lib, toolset_pat, tags, py, version),
'boost_%s%s%s%s' % (lib, tags, py, version),
'boost_%s%s%s' % (lib, tags, version),
# Give up trying to find the right version
'boost_%s%s%s%s' % (lib, toolset_pat, tags, py),
'boost_%s%s%s' % (lib, tags, py),
'boost_%s%s' % (lib, tags)]:
self.to_log('Trying pattern %s' % pattern)
file = find_lib(re.compile(pattern), files)
if file:
libs.append(format_lib_name(file.name))
break
else:
self.end_msg('lib %s not found in %s' % (lib, path.abspath()))
self.fatal('The configuration failed')
def match_libs(lib_names, is_static):
libs = []
lib_names = Utils.to_list(lib_names)
if not lib_names:
return libs
t = []
if kw.get('mt', False):
t.append('-mt')
if kw.get('abi', None):
t.append('%s%s' % (is_static and '-s' or '-', kw['abi']))
elif is_static:
t.append('-s')
tags_pat = t and ''.join(t) or ''
ext = is_static and self.env.cxxstlib_PATTERN or self.env.cxxshlib_PATTERN
ext = ext.partition('%s')[2] # remove '%s' or 'lib%s' from PATTERN
return path.abspath(), libs
for lib in lib_names:
if lib == 'python':
# for instance, with python='27',
# accepts '-py27', '-py2', '27' and '2'
# but will reject '-py3', '-py26', '26' and '3'
tags = '({0})?((-py{2})|(-py{1}(?=[^0-9]))|({2})|({1}(?=[^0-9]))|(?=[^0-9])(?!-py))'.format(tags_pat, kw['python'][0], kw['python'])
else:
tags = tags_pat
# Trying libraries, from most strict match to least one
for pattern in ['boost_%s%s%s%s%s$' % (lib, toolset_pat, tags, version, ext),
'boost_%s%s%s%s$' % (lib, tags, version, ext),
# Give up trying to find the right version
'boost_%s%s%s%s$' % (lib, toolset_pat, tags, ext),
'boost_%s%s%s$' % (lib, tags, ext),
'boost_%s%s$' % (lib, ext),
'boost_%s' % lib]:
self.to_log('Trying pattern %s' % pattern)
file = find_lib(re.compile(pattern), files)
if file:
libs.append(format_lib_name(file.name))
break
else:
self.end_msg('lib %s not found in %s' % (lib, path.abspath()), 'YELLOW')
self.fatal('The configuration failed')
return libs
return path.abspath(), match_libs(kw.get('lib', None), False), match_libs(kw.get('stlib', None), True)
@conf
def _check_pthread_flag(self, *k, **kw):
'''
Computes which flags should be added to CXXFLAGS and LINKFLAGS to compile in multi-threading mode
Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
boost/thread.hpp will trigger a #error if -pthread isn't used:
boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
is not turned on. Please set the correct command line options for
threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
Based on _BOOST_PTHREAD_FLAG(): https://github.com/tsuna/boost.m4/blob/master/build-aux/boost.m4
'''
var = kw.get('uselib_store', 'BOOST')
self.start_msg('Checking the flags needed to use pthreads')
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# (none): in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -lpthreads: AIX (must check this before -lpthread)
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
# -pthreads: Solaris/GCC
# -mthreads: MinGW32/GCC, Lynx/GCC
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# -lpthread: GNU Linux, etc.
# --thread-safe: KAI C++
if Utils.unversioned_sys_platform() == 'sunos':
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
boost_pthread_flags = ['-pthreads', '-lpthread', '-mt', '-pthread']
else:
boost_pthread_flags = ['', '-lpthreads', '-Kthread', '-kthread', '-llthread', '-pthread',
'-pthreads', '-mthreads', '-lpthread', '--thread-safe', '-mt']
for boost_pthread_flag in boost_pthread_flags:
try:
self.env.stash()
self.env['CXXFLAGS_%s' % var] += [boost_pthread_flag]
self.env['LINKFLAGS_%s' % var] += [boost_pthread_flag]
self.check_cxx(code=PTHREAD_CODE, msg=None, use=var, execute=False, quiet=True)
self.end_msg(boost_pthread_flag)
return
except self.errors.ConfigurationError:
self.env.revert()
self.end_msg('none')
@conf
def check_boost(self, *k, **kw):
@@ -285,7 +396,10 @@ def check_boost(self, *k, **kw):
if not self.env['CXX']:
self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
params = {'lib': k and k[0] or kw.get('lib', None)}
params = {
'lib': k and k[0] or kw.get('lib', None),
'stlib': kw.get('stlib', None)
}
for key, value in self.options.__dict__.items():
if not key.startswith('boost_'):
continue
@@ -294,48 +408,70 @@ def check_boost(self, *k, **kw):
var = kw.get('uselib_store', 'BOOST')
self.start_msg('Checking boost includes')
self.env['INCLUDES_%s' % var] = inc = self.boost_get_includes(**params)
versions = self.boost_get_version(inc)
self.env.BOOST_VERSION = versions[0]
self.env.BOOST_VERSION_NUMBER = int(versions[1])
self.end_msg("%d.%d.%d" % (int(versions[1]) / 100000,
int(versions[1]) / 100 % 1000,
int(versions[1]) % 100))
if Logs.verbose:
Logs.pprint('CYAN', ' path : %s' % self.env['INCLUDES_%s' % var])
if not self.env.DONE_FIND_BOOST_COMMON:
self.find_program('dpkg-architecture', var='DPKG_ARCHITECTURE', mandatory=False)
if self.env.DPKG_ARCHITECTURE:
deb_host_multiarch = self.cmd_and_log([self.env.DPKG_ARCHITECTURE[0], '-qDEB_HOST_MULTIARCH'])
BOOST_LIBS.insert(0, '/usr/lib/%s' % deb_host_multiarch.strip())
if not params['lib']:
self.start_msg('Checking boost includes')
self.env['INCLUDES_%s' % var] = inc = self.boost_get_includes(**params)
versions = self.boost_get_version(inc)
self.env.BOOST_VERSION = versions[0]
self.env.BOOST_VERSION_NUMBER = int(versions[1])
self.end_msg('%d.%d.%d' % (int(versions[1]) / 100000,
int(versions[1]) / 100 % 1000,
int(versions[1]) % 100))
if Logs.verbose:
Logs.pprint('CYAN', ' path : %s' % self.env['INCLUDES_%s' % var])
self.env.DONE_FIND_BOOST_COMMON = True
if not params['lib'] and not params['stlib']:
return
if 'static' in kw or 'static' in params:
Logs.warn('boost: static parameter is deprecated, use stlib instead.')
self.start_msg('Checking boost libs')
suffix = params.get('static', None) and 'ST' or ''
path, libs = self.boost_get_libs(**params)
self.env['%sLIBPATH_%s' % (suffix, var)] = [path]
self.env['%sLIB_%s' % (suffix, var)] = libs
self.end_msg('ok')
path, libs, stlibs = self.boost_get_libs(**params)
self.env['LIBPATH_%s' % var] = [path]
self.env['STLIBPATH_%s' % var] = [path]
self.env['LIB_%s' % var] = libs
self.env['STLIB_%s' % var] = stlibs
self.end_msg(' '.join(libs + stlibs))
if Logs.verbose:
Logs.pprint('CYAN', ' path : %s' % path)
Logs.pprint('CYAN', ' libs : %s' % libs)
Logs.pprint('CYAN', ' shared libs : %s' % libs)
Logs.pprint('CYAN', ' static libs : %s' % stlibs)
def has_shlib(lib):
return params['lib'] and lib in params['lib']
def has_stlib(lib):
return params['stlib'] and lib in params['stlib']
def has_lib(lib):
return has_shlib(lib) or has_stlib(lib)
if has_lib('thread'):
# not inside try_link to make check visible in the output
self._check_pthread_flag(k, kw)
def try_link():
if 'system' in params['lib']:
self.check_cxx(
fragment=BOOST_SYSTEM_CODE,
use=var,
execute=False,
)
if 'thread' in params['lib']:
self.check_cxx(
fragment=BOOST_THREAD_CODE,
use=var,
execute=False,
)
if has_lib('system'):
self.check_cxx(fragment=BOOST_ERROR_CODE, use=var, execute=False)
if has_lib('thread'):
self.check_cxx(fragment=BOOST_THREAD_CODE, use=var, execute=False)
if has_lib('log') or has_lib('log_setup'):
if not has_lib('thread'):
self.env['DEFINES_%s' % var] += ['BOOST_LOG_NO_THREADS']
if has_shlib('log') or has_shlib('log_setup'):
self.env['DEFINES_%s' % var] += ['BOOST_LOG_DYN_LINK']
if has_lib('log_setup'):
self.check_cxx(fragment=BOOST_LOG_SETUP_CODE, use=var, execute=False)
else:
self.check_cxx(fragment=BOOST_LOG_CODE, use=var, execute=False)
if params.get('linkage_autodetect', False):
self.start_msg("Attempting to detect boost linkage flags")
self.start_msg('Attempting to detect boost linkage flags')
toolset = self.boost_get_toolset(kw.get('toolset', ''))
if toolset in ['vc']:
if toolset in ('vc',):
# disable auto-linking feature, causing error LNK1181
# because the code wants to be linked against
self.env['DEFINES_%s' % var] += ['BOOST_ALL_NO_LIB']
@@ -355,27 +491,43 @@ def check_boost(self, *k, **kw):
# we attempt to play with some known-to-work CXXFLAGS combinations
for cxxflags in (['/MD', '/EHsc'], []):
self.env.stash()
self.env["CXXFLAGS_%s" % var] += cxxflags
self.env['CXXFLAGS_%s' % var] += cxxflags
try:
try_link()
self.end_msg("ok: winning cxxflags combination: %s" % (self.env["CXXFLAGS_%s" % var]))
e = None
self.end_msg('ok: winning cxxflags combination: %s' % (self.env['CXXFLAGS_%s' % var]))
exc = None
break
except Errors.ConfigurationError as exc:
except Errors.ConfigurationError as e:
self.env.revert()
e = exc
exc = e
if e is not None:
self.end_msg("Could not auto-detect boost linking flags combination, you may report it to boost.py author", ex=e)
if exc is not None:
self.end_msg('Could not auto-detect boost linking flags combination, you may report it to boost.py author', ex=exc)
self.fatal('The configuration failed')
else:
self.end_msg("Boost linkage flags auto-detection not implemented (needed ?) for this toolchain")
self.end_msg('Boost linkage flags auto-detection not implemented (needed ?) for this toolchain')
self.fatal('The configuration failed')
else:
self.start_msg('Checking for boost linkage')
try:
try_link()
except Errors.ConfigurationError as e:
self.end_msg("Could not link against boost libraries using supplied options")
self.end_msg('Could not link against boost libraries using supplied options', 'YELLOW')
self.fatal('The configuration failed')
self.end_msg('ok')
@feature('cxx')
@after_method('apply_link')
def install_boost(self):
if install_boost.done or not Utils.is_win32 or not self.bld.cmd.startswith('install'):
return
install_boost.done = True
inst_to = getattr(self, 'install_path', '${BINDIR}')
for lib in self.env.LIB_BOOST:
try:
file = self.bld.find_file(self.env.cxxshlib_PATTERN % lib, self.env.LIBPATH_BOOST)
self.bld.install_files(inst_to, self.bld.root.find_node(file))
except:
continue
install_boost.done = False
+30
View File
@@ -0,0 +1,30 @@
# -*- 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()
+4 -2
View File
@@ -3,11 +3,13 @@
from waflib import TaskGen
def options(opt):
opt.add_option('--with-coverage', action='store_true', default=False, dest='with_coverage',
help='''Set compiler flags for gcc to enable code coverage information''')
opt.add_option('--with-coverage', action='store_true', default=False,
help='Add compiler flags to enable code coverage information')
def configure(conf):
if conf.options.with_coverage:
if not conf.options.debug:
conf.fatal('Code coverage flags require debug mode compilation (add --debug)')
conf.check_cxx(cxxflags=['-fprofile-arcs', '-ftest-coverage', '-fPIC'],
linkflags=['-fprofile-arcs'], uselib_store='GCOV', mandatory=True)
-91
View File
@@ -1,91 +0,0 @@
#! /usr/bin/env python
# encoding: utf-8
'''
When using this tool, the wscript will look like:
def options(opt):
opt.load('compiler_cxx cryptopp')
def configure(conf):
conf.load('compiler_cxx cryptopp')
conf.check_cryptopp()
def build(bld):
bld(source='main.cpp', target='app', use='CRYPTOPP')
Options are generated, in order to specify the location of cryptopp includes/libraries.
'''
import sys
import re
from waflib import Utils,Logs,Errors
from waflib.Configure import conf
CRYPTOPP_DIR = ['/usr', '/usr/local', '/opt/local', '/sw', '/usr/local/ndn', '/opt/ndn']
CRYPTOPP_VERSION_FILE = 'config.h'
def options(opt):
opt.add_option('--with-cryptopp', type='string', default=None, dest='cryptopp_dir',
help='''Path to where CryptoPP is installed, e.g., /usr/local''')
@conf
def __cryptopp_get_version_file(self, dir):
try:
return self.root.find_dir(dir).find_node('%s/%s' % ('include/cryptopp',
CRYPTOPP_VERSION_FILE))
except:
return None
@conf
def __cryptopp_find_root_and_version_file(self, *k, **kw):
root = k and k[0] or kw.get('path', self.options.cryptopp_dir)
file = self.__cryptopp_get_version_file(root)
if root and file:
return (root, file)
for dir in CRYPTOPP_DIR:
file = self.__cryptopp_get_version_file(dir)
if file:
return (dir, file)
if root:
self.fatal('CryptoPP not found in %s' % root)
else:
self.fatal('CryptoPP not found, please provide a --with-cryptopp=PATH argument (see help)')
@conf
def check_cryptopp(self, *k, **kw):
if not self.env['CXX']:
self.fatal('Load a c++ compiler first, e.g., conf.load("compiler_cxx")')
var = kw.get('uselib_store', 'CRYPTOPP')
mandatory = kw.get('mandatory', True)
use = kw.get('use', 'PTHREAD')
self.start_msg('Checking Crypto++ lib')
(root, file) = self.__cryptopp_find_root_and_version_file(*k, **kw)
try:
txt = file.read()
re_version = re.compile('^#define\\s+CRYPTOPP_VERSION\\s+(.*)', re.M)
match = re_version.search(txt)
if match:
self.env.CRYPTOPP_VERSION = match.group(1)
self.end_msg(self.env.CRYPTOPP_VERSION)
else:
self.fatal('CryptoPP files are present, but are not recognizable')
except:
self.fatal('CryptoPP not found or is not usable')
val = self.check_cxx(msg='Checking if CryptoPP library works',
header_name='cryptopp/config.h',
lib='cryptopp',
includes="%s/include" % root,
libpath="%s/lib" % root,
mandatory=mandatory,
use=use,
uselib_store=var)
+205 -37
View File
@@ -1,59 +1,227 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
from waflib import Logs, Configure
import platform
from waflib import Configure, Logs, Utils
def options(opt):
opt.add_option('--debug', '--with-debug', action='store_true', default=False, dest='debug',
help='''Compile in debugging mode without all optimizations (-O0)''')
opt.add_option('--with-c++11', action='store_true', default=False, dest='use_cxx11',
help='''Use C++ 11 features if available in the compiler''')
opt.add_option('--debug', '--with-debug', action='store_true', default=False,
help='Compile in debugging mode with minimal optimizations (-Og)')
def configure(conf):
areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
defaultFlags = []
conf.start_msg('Checking C++ compiler version')
if conf.options.use_cxx11:
defaultFlags += ['-std=c++0x', '-std=c++11']
cxx = conf.env.CXX_NAME # generic name of the compiler
ccver = tuple(int(i) for i in conf.env.CC_VERSION)
ccverstr = '.'.join(conf.env.CC_VERSION)
errmsg = ''
warnmsg = ''
if cxx == 'gcc':
if ccver < (5, 3, 0):
errmsg = ('The version of gcc you are using is too old.\n'
'The minimum supported gcc version is 7.4.0.')
elif ccver < (7, 4, 0):
warnmsg = ('Using a version of gcc older than 7.4.0 is not '
'officially supported and may result in build failures.')
conf.flags = GccFlags()
elif cxx == 'clang':
if Utils.unversioned_sys_platform() == 'darwin' and ccver < (9, 0, 0):
errmsg = ('The version of Xcode you are using is too old.\n'
'The minimum supported Xcode version is 9.0.')
elif ccver < (4, 0, 0):
errmsg = ('The version of clang you are using is too old.\n'
'The minimum supported clang version is 4.0.')
conf.flags = ClangFlags()
else:
defaultFlags += ['-std=c++03', '-Wno-variadic-macros', '-Wno-c99-extensions']
warnmsg = '%s compiler is unsupported' % cxx
conf.flags = CompilerFlags()
defaultFlags += ['-pedantic', '-Wall', '-Wno-long-long', '-Wno-unneeded-internal-declaration']
if errmsg:
conf.end_msg(ccverstr, color='RED')
conf.fatal(errmsg)
elif warnmsg:
conf.end_msg(ccverstr, color='YELLOW')
Logs.warn('WARNING: ' + warnmsg)
else:
conf.end_msg(ccverstr)
conf.areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
# General flags are always applied (e.g., selecting C++ language standard)
generalFlags = conf.flags.getGeneralFlags(conf)
conf.add_supported_cxxflags(generalFlags['CXXFLAGS'])
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
# corresponding environment variables are not set.
# DEFINES are always applied.
if conf.options.debug:
conf.define('_DEBUG', 1)
defaultFlags += ['-O0',
'-Og', # gcc >= 4.8
'-g3',
'-fcolor-diagnostics', # clang
'-fdiagnostics-color', # gcc >= 4.9
'-Werror',
'-Wno-error=deprecated-register',
'-Wno-error=maybe-uninitialized', # Bug #1615
]
if areCustomCxxflagsPresent:
missingFlags = [x for x in defaultFlags if x not in conf.env.CXXFLAGS]
if len(missingFlags) > 0:
Logs.warn("Selected debug mode, but CXXFLAGS is set to a custom value '%s'"
% " ".join(conf.env.CXXFLAGS))
Logs.warn("Default flags '%s' are not activated" % " ".join(missingFlags))
else:
conf.add_supported_cxxflags(defaultFlags)
extraFlags = conf.flags.getDebugFlags(conf)
if conf.areCustomCxxflagsPresent:
missingFlags = [x for x in extraFlags['CXXFLAGS'] if x not in conf.env.CXXFLAGS]
if missingFlags:
Logs.warn('Selected debug mode, but CXXFLAGS is set to a custom value "%s"'
% ' '.join(conf.env.CXXFLAGS))
Logs.warn('Default flags "%s" will not be used' % ' '.join(missingFlags))
else:
defaultFlags += ['-O2', '-g']
if not areCustomCxxflagsPresent:
conf.add_supported_cxxflags(defaultFlags)
extraFlags = conf.flags.getOptimizedFlags(conf)
if not conf.areCustomCxxflagsPresent:
conf.add_supported_cxxflags(extraFlags['CXXFLAGS'])
conf.add_supported_linkflags(extraFlags['LINKFLAGS'])
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
"""
self.start_msg('Checking allowed flags for c++ compiler')
if len(cxxflags) == 0:
return
self.start_msg('Checking supported CXXFLAGS')
supportedFlags = []
for flag in cxxflags:
if self.check_cxx(cxxflags=['-Werror', flag], mandatory=False):
supportedFlags += [flag]
for flags in cxxflags:
flags = Utils.to_list(flags)
if self.check_cxx(cxxflags=['-Werror'] + flags, mandatory=False):
supportedFlags += flags
self.end_msg(' '.join(supportedFlags))
self.env.CXXFLAGS = supportedFlags + self.env.CXXFLAGS
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
"""
if len(linkflags) == 0:
return
self.start_msg('Checking supported LINKFLAGS')
supportedFlags = []
for flags in linkflags:
flags = Utils.to_list(flags)
if self.check_cxx(linkflags=['-Werror'] + flags, mandatory=False):
supportedFlags += flags
self.end_msg(' '.join(supportedFlags))
self.env.prepend_value('LINKFLAGS', supportedFlags)
class CompilerFlags(object):
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': []}
def getDebugFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['_DEBUG']}
def getOptimizedFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']}
class GccBasicFlags(CompilerFlags):
"""
This class defines basic 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['LINKFLAGS'] += ['-fuse-ld=lld']
return flags
def getDebugFlags(self, conf):
flags = super(GccBasicFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-Og',
'-g3',
'-pedantic',
'-Wall',
'-Wextra',
'-Werror',
'-Wcatch-value=2',
'-Wextra-semi',
'-Wnon-virtual-dtor',
'-Wno-error=deprecated-declarations', # Bug #3795
'-Wno-error=maybe-uninitialized', # Bug #1615
'-Wno-unused-parameter',
]
flags['LINKFLAGS'] += ['-Wl,-O1']
return flags
def getOptimizedFlags(self, conf):
flags = super(GccBasicFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-O2',
'-g',
'-pedantic',
'-Wall',
'-Wextra',
'-Wcatch-value=2',
'-Wextra-semi',
'-Wnon-virtual-dtor',
'-Wno-unused-parameter',
]
flags['LINKFLAGS'] += ['-Wl,-O1']
return flags
class GccFlags(GccBasicFlags):
def getDebugFlags(self, conf):
flags = super(GccFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-fdiagnostics-color',
'-Wredundant-tags',
]
if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0):
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
return flags
def getOptimizedFlags(self, conf):
flags = super(GccFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-fdiagnostics-color',
'-Wredundant-tags',
]
if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0):
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
return flags
class ClangFlags(GccBasicFlags):
def getGeneralFlags(self, conf):
flags = super(ClangFlags, self).getGeneralFlags(conf)
if Utils.unversioned_sys_platform() == 'darwin':
# Bug #4296
flags['CXXFLAGS'] += [['-isystem', '/usr/local/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
def getDebugFlags(self, conf):
flags = super(ClangFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
'-Wundefined-func-template',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
if self.getCompilerVersion(conf) < (6, 0, 0):
flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
return flags
def getOptimizedFlags(self, conf):
flags = super(ClangFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
'-Wundefined-func-template',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
if self.getCompilerVersion(conf) < (6, 0, 0):
flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
return flags
+1 -1
View File
@@ -85,7 +85,7 @@ class doxygen(Task.Task):
# Override with any parameters passed to the task generator
if getattr(self.generator, 'pars', None):
for k, v in self.generator.pars.iteritems():
for k, v in self.generator.pars.items():
self.pars[k] = v
self.doxy_inputs = getattr(self, 'doxy_inputs', [])
+80 -24
View File
@@ -1,12 +1,13 @@
#! /usr/bin/env python
# encoding: utf-8
# Yingdi Yu (UCLA) 2016
'''
When using this tool, the wscript will look like:
def options(opt):
opt.tool_options('openssl')
opt.load('openssl')
def configure(conf):
conf.load('compiler_cxx openssl')
@@ -17,30 +18,85 @@ When using this tool, the wscript will look like:
'''
from waflib import Options
import re
from waflib import Utils
from waflib.Configure import conf
@conf
def check_openssl(self,*k,**kw):
root = k and k[0] or kw.get('path', None) or Options.options.with_openssl
mandatory = kw.get('mandatory', True)
var = kw.get('uselib_store', 'OPENSSL')
if root:
libcrypto = self.check_cxx(lib=['ssl', 'crypto'],
msg='Checking for OpenSSL library',
define_name='HAVE_%s' % var,
uselib_store=var,
mandatory=mandatory,
includes="%s/include" % root,
libpath="%s/lib" % root)
else:
libcrypto = self.check_cxx(lib=['ssl', 'crypto'],
msg='Checking for OpenSSL library',
define_name='HAVE_%s' % var,
uselib_store=var,
mandatory=mandatory)
OPENSSL_DIR_OSX = ['/usr/local', '/opt/local', '/usr/local/opt/openssl']
OPENSSL_DIR = ['/usr', '/usr/local', '/opt/local', '/sw']
def options(opt):
opt.add_option('--with-openssl', type='string', default=None,
dest='with_openssl', help='''Path to OpenSSL''')
opt.add_option('--with-openssl', type='string', default=None, dest='openssl_dir',
help='directory where OpenSSL is installed, e.g., /usr/local')
@conf
def __openssl_get_version_file(self, dir):
try:
return self.root.find_dir(dir).find_node('include/openssl/opensslv.h')
except:
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:
return (root, file)
openssl_dir = []
if Utils.unversioned_sys_platform() == 'darwin':
openssl_dir = OPENSSL_DIR_OSX
else:
openssl_dir = OPENSSL_DIR
if not root:
for dir in openssl_dir:
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)')
@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')
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')
if 'msg' not in kw:
kw['msg'] = 'Checking if OpenSSL library works'
if 'lib' not in kw:
kw['lib'] = ['ssl', 'crypto']
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
self.check_cxx(**kw)
+42
View File
@@ -0,0 +1,42 @@
#! /usr/bin/env python
# encoding: utf-8
from waflib import Logs, Utils, TaskGen
from waflib.Configure import conf
@conf
def check_osx_framework_cxx(conf, fw_name, **kw):
conf.check_cxx(framework_name=fw_name,
uselib_store='OSX_' + fw_name.upper(),
fragment='#include <{0}/{0}.h>\nint main() {{}}'.format(fw_name),
**kw)
@conf
def check_osx_framework_mm(conf, fw_name, **kw):
conf.check_cxx(framework_name=fw_name,
uselib_store='OSX_' + fw_name.upper(),
fragment='#import <{0}/{0}.h>\nint main() {{}}'.format(fw_name),
compile_filename='test.mm',
**kw)
@conf
def check_osx_frameworks(conf, *k, **kw):
if Utils.unversioned_sys_platform() == 'darwin':
try:
conf.check_osx_framework_cxx('CoreFoundation', mandatory=True)
conf.check_osx_framework_cxx('Security', use='OSX_COREFOUNDATION', mandatory=True)
conf.check_osx_framework_cxx('SystemConfiguration', use='OSX_COREFOUNDATION', mandatory=True)
conf.check_osx_framework_mm('Foundation', mandatory=True)
conf.check_osx_framework_mm('CoreWLAN', use='OSX_FOUNDATION', mandatory=True)
conf.define('HAVE_OSX_FRAMEWORKS', 1)
conf.env['HAVE_OSX_FRAMEWORKS'] = True
except:
Logs.warn('Building on macOS, but one or more required frameworks are not functional.')
Logs.warn('Note that the frameworks are known to work only with the Apple clang compiler.')
@TaskGen.extension('.mm')
def m_hook(self, node):
'''Alias .mm files to be compiled the same as .cpp files, clang will do the right thing.'''
return self.create_compiled_task('cxx', node)
-36
View File
@@ -1,36 +0,0 @@
#! /usr/bin/env python
# encoding: utf-8
from waflib import Logs, Utils
from waflib.Configure import conf
OSX_SECURITY_CODE='''
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
#include <Security/SecRandom.h>
#include <CoreServices/CoreServices.h>
#include <Security/SecDigestTransform.h>
int main(int argc, char **argv) {
(void)argc; (void)argv;
return 0;
}
'''
@conf
def check_osx_security(conf, *k, **kw):
if Utils.unversioned_sys_platform() == "darwin":
try:
conf.check_cxx(framework_name='CoreFoundation', uselib_store='OSX_COREFOUNDATION',
mandatory=True)
conf.check_cxx(framework_name='CoreServices', uselib_store='OSX_CORESERVICES',
mandatory=True)
conf.check_cxx(framework_name='Security', uselib_store='OSX_SECURITY',
define_name='HAVE_SECURITY', use="OSX_COREFOUNDATION",
fragment=OSX_SECURITY_CODE, mandatory=True)
conf.define('HAVE_OSX_SECURITY', 1)
conf.env['HAVE_OSX_SECURITY'] = True
except:
Logs.warn("Compiling on OSX, but CoreFoundation, CoreServices, or Security framework is not functional.")
Logs.warn("The frameworks are known to work only with Apple-specific compilers: llvm-gcc-4.2 or clang")
+5 -5
View File
@@ -52,7 +52,7 @@ Note that precompiled header must have multiple inclusion guards. If the guards
"""
import os
from waflib import Task, TaskGen, Logs, Utils
from waflib import Task, TaskGen, Utils
from waflib.Tools import c_preproc, cxx
@@ -90,8 +90,8 @@ def apply_pch(self):
if getattr(self, 'name', None):
try:
task = self.bld.pch_tasks[self.name]
self.bld.fatal("Duplicated 'pch' task with name %r" % self.name)
task = self.bld.pch_tasks["%s.%s" % (self.name, self.idx)]
self.bld.fatal("Duplicated 'pch' task with name %r" % "%s.%s" % (self.name, self.idx))
except KeyError:
pass
@@ -104,7 +104,7 @@ def apply_pch(self):
self.pch_task = task
if getattr(self, 'name', None):
self.bld.pch_tasks[self.name] = task
self.bld.pch_tasks["%s.%s" % (self.name, self.idx)] = task
@TaskGen.feature('cxx')
@TaskGen.after_method('process_source', 'propagate_uselib_vars')
@@ -129,7 +129,7 @@ def add_pch(self):
x.env.append_value('CXXFLAGS', self.env['CXXPCH_F'] + [pch.target])
class gchx(Task.Task):
run_str = '${CXX} ${ARCH_ST:ARCH} ${CXXFLAGS} ${CPPFLAGS} ${CXXPCH_FLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXXPCH_F:SRC} ${CXX_SRC_F}${SRC[0].abspath()} ${CXX_TGT_F}${TGT[0].abspath()}'
run_str = '${CXX} ${ARCH_ST:ARCH} ${CXXFLAGS} ${CXXPCH_FLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXXPCH_F:SRC} ${CXX_SRC_F}${SRC[0].abspath()} ${CXX_TGT_F}${TGT[0].abspath()} ${CPPFLAGS}'
scan = c_preproc.scan
color = 'BLUE'
ext_out=['.h']
+22
View File
@@ -0,0 +1,22 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
def options(opt):
opt.add_option('--with-sanitizer', action='store', default='', dest='sanitizers',
help='Comma-separated list of compiler sanitizers to enable [default=none]')
def configure(conf):
for san in conf.options.sanitizers.split(','):
if not san:
continue
sanflag = '-fsanitize=%s' % san
conf.start_msg('Checking if compiler supports %s' % sanflag)
if conf.check_cxx(cxxflags=['-Werror', sanflag, '-fno-omit-frame-pointer'],
linkflags=[sanflag], mandatory=False):
conf.end_msg('yes')
conf.env.append_unique('CXXFLAGS', [sanflag, '-fno-omit-frame-pointer'])
conf.env.append_unique('LINKFLAGS', [sanflag])
else:
conf.end_msg('no', color='RED')
conf.fatal('%s sanitizer is not supported by the current compiler' % san)
+8 -8
View File
@@ -44,28 +44,28 @@ def apply_sphinx(self):
task.inputs.append(conf)
confdir = conf.parent.abspath()
buildername = getattr(self, "builder", "html")
srcdir = getattr(self, "srcdir", confdir)
outdir = self.path.find_or_declare(getattr(self, "outdir", buildername)).get_bld()
doctreedir = getattr(self, "doctreedir", os.path.join(outdir.abspath(), ".doctrees"))
buildername = getattr(self, 'builder', 'html')
srcdir = getattr(self, 'srcdir', confdir)
outdir = self.path.find_or_declare(getattr(self, 'outdir', buildername)).get_bld()
doctreedir = getattr(self, 'doctreedir', os.path.join(outdir.abspath(), '.doctrees'))
task.env['BUILDERNAME'] = buildername
task.env['SRCDIR'] = srcdir
task.env['DOCTREEDIR'] = doctreedir
task.env['OUTDIR'] = outdir.abspath()
task.env['VERSION'] = "version=%s" % self.VERSION
task.env['RELEASE'] = "release=%s" % self.VERSION
task.env['VERSION'] = 'version=%s' % self.version
task.env['RELEASE'] = 'release=%s' % getattr(self, 'release', self.version)
import imp
confData = imp.load_source('sphinx_conf', conf.abspath())
if buildername == "man":
if buildername == 'man':
for i in confData.man_pages:
target = outdir.find_or_declare('%s.%d' % (i[1], i[4]))
task.outputs.append(target)
if self.install_path:
self.bld.install_files("%s/man%d/" % (self.install_path, i[4]), target)
self.bld.install_files('%s/man%d/' % (self.install_path, i[4]), target)
else:
task.outputs.append(outdir)
+7 -6
View File
@@ -1,16 +1,15 @@
#! /usr/bin/env python
# encoding: utf-8
from waflib import Options
from waflib.Configure import conf
def options(opt):
opt.add_option('--with-sqlite3', type='string', default=None,
dest='with_sqlite3', help='''Path to SQLite3, e.g., /usr/local''')
opt.add_option('--with-sqlite3', type='string', default=None, dest='sqlite3_dir',
help='directory where SQLite3 is installed, e.g., /usr/local')
@conf
def check_sqlite3(self, *k, **kw):
root = k and k[0] or kw.get('path', None) or Options.options.with_sqlite3
root = k and k[0] or kw.get('path', self.options.sqlite3_dir)
mandatory = kw.get('mandatory', True)
var = kw.get('uselib_store', 'SQLITE3')
@@ -20,12 +19,14 @@ def check_sqlite3(self, *k, **kw):
define_name='HAVE_%s' % var,
uselib_store=var,
mandatory=mandatory,
includes="%s/include" % root,
libpath="%s/lib" % root)
includes='%s/include' % root,
libpath='%s/lib' % root)
else:
try:
self.check_cfg(package='sqlite3',
args=['--cflags', '--libs'],
global_define=True,
define_name='HAVE_%s' % var,
uselib_store='SQLITE3',
mandatory=True)
except:
+57 -28
View File
@@ -1,32 +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 alphabetic 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/master/CONTRIBUTING.md.
* Jeff Thompson <jefft0@remap.ucla.edu>
* Zhenkai Zhu <http://irl.cs.ucla.edu/~zhenkai/>
* Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
* Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
* 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://wwsw.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>
* 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/>
* Junxiao Shi <http://www.cs.arizona.edu/people/shijunxiao/>
* Steve DiBenedetto <http://www.cs.colostate.edu/~dibenede/>
* Davide Pesavento <http://www.lip6.fr/actualite/personnes-fiche.php?ident=D1469>
* 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>
* Jeff Burke <https://jeff-burke.com>
* Beichuan Zhang <https://cs.arizona.edu/~bzhang>
* Lixia Zhang <https://cs.ucla.edu/~lixia>
+473 -474
View File
File diff suppressed because it is too large. Load diff
+67 -6
View File
@@ -1,22 +1,24 @@
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/.github/blob/master/CONTRIBUTING.md).
Code style
----------
ndn-cxx code is subject to [ndn-cxx code style](http://named-data.net/doc/ndn-cxx/current/code-style.html).
ndn-cxx code is subject to [ndn-cxx code style](https://named-data.net/doc/ndn-cxx/current/code-style.html).
Licensing
---------
Contributions to the library must be licensed under LGPL 3.0 or compatible license. If
you are choosing LGPL 3.0, please use the following license boilerplate in all `.hpp` and
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:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) [Year(s)] [Copyright Holder].
/*
* Copyright (c) [Year(s)] [Copyright Holder(s)].
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -39,3 +41,62 @@ you are choosing LGPL 3.0, please use the following license boilerplate in all `
* @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
Boilerplate](https://redmine.named-data.net/projects/ndn-cxx/wiki/NDN_Team_License_Boilerplate_(ndn-cxx)).
Running unit tests
------------------
To run the unit tests, ndn-cxx needs to be built with unit test support and installed
into the configured location. For example:
./waf configure --with-tests # --debug is also strongly recommended while developing
./waf
sudo ./waf install
**Note**: On Linux you also need to run `sudo ldconfig` to reconfigure dynamic loader
run-time bindings.
The simplest way to run the tests is to launch the compiled binary without any parameters:
./build/unit-tests
The [Boost.Test framework](https://www.boost.org/doc/libs/1_65_1/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:
# Run only Face test suite tests (tests/unit/face.t.cpp)
./build/unit-tests -t TestFace
# Run only test case ExpressInterestData from the same test suite
./build/unit-tests -t TestFace/ExpressInterestData
# Run Basic test case from all test suites
./build/unit-tests -t */Basic
By default, Boost.Test framework will produce verbose output only when a test case fails.
If it is desired to see verbose output (result of each test assertion), add `-l all`
option to `./build/unit-tests` command. To see test progress, you can use `-l test_suite`,
or `-p` to show a progress bar:
# Show report all log messages including the passed test notification
./build/unit-tests -l all
# Show test suite messages
./build/unit-tests -l test_suite
# Show nothing
./build/unit-tests -l nothing
# Show 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 the `--help` switch, or online on the
[Boost.Test website](https://www.boost.org/doc/libs/1_65_1/libs/test/doc/html/index.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
path during `./waf configure`), Face-related test cases may fail.
+31 -19
View File
@@ -1,30 +1,42 @@
ndn-cxx: NDN C++ library with eXperimental eXtensions
=====================================================
# ndn-cxx: NDN C++ library with eXperimental eXtensions
ndn-cxx is a C++ library, implementing Named Data Networking (NDN) primitives that can be
used to implement various NDN applications. The library is currently being used as part
of the following projects:
![Language](https://img.shields.io/badge/C%2B%2B-14-blue.svg)
[![Build Status](https://travis-ci.org/named-data/ndn-cxx.svg?branch=master)](https://travis-ci.org/named-data/ndn-cxx)
![Latest Version](https://img.shields.io/github/tag/named-data/ndn-cxx.svg?color=darkkhaki&label=latest%20version)
**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)
* [repo-ng - Next generation of NDN repository](https://github.com/named-data/repo-ng)
* [ChronoChat - Multi-user NDN chat application](https://github.com/named-data/ChronoChat)
* [ChronoSync - Sync library for multiuser realtime applications for NDN](https://github.com/named-data/ChronoSync)
* [ndn-tlv-ping - Ping Application For NDN](https://github.com/named-data/ndn-tlv-ping)
* [ndn-traffic-generator - Traffic Generator For NDN](https://github.com/named-data/ndn-traffic-generator)
* [ndn-tools - Essential NDN command-line tools](https://github.com/named-data/ndn-tools)
* [repo-ng - Next generation NDN repository](https://github.com/named-data/repo-ng)
* [ChronoSync - Sync library for multi-user real-time 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)
See the file [`docs/INSTALL.rst`](https://github.com/cawka/ndn-cxx/blob/master/docs/INSTALL.rst)
for build and install instructions.
## Documentation
Please submit any bugs or issues to the ndn-cxx issue tracker:
http://redmine.named-data.net/projects/ndn-cxx/issues
See [`docs/INSTALL.rst`](docs/INSTALL.rst) for compilation and installation instructions.
## More documentation
Extensive documentation is available on the library's [homepage](https://named-data.net/doc/ndn-cxx/).
Extensive documentation of the library is available on the library's homepage:
http://www.named-data.net/doc/ndn-cxx/
## Reporting bugs
Please submit any bugs or feature requests to the
[ndn-cxx issue tracker](https://redmine.named-data.net/projects/ndn-cxx/issues).
## Contributing
We greatly appreciate contributions to the ndn-cxx code base.
If you are new to the NDN software community, please read the
[Contributor's Guide](https://github.com/named-data/.github/blob/master/CONTRIBUTING.md)
to get started.
## License
ndn-cxx is an open source project licensed under LGPL 3.0 license. For more information about
the license, refer to [`COPYING.md`](https://github.com/named-data/ndn-cxx/blob/master/COPYING.md).
ndn-cxx is an open source project licensed under the LGPL version 3.
See [`COPYING.md`](COPYING.md) for more information.
+1
View File
@@ -0,0 +1 @@
docs/release-notes-latest.rst
+21 -19
View File
@@ -1,25 +1,27 @@
; "unix_socket" specifies the location of the NFD unix socket
unix_socket=/var/run/nfd.sock
; "protocol" determines the protocol for prefix registration
; it has a value of:
; nfd-0.1
; nrd-0.1
; ndnd-tlv-0.7
; ndnx-0.7
protocol=nrd-0.1
; "transport" specifies Face's default transport connection.
; The value can be a "unix:" or "tcp4:" Face URI.
;
; For example:
; unix:///var/run/nfd.sock
; tcp://192.0.2.1
; tcp4://example.com:6363
;
; 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, the default PIB will be used.
; Note that default PIB could be different on different system.
; If "pib" is not specified, a platform-dependent default will be used.
; If "pib" is specified, it may have a value of:
; sqlite3
; pib=sqlite3
; pib-sqlite3
;
;pib=pib-sqlite3
; "tpm" determines which Trusted Platform Module (TPM) should used by default in applications.
; If "tpm" is not specified, the default TPM will be used.
; Note that default TPM could be different on different system.
; If "tpm" is not specified, a platform-dependent default will be used.
; If "tpm" is specified, it may have a value of:
; file
; osx-keychain
; tpm=file
; tpm-osxkeychain (default on macOS)
; tpm-file (default in operating systems other than macOS)
;
;tpm=tpm-file
+201 -130
View File
@@ -1,158 +1,215 @@
.. _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 12.04 (64-bit and 32-bit)
- Ubuntu 13.10 (64-bit and 32-bit)
- OS X 10.8
- OS X 10.9
- Ubuntu 18.04 (amd64, armhf, i386)
- Ubuntu 20.04 (amd64)
- macOS 10.13
- macOS 10.14
- macOS 10.15
- CentOS 8
ndn-cxx is known to work on the following platforms, although they are not officially
supported:
- Ubuntu 14.04
- Fedora >= 20
- FreeBSD >= 10.0
- Raspberry Pi
- Debian 10 (Buster)
- Fedora >= 29
- Gentoo Linux
- Raspbian >= 2019-06-20 (Buster)
- FreeBSD >= 11.3
Prerequisites
-------------
Required:
~~~~~~~~~
Required
~~~~~~~~
- ``python`` >= 2.6
- ``libcrypto``
- ``libsqlite3``
- ``libcrypto++``
- ``pkg-config``
- Boost libraries >= 1.48
- OSX Security framework (on OSX platform only)
- GCC >= 7.4 or clang >= 4.0 (on Linux and FreeBSD)
- Xcode >= 9.0 (on macOS)
- Python >= 3.6
- pkg-config
- Boost >= 1.65.1
- OpenSSL >= 1.0.2
- 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:
- OS X
- On **Ubuntu**
Install Xcode. In Xcode Preferences > Downloads, install "Command
Line Tools".
In a terminal, enter::
If using MacPorts, dependencies can be installed using the following
commands::
sudo apt install g++ pkg-config python3-minimal libboost-all-dev libssl-dev libsqlite3-dev
sudo port install pkgconfig boost sqlite3 libcryptopp
- On **CentOS** and **Fedora**
- Ubuntu 12.04, Ubuntu 13.10
In a terminal, enter::
In a terminal, enter::
sudo dnf install gcc-c++ pkgconf-pkg-config python3 boost-devel openssl-devel sqlite-devel
sudo apt-get install build-essential
sudo apt-get install libssl-dev libsqlite3-dev libcrypto++-dev
- On **macOS**
# For Ubuntu 12.04
sudo apt-get install libboost1.48-all-dev
* Install either Xcode (from the App Store) or the Command Line Tools
(with ``xcode-select --install``)
# For Ubuntu 13.10
sudo apt-get install libboost-all-dev
* If using Homebrew (recommended), enter the following in a terminal::
- Fedora >=20
brew install boost openssl pkg-config
In a terminal, enter::
.. warning::
sudo yum install gcc-g++ git
sudo yum install openssl-devel sqlite-devel cryptopp-devel boost-devel
If a major OS upgrade is performed after installing the dependencies
with Homebrew, remember to reinstall all packages.
Optional:
~~~~~~~~~
- On **FreeBSD**
To build tutorials, manpages, and API documentation the following
dependencies need to be installed:
In a terminal, enter::
- ``doxygen``
- ``graphviz``
- ``python-sphinx`` and sphinx extensions ``sphinxcontrib-doxylink``,
``sphinxcontrib-googleanalytics``
sudo pkg install pkgconf python3 boost-libs openssl sqlite3
The following lists steps for common platforms to install these prerequisites:
Optional
~~~~~~~~
- On OS X 10.8 and 10.9 with MacPorts::
To build tutorials, manpages, and API documentation the following additional dependencies
need to be installed:
sudo port install doxygen graphviz py27-sphinx sphinx_select
sudo port select sphinx py27-sphinx
- doxygen
- graphviz
- sphinx >= 1.3
- sphinxcontrib-doxylink
# Install sphinx extensions
sudo port install py27-pip
sudo port select pip pip27
sudo pip install sphinxcontrib-doxylink sphinxcontrib-googleanalytics
The following lists the steps to install these prerequisites on various common platforms.
- On Ubuntu >= 12.04::
- On **Ubuntu**:
sudo apt-get install doxygen graphviz python-sphinx python-pip
sudo pip install sphinxcontrib-doxylink sphinxcontrib-googleanalytics
.. code-block:: sh
- On Fedora >= 20::
sudo apt install doxygen graphviz python3-pip
sudo pip3 install sphinx sphinxcontrib-doxylink
sudp yum install doxygen graphviz python-sphinx
sudo pip install sphinxcontrib-doxylink sphinxcontrib-googleanalytics
- On **CentOS** and **Fedora**:
.. code-block:: sh
sudo dnf config-manager --enable PowerTools # on CentOS only
sudo dnf install doxygen graphviz python3-pip
pip3 install --user sphinx sphinxcontrib-doxylink
- On **macOS**:
.. code-block:: sh
brew install doxygen graphviz
sudo pip install sphinx sphinxcontrib-doxylink
- On **FreeBSD**:
.. code-block:: sh
sudo pkg install doxygen graphviz py37-sphinx
Build
-----
(These are instructions to build ndn-cxx. To do development of ndn-cxx
code and update the build system, see Development.)
.. note::
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. Enter:
To build in a terminal, change directory to the ndn-cxx root, then enter:
::
.. code-block:: sh
./waf configure
./waf configure # on CentOS, add --without-pch
./waf
sudo ./waf install
This builds and installs the following items:
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:
- ``<LIBPATH>/libndn-cxx.a``: static NDN C++ library
- ``<LIBPATH>/pkgconfig/libndn-cxx.pc``: pkgconfig file storing all
neccessary flags to build against the library. For example, if
pkgconfig 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>/tlvdump``: a simple tool to dump contents of
TLV-formatted data
- ``<BINPATH>/ndncatchunks3``: a simplified equivalent to ndncatchunks2
in NDNx package
- ``<BINPATH>/ndnputchunks3``: a simplified equivalent to ndnputchunks2
in NDNx package
- ``<BINPATH>/ndnsec``: tool to manage NDN keys and certificates
- ``<BINPATH>/ndnsec-*``: convenience scripts for ``ndnsec`` tools
.. code-block:: sh
If configured with tests: ``./waf configure --with-tests``), the above
commands will also produce:
./waf configure --enable-static
- ``build/unit-tests``: A unit test binary for the library
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
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.
The installation path should be added to ``/etc/ld.so.conf`` (or in
``/etc/ld.so.conf.d``) **before** running ``sudo 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:
.. code-block:: sh
export LD_LIBRARY_PATH=/usr/local/lib
The ``./waf install`` command installs the following files:
- ``<LIBPATH>/libndn-cxx.a``: static NDN C++ library (if enabled).
- ``<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 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``: 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:
- ``build/unit-tests``: a unit test binary for the library.
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 build. To enable them, use
``--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 configure --with-examples # on CentOS, add --without-pch
./waf
sudo ./waf install
sudo ldconfig # on Linux only
To run examples:
To run the examples:
::
.. code-block:: sh
# trivial producer app
./build/examples/producer
@@ -163,75 +220,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``:
::
.. code-block:: sh
cp examples/consumer.cpp examples/my-new-consumer-app.cpp
cp examples/consumer.cpp examples/my-new-app.cpp
... # edit examples/my-new-app.cpp with your preferred editor
./waf
./build/examples/my-new-consumer-app
sudo ./waf install
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.
If it is undesirable, default flags can be easily 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
Documentation
-------------
Customizing the compiler
------------------------
ndn-cxx tutorials and API documentation can be built using the following
commands:
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:
::
.. 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`
./waf doxgyen
# 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``, manpages will automatically
be built and installed during the normal build process (i.e., during ``./waf`` and
``./waf install``). By default, manpages 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:
Development build
-----------------
The following is the suggested configure commands for development build.
The following is the suggested build procedure for development builds:
::
.. code-block:: sh
./waf configure --debug --with-tests
./waf configure --debug --with-tests # on CentOS, add --without-pch
./waf
sudo ./waf install
sudo ldconfig # on Linux only
In the development build all compiler optimizations are disabled by
default and all warnings are treated as error. 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:
::
.. code-block:: sh
CXXFLAGS="-O1 -g3" ./waf configure --debug --with-tests
...
-25
View File
@@ -1,25 +0,0 @@
ndn-cxx overview
================
ndn-cxx is a C++ library, implementing Named Data Networking (NDN) primitives that can be
used to implement various NDN applications. The library is currently being used as part of
the following projects:
- `NFD - NDN Forwarding Daemon <http://named-data.net/doc/NFD>`__
- `NLSR - Named-data Link-State Routing
protocol <https://github.com/named-data/NLSR>`__
- `repo-ng - Next generation of NDN
repository <https://github.com/named-data/repo-ng>`__
- `ChronoChat - Multi-user NDN chat
application <https://github.com/named-data/ChronoChat>`__
- `ChronoSync - Sync library for multiuser realtime applications for
NDN <https://github.com/named-data/ChronoSync>`__
- `ndn-tlv-ping - Ping Application For
NDN <https://github.com/named-data/ndn-tlv-ping>`__
- `ndn-traffic-generator - Traffic Generator For
NDN <https://github.com/named-data/ndn-traffic-generator>`__
Please submit any bugs or issues to the `ndn-cxx issue tracker
<http://redmine.named-data.net/projects/ndn-cxx/issues>`__.
.. include:: RELEASE_NOTES.rst
+3 -279
View File
@@ -1,280 +1,4 @@
.. _Release Notes:
Release Notes
+++++++++++++
ndn-cxx Release Notes
---------------------
ndn-cxx v0.2.0 (changes since version 0.1.0)
++++++++++++++++++++++++++++++++++++++++++++
Release date: August 25, 2014
New features:
^^^^^^^^^^^^^
- **Base**
+ The license under which the library is released is changed to **Lesser GNU 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
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 <http://redmine.named-data.net/issues/1761>`_)
- **Security**
+ Add ``type dir`` :ref:`trust-anchor in ValidatorConfig <validator-conf-trust-anchors>`
to add all certificates under the specified directory as trust anchors.
The new option also allow periodic reloading trust anchors, allowing dynamic trust
models.
+ Added support for multiple signature types to :ndn-cxx:`PublicKey`,
:ndn-cxx:`SecPublicInfo` abstractions
+ 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/>`_
- **Wire encoding**
+ :ndn-cxx:`Data::getFullName() <getFullName()>` method to get :ndn-cxx:`Data` packet
name with implicit digest
+ New :ndn-cxx:`Name::getSuccessor()` method to get `name successor
<http://redmine.named-data.net/issues/1677>`_
+ New in-wire refreshing of Interest's nonce
(`Issue #1758 <http://redmine.named-data.net/issues/1758>`_)
- **Management**
+ Support for :ndn-cxx:`ChannelStatus`, :ndn-cxx:`StrategyChoice` datasets
+ Defining new common Route Origins for NFD RIB management protocol
(`Issue #1719 <http://redmine.named-data.net/issues/1719>`_)
+ New RibEntry and Route data structures for RIB management protocol
(`Issue #1764 <http://redmine.named-data.net/issues/1764>`_)
+ Add support for RIB flags for setInterestFilter and registerPrefix
(`Issue #1842 <http://redmine.named-data.net/issues/1842>`_)
- **Miscellaneous tools**
+ Introduce :ndn-cxx:`Scheduler::cancelAllEvents` to cancel all previously scheduled events
(`Issue #1757 <http://redmine.named-data.net/issues/1757>`_)
+ Introduce :ndn-cxx:`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
(`Issue #1879 <http://redmine.named-data.net/issues/1879>`_)
- **Build**
+ enabled support of precompiled headers for clang and gcc compilers to speed up compilation
Updates and bug fixes:
^^^^^^^^^^^^^^^^^^^^^^
- **Base**
+ Serialization of socket write operations
(`Issue #1707 <http://redmine.named-data.net/issues/1707>`_)
+ Enforcing limit on Interest and Data packet size in :ndn-cxx:`Face::expressInterest`
and :ndn-cxx:`Face::put` methods
(`Issue #1774 <http://redmine.named-data.net/issues/1774>`_)
+ Cleaning up transport state on communication failure, so Face can try to reconnect
in the future.
+ Fix bug with Face::removePendingInterest
(`Issue #1917 <http://redmine.named-data.net/issues/1917>`_)
- **Wire encoding**
+ Nonce field is now encoded as 4-byte uint8_t value, as defined by NDN-TLV spec.
+ Optimized Data packet signing
:ndn-cxx:`KeyChain::sign` method now pre-allocates :ndn-cxx:`EncodingBuffer`, requests
unsigned portion of :ndn-cxx:`Data` using ``Data::wireEncode(EncodingBuffer, true)``,
and then appends the resulting signature and prepends :ndn-cxx:`Data` packet header.
This way there is no extra memory allocation after :ndn-cxx:`Data` packet is signed.
+ Optimized implicit digest calculation in :ndn-cxx:`Interest::matchesData` method
(`Issue #1769 <http://redmine.named-data.net/issues/1769>`_)
- **Management**
+ Add link-layer byte counts in FaceStatus data structure
(`Issue #1765 <http://redmine.named-data.net/issues/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/>`_.
+ Add checking of ``Timestamp`` and ``Nonce`` fields in signed Interest within
:ndn-cxx:`ValidatorConfig`
+ Allow validator customization using hooks:
Sub-classes of :ndn-cxx:`Validator` class can use the following hooks to fine-tune the
validation process:
* :ndn-cxx:`Validator::preCertificateValidation <preCertificateValidation>` to
process received certificate before validation.
* :ndn-cxx:`Validator::onTimeout <onTimeout>` to process interest timeout
* :ndn-cxx:`Validator::afterCheckPolicy <afterCheckPolicy>` to process validation requests.
+ Fix memory issues in :ndn-cxx:`SecPublicInfoSqlite3`
- **Miscellaneous tools**
+ Redefine method for random number generation: ``random::generateWord*`` and
``random::generateSecureWord*`` to generate cryptographically non-secure (fast) and
secure (slow) random numbers.
- Other minor fixes and corrections
Deprecated:
^^^^^^^^^^^
- ``SignatureSha256`` class, use :ndn-cxx:`DigestSha256` instead.
- All :ndn-cxx:`Face` constructors that accept ``shared_ptr<io_service>``.
Use versions that accept reference to ``io_service`` object.
- ``Face::ioService`` method, use :ndn-cxx:`Face::getIoService` instead.
- :ndn-cxx:`Interest` constructor that accepts name, individual selectors, and individual
guiders as constructor parameters.
Use ``Interest().setX(...).setY(...)`` or use the overload taking ``Selectors``
- ``name::Component::toEscapedString`` method, use :ndn-cxx:`name::Component::toUri` instead.
- ``SecPublicInfo::addPublicKey`` method, use :ndn-cxx:`SecPublicInfo::addKey` instead.
- ``Tlv::ConentType`` constant (typo), use ``Tlv::ContentType`` instead.
- ``CommandInterestGenerator`` and ``CommandInterestValidator`` utility classes.
:ndn-cxx:`ValidatorConfig` should be used instead.
Removed:
^^^^^^^^
- support of ndnd-tlv (only NFD management protocol is supported now)
- ``SecPublicInfoMemory`` and ``SecTpmMemory`` classes that were no longer used
- Removing concept of periodic event from :ndn-cxx:`Scheduler`.
In applications, periodic events should be just re-scheduled within the callback for
single-shot events.
ndn-cxx v0.1.0
++++++++++++++
Release date: May 7, 2014
Version 0.1.0 is the initial release of ndn-cxx, an NDN C++ library with eXperimental
eXtensions.
Originally based on `ndn-cpp library <https://github.com/named-data/ndn-cpp>`_ the ndn-cxx
library adopts a slightly different design philosophy (including an extensive use of Boost
libraries to facilitate development, as well as the use of Crypto++ library to support
cryptographic operations), and includes a number of extensions that aim to simplify NDN
application development.
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>`_
+ 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>`_
+ 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>`_
- 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
integration service compile and verify correctness of the library for each commit
- **Wire format**
+ Full support of `NDN-TLV packet format v0.1 <http://named-data.net/doc/NDN-TLV/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
In many cases, NDN packet abstractions are just "indices" to the wire format
- **Communication with the forwarder**
+ Enable connecting to local forwarder via UNIX and TCP transports and to remote
forwarders using TCP transport
+ Full support for communication with `Named Data Networking Forwarding Daemon (NFD)
<https://github.com/named-data/NFD>`_
- Full support for `NFD management protocols
<http://redmine.named-data.net/projects/nfd/wiki/Management>`_ to NFD status
information, create and manage NFD Faces, receive NFD Face status change
notifications, update StrategyChoice for namespaces, and manage routes in RIB
- Support for `LocalControlHeader
<http://redmine.named-data.net/projects/nfd/wiki/LocalControlHeader>`_ to implement
special NDN applications that need low-level control of NDN packet forwarding
- **Security support**
+ A set of security primitives to allowing implementation of secure NDN applications in
a simplified manner
- **KeyChain**: provides simple interfaces of packet signing, and key and certificate
management
- **ValidatorConfig**: validator that implements trust model defined in a configuration
file
- **CommandInterestGenerator** and **CommandInterestValidator**: convenient helpers to produce
and validate command interests, while preventing potential replay attacks
+ Several implementations of trusted platform modules to securely manage private keys
- **SecTpmOsx**: TPM based on OSX KeyChain (OSX-specific)
- **SecTpmFile**: TPM that uses file-based access control to protect keys (cross-platform)
+ Extensive set of security command-line tools to manage security identities and certificates
- Generating private/public keys
- Issuing certificates
- Exporting/importing identities
- Managing default security settings
- **Miscellaneous tools**
+ Scheduler to support delayed time operations
+ NDN regular expressions
+ Simple config file to alter various aspects of the library
+ **tlvdump**: a simple tool to visualize TLV-encoded blocks
.. include:: release-notes-latest.rst
+340 -159
View File
@@ -7,10 +7,10 @@ Based on
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/>`_
The original document available at `<https://named-data.net/codebase/platform/documentation/ndn-platform-development-guidelines/cpp-code-guidelines/>`_
1. Code layout and file naming
------------------------------
1. Code layout
--------------
1.1. The code layout should generally follow the GNU coding standard layout for C,
extended it to C++.
@@ -52,7 +52,7 @@ extended it to C++.
} // namespace example
Note that code inside namespace is **not** indented. Avoid following:
Note that code inside namespace is **not** indented. Avoid the following:
.. code-block:: c++
@@ -65,7 +65,7 @@ extended it to C++.
//
// } // namespace example
1.4. The class declarations should have the following form:
1.4. Class declarations should have the following form:
.. code-block:: c++
@@ -73,21 +73,25 @@ extended it to C++.
{
public:
... <public methods> ...
protected:
... <protected methods> ...
private:
... <private methods> ...
public:
... <public data> ...
protected:
... <protected data> ...
private:
... <private data> ...
};
``public``, ``protected``, ``private`` may be repeated several times without
interleaving (e.g., public, public, public, private, private) if this allows better
interleaving (e.g., public, public, public, private, private) if this improves
readability of the code.
Nested classes can be defined in appropriate visibility section, either in methods
@@ -135,23 +139,6 @@ extended it to C++.
statements;
}
or (less preferred):
.. code-block:: c++
if (condition)
{
statements;
}
else if (condition)
{
statements;
}
else
{
statements;
}
1.7. A ``for`` statement should have the following form:
.. code-block:: c++
@@ -160,23 +147,14 @@ extended it to C++.
statements;
}
or (less preferred):
.. code-block:: c++
for (initialization; condition; update)
{
statements;
}
An empty for statement should have the following form:
An empty ``for`` statement should have the following form:
.. code-block:: c++
for (initialization; condition; update)
;
This emphasizes the fact that the for statement is empty and it makes it obvious for
This emphasizes the fact that the ``for`` statement is empty and makes it obvious for
the reader that this is intentional. Empty loops should be avoided however.
1.8. A ``while`` statement should have the following form:
@@ -187,15 +165,6 @@ extended it to C++.
statements;
}
or (less preferred):
.. code-block:: c++
while (condition)
{
statements;
}
1.9. A ``do-while`` statement should have the following form:
.. code-block:: c++
@@ -209,15 +178,63 @@ extended it to C++.
.. code-block:: c++
switch (condition) {
case ABC:
statements;
// Fallthrough
case ABC: // 2 space indent
statements; // 4 space indent
NDN_CXX_FALLTHROUGH;
case DEF:
case DEF:
statements;
break;
case XYZ: {
statements;
break;
}
default:
statements;
break;
}
When curly braces are used inside a ``case`` block, the braces must cover the entire
``case`` block.
.. code-block:: c++
switch (condition) {
// Correct style
case A0: {
statements;
break;
}
// Correct style
case A1: {
statements;
NDN_CXX_FALLTHROUGH;
}
// Incorrect style: braces should cover the entire case block
case B: {
statements;
}
statements;
break;
case XYZ:
default:
break;
}
The following style is still allowed when none of the ``case`` blocks has curly braces.
.. code-block:: c++
switch (condition) {
case ABC: // no indent
statements; // 2 space indent
NDN_CXX_FALLTHROUGH;
case DEF:
statements;
break;
@@ -226,32 +243,11 @@ extended it to C++.
break;
}
or (less preferred):
.. code-block:: c++
switch (condition)
{
case ABC:
statements;
// Fallthrough
case DEF:
statements;
break;
case XYZ:
statements;
break;
default:
statements;
break;
}
The explicit ``Fallthrough`` comment should be included whenever there is a case
statement 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.
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,
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.
1.11. A ``try-catch`` statement should have the following form:
@@ -260,23 +256,10 @@ extended it to C++.
try {
statements;
}
catch (Exception& exception) {
catch (const Exception& exception) {
statements;
}
or (less preferred):
.. code-block:: c++
try
{
statements;
}
catch (Exception& exception)
{
statements;
}
1.12. The incompleteness of split lines must be made obvious.
.. code-block:: c++
@@ -290,9 +273,9 @@ extended it to C++.
...
}
Split lines occurs when a statement exceed the 80 column limit given above. It is
Split lines occur when a statement exceeds the column limit given in rule 1.1. It is
difficult to give rigid rules for how lines should be split, but the examples above should
give a general hint.In general:
give a general hint. In general:
* Break after a comma.
* Break after an operator.
@@ -300,7 +283,7 @@ extended it to C++.
Exceptions:
* The following is the standard practice with operator<<:
* The following is standard practice with ``operator<<``:
.. code-block:: c++
@@ -322,6 +305,118 @@ should take the following form:
Each initialization should be put on a separate line, starting either with the colon
for the first initialization or with comma for all subsequent initializations.
1.14. A range-based ``for`` statement should have the following form:
.. code-block:: c++
for (T i : range) {
statements;
}
1.15. A lambda expression should have the following form:
.. code-block:: c++
[&capture1, capture2] (T1 arg1, T2 arg2) {
statements;
}
[&capture1, capture2] (T1 arg1, T2 arg2) mutable {
statements;
}
[this] (T arg) {
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;
}
[=] (T arg) {
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.
``()`` is required by the C++ standard when ``mutable`` or a trailing return type is used.
.. code-block:: c++
[] (T arg) -> int {
statements;
}
[] () -> int {
statements;
}
If the function body has only one line, and the whole lambda expression can fit in one line,
the following form is also acceptable:
.. code-block:: c++
[&capture1, capture2] (T1 arg1, T2 arg2) { statement; }
No-op can be written in a more compact form:
.. code-block:: c++
[]{}
1.16. List initialization should have the following form:
.. code-block:: c++
T object{arg1, arg2};
T{arg1, arg2};
new T{arg1, arg2};
return {arg1, arg2};
function({arg1, arg2}, otherArgument);
object[{arg1, arg2}];
T({arg1, arg2})
class Class
{
private:
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
---------------------
@@ -337,7 +432,6 @@ extension ``.cpp``
my-class.hpp, my-class.cpp
2.2. Names representing types must be written in English in mixed case starting with upper case.
.. code-block:: c++
@@ -365,11 +459,11 @@ to separate words.
static const double PI = 3.14;
In some cases, it is a better (or is the only way for complex constants in header-only
classes) to implement the value as a method:
classes) to implement the value as a method.
.. code-block:: c++
int
static int // declare constexpr if possible
getMaxIterations()
{
return 25;
@@ -404,19 +498,19 @@ written in mixed case starting with lower case.
} // namespace analyzer
} // namespace model
2.7. Names representing generic template types should be a single uppercase letter
2.7. Names representing generic template types should be a single uppercase letter.
.. code-block:: c++
template<class T> ...
template<class C, class D> ...
However, when template parameter represents a certain concept and expected to have a
certain interface, the name should be explicitly spelled out:
However, when a template parameter represents a certain concept and is expected
to have a certain interface, the name should be explicitly spelled out.
.. code-block:: c++
template<class FaceBase> ...
template<class InputIterator> ...
template<class Packet> ...
2.8. Abbreviations and acronyms must not be uppercase when used as name.
@@ -449,7 +543,6 @@ written in mixed case starting with lower case.
static std::string s_name;
};
2.11. Variables with a large scope should have long (explicit) names, variables with a small
scope can have short names.
@@ -517,16 +610,11 @@ scope can have short names.
The notation is taken from mathematics where it is an established convention for
indicating a number of objects.
2.18. The suffix ``No`` should be used for variables representing an entity number.
2.18. The suffix ``Num`` or ``No`` should be used for variables representing an entity number.
.. code-block:: c++
tableNo, employeeNo
The notation is taken from mathematics where it is an established convention for
indicating an entity number. An elegant alternative is to prefix such variables with
an ``i``: ``iTable``, ``iEmployee``. This effectively makes them named iterators.
tableNum, tableNo, employeeNum, employeeNo
2.19. The prefix ``is``, ``has``, ``need``, or similar should be used for boolean variables and
methods.
@@ -581,9 +669,9 @@ notation).
2.24. Exceptions can be suffixed with either ``Exception`` (e.g., ``SecurityException``) or
``Error`` (e.g., ``SecurityError``).
The recommended method is to declare exception class ``Exception`` or ``Error`` as an
inner class, from which the exception is thrown. For example, when declaring class
``Foo`` that can throw errors, one can write the following:
The recommended method is to declare an exception class ``Exception`` or ``Error`` as
a nested type inside the class from which the exception is thrown. For example, when
defining a class ``Foo`` that can throw errors, one can write the following:
.. code-block:: c++
@@ -591,12 +679,16 @@ notation).
class Foo
{
public:
class Error : public std::runtime_error
{
public:
explicit
Error(const std::string& what)
: std::runtime_error(what)
// You can inherit constructors from std::runtime_error like this:
using std::runtime_error::runtime_error;
// Additional constructors, if desired, can be declared as usual:
Error(const std::string& what, const std::exception& inner)
: std::runtime_error(what + ": " + inner.what())
{
}
};
@@ -606,7 +698,6 @@ notation).
hierarchy, then child classes should should define their own ``Error`` or
``Exception`` classes that are inherited from the parent's Error class.
2.25. Functions (methods returning something) should be named after what they return and
procedures (void methods) after what they do.
@@ -622,8 +713,8 @@ not in the primary processing path.
3.2. Header files must contain an include guard.
For example, header file located in ``module/class-name.hpp`` or in
``src/module/class-name.hpp`` should have header guard in the following form:
For example, a header file named ``module/class-name.hpp`` or
``src/module/class-name.hpp`` should have a header guard in the following form:
.. code-block:: c++
@@ -632,40 +723,43 @@ not in the primary processing path.
...
#endif // APP_MODULE_CLASS_NAME_HPP
The name should follow the location of the file inside the source tree and prevents
naming conflicts. Header guard should be prefixed with the application/library name
to avoid conflicts with other packaged and libraries.
The macro name should reflect the path of the header file relative to the root of the
source tree, in order to prevent naming conflicts. The header guard should be prefixed
with the application/library name to avoid conflicts with other packages and libraries.
3.3. Header files which are in the same source distribution should be included in
``"quotes"``, if possible with a path relative to the source file. Header files for
system and other external libraries should be included in ``<angle brackets>``.
3.3. Include directives for system headers and other external libraries should use
``<angle brackets>``. Header files in the same source code repository should be included
using ``"quotes"``.
.. code-block:: c++
#include "ndn-cxx/util/random.hpp"
#include <string>
#include <boost/lexical_cast.hpp>
#include "util/random.hpp"
All of a project's header files should be included with their path relative to
the project's source directory. The use of UNIX directory shortcuts ``.``
(the current directory) and ``..`` (the parent directory) is discouraged.
3.4. Include statements should be sorted and grouped. Sorted by their hierarchical position
in the system with low level files included first. Leave an empty line between groups
of include statements.
3.4. Include statements should be grouped. Same-project headers should be included first.
Leave an empty line between groups of include statements. Sort alphabetically within a group.
For example, the include section of ``ndn-cxx/foo/bar.cpp`` may look like this:
.. code-block:: c++
#include "ndn-cxx/impl/pending-interest.hpp"
#include "ndn-cxx/util/random.hpp"
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <boost/lexical_cast.hpp>
#include <boost/regex.hpp>
#include "detail/pending-interest.hpp"
#include "util/random.hpp"
3.5. Types that are local to one file only can be declared inside that file.
3.6. Implicit conversion is generally allowed.
Implicit conversion between integer and floating point numbers can cause problems and
@@ -679,11 +773,10 @@ of include statements.
``const_cast`` instead where appropriate. Use ``static_pointer_cast``,
``dynamic_pointer_cast``, ``const_pointer_cast`` when dealing with ``shared_ptr``.
3.7. Variables should be initialized where they are declared.
This ensures that variables are valid at any time. Sometimes it is impossible to
initialize a variable to a valid value where it is declared:
initialize a variable to a valid value where it is declared.
.. code-block:: c++
@@ -693,21 +786,20 @@ of include statements.
In these cases it should be left uninitialized rather than initialized to some phony
value.
3.8. In most cases, class instance variables should not be declared public.
3.8. In most cases, class data members should not be declared ``public``.
The concepts of information hiding and encapsulation are violated by public variables. Use
private variables and access methods instead.
Public data members violate the concepts of information hiding and encapsulation.
Use private variables and public accessor methods instead.
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 PODS). In this case it is appropriate to make
the instance variables public by using struct.
* 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 used only inside the compilation unit, e.g., when implementing pImpl
* When the class is used only inside the compilation unit, e.g., when implementing pImpl
idiom (aka Bridge pattern) or similar cases.
3.9. C++ pointers and references should have their reference symbol next to the type rather
than to the name.
@@ -723,23 +815,19 @@ than to the name.
if (nLines != 0) // NOT: if (nLines)
if (value != 0.0) // NOT: if (value)
3.11. When checking if ``shared_ptr`` points to an object, explicit ``static_cast<bool>``
must be used.
``shared_ptr`` in C++11 (unlike ``boost::shared_ptr``) does not have implicit
conversion to bool.
3.11. *(removed)*
3.12. Loop variables should be initialized immediately before the loop.
.. code-block:: c++
isDone = false; // NOT: bool isDone = false;
bool isDone = false; // NOT: bool isDone = false;
while (!isDone) { // // other stuff
: // while (!isDone) {
} // :
... // while (!isDone) {
} // ...
// }
3.13. The form while (true) should be used for infinite loops.
3.13. The form ``while (true)`` should be used for infinite loops.
.. code-block:: c++
@@ -772,7 +860,7 @@ instead.
// }
By assigning boolean variables to expressions, the program gets automatic
documentation. The construction will be easier to read, debug and maintain.
documentation. The construction will be easier to read, debug, and maintain.
3.15. The conditional should be put on a separate line.
@@ -802,11 +890,11 @@ instead.
should be considered declared as named constants instead.
If the number does not have an obvious meaning by itself, the readability is enhanced
by introducing a named constant instead. A different approach is to introduce a method
by introducing a named constant instead. A different approach is to introduce a method
from which the constant can be accessed.
3.18. Floating point constants should always be written with decimal point, at least one
decimal, and without omitting 0 before decimal point.
3.18. Floating point literals should always be written with a decimal point, at least one
decimal, and without omitting 0 before the decimal point.
.. code-block:: c++
@@ -819,11 +907,11 @@ should be considered declared as named constants instead.
3.19. ``goto`` should not be used.
Goto statements violate the idea of structured code. Only in some very few cases (for
instance breaking out of deeply nested structures) should goto be considered, and only if
the alternative structured counterpart is proven to be less readable.
``goto`` statements violate the idea of structured code. Only in very few cases (for
instance, breaking out of deeply nested structures) should ``goto`` be considered,
and only if the alternative structured counterpart is proven to be less readable.
3.20. "0" should be used instead of "NULL".
3.20. ``nullptr`` should be used to represent a null pointer, instead of "0" or "NULL".
3.21. Logical units within a block should be separated by one blank line.
@@ -871,7 +959,7 @@ the alternative structured counterpart is proven to be less readable.
3.24. All comments should be written in English.
In an international environment English is the preferred language.
In an international environment, English is the preferred language.
3.25. Use ``//`` for all comments, including multi-line comments.
@@ -888,7 +976,7 @@ the alternative structured counterpart is proven to be less readable.
always start with an upper case letter and end with a period.
However, method and class documentation comments should use ``/** */`` style for
Doxygen, JavaDoc and JSDoc.
Doxygen, JavaDoc and JSDoc. License boilerplate should use ``/* */`` style.
3.26. Comments should be included relative to their position in the code.
@@ -906,3 +994,96 @@ the alternative structured counterpart is proven to be less readable.
}
This is to avoid that the comments break the logical structure of the program.
3.27. Use ``BOOST_ASSERT`` and ``BOOST_ASSERT_MSG`` for runtime assertions.
.. code-block:: c++
int x = 1;
int y = 2;
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.
3.28. Use ``static_assert`` for static assertions.
.. code-block:: c++
class BaseClass
{
};
class DerivedClass : public BaseClass
{
};
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.
.. code-block:: c++
std::vector<int> intVector;
auto i = intVector.find(4);
auto stringSet = std::make_shared<std::set<std::string>>();
``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`
}
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`` SHOULD NOT be used along with ``override``, for consistency
with ``final``.
.. code-block:: c++
class Stream
{
public:
virtual void
open();
};
class InputStream : public Stream
{
public:
void
open() override;
};
class Console : public InputStream
{
public:
void
open() final;
};
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.
+82 -199
View File
@@ -1,35 +1,50 @@
# -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
#
# NFD - Named Data Networking Forwarding Daemon documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 6 19:58:22 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import sys
import os
import re
# -- 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.
#sys.path.insert(0, os.path.abspath('.'))
#
# import os
import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# -- Project information -----------------------------------------------------
project = u'ndn-cxx: NDN C++ library with eXperimental eXtensions'
copyright = u'Copyright © 2013-2020 Regents of the University of California.'
author = u'Named Data Networking Project'
# The short X.Y version.
#version = ''
# The full version, including alpha/beta/rc tags.
#release = ''
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%Y-%m-%d'
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
#
needs_sphinx = '1.3'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.extlinks',
'sphinx.ext.todo',
]
@@ -38,238 +53,106 @@ def addExtensionIfExists(extension):
__import__(extension)
extensions.append(extension)
except ImportError:
sys.stderr.write("Extension '%s' in not available. "
sys.stderr.write("Extension '%s' not found. "
"Some documentation may not build correctly.\n" % extension)
sys.stderr.write("To install, use \n"
" sudo pip install %s\n" % extension.replace('.', '-'))
addExtensionIfExists('sphinxcontrib.doxylink')
if os.getenv('GOOGLE_ANALYTICS', None):
addExtensionIfExists('sphinxcontrib.googleanalytics')
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'ndn-cxx: NDN C++ library with eXperimental eXtensions'
copyright = u'2014, Named Data Networking Project'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# 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 = []
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# html_theme = 'default'
#
html_theme = 'named_data_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['./']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
html_theme_path = ['.']
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
html_copy_source = False
html_show_sourcelink = False
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
html_file_suffix = ".html"
# Output file base name for HTML help builder.
htmlhelp_basename = 'ndn-cxx-docs'
# Disable syntax highlighting of code blocks by default.
highlight_language = 'none'
# -- Options for LaTeX output ---------------------------------------------
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# 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',
u'Named Data Networking Project', 'manual'),
('index', 'ndn-cxx-docs.tex', u'NDN C++ library with eXperimental eXtensions',
author, 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# -- 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', u'NDN security tools', None, 1),
('manpages/ndnsec-cert-dump', 'ndnsec-cert-dump', 'part of NDN security tools', None, 1),
('manpages/ndnsec-cert-gen', 'ndnsec-cert-gen', 'part of NDN security tools', None, 1),
('manpages/ndnsec-cert-revoke', 'ndnsec-cert-revoke', 'part of NDN security tools', None, 1),
('manpages/ndnsec-cert-install', 'ndnsec-cert-instal', 'part of NDN security tools', None, 1),
('manpages/ndnsec-delete', 'ndnsec-delete', 'part of NDN security tools', None, 1),
('manpages/ndnsec-export', 'ndnsec-export', 'part of NDN security tools', None, 1),
('manpages/ndnsec-get-default', 'ndnsec-get-default', 'part of NDN security tools', None, 1),
('manpages/ndnsec-import', 'ndnsec-import', 'part of NDN security tools', None, 1),
('manpages/ndnsec-key-gen', 'ndnsec-key-gen', 'part of NDN security tools', None, 1),
('manpages/ndnsec-list', 'ndnsec-list', 'part of NDN security tools', None, 1),
('manpages/ndnsec-set-acl', 'ndnsec-set-acl', 'part of NDN security tools', None, 1),
('manpages/ndnsec-set-default', 'ndnsec-set-default', 'part of NDN security tools', None, 1),
('manpages/ndnsec-sign-req', 'ndnsec-sign-req', 'part of NDN security tools', None, 1),
('manpages/ndnsec-unlock-tpm', 'ndnsec-unlock-tpm', 'part of NDN security tools', None, 1),
('tutorials/security-validator-config', 'ndnsec-validator.conf',
'NDN trust validator configuration file', None, 5),
('manpages/tlvdump', 'tlvdump', 'Decode structure of TLV encoded buffer', None, 1),
('manpages/ndn-client.conf', 'ndn-client.conf', 'Configuration file for NDN platform', None, 5),
('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 applications', None, 5),
('manpages/ndn-log', 'ndn-log', 'ndn-cxx logging', None, 7),
]
# If true, show URL addresses after external links.
man_show_urls = True
#man_show_urls = True
# ---- Custom options --------
# -- Custom options ----------------------------------------------------------
doxylink = {
'ndn-cxx' : ('ndn-cxx.tag', 'doxygen/'),
'ndn-cxx': ('ndn-cxx.tag', 'doxygen/'),
}
if os.getenv('GOOGLE_ANALYTICS', None):
googleanalytics_id = os.environ['GOOGLE_ANALYTICS']
googleanalytics_enabled = True
exclude_patterns = ['RELEASE_NOTES.rst']
extlinks = {
'issue': ('https://redmine.named-data.net/issues/%s', 'issue #'),
}
+341 -183
View File
File diff suppressed because it is too large. Load diff
+15 -22
View File
@@ -5,33 +5,27 @@ 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://named-data.net/doc/NFD/>`_.
Trivial consumer
----------------
In the following trivial example, a consumer creates a :ndn-cxx:`Face` with default
transport (:ndn-cxx:`UnixTransport`) and sends an Interest for
``/localhost/testApp/randomData``. While expressing Interest, the app specifies two
callbacks to be called when Data is retrieved or Interest times out.
``ndn::bind`` is an alias for either `boost::bind
<http://www.boost.org/doc/libs/1_55_0/libs/bind/bind.html>`_ or `std::bind
<http://en.cppreference.com/w/cpp/utility/functional/bind>`_ when the library is compiled
in C++11 mode.
``/localhost/testApp/randomData``. While expressing Interest, the app specifies three
callbacks to be called when Data/Nack is retrieved or Interest times out.
.. literalinclude:: ../examples/consumer.cpp
:language: c++
:linenos:
:emphasize-lines: 24-26,32-34,48-52,54
:emphasize-lines: 39-45,48,59,65,71
Trivial producer
----------------
The following example demonstrates how to write a simple producer application.
First, the application sets an Interset filter for ``/localhost/testApp`` to receive all
First, the application sets an Interest filter for ``/localhost/testApp`` to receive all
Interests that have this prefix. The :ndn-cxx:`Face::setInterestFilter` call accepts two
callbacks; the first will be called when an Interest is received and the second if prefix
registration fails.
@@ -47,28 +41,27 @@ using :ndn-cxx:`Face::put` method.
.. literalinclude:: ../examples/producer.cpp
:language: c++
:linenos:
:emphasize-lines: 44-47,50,56,71-74
:emphasize-lines: 41,50,57-59,62,70,74
Consumer that uses Scheduler
----------------------------
Consumer that uses ndn::Scheduler
---------------------------------
The following example demonstrates how to use :ndn-cxx:`ndn::Scheduler` to schedule arbitrary
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
<http://www.boost.org/doc/libs/1_48_0/doc/html/boost_asio/reference/io_service.html>`_ to
<https://www.boost.org/doc/libs/1_65_1/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
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:`ndn::Scheduler` is just a wrapper on top of ``boost::asio::io_service``,
allowing simple interface to schedule tasks at specific times.
``io_service::run()`` or implicitly via :ndn-cxx:`Face::processEvents` as in previous
examples). :ndn-cxx:`Scheduler` is just a wrapper on top of ``io_service``, 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: 19,61,76,79-80,83
:emphasize-lines: 39-40,56,62,93,106,114-116
+39 -15
View File
@@ -1,11 +1,22 @@
ndn-cxx: NDN C++ library with eXperimental eXtensions
=====================================================
ndn-cxx is a C++ library, implementing Named Data Networking (NDN) primitives that can be
used to implement various NDN applications.
**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:
Please submit any bugs or issues to the `ndn-cxx issue tracker
<http://redmine.named-data.net/projects/ndn-cxx/issues>`__.
* `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
---------------------
@@ -14,34 +25,47 @@ ndn-cxx Documentation
:hidden:
:maxdepth: 3
README
INSTALL
examples
tutorials
code-style
specs
manpages
- :doc:`README`
.. toctree::
:hidden:
:maxdepth: 1
code-style
RELEASE_NOTES
releases
- :doc:`INSTALL`
- :doc:`examples`
- :doc:`tutorials`
+ :doc:`tutorials/security-library`
+ `NDN Software Contributor's Guide <https://github.com/named-data/.github/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`
Documentation for ndn-cxx developers and contributors
+++++++++++++++++++++++++++++++++++++++++++++++++++++
- :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:`code-style`
- :doc:`RELEASE_NOTES`
- :doc:`releases`
License
-------
ndn-cxx is an open source project licensed under LGPL 3.0 license. For more information about
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>`_.
+1 -8
View File
@@ -3,6 +3,7 @@ Manpages
.. 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>
@@ -10,18 +11,10 @@ Manpages
ndnsec-key-gen <manpages/ndnsec-key-gen>
ndnsec-sign-req <manpages/ndnsec-sign-req>
ndnsec-cert-gen <manpages/ndnsec-cert-gen>
ndnsec-cert-revoke <manpages/ndnsec-cert-revoke>
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>
ndnsec-set-acl <manpages/ndnsec-set-acl>
manpages/tlvdump
:maxdepth: 1
..
manpages/ndnsec-op-tool
manpages/ndnsec-set-acl
manpages/ndnsec-sig-verify
+80 -44
View File
@@ -2,66 +2,102 @@ client.conf
===========
System configuration of NDN platform is specified in ``client.conf``.
Here is an example of ``client.conf`` for current ndn-cxx package:
::
The configuration file ``client.conf`` is looked up in several directories in the following order:
; "unix_socket" specifies the location of the NFD unix socket
unix_socket=/var/run/nfd.sock
- ``$HOME/.ndn``: user-specific 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
; "protocol" determines the protocol for prefix registration
; it has a value of:
; nrd-0.1
protocol=nrd-0.1
Here is an example of ``client.conf`` for the current ndn-cxx package:
; "pib" determines which Public Info Base (PIB) should used by default in applications.
; If "pib" is not specified, the default PIB will be used.
; Note that default PIB could be different on different system.
; If "pib" is specified, it may have a value of:
; sqlite3
; pib=sqlite3
.. literalinclude:: ../../client.conf.sample
:language: ini
; "tpm" determines which Trusted Platform Module (TPM) should used by default in applications.
; If "tpm" is not specified, the default TPM will be used.
; Note that default TPM could be different on different system.
; If "tpm" is specified, it may have a value of:
; file
; osx-keychain
; tpm=file
NFD
---
unix_socket
The local interface of NFD to applications. By default, the path to the socket is ``/var/run/nfd.sock``.
transport
FaceUri for default connection toward local NDN forwarder. Only ``unix``, ``tcp``, ``tcp4``, and
``tcp6`` FaceUris can be specified here.
Prefix Registration
-------------------
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.
protocol
The prefix registration protocol. For now, only one protocol ``nrd-0.1`` is supported.
With this protocol, applications send prefix registration requests to NRD.
NRD, after authenticating the request, will set up corresponding FIB entries in NFD.
Key Management
--------------
tpm
Trusted Platform Module (TPM) where the private keys are stored.
Two options are currently available: ``file`` and ``osx-keychain``.
**Users are not supposed to change the ``tpm`` setting once it is configued,
otherwise users may face the problem of "Keys are not found".**
The default value of ``tpm`` depends on the operating system.
For OS X, the default value is ``osx-keychain``.
For other systems, the default value is ``file``.
pib
The public key information for each private key stored in TPM.
There is only one option for ``pib``: ``sqlite3``, which is also the default value of ``pib``.
The public key information for each private key stored in TPM. The format for this setting is::
Users are not supposed to change the configuration of Key Management.
If changes is inevitable, please clean up the all the existing data (which is usually under ``~/.ndn/``):
pib=[scheme]:[location]
::
Possible values for ``[scheme]``:
rm -rf ~/.ndn/ndnsec-*
* ``pib-sqlite3``: local PIB implementation with 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
When ``[location]`` is empty, trailing ``:`` can be omitted. For example::
pib=pib-sqlite3
Changing PIB scheme without changing location is **not** allowed. If a change like this is
necessary, the whole backend storage must be destroyed. For example, when the default location is
used::
rm -rf ~/.ndn/ndnsec-*
It is not recommended to share the same directory between machines, e.g. via NFS.
Simultaneous access from multiple machines may cause errors.
.. note::
This value can be overridden using the ``NDN_CLIENT_PIB`` environment variable.
tpm
Trusted Platform Module (TPM) where the private keys are stored. The format for this setting
is::
tpm=[scheme]:[location]
Possible values for ``[scheme]``:
* ``tpm-osx-keychain`` (default on macOS): secure storage of private keys in the macOS
Keychain with OS-provided access restrictions.
``[location]`` parameter is ignored.
May not work for daemon applications, as user interaction may be required to access the
macOS Keychain.
* ``tpm-file`` (default on all other platforms): file-based storage of private keys.
Possible values for ``[location]``:
* 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
When ``[location]`` is empty, trailing ``:`` can be omitted. For example::
tpm=tpm-file
**Changing the ``tpm`` setting is only possible together with ``pib`` setting. Otherwise,
an error will be generated during PIB/TPM access.**
It is not recommended to share the same directory between machines, e.g. via NFS.
Simultaneous access from multiple machines may cause errors.
.. note::
This value can be overridden using the ``NDN_CLIENT_TPM`` environment variable.
+100
View File
@@ -0,0 +1,100 @@
ndn-log
=======
The ndn-cxx logging facility exposes the internal state of NDN libraries and
applications so the user can investigate internal interactions, such as interest
dispatch inside ndn::Face, Data and Interest validation in the security framework,
sync and recovery Interest processing inside ChronoSync, etc. During runtime, the
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
--------------------
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
modules. Logging modules within different libraries and applications usually have
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.
**Log Levels:**
::
TRACE
DEBUG
INFO
WARN
ERROR
FATAL
A message's severity level will determine whether the log is written. For instance,
if an application sets its log severity level to DEBUG, all messages marked with
DEBUG, or any of those below that level, are written. FATAL level logs are always
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>"
*Example:*
.. code-block:: sh
export NDN_LOG="ndn.*=DEBUG"
export NDN_LOG="ndn.UnixTransport=INFO"
export NDN_LOG="sync.Logic=ERROR"
export NDN_LOG="*=DEBUG:ndn.UnixTransport=INFO:sync.Logic=ERROR"
**Note:**
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
sudo env NDN_LOG=logLevel ./ndn-application
# Also correct
sudo -s
export NDN_LOG=logLevel
./ndn-application
# Incorrect
sudo export NDN_LOG=logLevel
sudo ./ndn-application
# Incorrect
NDN_LOG=logLevel sudo ./ndn-application
+29 -31
View File
@@ -1,56 +1,54 @@
ndnsec-cert-dump
================
``ndnsec-cert-dump`` is a tool to dump a certificate from **Public Info Base** or file and output
it to standard output.
Synopsis
--------
Usage
-----
::
$ ndnsec-cert-dump [-h] [-p] [-ikf] name
**ndnsec-cert-dump** [**-h**] [**-p**] [**-r** [**-H** *host*] [**-P** *port*]]
[**-i**\|\ **-k**\|\ **-f**] *name*
Description
-----------
``ndnsec-cert-dump`` can read a certificate from **Public Info Base (PIB)** or a file and output
the certificate to standard output.
:program:`ndnsec-cert-dump` reads a certificate from the **Public Info Base (PIB)**
or from a file, and prints it on the standard output.
By default, ``name`` is interpreted as a certificate name.
By default, *name* is interpreted as a certificate name.
Options
-------
``-i``
Interpret ``name`` as an identity name. If specified, the certificate to dump is the default
certificate of the identity.
.. option:: -i, --identity
``-k``
Interpret ``name`` as a key name. If specified, the certificate to dump is the default certificate
of the key.
Interpret *name* as an identity name. If specified, the certificate to dump
is the default certificate of the identity.
``-f``
Interpret ``name`` as a path to a file containing the certificate. If ``name`` is ``-``,
certificate will be read from standard input.
.. option:: -k, --key
``-p``
Print out the certificate to a human-readable format.
Interpret *name* as a key name. If specified, the certificate to dump is the
default certificate of the key.
Examples
--------
.. option:: -f, --file
Dump a certificate from PIB to standard output:
::
Interpret *name* as a path to a file containing the certificate. If *name*
is "-", the certificate will be read from the standard input.
$ ndnsec-cert-dump /ndn/test/KEY/david/ksk-1396913058196/ID-CERT/%00%00%01E%3E%9D%A0%DE
.. option:: -p, --pretty
Dump a certificate to a human-readable format:
::
Print the certificate in a human-readable format.
$ ndnsec-cert-dump -p /ndn/test/KEY/david/ksk-1396913058196/ID-CERT/%00%00%01E%3E%9D%A0%DE
Example
-------
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::
$ ndnsec-cert-dump -p /ndn/test/david/KEY/ksk-1396913058196/ID-CERT/%00%00%01E%3E%9D%A0%DE
Certificate name:
/ndn/test/KEY/david/ksk-1396913058196/ID-CERT/%00%00%01E%3E%9D%A0%DE
/ndn/test/david/KEY/ksk-1396913058196/ID-CERT/%00%00%01E%3E%9D%A0%DE
Validity:
NotBefore: 20140401T000000
NotAfter: 20150331T235959
+66 -54
View File
@@ -1,79 +1,91 @@
ndnsec-cert-gen
===============
``ndnsec-cert-gen`` is a tool to issue an identity certificate.
Synopsis
--------
Usage
-----
::
$ ndnsec-cert-gen [-h] [-S timestamp] [-E timestamp] [-N name] [-I info] [-s sign-id] [-p cert-prefix] request
**ndnsec-cert-gen** [**-h**] [**-S** *timestamp*] [**-E** *timestamp*]
[**-I** *info*]... [**-s** *signer*] [**-i** *issuer*] *file*
Description
-----------
``ndnsec-cert-gen`` takes signing request as input and issues an identity certificate for the key in
the signing request. The signing request can be created during ``ndnsec-keygen`` and can be
re-generated with ``ndnsec-sign-req``.
:program:`ndnsec-cert-gen` takes a signing request as input and issues an
identity certificate for the key in the signing request. The signing request
can be created with :program:`ndnsec-key-gen` and can be re-generated with
:program:`ndnsec-sign-req`.
By default, the default key/certificate will be used to sign the issued certificate.
By default, the default key is used to sign the issued certificate.
``request`` could be a path to a file that contains the signing request. If ``request`` is ``-``,
then signing request will be read from standard input.
The generated certificate will be written to standard output in base64 encoding.
*file* is the name of a file that contains the signing request. If *file* is
"-", the signing request is read from the standard input.
The generated certificate is written to the standard output in base64 encoding.
Options
-------
``-S timestamp``
Timestamp when the certificate becomes valid. The default value is now.
.. option:: -S <timestamp>, --not-before <timestamp>
``-E timestamp``
Timestamp when the certificate expires. The default value is one year from now.
Date and time when the certificate becomes valid, in "YYYYMMDDhhmmss" format.
The default value is now.
``-N name``
Name of the certificate owner.
.. option:: -E <timestamp>, --not-after <timestamp>
``-I info``
Other information about the certificate owner. ``subject-info`` is a list of pairs of OID and
corresponding value. For example, "2.5.4.10 'Some Organization' 2.5.4.3 'http://home.page/'".
Date and time when the certificate expires, in "YYYYMMDDhhmmss" format.
The default value is 365 days after the **--not-before** timestamp.
``-s sign-id``
Signing identity. The default key/certificate of ``sign-id`` will be used to sign the requested
certificate. If this option is not specified, the system default identity will be used.
.. option:: -I <info>, --info <info>
``-p cert-prefix``
The certificate prefix, which is the part of certificate name before ``KEY`` component.
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.
By default, the certificate prefix will be inferred from the certificate name according
to the relation between the signing identity and the subject identity. If the signing
identity is a prefix of the subject identity, ``KEY`` will be inserted after the
signingIdentity, otherwise ``KEY`` is inserted after subject identity (i.e., before
``ksk-....``).
For example::
Examples
--------
-I "affiliation Some Organization" -I "homepage https://home.page/"
.. option:: -s <signer>, --sign-id <signer>
Signing identity. The default key/certificate of *signer* will be used to
sign the requested certificate. If this option is not specified, the system
default identity will be used.
.. option:: -i <issuer>, --issuer-id <issuer>
Issuer's ID to be included in the issued certificate name. The default
value is "NA".
Example
-------
::
$ ndnsec-cert-gen -S 20140401000000 -E 20150331235959 -N "David"
-I "2.5.4.10 'Some Organization'" -s /ndn/test sign_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-dump-certificate -p -f signed.cert
Certificate name:
/example/KEY/%E4%14%99%7F%28%96%82%EB/Universe/%FD%00%00%01q%D1%02N%82
Validity:
NotBefore: 20200501T000000
NotAfter: 20210101T000000
Additional Description:
affiliation: Some Organization
foobar: Foo Bar
Public key bits:
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEOkmwKS8TlEyPFFV3IrpbrP4WgKr6
pEQSf+zF/6faCeyXbmqbU1qsJ9IZ/3rMgnL0FED1u24wx65aUA3/Ka8wXA==
Signature Information:
Signature Type: SignatureSha256WithEcdsa
Key Locator: Name=/ndn/test/KEY/I%3FS%9A%28%BB%9A%95
+24 -30
View File
@@ -1,56 +1,50 @@
ndnsec-cert-install
===================
``ndnsec-cert-install`` is a tool to install a certificate into **Public Information Base (PIB)**.
Synopsis
--------
Usage
-----
::
$ ndnsec-cert-install [-h] [-IKN] cert-source
**ndnsec-cert-install** [**-h**] [**-I**\|\ **-K**\|\ **-N**] *file*
Description
-----------
``ndnsec-cert-install`` can insert a certificate into PIB. By default, the installed certificate
will be set as the default certificate of its corresponding identity and the identity is set as
the system default identity.
:program:`ndnsec-cert-install` allows importing a certificate into the
**Public Information Base (PIB)**. By default, the installed certificate
will be set as the default certificate for the corresponding identity and
the identity will be set as the user's default identity.
``cert-source`` could be a filesystem path or an HTTP URL of a file containing to certificate to
install or . If ``cert-file`` is ``-``, the certificate will be read from standard input.
*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.
Options
-------
``-I``
Set the certificate as the default certificate of its corresponding identity, but do not change
the system default identity.
.. option:: -I, --identity-default
``-K``
Set the certificate as the default certificate of its corresponding key, but do not change the
corresponding identity's default key and the system default identity.
Set the certificate as the default certificate for the corresponding identity,
but do not change the user's default identity.
``-N``
Install the certificate but do not change any default settings.
.. option:: -K, --key-default
Examples
--------
Set the certificate as the default certificate for the corresponding key, but
do not change the identity's default key or the user's default identity.
Install a certificate and set it as the system default certificate:
.. option:: -N, --no-default
::
Install the certificate but do not change any default settings.
Example
-------
Install a certificate and set it as the default certificate::
$ ndnsec-cert-install cert_file.cert
Install a certificate with HTTP URL and set it as the system default certificate:
::
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:
::
Install a certificate but do not change any default settings::
$ ndnsec-cert-install -N cert_file.cert
-36
View File
@@ -1,36 +0,0 @@
ndnsec-cert-revoke
==================
``ndnsec-cert-revoke`` is a tool to generate a certificate revocation data.
Usage
-----
::
$ ndnsec-cert-revoke [-h] request
Description
-----------
This command takes an identity ertificate as input.
The tool will check whether user is the issuer of the certificate (by checking whether user has the key pointed by the KeyLocator of the certificate).
If so, the tool will generate an empty packet named by the certificate name appended with "REVOKED" as a revocation data.
If user is not the issuer of the certificate, the command will return error.
This tool generates a revocation Data.
It does not actually revoke a certificate.
How to publish and use the revocation Data is not finalized yet.
Options
-------
``request``
request is file name of the certificate to revoke (``-`` for standard input)
Examples
--------
::
$ ndnsec-cert-revoke some-cert-to-revoke.ndncert
+25 -19
View File
@@ -1,37 +1,43 @@
ndnsec-delete
=============
``ndnsec-delete`` is a tool to delete security data from both **Public Info Base** and
**Trusted Platform Module**.
Synopsis
--------
Usage
-----
::
ndnsec-delete [-h] [-kc] name
**ndnsec-delete** [**-h**] [**-k**\|\ **-c**] *name*
Description
-----------
By default, ``ndnsec-delete`` interpret ``name`` as an identity name. If an identity is deleted,
all the keys and certificates belonging to the identity will be deleted as well. If a key is
deleted, all the certificate belonging to the key will be deleted as well.
:program:`ndnsec-delete` allows to delete security data from both the
**Public Info Base (PIB)** and the **Trusted Platform Module (TPM)**.
By default, :program:`ndnsec-delete` will interpret *name* as an identity name.
If an identity is deleted, all keys and certificates belonging to that identity
will be deleted as well. If a key is deleted, all certificates associated with
that key will be deleted as well.
Options
-------
``-k``
Interpret ``name`` as a key name and delete the key and its related data.
.. option:: -k, --delete-key
``-c``
Interpret ``name`` as a certificate name and delete the certificate.
Interpret *name* as a key name and delete the key and its associated data.
Examples
--------
.. option:: -c, --delete-cert
Delete all data related to an identity:
Interpret *name* as a certificate name and delete the certificate.
::
Exit Status
-----------
Normally, the exit status is 0 if the requested entity is deleted successfully.
If the entity to be deleted does not exist, the exit status is 1.
For other errors, the exit status is 2.
Example
-------
Delete all data related to an identity::
$ ndnsec-delete /ndn/test/david
+33 -24
View File
@@ -1,44 +1,53 @@
ndnsec-export
=============
``ndnsec-export`` is a tool to export an identity's security data
Synopsis
--------
Usage
-----
::
$ ndnsec-export [-h] [-o output] [-p] identity
**ndnsec-export** [**-h**] [**-o** *file*] [**-P** *passphrase*]
[**-i**\|\ **-k**\|\ **-c**] *name*
Description
-----------
``ndnsec-export`` can export public data of the ``identity`` including default key/certificate.
``ndnsec-export`` can also export sensitive data (such as private key), but the sensitive data will
be encrypted. The exported identity can be imported again using ``ndnsec-import``.
By default, the command will write exported data to standard output.
: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
-------
``-o output``
Output the exported data to a file pointed by ``output``.
.. option:: -i, --identity
``-p``
Export private key of the identity. A password will be asked for data encryption.
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.
Examples
--------
.. option:: -k, --key
Export an identity's security data including private key and store the security data in a file:
Interpret *name* as a key name. The default certificate of the key will be exported.
::
.. option:: -c, --cert
$ ndnsec-export -o id.info -p /ndn/test/alice
Interpret *name* as a certificate name.
Export an identity's security data without private key and write it to standard output:
.. option:: -o <file>, --output <file>
::
Write to the specified output file instead of the standard output.
$ ndnsec-export /ndn/test/alice
.. option:: -P <passphrase>, --password <passphrase>
Passphrase to use for the export. If empty or not specified, the user is
interactively asked to type the passphrase on the terminal. Note that
specifying the passphrase via this option is insecure, as it can potentially
end up in the shell's history, be visible in :command:`ps` output, and so on.
Example
-------
Export an identity's default certificate and private key into a file::
$ ndnsec-export -o alice.ndnkey /ndn/test/alice
Export a specific certificate and its private key to the standard output::
$ ndnsec-export -c /ndn/edu/ucla/alice/KEY/1%5D%A7g%90%B2%CF%AA/self/%FD%00%00%01r-%D3%DC%2A
+26 -31
View File
@@ -1,61 +1,56 @@
ndnsec-get-default
==================
``ndnsec-get-default`` is a tool to display the default setting of a particular entity.
Synopsis
--------
Usage
-----
::
$ ndnsec-get-default [-h] [-kc] [-i identity|-K key] [-q]
**ndnsec-get-default** [**-h**] [**-k**\|\ **-c**] [**-i** *identity*\|\ **-K** *key*] [**-q**]
Description
-----------
Given a particular entity, ``ndnsec-get-default`` can display its default setting as specified in
options. If ``identity`` is specified, the given entity becomes the identity. If ``key`` is
specified, the given identity becomes the key. If no entity is specified, the command will take the
system default identity as the given entity.
Given a particular entity, :program:`ndnsec-get-default` shows its default settings
according to the command-line options. By default, if neither **-i** nor **-K** is
given, the command displays the default identity or the default key/certificate of
the default identity.
Options
-------
``-k``
Display the given entity's default key name.
.. option:: -k, --default-key
``-c``
Display the given entity's default certificate name.
Display the chosen entity's default key name.
``-i identity``
Display default setting of the ``identity``
.. option:: -c, --default-cert
``-K key``
Display default setting of the ``key``.
Display the chosen entity's default certificate name.
``-q``
Disable trailling new line character.
.. option:: -i <identity>, --identity <identity>
Examples
--------
Display default settings of *identity*.
Display an identity's default key name.
.. option:: -K <key>, --key <key>
::
Display default settings of *key*.
.. option:: -q, --quiet
Disable printing the trailing newline character.
Example
-------
Display an identity's default key name::
$ ndnsec-get-default -k -i /ndn/test/alice
/ndn/test/alice/ksk-1394129695025
Display an identity's default certificate name.
::
Display an identity's default certificate name::
$ ndnsec-get-default -c -i /ndn/test/alice
/ndn/test/KEY/alice/ksk-1394129695025/ID-CERT/%FD%01D%98%9A%F2%3F
Display a key's default certificate name.
::
Display a key's default certificate name::
$ ndnsec-get-default -c -K /ndn/test/alice/ksk-1394129695025
/ndn/test/KEY/alice/ksk-1394129695025/ID-CERT/%FD%01D%98%9A%F2%3F
+17 -17
View File
@@ -1,33 +1,33 @@
ndnsec-import
=============
``ndnsec-import`` is a tool to import an identity's security data that is prepared by
``ndnsec-export``.
Synopsis
--------
Usage
-----
::
$ ndnsec-import [-h] [-p] input
**ndnsec-import** [**-h**] [**-P** *passphrase*] *file*
Description
-----------
``ndnsec-import`` read data from ``input``. It will ask for password if the input contains private
key. If ``input`` is ``-``, security data will be read from standard input.
:program:`ndnsec-import` imports a certificate and its private key from a file
created by :program:`ndnsec-export`. It will ask for the passphrase used to
encrypt the private key.
If *file* is "-", read from the standard input.
Options
-------
``-p``
Indicates the imported data containing private key. A password will be asked for data encryption.
.. option:: -P <passphrase>, --password <passphrase>
Examples
--------
Passphrase to use for the export. If empty or not specified, the user is
interactively asked to type the passphrase on the terminal. Note that
specifying the passphrase via this option is insecure, as it can potentially
end up in the shell's history, be visible in :command:`ps` output, and so on.
Import an identity's security data including private key:
Example
-------
::
Import a certificate and private key from a file::
$ ndnsec-import -p input_file
$ ndnsec-import alice.ndnkey
+30 -15
View File
@@ -1,32 +1,47 @@
ndnsec-key-gen
==============
``ndnsec-key-gen`` is tool to generate a pair of RSA key.
Synopsis
--------
Usage
-----
::
$ ndnsec-key-gen [-h] [-n] identity
**ndnsec-key-gen** [**-h**] [**-n**] [**-t** *type*]
[**-k** *keyidtype*\|\ **--keyid** *keyid*] *identity*
Description
-----------
``ndnsec-key-gen`` creates a RSA key pair for the specified ``identity`` and sets the key as the
identity's default key. ``ndnsec-key-gen`` will also create a signing request for the generated key.
The signing request will be written to standard output in base64 encoding.
:program:`ndnsec-key-gen` generates a key pair for the specified *identity* and
sets the generated public key as the identity's default key.
:program:`ndnsec-key-gen` will also create a signing request for the generated key.
The signing request will be written to the standard output in base64 encoding.
By default, it will also set the identity as the system default identity.
By default, it will also set the identity as the user's default identity.
Options
-------
``-n``
Do not set the identity as the system default identity.
.. option:: -n, --not-default
Examples
--------
Do not set the identity as the user's default identity.
Note that if no other identity/key/certificate exists, then the identity
will become the default regardless of this option.
.. option:: -t <type>, --type <type>
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 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
-------
::
+19 -26
View File
@@ -1,24 +1,20 @@
ndnsec-list
===========
``ndnsec-list`` is a tool to display entities stored in **Public Information Base (PIB)**, such as
identities, keys, and certificates.
Synopsis
--------
Usage
-----
::
$ ndnsec-list [-h] [-KkCc]
**ndnsec-list** [**-h**] [**-k**\|\ **-c**]
Description
-----------
``ndnsec-list`` lists names of all the entities according to the granularity specified in options
(The default granularity is identity). The default entities will be marked with ``*`` in front of
their names. For example:
:program:`ndnsec-list` prints the names of all the entities stored in the
**Public Information Base (PIB)**, such as identities, keys, and certificates,
up to the given granularity level. By default, only the identity names are
shown. The default entities will be marked with a "*" in front of their names.
::
For example::
$ ndnsec list
* /ndn/edu/ucla/cs/yingdi
@@ -26,24 +22,23 @@ their names. For example:
/ndn/test/bob
/ndn/test/alice
Options
-------
``-K, -k``
Display key names for each identity. The key name with ``*`` in front is the default key name of
the corresponding identity.
.. option:: -k, --key
``-C, -c``
Display certificate names for each key. The certificate name with ``*`` in front is the default
certificate name of the corresponding key.
Display key names for each identity. The key name with a "*" in front is
the default key name of the corresponding identity.
Examples
--------
.. option:: -c, --cert
Display all the key names in PIB.
Display certificate names for each key. The certificate name with a "*"
in front is the default certificate name of the corresponding key.
::
Example
-------
Display all the key names in PIB::
$ ndnsec-list -k
* /ndn/edu/ucla/cs/yingdi
@@ -59,9 +54,7 @@ Display all the key names in PIB.
/ndn/test/alice
+->* /ndn/test/alice/ksk-1394129695025
Display all the certificate names in PIB.
::
Display all the certificate names in PIB::
$ ndnsec-list -c
* /ndn/edu/ucla/cs/yingdi
-26
View File
@@ -1,26 +0,0 @@
ndnsec-set-acl
==============
``ndnsec-set-acl`` is a tool to add an application into access control list of an private key.
Usage
-----
::
$ ndnsec-set-acl [-h] keyName appPath
Description
-----------
``ndnsec-set-acl`` will add the application pointed by ``appPath`` into the ACL of a key with name
``keyName``.
Examples
--------
Add an application into a key's ACL:
::
$ ndnsec-set-acl /ndn/test/alice/ksk-1394129695025 /test/app/path
+19 -25
View File
@@ -1,49 +1,43 @@
ndnsec-set-default
==================
``ndnsec-set-default`` is a tool to change the default security settings.
Synopsis
--------
Usage
-----
::
$ ndnsec-set-default [-h] [-k|c] name
**ndnsec-set-default** [**-h**] [**-k**\|\ **-c**] *name*
Description
-----------
By default, ``ndnsec-set-default`` takes ``name`` as an identity name and sets the identity as the
system default identity.
:program:`ndnsec-set-default` allows changing the default security settings.
Without any options, *name*, which must be an identity name, is set as the
default identity for the current user.
Options
-------
``-k``
Set default key. ``name`` should be a key name, ``ndnsec-set-default`` can infer the corresponding
identity and set the key as the identity's default key.
.. option:: -k, --default-key
``-c``
Set default certificate. ``name`` should be a certificate name, ``ndnsec-set-default`` can
infer the corresponding key name and set the certificate as the key's default certificate.
Set *name*, which must be a key name, as the default key for the
corresponding identity.
Examples
--------
.. option:: -c, --default-cert
Set a key's default certificate:
Set *name*, which must be a certificate name, as the default certificate
for the corresponding key.
::
Example
-------
Set a key's default certificate::
$ ndnsec-set-default -c /ndn/test/KEY/alice/ksk-1394129695025/ID-CERT/%FD%01D%98%9A%F2%3F
Set an identity's default key:
::
Set an identity's default key::
$ ndnsec-set-default -k /ndn/test/alice/ksk-1394129695025
Set system default identity:
::
Set the user's default identity::
$ ndnsec-set-default /ndn/test/alice
+17 -22
View File
@@ -1,37 +1,35 @@
ndnsec-sign-req
===============
``ndnsec-sign-req`` is a tool to generate a signing request for a particular key.
Synopsis
--------
Usage
-----
::
$ ndnsec-sign-req [-h] [-k] name
**ndnsec-sign-req** [**-h**] [**-k**] *name*
Description
-----------
The signing request of a key is actually a self-signed certificate. Given key's information,
``ndnsec-sign-req`` looks up the key in PIB. If such a key exists, a self-signed certificate of the
key, or its signing request, will be outputed to **stdout** with base64 encoding.
:program:`ndnsec-sign-req` generates a signing request for a key.
By default, ``name`` is interpreted as an identity name. ``ndnsec-sign-req`` will generate a
signing request for the identity's default key.
The signing request of a key is actually a self-signed certificate. Given the
key's information, :program:`ndnsec-sign-req` looks up the key in the PIB.
If such a key exists, a self-signed certificate for the key, i.e. its signing
request, is written to the standard output in base64 encoding.
By default, *name* is interpreted as an identity name, and the signing request
will be generated for that identity's default key.
Options
-------
``-k``
Interpret ``name`` as a key name.
.. option:: -k, --key
Examples
--------
Interpret *name* as a key name, instead of an identity name.
Create a signing request for an identity's default key.
Example
-------
::
Create a signing request for an identity's default key::
$ ndnsec-sign-req /ndn/test/david
Bv0DAAc9CANuZG4IBHRlc3QIBWRhdmlkCANLRVkIEWtzay0xMzk2OTk4Mzg5MjU3
@@ -52,10 +50,7 @@ Create a signing request for an identity's default key.
0wHjvDS1cuIH2j6XveoUYapRjZXaEZqB/YoBwRqEYq2KVn/ol5knLM6FIISXXjxn
cIh62A==
Create a signing request for a particular key.
::
Create a signing request for a particular key::
$ ndnsec-sign-req -k /ndn/test/david/ksk-1396913058196
Bv0DAAc9CANuZG4IBHRlc3QIBWRhdmlkCANLRVkIEWtzay0xMzk2OTEzMDU4MTk2
+5 -9
View File
@@ -1,17 +1,13 @@
ndnsec-unlock-tpm
=================
``ndnsec-unlock-tpm`` is a tool to (temporarily) unlock the **Trusted Platform Module (TPM)** that
manages private keys.
Synopsis
--------
Usage
-----
::
$ ndnsec-unlock-tpm [-h]
ndnsec-unlock-tpm [**-h**]
Description
-----------
``ndnsec-unlock-tpm`` will ask for password to unlock the TPM.
:program:`ndnsec-unlock-tpm` can be used to (temporarily) unlock the
**Trusted Platform Module (TPM)** that manages private keys.
+47 -61
View File
@@ -1,85 +1,71 @@
ndnsec
======
``ndnsec`` is a command-line toolkit to perform various NDN security management
operation.
:program:`ndnsec` is a command-line toolkit to perform various NDN security
management operations.
Usage
-----
Synopsis
--------
::
**ndnsec** *command* [*argument*]...
$ ndnsec <command> [<args>]
or alternatively
::
$ ndnsec-command [<args>]
**ndnsec-**\ *command* [*argument*]...
Description
-----------
The NDN security data are stored and managed in two places: **Public Information Base** and
**Trusted Platform Module**. ``ndnsec`` toolkit provides a command-line interface of managing and
using the NDN security data.
The NDN security data are stored in two places: **Public Information Base**
(PIB) and **Trusted Platform Module** (TPM). The :program:`ndnsec` toolkit
provides a command-line interface for managing and using the NDN security data.
ndnsec commands
---------------
Commands
--------
ndnsec-list_
Display information in PublicInfo.
list_
List all known identities/keys/certificates.
ndnsec-get-default_
Get default setting info.
get-default_
Show the default identity/key/certificate.
ndnsec-set-default_
Configure default setting.
set-default_
Change the default identity/key/certificate.
ndnsec-key-gen_
Generate a Key-Signing-Key for an identity.
delete_
Delete an identity/key/certificate.
ndnsec-sign-req_
key-gen_
Generate a key for an identity.
sign-req_
Generate a certificate signing request.
ndnsec-cert-gen_
Generate an identity certificate.
cert-gen_
Create a certificate for an identity.
ndnsec-cert-dump_
Dump a certificate from PublicInfo.
cert-dump_
Export a certificate.
ndnsec-cert-install_
Install a certificate into PublicInfo.
cert-install_
Import a certificate from a file.
ndnsec-delete_
Delete identity/key/certificate.
export_
Export an identity as a SafeBag.
ndnsec-export_
Export an identity package.
import_
Import an identity from a SafeBag.
ndnsec-import_
Import an identity package.
unlock-tpm_
Unlock the TPM.
ndnsec-set-acl_
Configure ACL of a private key.
ndnsec-unlock-tpm_
Unlock Tpm.
ndnsec-op-tool_
Operator tool.
.. _ndnsec-list: ndnsec-list.html
.. _ndnsec-get-default: ndnsec-get-default.html
.. _ndnsec-set-default: ndnsec-set-default.html
.. _ndnsec-key-gen: ndnsec-key-gen.html
.. _ndnsec-sign-req: ndnsec-sign-req.html
.. _ndnsec-cert-gen: ndnsec-cert-gen.html
.. _ndnsec-cert-dump: ndnsec-cert-dump.html
.. _ndnsec-cert-install: ndnsec-cert-install.html
.. _ndnsec-delete: ndnsec-delete.html
.. _ndnsec-export: ndnsec-export.html
.. _ndnsec-import: ndnsec-import.html
.. _ndnsec-set-acl: ndnsec-set-acl.html
.. _ndnsec-unlock-tpm: ndnsec-unlock-tpm.html
.. _ndnsec-op-tool: ndnsec-op-tool.html
.. _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
-46
View File
@@ -1,46 +0,0 @@
tlvdump
=======
``tlvdump`` is a simple application allowing to decode structure of TLV-encoded packet.
Usage
-----
::
tlvdump [filename]
Description
-----------
If filename is specified, ``tlvdump`` will attempt to read and decode content of the file,
otherwise data will be read from standard input.
Example
-------
::
$ tlvdump interest.tlv
5 (Interest) (size: 89)
7 (Name) (size: 20)
8 (NameComponent) (size: 5) [[local]]
8 (NameComponent) (size: 3) [[ndn]]
8 (NameComponent) (size: 6) [[prefix]]
9 (Selectors) (size: 55)
13 (MinSuffixComponents) (size: 1) [[%01]]
14 (MaxSuffixComponents) (size: 1) [[%01]]
28 (KeyLocatorDigest) (size: 22)
7 (Name) (size: 20)
8 (NameComponent) (size: 4) [[test]]
8 (NameComponent) (size: 3) [[key]]
8 (NameComponent) (size: 7) [[locator]]
16 (Exclude) (size: 20)
8 (NameComponent) (size: 4) [[alex]]
8 (NameComponent) (size: 4) [[xxxx]]
19 (Any) (size: 0) [[...]]
8 (NameComponent) (size: 4) [[yyyy]]
17 (ChildSelector) (size: 1) [[%01]]
10 (Nonce) (size: 1) [[%01]]
11 (Scope) (size: 1) [[%01]]
12 (InterestLifetime) (size: 2) [[%03%E8]]
+27 -68
View File
@@ -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 %}
-459
View File
@@ -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
View File
@@ -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

+8 -11
View File
@@ -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
View File
@@ -0,0 +1 @@
release-notes/release-notes-0.7.1.rst
@@ -0,0 +1,88 @@
ndn-cxx version 0.1.0
---------------------
Release date: May 7, 2014
Version 0.1.0 is the initial release of ndn-cxx, an NDN C++ library with eXperimental
eXtensions.
Originally based on `ndn-cpp library <https://github.com/named-data/ndn-cpp>`_ the ndn-cxx
library adopts a slightly different design philosophy (including an extensive use of Boost
libraries to facilitate development, as well as the use of Crypto++ library to support
cryptographic operations), and includes a number of extensions that aim to simplify NDN
application development.
The current features include:
- **Base**
+ Fully asynchronous, event-driven communication model, which is implemented using `Boost.Asio
<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
<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
<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
integration service compile and verify correctness of the library for each commit
- **Wire format**
+ Full support of `NDN-TLV packet format v0.1 <https://named-data.net/doc/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
In many cases, NDN packet abstractions are just "indices" to the wire format
- **Communication with the forwarder**
+ Enable connecting to local forwarder via UNIX and TCP transports and to remote
forwarders using TCP transport
+ Full support for communication with `Named Data Networking Forwarding Daemon (NFD)
<https://github.com/named-data/NFD>`_
- Full support for `NFD management protocols
<https://redmine.named-data.net/projects/nfd/wiki/Management>`_ to NFD status
information, create and manage NFD Faces, receive NFD Face status change
notifications, update StrategyChoice for namespaces, and manage routes in RIB
- Support for `LocalControlHeader
<https://redmine.named-data.net/projects/nfd/wiki/LocalControlHeader>`_ to implement
special NDN applications that need low-level control of NDN packet forwarding
- **Security support**
+ A set of security primitives to allowing implementation of secure NDN applications in
a simplified manner
- **KeyChain**: provides simple interfaces of packet signing, and key and certificate
management
- **ValidatorConfig**: validator that implements trust model defined in a configuration
file
- **CommandInterestGenerator** and **CommandInterestValidator**: convenient helpers to produce
and validate command interests, while preventing potential replay attacks
+ Several implementations of trusted platform modules to securely manage private keys
- **SecTpmOsx**: TPM based on OSX KeyChain (OSX-specific)
- **SecTpmFile**: TPM that uses file-based access control to protect keys (cross-platform)
+ Extensive set of security command-line tools to manage security identities and certificates
- Generating private/public keys
- Issuing certificates
- Exporting/importing identities
- Managing default security settings
- **Miscellaneous tools**
+ Scheduler to support delayed time operations
+ NDN regular expressions
+ Simple config file to alter various aspects of the library
+ **tlvdump**: a simple tool to visualize TLV-encoded blocks
+174
View File
@@ -0,0 +1,174 @@
ndn-cxx version 0.2.0
---------------------
Release date: August 25, 2014
Changes since version 0.1.0:
New features
^^^^^^^^^^^^
- **Base**
+ 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.
* 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 the `NDN naming conventions (revision 1)
<https://named-data.net/publications/techreports/ndn-tr-22-ndn-memo-naming-conventions/>`_
(:issue:`1761`)
- **Security**
+ Add ``type dir`` :ref:`trust-anchor in ValidatorConfig <validator-conf-trust-anchors>`
to add all certificates under the specified directory as trust anchors.
The new option also allow periodic reloading trust anchors, allowing dynamic trust
models.
+ Added support for multiple signature types to ``PublicKey``, ``SecPublicInfo`` abstractions
+ New :ndn-cxx:`SignatureSha256WithEcdsa` signature type
+ Updates in :ndn-cxx:`Signature` data structure to reflect changes in `NDN-TLV spec
0.1.1 <https://named-data.net/doc/NDN-packet-spec/0.1.1/>`_
- **Wire encoding**
+ ``Data::getFullName()`` method to get the Data packet name including the implicit digest
+ ``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` 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`)
+ Add support for RIB flags in ``setInterestFilter()`` and ``registerPrefix()`` (:issue:`1842`)
- **Miscellaneous tools**
+ Introduce :ndn-cxx:`Scheduler::cancelAllEvents` to cancel all previously scheduled events
(:issue:`1757`)
+ 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
(:issue:`1879`)
- **Build**
+ Enabled support of precompiled headers for clang and gcc compilers to speed up compilation
Updates and bug fixes
^^^^^^^^^^^^^^^^^^^^^
- **Base**
+ Serialization of socket write operations (:issue:`1707`)
+ 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
+ Fix bug in ``Face::removePendingInterest`` (:issue:`1917`)
- **Wire encoding**
+ The Nonce field is now encoded as a 4-byte value, as defined by NDN-TLV spec
+ Optimized Data packet signing
:ndn-cxx:`KeyChain::sign` method now pre-allocates :ndn-cxx:`EncodingBuffer`, requests
unsigned portion of :ndn-cxx:`Data` using ``Data::wireEncode(EncodingBuffer, true)``,
and then appends the resulting signature and prepends :ndn-cxx:`Data` packet header.
This way there is no extra memory allocation after :ndn-cxx:`Data` packet is signed.
+ Optimized implicit digest calculation in :ndn-cxx:`Interest::matchesData` method
(:issue:`1769`)
- **Management**
+ 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 to
`NDN-TLV specification <https://named-data.net/doc/NDN-packet-spec/0.1.1/>`_
+ Add checking of Timestamp and Nonce fields in signed Interest within
:ndn-cxx:`ValidatorConfig`
+ 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
* ``onTimeout`` to process interest timeout
* ``afterCheckPolicy`` to process validation requests
+ Fix memory issues in ``SecPublicInfoSqlite3``
- **Miscellaneous tools**
+ Redefine method for random number generation: ``random::generateWord*`` and
``random::generateSecureWord*`` to generate cryptographically non-secure (fast) and
secure (slow) random numbers.
- Other minor fixes and corrections
Deprecated
^^^^^^^^^^
- ``SignatureSha256`` class, use :ndn-cxx:`DigestSha256` instead.
- All :ndn-cxx:`Face` constructors that accept ``shared_ptr<io_service>``.
Use versions that accept reference to ``io_service`` object.
- ``Face::ioService`` method, use :ndn-cxx:`Face::getIoService` instead.
- :ndn-cxx:`Interest` constructor that accepts name, individual selectors, and individual
guiders as constructor parameters.
Use ``Interest().setX(...).setY(...)`` or use the overload taking ``Selectors``
- ``name::Component::toEscapedString`` method, use :ndn-cxx:`name::Component::toUri` instead.
- ``SecPublicInfo::addPublicKey`` method, use ``SecPublicInfo::addKey`` instead.
- ``Tlv::ConentType`` constant (typo), use ``Tlv::ContentType`` instead.
- ``CommandInterestGenerator`` and ``CommandInterestValidator`` utility classes.
:ndn-cxx:`ValidatorConfig` should be used instead.
Removed
^^^^^^^
- Support for ndnd-tlv (only NFD management protocol is supported now)
- ``SecPublicInfoMemory`` and ``SecTpmMemory`` classes that were no longer used
- Removing concept of periodic event from :ndn-cxx:`Scheduler`.
In applications, periodic events should be just re-scheduled within the callback for
single-shot events.
+241
View File
@@ -0,0 +1,241 @@
ndn-cxx version 0.3.0
---------------------
Release date: February 2, 2015
Changes since version 0.2.0:
New features
^^^^^^^^^^^^
- **Build**
+ The code now requires C++11. The minimum supported gcc version is 4.6, as earlier versions
do not have proper support for C++11 features.
- **Base**
+ Enable detailed version information when built from shallow clone or tarball
(:issue:`1915`)
+ Make default transport configurable (:issue:`2189`)
+ Add ability to do partial Name comparison (:issue:`2090`)
- **Security**
+ Add support for KeyDigest key locator (:issue:`1426`)
+ Add a method to get KeyDigest from a PublicKey instance (:issue:`1964`)
+ Add support for KeyChain to sign Interest using SHA256 digest (:issue:`2218`)
+ Add ``ndnsec-dsk-gen`` tool to generate a pair of Data-Signing-Key (DSK) for the specified
identity (:issue:`2246`)
+ Pair-up PIB and TPM in KeyChain: PIB remembers the last used TPM type/location, which is
used during KeyChain construction (unless overriden) (:issue:`2242`)
- **Wire encoding**
+ Add support for application-defined meta information blocks (:issue:`2021`)
+ Introduce new ``name::Component::is*`` methods to allow checking if the name component
follows the specific naming convention without relying on the exception handling
(:issue:`2088`)
+ Add definition of producer-generated NACK (:issue:`2111`)
+ Add ``std::hash<Name>`` specialization to support ``unordered_map`` container
(:issue:`2147`)
+ Add support for ImplicitSha256DigestComponent (:issue:`1640`)
+ Allow tagging Interest and Data packets with arbitrary information (:issue:`2336`)
- **Management**
+ Support NFD face query operation (:issue:`2085`)
- **Miscellaneous tools**
+ Add a new helper to calculate digests over dynamic inputs (:issue:`1934`)
+ Add DNS resolver helper (:issue:`1918`)
+ Import and re-license Ethernet and FaceUri classes from NFD codebase, add FaceUri
canonization support for ``udp``, ``tcp``, and ``ether`` schemas (:issue:`1994`)
+ Add per-application in-memory storage with LRU, LFU, and FIFO replacement policies
(:issue:`1940`)
+ Add ability to specialize system and steady clocks (e.g., for unit tests and simulation
purposes) (:issue:`2158`)
+ Expose DummyClientFace as public API
+ New IndentedStream helper class to simplify writing to streams with the specified indents
or prefixes (:issue:`2238`)
+ New Signal class template as an enhanced version of the deprecated EventEmitter
(:issue:`2279`)
+ New scheduler::ScopedEventId helper to automatically cancel scheduled events upon
destruction (:issue:`2442`)
+ New NetworkMonitor helper to detect network state changes (:issue:`2443`)
Updates and bug fixes
^^^^^^^^^^^^^^^^^^^^^
- **Base**
+ Prevent flags being set for rib/unregister command (:issue:`1945`)
+ Fix segfault caused by Face::unregisterPrefix when registeredPrefixId does not exist
+ Add explicit internal KeyChain to Face class. KeyChain previously existed in the Face as
part of NFD controller class. (:issue:`2039`)
+ Properly disable assertions in release builds (:issue:`2135`)
+ Connect to Transport during construction of Face instance (:issue:`2318`)
- **Wire encoding**
+ Fix segfault when decoding empty Exclude element (:issue:`1970`)
+ Provide EqualityComparable concept for Exclude element
+ Correct Marker in Name::appendVersion() (:issue:`2086`)
+ Ensure that wire-encoding errors are inherited from ``tlv::Error`` (:issue:`1983`)
- **Management**
+ Replace FaceFlags with individual fields in face management data structures (:issue:`1992`)
+ ``ndn::nfd::Controller`` extended to allow generating ControlCommand for remote prefix
registration (:issue:`2039`)
+ Change ``ForwarderStatus.NfdVersion`` to string (:issue:`2003`)
- **Security**
+ Fix ``ndnsec-cert-gen`` to correctly infer prefix before KEY component (:issue:`2052`)
+ Help message corrections in ``ndnsec-cert-dump``, ``ndnsec-cert-gen``, and
``ndnsec-key-gen`` (:issue:`2052`)
+ Accept ``--sign-id`` and ``--cert-prefix`` in ``ndnsec-cert-revoke`` (:issue:`2058`)
+ Changes output format of ``ndnsec-cert-revoke`` to base64 encoding (:issue:`2059`)
+ Add a new (safer) option to ``ndnsec-cert-gen`` allowing inclusion of additional
information blocks into the certificate. The new ``--signed-info`` parameter makes minimum
assumptions, treating text before first space as OID and the rest as the associated string
with this OID.
+ Make Face optional in Validator class (:issue:`2124`)
+ Display signature information when printing a certificate (:issue:`2196`)
+ Handle certificate decoding error in validation process (:issue:`2212`)
+ Fix segmentation fault in ``ndnsec-sign-req`` (:issue:`2211`)
+ Allow verbose option in ``ndnsec-list`` (:issue:`2197`)
+ Allow generation of DSK using ``ndnsec-key-gen`` (:issue:`2247`)
+ Allow ``ndnsec-key-gen`` to generate ECDSA keys (:issue:`2248`)
+ Fix memory leak in SecPublicInfoSqlite3 (:issue:`2253`)
+ Properly report status of ``ndnsec-delete`` execution (:issue:`2275`)
- **Miscellaneous tools**
+ Fix incorrect tag map in ``tlvdump`` tool
+ Change to default resolver behavior in util::dns::Resolver (:issue:`2415`)
- **Documentation**
+ Update of tutorials and installation instructions
+ Rename manpage of ``client.conf`` to ``ndn-client.conf`` (:issue:`1967`)
+ Updated and extended ndn-cxx code style:
- add rules for some C++11 constructs
- prefer ``BOOST_ASSERT`` and ``static_assert``
+ Improve example applications (:issue:`1976`)
- **Tests**
+ Improve security unit test cases (:issue:`1683`)
+ Embedding CI build and test running scripts into the repository
+ Partial unit test coverage for Face class (previously covered only by integration tests)
(:issue:`1947`)
+ Improve stability of unit tests by using UnitTestTime (wall clock independent time)
(:issue:`2152`)
- **Build**
+ Redesign the way default compiler flags are determined (:issue:`2209`)
+ Support tools and examples with multiple translation units (:issue:`2344`)
+ Disable installation of internal headers and headers of the disabled components
(:issue:`2266`, and :issue:`2269`)
+ Enable conditional compilation based on presence of ``getpass()`` function
- Other minor fixes and corrections
Deprecated
^^^^^^^^^^
- ``ndn::ptr_lib`` and ``ndn::func_lib`` namespace aliases
- The following ``nfd::Controller`` methods:
+ ``Controller::start`` overloads, except the overload taking ``CommandOptions``
+ ``Controller::Sign`` typedef
+ ``Controller::getDefaultCommandTimeout``
+ ``ControlCommand::getPrefix``
+ ``ControlCommand::getRequestName(ControlParameters)``
+ ``Controller::Controller(Face&)``
- ``MetaInfo::TYPE_*`` constants
- ``EventEmitter`` is deprecated in favor of ``Signal``
Removed
^^^^^^^
- FaceFlags APIs (:issue:`1992`)
- ``ControlCommand::makeCommandInterest`` (:issue:`2008`)
- namespace ``ndn::Tlv`` (:issue:`2079`)
- ``shared_ptr<io_service>`` constructor and getter in Face class
- ``tlv::ConentType`` (typo in the name)
- ``Selectors::Selectors(int, int, Exclude, int, bool)`` constructor
- ``Interest::Interest(Name, int, int, Exclude, int, bool, int, time::milliseconds, uint32_t)``
constructor
- ``signature-sha256.hpp`` file
- unused ``encryption-manager.hpp`` file
- unused ``openssl`` dependency
@@ -0,0 +1,61 @@
ndn-cxx version 0.3.1
---------------------
Release date: March 3, 2015
Changes since version 0.3.0:
New features
^^^^^^^^^^^^
- **Management**
- Add isConnected() in :ndn-cxx:`signal::Connection` and :ndn-cxx:`signal::ScopedConnection`
(:issue:`2308`)
- Extend :ndn-cxx:`DummyClientFace` to process ``LocalControlHeader`` (:issue:`2510`)
- Add CachingPolicy to ``LocalControlHeader`` (:issue:`2183`)
Updates and bug fixes
^^^^^^^^^^^^^^^^^^^^^
- **Wire encoding**
- Refactoring of :ndn-cxx:`EncodingImpl` class template (``EncodingBuffer`` and
``EncodingEstimator``) (:issue:`2494`, :issue:`2490`)
- Change :ndn-cxx:`Block::fromBuffer` return type (:issue:`2553`)
- **Miscellaneous tools**
- Mark ``Digest<Hash>::operator==`` as unsuitable in a security sensitive context
(:issue:`2395`)
- Restrict destruction of Signal from handler (:issue:`2313`)
- **Documentation**
- Correct function names in security library tutorial (:issue:`2474`)
- Remind users to reinstall ports after OSX upgrade (:issue:`2284`)
- **Tests**
- Fix global buffer overflow in ``ImplicitSha256Digest`` test case (:issue:`2307`)
- Change naming conventions for unit test files and test suite names (:issue:`2497`)
- **Build**
- Explicitly define ``_GLIBCXX_USE_NANOSLEEP``, necessary for gcc < 4.8 in some environments
(:issue:`2499`)
Removed
^^^^^^^
- Delete deprecated ``Block(std::istream&)`` constructor (:issue:`2241`)
- Delete deprecated ``ndn::ptr_lib``, ``ndn::func_lib`` (:issue:`2110`)
- Delete deprecated ``MetaInfo::TYPE_*`` (:issue:`2170`)
@@ -0,0 +1,53 @@
ndn-cxx version 0.3.2
---------------------
Release date: May 12, 2015
Changes since version 0.3.1:
New features
^^^^^^^^^^^^
- Add Link abstraction (:issue:`2587`)
- Add Link and SelectedDelegation fields to the Interest abstraction (:issue:`2587`)
- Initial implementation of several components for the upcoming PIB feature (:issue:`2451`):
* User-facing PIB implementation and implementation-specific PIB interface
* In-memory PIB implementation
* Define new abstraction for identity, key, and certificate
Updates and bug fixes
^^^^^^^^^^^^^^^^^^^^^
- Enable decoding Exclude containing ImplicitSha256DigestComponent (:issue:`2629`)
- Update waf build system to version 1.8.9 (:issue:`2209`, :issue:`2657`, :issue:`2792`)
- Avoid duplicating output in IndentedStream (:issue:`2723`)
- Fix skipping empty name component `(...)` during URI decoding (:issue:`2725`)
- Enable ability to exclude empty name component (:issue:`2660`)
- Fix bug with TLV-LENGTH processing in `Block::fromStream` (:issue:`2728`, :issue:`2729`)
- Disable precompiled headers on OS X with clang < 6.1.0 (:issue:`2804`)
Deprecated
^^^^^^^^^^
- `Block::fromBuffer` overloads with output parameter (:issue:`2553`)
Removed
^^^^^^^
- Delete deprecated Controller functions:
* `Controller::start` overloads, except the overload taking CommandOptions
* `Controller::Sign` typedef
* `Controller::getDefaultCommandTimeout`
* `ControlCommand::getPrefix`
* `ControlCommand::getRequestName(ControlParameters)`
* `Controller::Controller(Face&)`
+128
View File
@@ -0,0 +1,128 @@
ndn-cxx version 0.3.3
---------------------
Release date: July 1, 2015
Changes since version 0.3.2:
New features
^^^^^^^^^^^^
- Allow compilation of ndn-cxx as a shared library (:issue:`2243`)
In this release, by default, only a static library is compiled. The next release will change
the default behavior to compile only a shared library.
- Introduce concept of PartialName (:issue:`1962`)
Semantically, PartialName abstraction represents an arbitrary sequence of name components,
while Name represents an absolute name. Currently, PartialName is typedef alias to Name, but
it can be changed in the future releases.
- Introduce generalized signing API in KeyChain (:issue:`2871`, :issue:`1705`)
A new API in KeyChain introduces a general interface to sign interest and data packets and
supply necessary signing information, such as signing identity name, signing key name, or
signing certificate name. In addition, the supplied signing information can include additional
information that signer wants to include in the SignatureInfo of the signed packet.
- Introduce helpers to create SigningInfo for the generalized signing API (:issue:`2922`)
- Sqlite3Statement utility helper that wraps an SQLite3 statements and provide automatic memory
cleanup
- Introduce PibSqlite3 based on PibImpl (:issue:`2807`)
- Make public interface of Pib, Identity, and Key as read-only (:issue:`2928`)
- New encoding block helpers to simplify operations with ``std::string`` (:issue:`2951`):
* ``prependStringBlock``
* ``makeStringBlock``
* ``readString``
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Use C++11 lambda expression and smart pointers in Face implementation (:issue:`2112`)
- Fix compilation failure on OS X 10.10 with cryptopp from MacPorts
- Update client.conf manpage
- Change Name::compare to return negative, zero, or positive integer (instead of strictly -1,
0, 1) when the first name comes before the other in canonical ordering, is equal, or comes
after (:issue:`2445`)
- IdentityCertificate sets default FreshnessPeriod to 1 hour (:issue:`2872`)
- Unify TPM creation (:issue:`2722`)
- Allow negative start index in Name::getSubName method (:issue:`1962`)
- Improved documentation of PibImpl interfaces (:issue:`2896`, :issue:`2898`)
- Simplify CommandOptions with SigningInfo (:issue:`2893`)
- Refactor internal PIT to use scheduled events (:issue:`1372`, :issue:`2518`)
- Improve structure and documentation of block helpers (:issue:`2951`)
- Declare all move constructors as ``noexcept`` to ensure move operations are used even when a
restrictive move operation (`move_if_noexcept`) is used (e.g., in STL library's containers)
(:issue:`2966`)
Deprecated
^^^^^^^^^^
- The following ``KeyChain::sign*`` methods, in favor of generalized ``KeyChain::sign(..., SigningInfo)``
* ``KeyChain::sign(Packet, Name)``
* ``KeyChain::sign(uint8_t*, size_t, Name)``
* ``KeyChain::signByIdentity(Packet, Name)``
* ``KeyChain::signByIdentity(uint8_t*, size_t, Name)``
* ``KeyChain::signWithSha256(Data)``
* ``KeyChain::signWithSha256(Interest)``
- The following encoding block helper functions:
* ``nonNegativeIntegerBlock`` (use ``makeNonNegativeIntegerBlock``)
* ``prependBooleanBlock`` (use ``prependEmptyBlock``)
* ``booleanBlock`` (use ``makeEmptyBlock``)
* ``dataBlock`` (use ``makeBinaryBlock``)
* ``nestedBlock`` (use ``makeNestedBlock``)
- The following methods of ``CommandOptions`` class, use ``setSigningInfo()`` instead (:issue:`2893`):
* ``CommandOptions::getSigningParamsKind``
* ``CommandOptions::getSigningIdentity``
* ``CommandOptions::getSigningCertificate``
* ``CommandOptions::setSigningDefault``
* ``CommandOptions::setSigningIdentity``
* ``CommandOptions::setSigningCertificate``
Removed
^^^^^^^
- Remove SCOPE from Interests and all references to it in the related code (:issue:`2345`)
- 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>``).
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`)
- New NDN certificate format (:issue:`2861`, :issue:`2868`)
- NDN trust schema as a description of application trust model, which can help automate data
and interest packet signing and authentication (:issue:`2829`)
- Refactored KeyChain abstraction (:issue:`2926`)
@@ -0,0 +1,72 @@
ndn-cxx version 0.3.4
---------------------
Release date: August 31, 2015
Changes since version 0.3.3:
New features
^^^^^^^^^^^^
- By default, library is now compiled as a shared library (:issue:`2867`)
- Specification for the new NDN certificate format. The reference implementation is being
developed and will be merged in a future release. (:issue:`2861`)
- Add new ValidityPeriod abstraction into SignatureInfo (:issue:`2868`)
- Add new optional AdditionalInfo abstraction for SignatureInfo (:issue:`3058`)
- Implementation of basic NDNLP2 abstractions (:issue:`2875`, :issue:`2878`,
:issue:`2963`, :issue:`2879`)
- ``Face::registerPrefix`` and ``Face::setInterestFilter`` are now unified with the use
of SigningInfo abstraction (:issue:`2932`)
- New Dispatcher class to simplify server-side implementation of NFD management protocol
(:issue:`2107`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Fix compilation error with Boost 1.59 (:issue:`3128`)
- Enhance exception throwing with Boost Exception library (:issue:`2997`)
- Improvements of string helpers (:issue:`3006`)
- Add API in ``Block`` class to add sub-elements (:issue:`2998`)
- Add constructor to create sub-elements using the underlying buffer (:issue:`3100`)
- Fix bug in ``Block::remove``, so it removes all sub-elements of the specified type
(:issue:`2998`)
- Add ability to create ``util::Digest`` object from ``std::istream&`` (:issue:`3022`)
Deprecated
^^^^^^^^^^
- The following methods of ``CommandOptions`` class in favor of ``getSigningInfo`` and
``setSigningInfo`` methods (:issue:`2893`):
* ``getSigningParamsKind``
* ``getSigningIdentity``
* ``getSigningCertificate``
* ``setSigningDefault``
* ``setSigningIdentity``
* ``setSigningCertificate``
* ``setSigningCertificate``
- Overloads of ``Face::registerPrefix`` and ``Face::setInterestFilter`` that do not accept
SigningInfo parameter (:issue:`2932`)
Upcoming features (partially implemented in development branches)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Introduce new API to simplify security transformations (:issue:`3009`)
- NDN trust schema as a description of application trust model, which can help automate data
and interest packet signing and authentication (:issue:`2829`)
- Refactored KeyChain abstraction (:issue:`2926`)
@@ -0,0 +1,77 @@
ndn-cxx version 0.4.0
---------------------
Release date: December 31, 2015
.. note::
Version 0.4.0 introduces several breaking changes to API and wire format of management protocols
Changes since version 0.3.4:
New features
^^^^^^^^^^^^
- **(breaking change)** LocalControlHeader for special signaling between application and NFD has
been replaced with NDNLPv2 signaling (:issue:`2879`, :issue:`2930`)
- NDNLPv2 Network NACK support in Face abstraction (:issue:`2930`)
- **(breaking change)** FacePersistency field added to API and wire format of ControlParameters abstraction (:issue:`2991`)
- **(breaking change)** NACK counters added to ForwarderStatus and FaceStatus datasets (:issue:`3174`)
- Backport C++14 ``std::make_unique`` (:issue:`3093`)
- Emulate ``std::to_string`` on platforms that do not provide it (:issue:`2743`)
- New API in Face class to remove all pending Interests (:issue:`3300`)
- Ability to choose signing parameters (a specific certificate, the default certificate for
a key, or the default certificate for the default key) using a specially URI string
(:issue:`3281`)
- Ability to create Face with custom IO service and default transport (:issue:`2500`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- **(breaking change)** SegmentFetcher helper changed to use asynchronous data validation (:issue:`2734`)
- Support Interest Nack in nfd::Controller (:issue:`3264`)
- Fix bug causing failure of Face if there is a large delay between construction of Face and calling processEvents
(:issue:`2742`, :issue:`2526`)
- Cache Link object after the first call to getLink (:issue:`3158`)
- Minor documentation updates (:issue:`3207`, :issue:`3210`, :issue:`3221`)
Deprecated
^^^^^^^^^^
- Overloads of ``Face::registerPrefix`` and ``Face::setInterestFilter`` that do not accept
SigningInfo parameter (:issue:`2932`)
- tlvdump tool (:issue:`3196`). Use ``ndn-dissect`` program from ndn-tools repository
`<https://github.com/named-data/ndn-tools>`__
- ndn::util::makeDummyClientFace, use ndn::util::DummyClientFace constructors directly
(:issue:`3146`)
- ndn::util::DummyClientFace::sentDatas, use ndn::util::DummyClientFace.sentData instead
(:issue:`3146`)
Removed
^^^^^^^
- Deprecated EventEmitter class (:issue:`2351`)
Planned features for future releases
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Introduce new API to simplify security transformations (:issue:`3009`)
- NDN trust schema as a description of application trust model, which can help automate data
and interest packet signing and authentication (:issue:`2829`)
- Refactored KeyChain abstraction (:issue:`2926`)
@@ -0,0 +1,32 @@
ndn-cxx version 0.4.1
---------------------
Release date: March 25, 2016
Changes since version 0.4.0:
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Improved support for ECDSA signatures (:issue:`3438`, :issue:`3439`)
- Support for MustBeFresh selector processing in InMemoryStorage (:issue:`3274`)
- Use InMemoryStorage for StatusDataset and Notification produced by managers based on
Dispatcher class (:issue:`2182`)
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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Introduce new API to simplify security transformations (:issue:`3009`)
- NDN trust schema as a description of application trust model, which can help automate data
and interest packet signing and authentication (:issue:`2829`)
- Refactored KeyChain abstraction (:issue:`2926`)
+152
View File
@@ -0,0 +1,152 @@
ndn-cxx version 0.5.0
---------------------
Release date: October 4, 2016
.. note::
As of version 0.5.0, ndn-cxx requires a modern compiler (gcc >= 4.8.2, clang >= 3.4) and a
relatively new version of Boost libraries (>= 1.54). This means that the code no longer compiles
with the packaged version of gcc and boost libraries on Ubuntu 12.04. ndn-cxx can still be
compiled on such systems, but requires separate installation of a newer version of the compiler
(e.g., clang-3.4) and dependencies.
.. note::
The library now has a dependency on OpenSSL >= 1.0.1
Changes since version 0.4.1:
New features
^^^^^^^^^^^^
- New transformation API (:issue:`3009`)
* base64 and hex encoding/decoding
* digest calculation (SHA256)
* HMAC calculation
* block cipher operations (AES in CBC mode)
* public key signing/verification
- Introduce environment variables to set/override transport, pib, and tpm configurations
(:issue:`2925`, :issue:`2514`)
* ``NDN_CLIENT_TRANSPORT``: equivalent of transport in client.conf
* ``NDN_CLIENT_PIB``: equivalent of pib in client.conf
* ``NDN_CLIENT_TPM``: equivalent of tpm in client.conf
Whenever an environment variable is set, it takes precedence over any values specified in the
configuration file.
- Introduce logging facility based on Boost.Log (:issue:`3562`)
The logging can be enabled on selected moduled at the selected log level through ``NDN_LOG``
environment variable. For example,
::
export NDN_LOG=ndn.mgmt.Dispatcher=TRACE
- Introduce ``Name::deepCopy`` to allow memory optimizations when working with ``Name`` objects
(:issue:`3618`)
- New ``ndn::security::CommandInterestValidator`` class (:issue:`2376`)
- Add ``StatusDataset`` client functionality into ``ndn::nfd::Controller`` (:issue:`3329`)
- New ``FaceUpdateCommand`` structure for NFD management protocols (:issue:`3232`)
- **breaking change** Add Flags and Mask fields to faces/create and faces/update, add Flags field to
FaceStatus (:issue:`3731`, :issue:`3732`)
- New ``SafeBag`` structure for private key export/import (:issue:`3048`)
- ``ndn::io::loadBlock`` and ``saveBlock`` (:issue:`3741`)
- Backport of C++17 ``std::clamp`` and ``std::optional`` (:issue:`3636`, :issue:`3753`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- **breaking change** Expose ``ControlResponse`` as part of ``Controller::CommandFailCallback``
(:issue:`3739`)
- **breaking change** Change security constants to corresponding strongly typed enumerations
(:issue:`3083`)
- Fix ``SegmentFetcher`` restarting from segment 0 upon Nack (:issue:`3554`)
- Fix support for ``ImplicitSha256Digest`` name component in ``Exclude`` selector
(:issue:`3665`)
- Enable ``KeyChain`` customization in ``DummyClientFace`` (:issue:`3435`)
- Make ``ValidatorConfig`` to evaluate all checkers inside a rule (:issue:`3645`)
- Add validation of ``StatusDataset`` and ``ControlCommand`` responses in
``ndn::nfd::Controller`` (:issue:`3653`)
- Enable handling of NACKs in Validator and NotificationSubscriber classes (:issue:`3332`,
:issue:`3662`)
- Several fixes in ``Scheduler`` class (:issue:`3722`, :issue:`3691`)
- Add option to override ``processEvents`` method in ``DummyClientFace`` class (:issue:`3769`)
- Several other improvements, including fixes of potential segmentation faults and memory leaks
(:issue:`3136`, :issue:`3248`, :issue:`3723`, :issue:`3727`)
Deprecated
^^^^^^^^^^
- Constant ``io::BASE_64``, use ``io::BASE64`` instead (:issue:`3741`)
- Headers ``management/nfd-*``, use ``mgmt/nfd/*`` instead (:issue:`3760`)
- ``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 will be removed from future versions of the library.
- ``security/identity-certificate.hpp`` header. Use ``security/v1/identity-certificate.hpp`` instead.
- ``ndn::PublicKey``, ``ndn::Certificate``, ``ndn::IdentityCertificate``,
``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>`.
Removed
^^^^^^^
- Previously deprecated LocalControlHeader (:issue:`3755`)
- Previously deprecated ``makeDummyClientFace`` function, use ``DummyClientFace`` constructors
directly (:issue:`3383`)
- Previously deprecated ``Name::set``, use constructors directly (:issue:`2506`)
- Previously deprecated ``Block::fromBuffer`` and block helpers (:issue:`2950`, :issue:`2636`)
* ``Block::fromBuffer`` overloads with output parameter
* ``ndn::encoding::prependBlock``
* ``ndn::encoding::prependByteArrayBlock``
* ``ndn::encoding::nonNegativeIntegerBlock``
* ``ndn::encoding::prependBooleanBlock``
* ``ndn::encoding::booleanBlock``
* ``ndn::encoding::dataBlock``
* ``ndn::encoding::nestedBlock``
- Previously deprecated Command Interest classes (:issue:`2008`)
* ``CommandInterestGenerator``, replaced by ``KeyChain::sign``
* ``ndn::util::CommandInterestValidator``, replaced by
``ndn::security::CommandInterestValidator``
- ndncatchunks3 and ndnputchunks3 apps. Use ndncatchunks and ndnputchunks from `NDN Essential
Tools (ndn-tools) <https://github.com/named-data/ndn-tools>`__ (:issue:`3547`)
- ``ndn::ndn_digestSha256`` function. Use ``ndn::crypto::computeSha256Digest`` instead.
- **potentially breaking change** Headers ``security/certificate-extension.hpp``,
``security/certificate-subject-description.hpp``, and ``security/certificate.hpp``. When necessary,
use the corresponding headers in ``security/v1/*`` or ``security/v1/identity-certificate.hpp``.
+104
View File
@@ -0,0 +1,104 @@
ndn-cxx version 0.5.1
---------------------
Release date: January 25, 2017
.. note::
This is the last release of the library that supports NDN Certificate format version 1 and
the existing implementations of validators. The upcoming 0.6.0 release will include
multiple breaking changes of the security framework.
Changes since version 0.5.0:
New features
^^^^^^^^^^^^
- Add version 2 of the security framework (introduced 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
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`)
- Enable validator to fetch certificates directly from the signed/command interest sender
(:issue:`3921`)
- Add UP and DOWN kinds to :ndn-cxx:`FaceEventNotification` (issue:`3794`)
- Add support for NIC-associated permanent faces in FaceUri (:issue:`3522`)
- Add support for CongestionMark and Ack NDNLPv2 fields (:issue:`3797`, :issue:`3931`)
- Add StrategyChoice equality operators and formatted output (:issue:`3903`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Ensure that NACK callback is called for matching Interests, regardless of their nonce
(:issue:`3908`)
- Optimize :ndn-cxx:`name::Component::compare` implementation (:issue:`3807`)
- Fix memory leak in ndn-cxx:`Regex` (:issue:`3673`)
- Correct NDNLPv2 rules for whether an unknown field can be ignored (:issue:`3884`)
- Ensure that port numbers in FaceUri are 16 bits wide
- Correct ValidityPeriod::isValid check (:issue:`2868`)
- Fix encoding of type-specific TLV (:issue:`3914`)
- Rename previously incorrectly named EcdsaKeyParams to EcKeyParams (:issue:`3135`)
- Various documentation improvements, including ndn-cxx code style updates (:issue:`3795`, :issue:`3857`)
Deprecated
^^^^^^^^^^
- Old security framework. All old security framework classes are moved to
``ndn::security::v1`` namespace in this release and will be removed in the next release.
* ``v1::KeyChain``, use :ndn-cxx:`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).
* ``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.
* ``v1::Certificate``, ``v1::IdentityCertificate``, ``v1::CertificateExtension``,
``v1::CertificateSubjectDescription``, use :ndn-cxx:`v2::Certificate` and
:ndn-cxx:`AdditionalDescription`
* ``v1::SecuredBag``, use ``v2::SafeBag`` instead
- Constant ``io::BASE_64``, use ``io::BASE64`` instead (:issue:`3741`)
- Headers ``management/nfd-*``, use ``mgmt/nfd/*`` instead (:issue:`3760`)
- ``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 will be removed from future versions of the library.
- ``security/identity-certificate.hpp`` header. Use ``security/v1/identity-certificate.hpp`` instead.
- ``ndn::PublicKey``, ``ndn::Certificate``, ``ndn::IdentityCertificate``,
``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>`.
+153
View File
@@ -0,0 +1,153 @@
ndn-cxx version 0.6.0
---------------------
Release date: October 16, 2017
Changes since version 0.5.1:
New features
^^^^^^^^^^^^
- **(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`.
- Integration of fetching certificates using Certificate Bundle as part of specialized
``CertificateFetcher`` (:issue:`3891`)
- ``ForwardingHint``, ``Delegation``, and ``DelegationList``; refactoring of Interest encoding
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
for all supported platforms (:issue:`3353`, :issue:`4025`, :issue:`3817`, :issue:`4024`)
- Addition of ``TxSequence`` field and ``Ack``, the first repeatable field in
NDNLPv2 (:issue:`3931`)
- Optional ``LocalUri`` as part of ``ControlParameters`` and adjusting face creation command
and responses to handle the new optional field (:issue:`4014`, :issue:`4015`, :issue:`3956`)
- ``LpReliability`` flag in Face management data structures (:issue:`4003`)
- Backported implementation of C++17 classes ``ostream_joiner`` and ``optional``
(:issue:`3962`, :issue:`3753`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Removed dependency on CryptoPP library. All cryptographic operations are now realized using
OpenSSL library routines and/or with the help of ``security::transform`` framework
(:issue:`3006`, :issue:`3946`, :issue:`3924`, :issue:`3886`).
- Improved APIs for NFD management data structures, including equality comparators, formatted
output, etc. (:issue:`3932`, :issue:`3903`, :issue:`3864`)
- FaceUri now accepts link-local IPv6 addresses (:issue:`1428`)
- Rename variables in ``FaceStatus`` and ``ForwarderStatus`` ('datas' => 'data')
(:issue:`3955`)
- Improve logging framework and its uses
* Add API to enumerate Logger modules (:issue:`4013`)
* Advanced filtering of the logging modules (:issue:`3918`)
* 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:
::
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`)
- Fix potential overflow in ``time::toIsoString`` (:issue:`3915`)
- Fix potentially misaligned memory accesses (:issue:`4172`, :issue:`4097`, :issue:`4175`,
:issue:`4190`, :issue:`4191`)
- Fix potential memory access error in ``Face/PendingInterest`` (:issue:`4228`)
- Improvements and streamlining of the ``security::transform`` framework
- Source/header reorganization (:issue:`3940`)
* Move network-related files to ``src/net``
.. 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
* Move signal-related files into ``src/util/signal/`` directory, except for
the main include ``signal.hpp``
* Move InMemoryStorage to ``src/ims``
* Rename ``digest.hpp`` to ``sha256.hpp`` to match the ``Sha256`` class declared within
Removed
^^^^^^^
- Old security framework.
* ``v1::KeyChain``, use :ndn-cxx:`v2::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
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::SecuredBag``, use ``v2::SafeBag`` instead
- Constant ``io::BASE_64``, use ``io::BASE64`` instead (:issue:`3741`)
- Headers ``management/nfd-*``, use ``mgmt/nfd/*`` instead (:issue:`3760`)
- ``security/cryptopp.hpp`` header
- ``security/identity-certificate.hpp`` header
- ``ndn::PublicKey``, ``ndn::Certificate``, ``ndn::IdentityCertificate``,
``ndn::CertificateExtension``, ``ndn::CertificateSubjectDescription``.
- ``Link`` and ``SelectedDelegation`` fields in ``Interest``, replaced by
``ForwardingHint`` following the latest version of NDN specification (:issue:`4055`)
- ``LocalControlHeader`` constants (:issue:`3755`)
- ``NInDatas`` and ``NOutDatas`` (:issue:`3955`)
- Overload of ``Block::Block`` that parses a ``Block`` from a ``void*`` buffer
- Duplicate ``buf()`` and ``get()`` methods from ``Buffer`` class in favor of ``data()``
- ``util/crypto.hpp``, ``crypto::sha256()``, and ``crypto::computeSha256Digest()`` in favor of
``Sha256::computeDigest()``
- Previously deprecated functions (:issue:`4055`)
@@ -0,0 +1,57 @@
ndn-cxx version 0.6.1
---------------------
Release date: February 19, 2018
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
``InterestFilter::allowLoopback(false)`` (:issue:`3979`)
- New signal in :ndn-cxx:`SegmentFetcher` to notify retrieval of Data segments
(:issue:`4438`)
- 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)
- 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 ``name::Component::toUri()`` (:issue:`4484`)
- Fixed handling of large dates when converting to/from string (:issue:`4478`, :issue:`3915`)
- Fixed error handling in ``KeyChain::importSafeBag()`` (:issue:`4359`)
- Fixed parsing of IPv6 addresses with scope-id (:issue:`4474`)
- ``io::load()`` now handles empty files properly (:issue:`4434`)
- 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`)
- Fixed build when ``std::to_string`` is not available (:issue:`4393`)
- Avoid undefined behavior when casting to :ndn-cxx:`tlv::SignatureTypeValue` (:issue:`4370`)
- Fixed compilation with Boost 1.66.0 (:issue:`4422`)
- Various documentation updates
(:issue:`3918`, :issue: `4184`, :issue: `4275`)
Removed
^^^^^^^
- Removed obsolete TLV-TYPE constants (:issue:`4055`, :issue:`3098`, :issue: `3755`)
@@ -0,0 +1,53 @@
ndn-cxx version 0.6.2
---------------------
Release date: May 4, 2018
New features
^^^^^^^^^^^^
- Initial support for `NDN packet format version 0.3
<https://named-data.net/doc/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
* Recognize typed name components, allow typed name component in ``FinalBlockId``
(:issue:`4526`)
* Recognize Interest in Packet Format v0.3 (:issue:`4527`)
In this release, ``Interest::wireDecode`` accepts both v0.2 and v0.3 formats, but
``Interest::wireEncode`` only encodes into v0.2 format. A future release of the
library will switch the encoding to v0.3 format.
* Recognize Data in Packet Format v0.3 (:issue:`4568`)
In this release, ``Data::wireDecode`` accepts both v0.2 and v0.3 formats, but
``Data::wireEncode`` only encodes into v0.2 format. A future release of the library
will switch the encoding to v0.3 format.
- Library support for cs/erase command of NFD Management (:issue:`4318`)
- A convenience function to print out ``Block`` structures (:issue:`2225`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Change encoding of NDNLPv2 sequence number from nonNegativeInteger to fixed-width
integer (8 bytes in network order) (:issue:`4403`)
- Fix compilation with Boost 1.67 (:issue:`4584`)
- Upgrade build environment to latest version of ``waf`` and other improvements
- Logging system improvements (:issue:`4552`)
Deprecated
^^^^^^^^^^
- Selectors (:issue:`4527`)
NDN Packet Format v0.3 replaces Selectors with ``CanBePrefix`` and ``MustBeFresh`` elements.
This commit deprecates getter/setter for Selectors in Interest class. Getter/setter for
CanBePrefix and MustBeFresh are mapped to the closest v0.2 semantics and encoded as
selectors.
- ``Data::get/setFinalBlockId()`` in favor of ``Data::get/setFinalBlock()``
@@ -0,0 +1,88 @@
ndn-cxx version 0.6.3
---------------------
Release date: September 18, 2018
The build requirements have been upgraded to gcc >= 5.3 or clang >= 3.6, boost >= 1.58,
openssl >= 1.0.2. This effectively drops support for all versions of Ubuntu older than 16.04
that use distribution-provided compilers and packages.
The compilation now uses the C++14 standard.
New features
^^^^^^^^^^^^
- More support for `NDN packet format version 0.3
<https://named-data.net/doc/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
- Allow applications to declare a default ``CanBePrefix`` setting (:issue:`4581`)
- Accommodate typed name components in ``Name::getSuccessor`` (:issue:`4570`)
- Support Parameters element (:issue:`4658`)
- Recognize alternative type representations in URI syntax (:issue:`4690`)
- Introduce ``ParametersSha256DigestComponent`` (:issue:`4658`, :issue:`4570`)
- Prefix announcement object (:issue:`4650`)
- MTU element in ``ControlParameters`` and ``FaceStatus`` (:issue:`4005`)
- Enable congestion control features in ``SegmentFetcher`` (:issue:`4364`)
- ``_block`` literal operator (:issue:`4722`)
- Add official support for CentOS 7 (:issue:`4610`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Fix a segfault in ``Face::satisfyPendingInterests`` when ``Face::put`` is
called in DataCallback (:issue:`4596`)
- Allow specifying passphrase for ndnsec import/export on the command line (:issue:`4633`)
- Fix bug preventing customization of KeyChain's TPM on macOS (:issue:`4297`)
- Fix bug with handling Sha256-signed Command Interests (:issue:`4635`)
- Eliminate selector usage in ``SegmentFetcher`` (:issue:`4555`)
- Improvements in ``netlink`` message processing
- Gracefully handle ``NetworkMonitor`` backend initialization failure (:issue:`4668`)
- Add support 224-bit and 521-bit NIST elliptic curves, add support for SHA-3 (with
openssl >= 1.1.1-pre1), and forbid RSA keys shorter than 2048 bits in security helpers
- Improve and simplify code with modern C++ features
- Properly declare move constructors
- Improve error handling
- Improve test cases
- Correct and improve documentation
Deprecated
^^^^^^^^^^
- ``SegmentFetcher::fetch()`` static functions in favor of ``start()`` (:issue:`4464`)
- ``ndn::ip::address{,V6}FromString`` as Boost.Asio >= 1.58 has proper implementation of
``addressFromString``
- Selectors (:issue:`4527`)
NDN Packet Format v0.3 replaces Selectors with ``CanBePrefix`` and ``MustBeFresh`` elements.
``CanBePrefix`` and ``MustBeFresh`` are currently mapped to the closest v0.2 semantics and
encoded as selectors.
- ``Data::get/setFinalBlockId()`` in favor of ``Data::get/setFinalBlock()``
Removed
^^^^^^^
- Dependency on Boost.Regex in favor of ``std::regex``
@@ -0,0 +1,78 @@
ndn-cxx version 0.6.5
---------------------
Release date: February 4, 2019
New features
^^^^^^^^^^^^
- More support for `NDN packet format version
0.3 <https://named-data.net/doc/NDN-packet-spec/0.3/>`__ (:issue:`4527`)
* Stop using ``ChildSelector`` in ``NotificationSubscriber`` (:issue:`4664`)
* Stop using ``ChildSelector`` in ``CertificateBundleFetcher`` (:issue:`4665`)
- Support floating point numbers in TLV-VALUE (:issue:`4612`)
- Scoped prefix registration, scoped Interest filter, and scoped pending Interest
(:issue:`3919`, :issue:`4316`)
- Counters for satisfied and unsatisfied Interests in ``ForwarderStatus``
(:issue:`4720`)
- ``random::getRandomNumberEngine()`` in the public API
- ``MetadataObject`` class to encode/decode RDR-style metadata (:issue:`4707`)
- ``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`)
- 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 ``InMemoryStorage`` (:issue:`4769`)
- Clean up fetchers when destructing ``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.hpp`` header (:issue:`4698`)
- Implicit conversion from nullptr to ``scheduler::EventId`` (:issue:`4698`)
Removed
^^^^^^^
- ``ndn::ip::address{,V6}FromString``
- ``SegmentFetcher::fetch`` (:issue:`4464`)
- ``{get,set}FinalBlockId()``
- Headers that were already considered internal implementation details have been explicitly
moved to a ``detail/`` subdir to more clearly separate private and public headers
@@ -0,0 +1,62 @@
ndn-cxx version 0.6.6
---------------------
Release date: April 27, 2019
.. note::
This is the last release to support the `NDN packet format version 0.2.1
<https://named-data.net/doc/NDN-packet-spec/0.2.1/>`__.
The next release will be able to encode and decode only the `v0.3 packet format
<https://named-data.net/doc/NDN-packet-spec/0.3/>`__.
New features
^^^^^^^^^^^^
- More support for `NDN packet format version 0.3
<https://named-data.net/doc/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`)
* Stop using ``ChildSelector`` in ``CertificateBundleFetcher`` (:issue:`4665`)
- ``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`)
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Avoid directly using memory address as ``PendingInterestId`` to prevent potential false
removal of an entry (:issue:`2865`)
- Follow up packet specification changes to rename the ``Parameters`` element to
``ApplicationParameters`` and to change its number to be a non-critical element type
(:issue:`4658`, :issue:`4780`)
- 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`)
- Improve the "CanBePrefix unset" warning (:issue:`4581`)
- Improve documentation
Deprecated
^^^^^^^^^^
- ``PendingInterestId``, ``RegisteredPrefixId``, and ``InterestFilterId`` types in favor of
``PendingInterestHandle``, ``RegisteredPrefixHandle``, and ``InterestFilterHandle``
(:issue:`4316`, :issue:`3919`)
- ``Block::empty`` in favor of ``Block::isValid`` (with inverted semantics)
- ``Scheduler::scheduleEvent`` and ``Scheduler::cancelEvent`` in favor of ``Scheduler::schedule``
and ``EventId::cancel`` (or use ``ScopedEventId`` to automatically cancel the event when
the object goes out of scope) (:issue:`4883`)
- ``ndn::util::Scheduler`` (use ``ndn::Scheduler`` or ``ndn::scheduler::Scheduler``) and
``ndn::EventId`` (use ``ndn::scheduler::EventId``) (:issue:`4883`)
@@ -0,0 +1,79 @@
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://named-data.net/doc/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 ``Name`` and ``Interest`` classes
(:issue:`4658`)
- Encoding/decoding of ``HopLimit`` field in Interest (:issue:`4806`)
- PIT token (: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.
- ``io::loadBuffer`` and ``io::saveBuffer`` helper functions
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Various improvements in the Linux implementation of ``NetworkMonitor`` class
- Rework of ``RttEstimator`` class:
* split into two classes: ``RttEstimator`` and ``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 SignerFilter and 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,77 @@
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 according to Packet Specification v0.3 (:issue:`4804`)
- Add "in-order" mode to ``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 ``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 ``time::toIsoString`` in Boost 1.73.0+
- 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
+151
View File
@@ -0,0 +1,151 @@
All ndn-cxx Releases
++++++++++++++++++++
.. toctree::
:hidden:
:maxdepth: 1
release-notes/release-notes-0.7.1
release-notes/release-notes-0.7.0
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
* **ndn-cxx version 0.7.1**
(:doc:`Release Notes <release-notes/release-notes-0.7.1>`, `Documentation <https://named-data.net/doc/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/nfd-0.7.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-0.7.1.tar.bz2.sha256>`__)
* **ndn-cxx version 0.7.0**
(:doc:`Release Notes <release-notes/release-notes-0.7.0>`, `Documentation <https://named-data.net/doc/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/nfd-0.7.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nfd-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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
* **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/>`__)
`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>`__)
- ndn-cxx version 0.2.0-rc1
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.2.0-rc1>`__
- ndn-cxx version 0.2.0-rc2
`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/>`__)
`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>`__)
- ndn-cxx version 0.1.0-rc1
`src (git) <https://github.com/named-data/ndn-cxx/releases/tag/ndn-cxx-0.1.0-rc1>`__
+10
View File
@@ -0,0 +1,10 @@
Specifications
==============
.. toctree::
:maxdepth: 2
specs/signed-interest
specs/certificate-format
specs/safe-bag
specs/validation-error-code
+200
View File
@@ -0,0 +1,200 @@
.. _NDN Certificate Format Version 2.0:
NDN Certificate Format Version 2.0
==================================
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 |
+--------------------------+
.. code-block:: abnf
CertificateV2 = DATA-TYPE TLV-LENGTH
Name ; /<NameSpace>/KEY/[KeyId]/[IssuerId]/[Version]
MetaInfo ; ContentType == KEY, FreshnessPeriod required
Content ; X509PublicKey
CertificateV2SignatureInfo
SignatureValue
CertificateV2SignatureInfo = SIGNATURE-INFO-TYPE TLV-LENGTH
SignatureType
KeyLocator
ValidityPeriod
*CertificateV2Extension
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.
.. code-block:: abnf
ValidityPeriod = VALIDITY-PERIOD-TYPE TLV-LENGTH
NotBefore
NotAfter
NotBefore = NOT-BEFORE-TYPE TLV-LENGTH 8DIGIT "T" 6DIGIT
NotAfter = NOT-AFTER-TYPE TLV-LENGTH 8DIGIT "T" 6DIGIT
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 number | Assigned number|
| | (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.
.. code-block:: abnf
CertificateV2Extension = AdditionalDescription
AdditionalDescription = ADDITIONAL-DESCRIPTION-TYPE TLV-LENGTH
1*DescriptionEntry
DescriptionEntry = DESCRIPTION-ENTRY-TYPE TLV-LENGTH
DescriptionKey
DescriptionValue
DescriptionKey = DESCRIPTION-KEY-TYPE TLV-LENGTH 1*OCTET
DescriptionValue = DESCRIPTION-VALUE-TYPE TLV-LENGTH 1*OCTET
+---------------------------------------------+-------------------+----------------+
| TLV-TYPE | Assigned number | Assigned number|
| | (decimal) | (hexadecimal) |
+=============================================+===================+================+
| DescriptionEntry | 512 | 0x0200 |
+---------------------------------------------+-------------------+----------------+
| DescriptionKey | 513 | 0x0201 |
+---------------------------------------------+-------------------+----------------+
| DescriptionValue | 514 | 0x0202 |
+---------------------------------------------+-------------------+----------------+
+30
View File
@@ -0,0 +1,30 @@
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>`_.
The format of **SafeBag** is defined as:
.. code-block:: abnf
SafeBag = SAFE-BAG-TYPE TLV-LENGTH
CertificateV2
EncryptedKeyBag
EncryptedKeyBag = ENCRYPTED-KEY-BAG-TYPE TLV-LENGTH
*OCTET ; private key encrypted in PKCS #8 format
All TLV-TYPE numbers are application specific:
+---------------------------------------------+-------------------+----------------+
| TLV-TYPE | Assigned number | Assigned number|
| | (decimal) | (hexadecimal) |
+=============================================+===================+================+
| SafeBag | 128 | 0x80 |
+---------------------------------------------+-------------------+----------------+
| EncryptedKeyBag | 129 | 0x81 |
+---------------------------------------------+-------------------+----------------+
@@ -1,5 +1,12 @@
Signed Interest
===============
.. _Signed Interest:
Signed Interest Version 0.2 (DEPRECATED)
========================================
.. warning::
This document describes a deprecated format for signed Interest packets. The current format can
be found in the
`NDN Packet Specification <https://named-data.net/doc/NDN-packet-spec/current/signed-interest.html>`__.
**Signed Interest** is a mechanism to issue an authenticated interest.
@@ -11,7 +18,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 | |
@@ -25,14 +32,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>
@@ -49,21 +54,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://named-data.net/doc/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://named-data.net/doc/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://named-data.net/doc/NDN-packet-spec/0.2.1/signature.html>`__ TLV.
::
@@ -81,7 +86,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://named-data.net/doc/NDN-packet-spec/0.2.1/signature.html>`__ TLV.
::
@@ -106,7 +111,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://named-data.net/doc/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
+33
View File
@@ -0,0 +1,33 @@
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.
-3
View File
@@ -4,8 +4,5 @@ Tutorials
.. toctree::
:maxdepth: 2
tutorials/security-library
tutorials/utils-ndn-regex
tutorials/security-validator-config
tutorials/signed-interest
manpages
-359
View File
@@ -1,359 +0,0 @@
Security Library Tutorial
=========================
.. contents::
Identity, Key and Certificates
------------------------------
All keys, certificates and their corresponding identities are managed by :ndn-cxx:`KeyChain`.
An real world **identity** can be expressed by a namespace. (e.g.,
``/ndn/edu/ucla/alice``, or ``/ndn/edu/ucla/BoelterHall/4805``).
**Keys** belonging to an identity are named under the identity's namespace, with a unique
**KeyId**::
/<identity_name>/[KeyId]
For now, only two types of KeyId are specified: ``ksk-[timestamp]`` and
``dsk-[timestamp]``. The first type of KeyId is used to denote Key-Signing-Key (KSK)
which is supposed to have a long lifetime. The second type of KeyId is used to denote
Data-Signing-Key (DSK) which is supposed to have a short lifetime. Both types of KeyId
use timestamps (number of milliseconds since unix epoch) to provide relative uniqueness of
key names. Replacing timestamp with key hash can bring stronger uniqueness but on the
cost of longer name. Therefore, key hash is not used for now. For example,
``/ndn/edu/ucla/alice/ksk-1234567890`` or
``/ndn/edu/ucla/BoelterHall/4805/dsk-1357924680``.
An identity may have more than one keys associated with it. For example, one may have a
KSK to sign other keys and a DSK to sign data packets, or one may periodically replace its
expired DSK/KSK with a new key.
The private part of a key ("private key"), is stored in a :ndn-cxx:`Trusted Platform
Module (TPM) <SecTpm>`. The public part ("public key"), is managed in a
:ndn-cxx:`Public-key Information Base (PIB) <SecPublicInfo>`. The most important
information managed by PIB is **certificates** of public keys. A certificate binds a
public key to its key name or the corresponding identity. The signer (or issuer) of a
certificate vouches for the binding through its own signature. With different signers
vouching for the binding, a public key may have more than one certificates.
The certificate name follows the naming convention of `NDNS (NDN Domain Name Service) <http://lasr.cs.ucla.edu/afanasyev/data/files/Afanasyev/afanasyev-phd-thesis.pdf>`_. The
public key name will be broken into two parts:
- The first part ("authoritative namespace") will be put before a name component ``KEY``
which serves as an application tag
- The second part ("label") will be put between ``KEY`` and ``ID-CERT`` which serves as an
indicator of certificate.
A version number of the certificate is appended after ``ID-CERT``. For example,
``/ndn/edu/ucla/KEY/alice/ksk-1234567890/ID-CERT/%FD%01`` or
``/ndn/edu/ucla/BoelterHall/4805/KEY/dsk-1357924680/ID-CERT/%FD%44``.
The :ndn-cxx:`NDN certificate <IdentityCertificate>` is just an ordinary `NDN-TLV Data
packet <http://named-data.net/doc/ndn-tlv/data.html>`_, with the content part in DER
encoding that resembles X.509 certificate:
.. code-block:: cpp
// NDN-TLV Encoding
Certificate ::= DATA-TLV TLV-LENGTH
Name
MetaInfo (= CertificateMetaInfo)
Content (= CertificateContent)
Signature
CertificateMetaInfo ::= META-INFO-TYPE TLV-LENGTH
ContentType (= KEY)
FreshnessPeriod (= ?)
CertificateContent ::= CONTENT-TYPE TLV-LENGTH
CertificateDerPayload
// DER Encoding
CertificateDerPayload ::= SEQUENCE {
validity Validity,
subject Name,
subjectPubKeyInfo SubjectPublicKeyInfo,
extension Extensions OPTIONAL }
Validity ::= SEQUENCE {
notBefore Time,
notAfter Time }
Time ::= CHOICE {
GeneralizedTime }
Name ::= CHOICE {
RDNSequence }
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
RelativeDistinguishedName ::=
SET OF AttributeTypeAndValue
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier
keybits BIT STRING }
Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
See `RFC 3280 <http://www.ietf.org/rfc/rfc3280.txt>`_ for more details about DER field
definitions.
Signing
-------
Key Management
%%%%%%%%%%%%%%
Create Identity/Keys/Certificate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The simplest way to initialize an identity and its key and certificate is to call
:ndn-cxx:`KeyChain::createIdentity`
.. code-block:: cpp
KeyChain keyChain;
Name defaultCertName = keyChain.createIdentity(identity);
This method guarantees that the default key and certificate of the supplied identity
always exist in the KeyChain. This method checks if the supplied identity has already had
a default key and a default certificate and returns the default certificate name if
exists. If the default certificate is missing, KeyChain will automatically create a
self-signed certificate of the default key. If the default key is missing, KeyChain will
automatically create a new key and set it as the default key and create a self-signed
certificate as well.
Create Keys Manually
~~~~~~~~~~~~~~~~~~~~
One can call :ndn-cxx:`KeyChain::generateRsaKeyPair` to generate an RSA key pair or
:ndn-cxx:`KeyChain::generateEcdsaKeyPair` to generate an ECDSA key. Note that generated
key pair is not set as the default key of the identity, so you need to set it manually by
calling :ndn-cxx:`KeyChain::setDefaultKeyNameForIdentity`. There is also a helper method
:ndn-cxx:`KeyChain::generateRsaKeyPairAsDefault`, which combines the two steps into one.
.. code-block:: cpp
KeyChain keyChain;
Name alice("/ndn/test/alice");
Name aliceKeyName = keyChain.generateRSAKeyPair(alice);
keyChain.setDefaultKeyNameForIdentity(aliceKeyName);
// Now the key with the name aliceKeyName2 becomes alice's default key
Name aliceKeyName2 = keyChain.generateRSAKeyPairAsDefault(alice);
Create Identity Certificate Manually
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you have created a key pair, you can generate a self-signed certificate for the key by
calling :ndn-cxx:`KeyChain::selfSign`.
.. code-block:: cpp
KeyChain keyChain;
Name aliceKeyName("/ndn/test/alice/ksk-1394129695025");
shared_ptr<IdentityCertificate> aliceCert = keyChain.selfSign(aliceKeyName);
You can sign a public key using a different key:
.. code-block:: cpp
KeyChain keyChain;
shared_ptr<IdentityCertificate> certificate =
keyChain.prepareUnsignedIdentityCertificate(publicKeyName, publicKey,
signingIdentity,
notBefore, notAfter,
subjectDescription, prefix
keyChain.signByIdentity(*certificate, signingIdentity);
Signing Data
%%%%%%%%%%%%
Although the security library does not have the intelligence to automatically determine
the signing key for each data packet, it still provides a mechanism, called **Default
Signing Settings**, to facilitate signing process.
The basic signing process in the security library would be like this: create :ndn-cxx:`KeyChain`
instance and supply the data packet and signing certificate name to :ndn-cxx:`KeyChain::sign`
method.
.. code-block:: cpp
KeyChain keyChain;
keyChain.sign(dataPacket, signingCertificateName);
The :ndn-cxx:`KeyChain` instance will
- construct ``SignatureInfo`` using the signing certificate name;
- look up the corresponding private key in :ndn-cxx:`TPM <SecTpm>`;
- sign the data packet if the private key exists.
The basic process, however, requires application developers to supply the exact
certificate name. Such a process has two shortages: first, it might be difficult to
remember the certificate name; second, application developers have to be aware of
certificate update and key roll-over. Therefore, the security library provides another
signing process in which application developers only need to supply the signing identity:
.. code-block:: cpp
KeyChain keyChain;
keyChain.signByIdentity(dataPacket, signingIdentity);
The :ndn-cxx:`KeyChain` instance will
- determine the default key of the signing identity;
- determine the default certificate of the key;
- construct ``SignatureInfo`` using the default certificate name;
- look up the corresponding private key in :ndn-cxx:`TPM <SecTpm>`;
- sign the data packet if the private key exists.
The process above requires that each identity has a default key and that each key has a
default certificate. All these default settings is managed in :ndn-cxx:`PIB
<SecPublicInfo>`, one can get/set these default settings through :ndn-cxx:`KeyChain`
directly:
.. code-block:: cpp
KeyChain keyChain;
Name defaultKeyName = keyChain.getDefaultKeyNameForIdentity(identity);
Name defaultCertName = keyChain.getDefaultCertificateNameForKey(keyName);
keyChain.setDefaultKeyNameForIdentity(keyName);
keyChain.setDefaultCertificateNameForKey(certificateName);
There is even a default identity which will be used when no identity information is
supplied in signing method:
.. code-block:: cpp
KeyChain keyChain;
keyChain.sign(dataPacket);
And default identity can be got/set through :ndn-cxx:`KeyChain` as well:
.. code-block:: cpp
KeyChain keyChain;
Name defaultIdentity = keyChain.getDefaultIdentity();
keyChain.setDefaultIdentity(identity);
Signing Interests
%%%%%%%%%%%%%%%%%
The process of signing Interests according to the :doc:`Signed Interest specification
<signed-interest>` is exactly the same as the process of signing Data packets:
.. code-block:: cpp
KeyChain keyChain;
keyChain.sign(interest, signingCertName);
keyChain.signByIdentity(interest, signingIdentity);
keyChain.sign(interest);
Validation
----------
Interest and Data validation is done through a **Validator**. :ndn-cxx:`Validator` is a virtual
class, two pure virtual methods must be implemented in order to construct a working
validator:
.. code-block:: cpp
class Validator
{
...
protected:
virtual void
checkPolicy(const Data& data,
int nSteps,
const OnDataValidated& onValidated,
const OnDataValidationFailed& onValidationFailed,
std::vector<shared_ptr<ValidationRequest> >& nextSteps) = 0;
virtual void
checkPolicy(const Interest& interest,
int nSteps,
const OnInterestValidated& onValidated,
const OnInterestValidationFailed& onValidationFailed,
std::vector<shared_ptr<ValidationRequest> >& nextSteps) = 0;
...
};
What should be implemented in these two methods is to check:
- whether the packet and signer comply with trust policies;
- whether their signature can be verified.
If the packet can be validated, the ``onValidated`` callback should be invoked, otherwise
the ``onValidationFailed`` callback should be invoked. If more information (e.g., other
certificates) is needed, express the request for missing information in one or more
``ValidationRequest`` and push them into ``nextSteps``.
.. code-block:: cpp
class ValidationRequest
{
public:
Interest m_interest; // The Interest for the requested data/certificate.
OnDataValidated m_onValidated; // Callback when the retrieved certificate is authenticated.
OnDataValidationFailed m_onDataValidated; // Callback when the retrieved certificate cannot be authenticated.
int m_nRetries; // The number of retries when the interest times out.
int m_nStep; // The number of validation steps that have been performed.
};
Besides the two ``Validator::checkPolicy`` methods, the ``Validator`` also provides three
hooks to control packet validation in a finer granularity.
.. code-block:: cpp
class Validator
{
...
protected:
virtual shared_ptr<const Data>
preCertificateValidation(const Data& data);
virtual void
onTimeout(const Interest& interest,
int nRemainingRetries,
const OnFailure& onFailure,
const shared_ptr<ValidationRequest>& validationRequest);
virtual void
afterCheckPolicy(const std::vector<shared_ptr<ValidationRequest> >& nextSteps,
const OnFailure& onFailure);
...
};
``Validator::preCertificateValidation`` is triggered before validating requested
certificate. The Data supplied matches the interest in the ``ValidationRequest``. It may
be certificate or a data encapsulating certificate. This hook returns a data (actually
certificate) that is will be passed as Data into ``Validator::validate``;
``Validator::onTimeout`` is triggered when interest for certificate times out. The logic
to handle the timeout can be implemented in this hook. One could invoke onFailure or
re-express the interest.
``Validator::afterCheckPolicy`` is invoked after ``Validator::checkPolicy`` is done. One
can implement the logic of how to process the set of ValidationRequests according to its
trust model.
Configuration-based Validator
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In most cases, the trust model of applications are simple. However, it is not trivial to
implement the two ``Validator::checkPolicy`` methods. Therefore, we provide a more
developer-friendly configuration-based validator, ``ValidatorConfig``. With
``ValidatorConfig``, one can express the trust model using a policy language in a
configuration file. See :doc:`security-validator-config` for more details.
+177 -196
View File
@@ -9,7 +9,7 @@ write a configuration file.
The configuration file consists of **rules** and **trust-anchors** that will be used in
validation. **Rules** tell the validator how to validate a packet, while **trust-anchors**
tell the validator which certificates are valid immediately. Here is an example of
configuration file containing two rules.
configuration file containing two rules and a trust anchor.
::
@@ -30,7 +30,7 @@ configuration file containing two rules.
key-locator
{
type name
name /ndn/edu/ucla/KEY/yingdi/ksk-1234/ID-CERT
name /ndn/edu/ucla/yingdi/KEY/1234
relation equal
}
}
@@ -51,8 +51,7 @@ configuration file containing two rules.
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:
@@ -61,63 +60,72 @@ A rule can be broken into two parts:
- The second part is to check whether further validation process is
necessary.
When receiving a packet, the validator will apply rules in the configuration file
one-by-one against the packet, until finding a rule that the packet qualifies for. And the
second part of the matched rule will be used to check the validity of the packet. If the
packet cannot qualify for any rules, it is treated as an invalid packet. Once a packet has
been matched by a rule, the rest rules will not be applied against the packet. Therefore,
you should always put the most specific rule to the top, otherwise it will become useless.
When a packet is presented for validation, the validator will check the rules one-by-one
in the configuration file using **for** and **filter** conditions against the packet,
until finding a rule for which the packet qualifies. After that, the **checker**
conditions of the matched rule will be used to check the validity of the packet. If the
packet does not match any rules, it is treated as an invalid packet. Once a packet has
been matched by a rule, the remaining rules are not applied to the packet (i.e., the
matched rule "captures" the packet). Therefore, you should always put the most specific
rule first.
In the example configuration, the first rule indicates that all the data packets under the
name prefix ``/localhost/example`` must be signed by a key whose certificate name is
``/ndn/edu/ucla/KEY/yingdi/ksk-1234/ID-CERT``. If a packet does not have a name under prefix
``/localhost/example``, validator will skip the first rule and apply the second rule. The
second rule indicates that any data packets must be validated along a hierarchy. And a
certificate stored in a file "testbed-trust-anchor.cert" is valid.
name prefix ``/localhost/example`` must be signed by a certificate whose name (the key
part) is ``/ndn/edu/ucla/yingdi/KEY/1234``. If a packet does not have a name under
prefix ``/localhost/example``, the validator will skip the first rule and apply the second
rule. The second rule indicates that all other data packets must be validated using the
hierarchical policy (data name should be prefix or equal to the identity part of the
certificate name). The example configuration defines that all certificate chains must be
rooted in the certificate defined in the file "testbed-trust-anchor.cert".
Rules in general
----------------
A rule has four types of properties: **id**, **for**, **filter**, and **checker**.
A rule has four properties: **id**, **for**, **filter**, and **checker**.
The property **id** uniquely identifies the rule in the configuration file. As long as
The **id** property uniquely identifies the rule in the configuration file. As long as
being unique, any name can be given to a rule, e.g., "Simple Rule", "Testbed Validation
Rule". A rule must have one and only one **id** property.
A rule is either used to validate an interest packet or a data packet. This information
is specified in the property **for**. Only two value can be specified: **data** and
**interest**. A rule must have one and only one **for** property.
A rule is either used to validate a data packet or an interest packet. This information
is specified in the **for** property, which can be either **data** or **interest**. A
rule must have exactly one **for** property.
The property **filter** further constrains the packets that can be checked by the
rule. Filter property is not required in a rule, in this case, the rule will capture all
the packets passed to it. A rule may contain more than one filters, in this case, a packet
can be checked by a rule only if the packet satisfies all the filters.
The **filter** property further constrains the packets that can be checked by the
rule. The filter property is not required in a rule; if omitted, the rule will capture all
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 property **checker** 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
treated as invalid if it cannot pass none of the checkers.
**filter** and **checker** have their own properties. Next, we will introduce them
separately.
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
treated as valid if it can pass at least one of the checkers and as invalid when it cannot
pass any checkers.
Filter Property
---------------
Filter has its own **type** property. Although a rule may contain more than one filters,
there is at most one filter of each type. So far, only one type of filter is defined:
**name**. In other word, only one filter can be specified in a rule for now.
Filter has a **type** property and type-specific properties. Although a rule can contain
more than one filters, there can be at most one filter of each type.
Currently, only the packet name filter is defined.
Name Filter
~~~~~~~~~~~
There are two ways to express the conditions on name. The first way is to specify a
relationship between the packet name and a particular name. In this case, two more
properties are required: **name** and **relation**. A packet can fulfill the condition if
the **name** has a **relation\* to the packet name. Three types of **\ relation\*\* has
been defined: **equal**, **is-prefix-of**, **is-strict-prefix-of**. For example, a filter
There are two ways to express the conditions on packet name:
- relationship between the packet name and the specified name
- :doc:`NDN regular expression <utils-ndn-regex>` match.
Name and Relation
^^^^^^^^^^^^^^^^^
In the first case, two more properties are required: **name** and **relation**. A packet
can fulfill the condition if the **name** has a **relation** to the packet's name. Three
types of **relation** has been defined: **equal**, **is-prefix-of**,
**is-strict-prefix-of**. For example, the filter
::
@@ -128,8 +136,9 @@ been defined: **equal**, **is-prefix-of**, **is-strict-prefix-of**. For example,
relation equal
}
shall only capture a packet with the exact name ``/localhost/example``.
And a filter
will capture only a packet with the exact name ``/localhost/example``.
The filter
::
@@ -140,8 +149,8 @@ And a filter
relation is-prefix-of
}
shall capture a packet with name ``/localhost/example`` or ``/localhost/example/data``, but
cannot catch a packet with name ``/localhost/another_example``. And a filter
will capture a packet with name ``/localhost/example`` or ``/localhost/example/data``, but
will not capture a packet with name ``/localhost/another_example``. And the filter
::
@@ -152,42 +161,46 @@ cannot catch a packet with name ``/localhost/another_example``. And a filter
relation is-strict-prefix-of
}
shall capture a packet with name ``/localhost/example/data``, but cannot catch a packet
will capture a packet with name ``/localhost/example/data``, but will not capture a packet
with name ``/localhost/example``.
NDN Regular Expression Match
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The second way is to specify an :doc:`utils-ndn-regex` that can match the packet. In this
case, only one property **regex** is required. For example, a filter
case, only one property **regex** is required. For example, the filter
::
filter
{
type name
regex ^[^<KEY>]*<KEY><>*<ksk-.*><ID-CERT>$
regex ^<>*<KEY><><><>$
}
shall capture all the identity certificates.
will capture all certificates.
Checker Property
----------------
Passing all the filters in a rule only indicates that a packet can be checked using the
rule, and it does not necessarily implies that the packet is valid. The validity of a
rule, and it does not necessarily imply that the packet is valid. The validity of a
packet is determined by the property **checker**, which defines the conditions that a
valid packet must fulfill.
Same as **filter**, **checker** has a property **type**. We have defined three types of
checkers: **customized**, and **hierarchical**, and **fixed-signer**. As suggested by its
name, **customized** checker allows you to customize the conditions according to specific
requirements. **hierarchical** checker and **fixed-signer** checker are pre-defined
shortcuts, which specify specific trust models separately.
Same as **filter**, **checker** has a property **type**. We have defined two types of
checkers:
- **customized** is a checker that allows customization of the conditions according to specific
requirements;
- **hierarchical** is a checker with pre-defined hierarchical trust model.
Customized Checker
~~~~~~~~~~~~~~~~~~
So far, we only allow three customized properties in a customized
checker: **sig-type**, **key-locator**. All of them are related to the
``SignatureInfo`` of a packet.
The customized checker requires two properties: **sig-type**, **key-locator**. Both must
appear exactly once and are related to the ``SignatureInfo`` of a packet.
::
@@ -201,18 +214,16 @@ checker: **sig-type**, **key-locator**. All of them are related to the
}
}
The property **sig-type** specifies the acceptable signature type. Right now three
signature types have been defined: **rsa-sha256** and **ecdsa-sha256** (which are strong
signature types) and **sha256** (which is a weak signature type). If sig-type is sha256,
then **key-locator** will be ignored. 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**.
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**.
The property **key-locator** which specifies the conditions on ``KeyLocator``. If the
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``. Although there are more than one types of ``KeyLocator``
defined in the `Packet Format <http://named-data.net/doc/ndn-tlv/signature.html>`__,
**key-locator** property only supports one type: **name**:
field in ``SignatureInfo``. **key-locator** property only supports one type: **name**:
::
@@ -222,9 +233,9 @@ defined in the `Packet Format <http://named-data.net/doc/ndn-tlv/signature.html>
...
}
Such a 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 could be:
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:
::
@@ -235,23 +246,23 @@ the name filter. For example, a checker could be:
key-locator
{
type name
name /ndn/edu/ucla/KEY/yingdi/ksk-1234/ID-CERT
name /ndn/edu/ucla/yingdi/KEY/1234
relation equal
}
}
This checker property requires that the packet must have a ``rsa-sha256`` signature generated
by a key whose certificate name is ``/ndn/edu/ucla/KEY/yingdi/ksk-1234/ID-CERT``.
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.
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:
- an NDN regular expression that can extract information from packet name
- an NDN regular expression that can extract information from ``KeyLocator`` name
- relation from the part extracted from ``KeyLocator`` name to the one extracted from the
packet name
- an NDN regular expression that extracts information from the packet name
- an NDN regular expression that extracts information from the ``KeyLocator`` name
- relation from the part extracted from the ``KeyLocator`` name to the one extracted from
the packet name
For example, a checker:
@@ -266,8 +277,8 @@ For example, a checker:
type name
hyper-relation
{
k-regex ^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$
k-expand \\1\\2
k-regex ^(<>*)<KEY><>$
k-expand \\1
h-relation is-prefix-of
p-regex ^(<>*)$
p-expand \\1
@@ -276,30 +287,8 @@ For example, a checker:
}
}
requires the packet name must be under the corresponding namespace of the ``KeyLocator``
name.
In some cases, you can even customize checker with another property For example:
::
checker
{
type customized
sig-type rsa-sha256
key-locator
{
type name
hyper-relation
{
k-regex ^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$
k-expand \\1\\2
h-relation is-prefix-of
p-regex ^(<>*)$
p-expand \\1
}
}
}
requires the packet name must be under the corresponding namespace (identity part) of the
``KeyLocator`` name.
Hierarchical Checker
~~~~~~~~~~~~~~~~~~~~
@@ -328,8 +317,8 @@ is equivalent to a customized checker:
type name
hyper-relation
{
k-regex ^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$
k-expand \\1\\2
k-regex ^(<>*)<KEY><>$
k-expand \\1
h-relation is-prefix-of
p-regex ^(<>*)$
p-expand \\1
@@ -337,42 +326,14 @@ is equivalent to a customized checker:
}
}
Fixed-Signer Checker
~~~~~~~~~~~~~~~~~~~~
In some cases, you only accept packets signed with pre-trusted certificates,
i.e. "one-step validation". Such a trust model can be expressed with **fixed-signer**
checker. And you only need to specify the trusted certificate via property **signer**. The
definition of **signer** is the same as **trust-anchor**. For example:
::
checker
{
type fixed-signer
sig-type rsa-sha256
signer
{
type file
file-name "trusted-signer.cert"
}
signer
{
type base64
base64-string "Bv0DGwdG...amHFvHIMDw=="
}
}
.. _validator-conf-trust-anchors:
Trust Anchors
-------------
Although **trust-anchor** is always not required in the configuration file (for example,
if fixed-signer checker is used), it is very common to have a few trust-anchors in the
configuration file, otherwise most packets cannot be validated. A configuration file may
contain more than one trust anchors, but the order of trust anchors does not matter. The
structure of trust-anchor is same as the **signer** in fixed-signer checker, for example:
**trust-anchor** is a necessary option in order to properly validate packets. A
configuration file may contain more than one trust anchors and the order of trust anchors
does not matter. The structure of trust-anchor is as follows:
::
@@ -388,7 +349,7 @@ structure of trust-anchor is same as the **signer** in fixed-signer checker, for
}
You may also specify a trust-anchor directory. All certificates under this directory are
taken as trust anchors. For example, if all trust anchors are put into
taken as static trust anchors. For example, if all trust anchors are put into
``/usr/local/etc/ndn/keys``.
::
@@ -396,7 +357,7 @@ taken as trust anchors. For example, if all trust anchors are put into
trust-anchor
{
type dir
file-name /usr/local/etc/ndn/keys
dir /usr/local/etc/ndn/keys
}
If certificates under the directory might be changed during runtime, you can set a refresh
@@ -407,16 +368,16 @@ period, such as
trust-anchor
{
type dir
file-name /usr/local/etc/ndn/keys
dir /usr/local/etc/ndn/keys
refresh 1h ; refresh certificates every hour, other units include m (for minutes) and s (for seconds)
}
There is another special trust anchor **any**. As long as such a trust-anchor is defined
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).
::
@@ -457,31 +418,31 @@ example:
| | |
| | Identity example: ``/ndn`` |
| | |
| | Certificate name example: ``/ndn/KEY/ksk-1/ID-CERT/%01`` |
| | Certificate name example: ``/ndn/KEY/1/%00/%01`` |
+------------+-------------------------------------------------------------------------------------+
| site | ``/<network>/<site>`` |
| | |
| | Identity example: ``/ndn/edu/ucla`` |
| | |
| | Certificate name example: ``/ndn/edu/ucla/KEY/ksk-2/ID-CERT/%01`` |
| | Certificate name example: ``/ndn/edu/ucla/KEY/2/%00/%01`` |
+------------+-------------------------------------------------------------------------------------+
| operator | ``/<network>/<site>/%C1.O.N./<operator-id>`` |
| | |
| | Identity example: ``/ndn/edu/ucla/%C1.O.N./op1`` |
| | |
| | Certificate name example: ``/ndn/edu/ucla/%C1.O.N./op1/KEY/ksk-3/ID-CERT/%01`` |
| | Certificate name example: ``/ndn/edu/ucla/%C1.O.N./op1/KEY/3/%00/%01`` |
+------------+-------------------------------------------------------------------------------------+
| router | ``/<network>/<site>/%C1.O.R./<router-id>`` |
| | |
| | Identity example: ``/ndn/edu/ucla/%C1.O.R./rt1`` |
| | |
| | Certificate name example: ``/ndn/edu/ucla/%C1.O.R./rt1/KEY/ksk-4/ID-CERT/%01`` |
| | Certificate name example: ``/ndn/edu/ucla/%C1.O.R./rt1/KEY/4/%00/%01`` |
+------------+-------------------------------------------------------------------------------------+
| NLSR | ``/<network>/<site>/%C1.O.R./<router-id>/NLSR`` |
| | |
| | Identity example: ``/ndn/edu/ucla/%C1.O.R./rt1/NLSR`` |
| | |
| | Certificate name example: ``/ndn/edu/ucla/%C1.O.R./rt1/NLSR/KEY/ksk-5/ID-CERT/%01`` |
| | Certificate name example: ``/ndn/edu/ucla/%C1.O.R./rt1/NLSR/KEY/5/%00/%01`` |
+------------+-------------------------------------------------------------------------------------+
Assume that a typical NLSR data name is
@@ -506,7 +467,7 @@ And here is the configuration file:
filter
{
type name
regex ^[^<NLSR><LSA>]*<NLSR><LSA>
regex ^<>*<NLSR><LSA><><>$
}
checker
{
@@ -517,10 +478,10 @@ And here is the configuration file:
type name
hyper-relation
{
k-regex ^([^<KEY>]*)<KEY><ksk-.*><ID-CERT>$
k-regex ^(<>*)<KEY><>$
k-expand \\1
h-relation equal
p-regex ^([^<NLSR><LSA>]*)<NLSR><LSA><LSType\.\d><>$
p-regex ^(<>*)<NLSR><LSA><><>$
p-expand \\1
}
}
@@ -533,7 +494,7 @@ And here is the configuration file:
filter
{
type name
regex ^[^<KEY><%C1.O.R.>]*<%C1.O.R.><><KEY><ksk-.*><ID-CERT><>$
regex ^<>*<%C1.O.R.><><KEY><><><>$
}
checker
{
@@ -544,10 +505,10 @@ And here is the configuration file:
type name
hyper-relation
{
k-regex ^([^<KEY><%C1.O.N.>]*)<%C1.O.N.><><KEY><ksk-.*><ID-CERT>$
k-regex ^(<>*)<%C1.O.N.><><KEY><>$
k-expand \\1
h-relation equal
p-regex ^([^<KEY><%C1.O.R.>]*)<%C1.O.R.><><KEY><ksk-.*><ID-CERT><>$
p-regex ^(<>*)<%C1.O.R.><><KEY><><><>$
p-expand \\1
}
}
@@ -560,7 +521,7 @@ And here is the configuration file:
filter
{
type name
regex ^[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
regex ^<>*<KEY><><><>$
}
checker
{
@@ -577,49 +538,69 @@ And here is the configuration file:
Example Configuration For NFD RIB Management
--------------------------------------------
Assume `NFD RIB Management <http://redmine.named-data.net/projects/nfd/wiki/RibMgmt>`_
Assume `NFD RIB Management <https://redmine.named-data.net/projects/nfd/wiki/RibMgmt>`_
allows any valid testbed certificate to register prefix, the configuration file could be
written as:
::
rule
{
id "NRD Prefix Registration Command Rule"
for interest
filter
{
type name
regex ^<localhost><nrd>[<register><unregister><advertise><withdraw>]
}
checker
{
type customized
sig-type rsa-sha256
key-locator
{
type name
regex ^[^<KEY>]*<KEY><>*<ksk-.*><ID-CERT>$
}
}
}
rule
{
id "Testbed Hierarchy Rule"
for data
filter
{
type name
regex ^[^<KEY>]*<KEY><>*<ksk-.*><ID-CERT><>$
}
checker
{
type hierarchical
sig-type rsa-sha256
}
}
trust-anchor
{
type file
file-name "testbed-trust-anchor.cert"
}
rule
{
id "RIB Prefix Registration Command Rule"
for interest ; rule for Interests (to validate CommandInterests)
filter
{
type name ; condition on interest name (w/o signature)
regex ^[<localhop><localhost>]<nfd><rib>[<register><unregister>]<><><>$ ; prefix before
; SigInfo & SigValue
}
checker
{
type customized
sig-type rsa-sha256 ; interest must have a rsa-sha256 signature
key-locator
{
type name ; key locator must be the certificate name of the
; signing key
regex ^<>*<KEY><><><>$
}
}
checker
{
type customized
sig-type ecdsa-sha256 ; interest must have a ecdsa-sha256 signature
key-locator
{
type name ; key locator must be the certificate name of the
; signing key
regex ^<>*<KEY><><><>$
}
}
}
rule
{
id "NDN Testbed Hierarchy Rule"
for data ; rule for Data (to validate NDN certificates)
filter
{
type name ; condition on data name
regex ^<>*<KEY><><><>$
}
checker
{
type hierarchical ; the certificate name of the signing key and
; the data name must follow the hierarchical model
sig-type rsa-sha256 ; data must have a rsa-sha256 signature
}
checker
{
type hierarchical ; the certificate name of the signing key and
; the data name must follow the hierarchical model
sig-type ecdsa-sha256 ; data must have a ecdsa-sha256 signature
}
}
trust-anchor
{
type file
file-name keys/ndn-testbed-root.ndncert.base64
}
+56 -68
View File
@@ -1,23 +1,20 @@
NDN Regular Expression
======================
NDN regular expression matching is done at two levels: one at the name
level and one at the name component level.
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.
We use ``<`` and ``>`` to enclose a name component matcher which
specifies the pattern of a name component. The component pattern is
expressed using the `Perl Regular Expression
Syntax <http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html>`__.
For example, ``<ab*c>`` can match the 1st, 3rd, and 4th components of
``/ac/dc/abc/abbc``, but it cannot match the 2nd component. A special
case is that ``<>`` is a wildcard matcher that can match **ANY**
component.
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.
Note that a component match can match only one name component. In order
to match a name, you need to specify the pattern of a name based on the
name component matchers. For example, ``<ndn><edu><ucla>`` can match the
name ``/ndn/edu/ucla``. In order to describe a more complicated name
pattern, we borrow some syntaxes from the standard regular expressions.
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>``
matches the name ``/ndn/edu/ucla``. To describe a more complicated name pattern, we borrow some
syntaxes from the standard regular expressions.
NDN Regex Syntax
----------------
@@ -25,79 +22,70 @@ NDN Regex Syntax
Anchors
~~~~~~~
A ``'^'`` character shall match the start of a name. For example,
``^<ndn>`` shall match any names starting with a component ``ndn``, and
it will exclude a name like ``/local/broadcast``.
The ``^`` character matches the start of a name. For example, ``^<ndn>`` matches any name starting
with the component ``ndn``, but does not match a name like ``/local/broadcast``.
A ``'$'`` character shall match the end of a name. For example,
``^<ndn><edu>$`` shall match only one name: ``/ndn/edu``.
The ``$`` character matches the end of a name. For example, ``^<ndn><edu>$`` matches only one
name: ``/ndn/edu``.
Repeats
~~~~~~~
Repetition
~~~~~~~~~~
A component matcher can be followed by a repeat syntax to indicate how
many times the preceding component can be matched.
A component matcher can be followed by a repeat quantifier to indicate how many times the preceding
component may appear.
Syntax ``*`` for zero or more times. For example,
``^<ndn><KEY><>*<ID-CERT>`` shall match ``/ndn/KEY/ID-CERT/``, or
``/ndn/KEY/edu/ID-CERT``, or ``/ndn/KEY/edu/ksk-12345/ID-CERT`` and so
on.
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.
Syntax ``+`` for one or more times. For example,
``^<ndn><KEY><>+<ID-CERT>`` shall match ``/ndn/KEY/edu/ID-CERT``, or
``/ndn/KEY/edu/ksk-12345/ID-CERT`` and so on, but it cannot match
``/ndn/KEY/ID-CERT/``.
The ``+`` quantifier denotes "one or more times". For example, ``^<A><B>+<C>$`` matches ``/A/B/C``,
``/A/B/B/C``, and so on, but does not match ``/A/C``.
Syntax ``?`` for zero or one times. For example,
``^<ndn><KEY><>?<ID-CERT>`` shall match ``/ndn/KEY/ID-CERT/``, or
``/ndn/KEY/edu/ID-CERT``, but it cannot match
``/ndn/KEY/edu/ksk-12345/ID-CERT``.
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``.
Repetition can also be bounded:
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``.
``{n}`` for exactly ``n`` times. ``{n,}`` for at least ``n`` times.
``{,n}`` for at most ``n`` times. And ``{n, m}`` for ``n`` to ``m``
times.
Note that the repeat matching is **greedy**, that is it will consume as
many matched components as possible. We do not support non-greedy repeat
matching and possessive repeat matching for now.
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``.
Sets
~~~~
Name component set is a bracket-expression starting with ``'['`` and
ending with ``']'``, it defines a set of name components, and matches
any single name component that is a member of that set.
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 the standard regular expression, NDN regular expression only
supports **Single Components Set**, that is, you have to list all the
set members one by one between the bracket. For example,
``^[<ndn><localhost>]`` shall match any names starting with either a
component ``ndn"`` or ``localhost``.
Unlike standard regular expressions, NDN regular expression only supports **Single Components Set**,
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.
When a name component set starts with a ``'^'``, the set becomes a
**Negation Set**, that is, it matches the complement of the name
components it contains. For example, ``^[^<ndn>]`` shall match any names
that does not start with a component ``ndn``.
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.
Some other types of sets, such as Range Set, will be supported later.
Note that component set can be repeated as well.
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 sub-pattern is split out in a separate field by the
matching algorithms. For example ``^([^<DNS>])<DNS>(<>*)<NS>`` shall
match a data name of NDN DNS NS record, and the first sub-pattern
captures the zone name while the second sub-pattern captures the
relative record name.
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``. The
same example above shall match a name
``/ndn/edu/ucla/DNS/irl/NS/123456``, and a back reference ``\1\2`` shall
extract ``/ndn/edu/ucla/irl`` out of the name.
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.
Note that marked sub-patterns can be also repeated.
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.
If a new match is found by capturing parentheses, the previous match is overwritten. For example,
both ``^([<A><B><C>]+)$`` and ``^([<A><B><C>])+$`` match ``/C/A/B``. However, the former regex
stores ``C/A/B`` as the first back-reference, while the latter one stores ``B``. That is because the
``+`` quantifier in the latter NDN regular expression causes the marked sub-pattern to be matched
three times, and ``B`` is the last saved match.
+52
View File
@@ -0,0 +1,52 @@
ndn-cxx examples
================
By default, 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:
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:
echo "int main() { return 0; }" > examples/foo.cpp
./waf
# ... Compiling examples/foo.cpp
# ... Linking build/examples/foo
# To run the example
./build/examples/foo
2. Examples with multiple translation units
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`)
- 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:
mkdir examples/bar
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
# ... Linking build/examples/bar/bar
# To run the example
./build/examples/bar/bar
+90 -67
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2013-2014 Regents of the University of California.
/*
* Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -21,85 +21,100 @@
* @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
*/
// correct way to include ndn-cxx headers
// #include <ndn-cxx/face.hpp>
// #include <ndn-cxx/util/scheduler.hpp>
#include "face.hpp"
#include "util/scheduler.hpp"
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include <boost/asio/io_service.hpp>
#include <iostream>
// Enclosing code in ndn simplifies coding (can also use `using namespace ndn`)
namespace ndn {
// Additional nested namespace could be used to prevent/limit name contentions
// Additional nested namespaces should be used to prevent/limit name conflicts
namespace examples {
void
onData(Face& face,
const Interest& interest, Data& data)
class ConsumerWithTimer
{
std::cout << "I: " << interest.toUri() << std::endl;
std::cout << "D: " << data.getName().toUri() << std::endl;
}
public:
ConsumerWithTimer()
: m_face(m_ioService) // Create face with io_service object
, m_scheduler(m_ioService)
{
}
void
onTimeout(Face& face,
const Interest& interest)
{
std::cout << "Timeout" << std::endl;
}
void
run()
{
Name interestName("/example/testApp/randomData");
interestName.appendVersion();
void
delayedInterest(Face& face)
{
std::cout << "One more Interest, delayed by the scheduler" << std::endl;
Interest interest(interestName);
interest.setCanBePrefix(false);
interest.setMustBeFresh(true);
interest.setInterestLifetime(2_s);
Interest i(Name("/example/testApp/randomData"));
i.setScope(1);
i.setInterestLifetime(time::milliseconds(1000));
i.setMustBeFresh(true);
face.expressInterest(i,
bind(&onData, ref(face), _1, _2),
bind(&onTimeout, ref(face), _1));
}
int
main(int argc, char** argv)
{
try {
// Explicitly create io_service object, which can be shared between Face and Scheduler
boost::asio::io_service ioService;
Interest i(Name("/example/testApp/randomData"));
i.setScope(1);
i.setInterestLifetime(time::seconds(1));
i.setMustBeFresh(true);
// Create face with io_service object
Face face(ioService);
face.expressInterest(i,
bind(&onData, ref(face), _1, _2),
bind(&onTimeout, ref(face), _1));
// Create scheduler object
Scheduler scheduler(ioService);
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));
// Schedule a new event
scheduler.scheduleEvent(time::seconds(2),
bind(&delayedInterest, ref(face)));
m_scheduler.schedule(3_s, [this] { delayedInterest(); });
// ioService.run() will block until all events finished or ioService.stop() is called
ioService.run();
// m_ioService.run() will block until all events finished or m_ioService.stop() is called
m_ioService.run();
// Alternatively, a helper face.processEvents() also can be called
// processEvents will block until the requested data received or timeout occurs
// face.processEvents();
// Alternatively, m_face.processEvents() can also be called.
// processEvents will block until the requested data received or timeout occurs.
// m_face.processEvents();
}
catch(std::exception& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
private:
void
onData(const Interest&, const Data& data) const
{
std::cout << "Received Data " << data << std::endl;
}
return 0;
}
void
onNack(const Interest& interest, const lp::Nack& nack) const
{
std::cout << "Received Nack with reason " << nack.getReason()
<< " for " << interest << std::endl;
}
void
onTimeout(const Interest& interest) const
{
std::cout << "Timeout for " << interest << std::endl;
}
void
delayedInterest()
{
std::cout << "One more Interest, delayed by the scheduler" << std::endl;
Name interestName("/example/testApp/randomData");
interestName.appendVersion();
Interest interest(interestName);
interest.setCanBePrefix(false);
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));
}
private:
// Explicitly create io_service object, which will be shared between Face and Scheduler
boost::asio::io_service m_ioService;
Face m_face;
Scheduler m_scheduler;
};
} // namespace examples
} // namespace ndn
@@ -107,5 +122,13 @@ main(int argc, char** argv)
int
main(int argc, char** argv)
{
return ndn::examples::main(argc, argv);
try {
ndn::examples::ConsumerWithTimer consumer;
consumer.run();
return 0;
}
catch (const std::exception& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
return 1;
}
}
+55 -39
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2013-2014 Regents of the University of California.
/*
* Copyright (c) 2013-2019 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -21,53 +21,61 @@
* @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
*/
// correct way to include ndn-cxx headers
// #include <ndn-cxx/face.hpp>
#include "face.hpp"
#include <ndn-cxx/face.hpp>
#include <iostream>
// Enclosing code in ndn simplifies coding (can also use `using namespace ndn`)
namespace ndn {
// Additional nested namespace could be used to prevent/limit name contentions
// Additional nested namespaces should be used to prevent/limit name conflicts
namespace examples {
void
onData(Face& face,
const Interest& interest, Data& data)
class Consumer
{
std::cout << "I: " << interest.toUri() << std::endl;
std::cout << "D: " << data.getName().toUri() << std::endl;
}
public:
void
run()
{
Name interestName("/example/testApp/randomData");
interestName.appendVersion();
void
onTimeout(Face& face,
const Interest& interest)
{
std::cout << "Timeout" << std::endl;
}
Interest interest(interestName);
interest.setCanBePrefix(false);
interest.setMustBeFresh(true);
interest.setInterestLifetime(6_s); // The default is 4 seconds
int
main(int argc, char** argv)
{
try {
Interest i(Name("/example/testApp/randomData"));
i.setScope(1);
i.setInterestLifetime(time::milliseconds(1000));
i.setMustBeFresh(true);
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));
Face face;
face.expressInterest(i,
bind(onData, ref(face), _1, _2),
bind(onTimeout, ref(face), _1));
// processEvents will block until the requested data received or timeout occurs
face.processEvents();
// processEvents will block until the requested data is received or a timeout occurs
m_face.processEvents();
}
catch(std::exception& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
return 1;
private:
void
onData(const Interest&, const Data& data) const
{
std::cout << "Received Data " << data << std::endl;
}
return 0;
}
void
onNack(const Interest&, const lp::Nack& nack) const
{
std::cout << "Received Nack with reason " << nack.getReason() << std::endl;
}
void
onTimeout(const Interest& interest) const
{
std::cout << "Timeout for " << interest << std::endl;
}
private:
Face m_face;
};
} // namespace examples
} // namespace ndn
@@ -75,5 +83,13 @@ main(int argc, char** argv)
int
main(int argc, char** argv)
{
return ndn::examples::main(argc, argv);
try {
ndn::examples::Consumer consumer;
consumer.run();
return 0;
}
catch (const std::exception& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
return 1;
}
}
Loaded 100 of 955 files, more files were not shown because too many files have changed in this diff. Show more