291 Commits
Author SHA1 Message Date
Davide Pesavento fd1e940648 Switch to Face::getIoContext() and simplify some code
Change-Id: Iba49171f6e59ead02283e8f975219ab97fcbeb00
2023-11-13 15:40:41 -05:00
Davide Pesavento 5849ee7582 build: require boost >= 1.71.0
Refs: #5276
Change-Id: I6eaae86beb89e00adf3891deb87816a1f176fdd6
2023-11-12 20:00:21 -05:00
Junxiao Shi 2ecb059eb9 lsa: define NameLsa operator==
refs #4094

Change-Id: I99650cb3c6c452b157595a394c30227e47aa88c8
2023-08-27 20:27:34 +00:00
Junxiao Shi 20377645fb lsa: split test suites and reduce includes
refs #4094

Change-Id: I25817cc4786711432b0af60c7819a54b6e41311a
2023-08-27 20:27:17 +00:00
Junxiao Shi 6593a43fa3 route: use ndn::FaceUri type for faceUri
refs #4227

Change-Id: I1b0d7ed97e43e4d0c50770ed306cbe85382dfc9a
2023-08-25 10:06:59 +00:00
Junxiao Shi 931ca9f576 name-prefix-list: delete unused methods and cleanup tests
Unit tests for NamePrefixList type are deduplicated. This allows
deleting countSources() method and NamePair type, which were used
sparsely in the unit tests and not needed by the rest of the codebase.

refs #4094

Change-Id: Id5a6e6b90f863dfeef2ed71e67a9823d84088a48
2023-08-21 10:14:46 +00:00
Davide Pesavento cd77aabaa9 build: update waf to version 2.0.26
Change-Id: I786be093be266ccd1720cc5c7752b00323ee09b6
2023-08-21 02:42:11 +00:00
Davide Pesavento eed3209c8d build: sync default build flags with ndn-cxx
Refactor default-compiler-flags.py to reduce duplication

Change-Id: I71b9255caed4d9262d73155c392a202ec7674e71
2023-08-21 02:42:00 +00:00
Davide Pesavento 5110a8a4ee build: align minimum build requirements with ndn-cxx
Change-Id: Ia28aabc9e496f7467fa58525cde97d44ad159003
2023-08-21 02:41:43 +00:00
Junxiao Shi 52f16644ab name-prefix-list: compare names only in operator==
NamePrefixList type is now a sorted container. The sort() method is
deleted.

The remove() method is renamed to erase(), in accordance with ndn-cxx
code style recommendations.

refs #4094

Change-Id: I2d3f2fa768a8dd9a51108f6f4064243b21fd6df8
2023-08-21 01:47:10 +00:00
Junxiao Shi 43f37a08fc Change namespace of DummyClientFace, Signal, Segmenter, SegmentFetcher
refs #3940

Change-Id: Ia3c9b4adcca9ff79a14be705ca9da525914f3dff
2023-08-20 02:23:22 +00:00
Saurab Dulal ecb0b7180e Prepare release 0.7.0
Change-Id: I3d707d1f1684879fa9133ac87d1b53710465dea1
2023-08-17 21:48:54 -04:00
Junxiao Shi 771a0de40c tests: change FaceId in test-nlsr and test-fib
DummyClientFace is no longer overwriting FaceId of prefix registration
reply, so that we can use FaceId other than 1.

refs #5011

Change-Id: I50ff0a6ee023ebe5cc78e6d62a45ce375798ad41
2023-08-14 10:49:07 +00:00
Davide Pesavento 907675bd06 tests: fix sync prefix test if SVS support is disabled
Amends a2599dafa9

Change-Id: I21b4379ad83f2241ad6749759ac3a95d98929a17
2023-08-02 20:11:12 -04:00
Varun Patil 7543f590a3 sync: use incomingFace for SVS
Change-Id: I28c24fd6d8da58fdfd7f125736ac22af91179fed
2023-07-21 18:15:59 +00:00
Varun Patil a2599dafa9 comm: do not use localhop for SVS
SVS does not work with localhop; Sync Interests need to
be forwarded at the network layer to all nodes in the group.

Change-Id: I32cba55f98f5a77257dd249d1b7c92d78460b39b
2023-07-19 16:56:16 -07:00
Junxiao Shi f7ea150405 tools: exit with non-zero on advertise/withdraw error
refs #5271

Change-Id: I287fc5746ac1fd2930bb85ac49e5ad732abd3581
2023-06-23 04:30:19 +00:00
Davide Pesavento 658fd85bc7 Avoid using deprecated ndn-cxx type aliases
Change-Id: I55fd500377698adc8035113bdff2d64091a36e07
2023-05-10 22:15:03 -04:00
Davide Pesavento 070ee3b52d Add missing include
Change-Id: Ia350ad412e931c96b963595019f361a6f0181c4e
2023-03-16 22:36:36 -04:00
Davide Pesavento e0ad5808e3 tests: fix two dangling-reference warnings with gcc 13
Change-Id: Iccb9045eaa468f4af7782dc466bd8a28a53ffa73
2023-02-20 21:10:03 -05:00
Davide Pesavento fa54ee99b4 ci: adopt reusable workflows from named-data/actions
Switch source archive (tarball) to xz compression

Change-Id: I3e1963bc1f101b7815f1919b4a16da973261f158
2023-02-20 04:22:42 -05:00
Davide Pesavento 1e9faf1d1b build: bump ndn-cxx, ChronoSync, PSync dependencies
Also fix a few outdated URLs in docs

Change-Id: I4269ca53f55433568e8fd93eec497697c01b3c6d
2023-01-21 16:04:50 -05:00
Davide Pesavento 1b640fd092 docs: improve formatting and document structure
Change-Id: I530d58f2700eb264855843021db32f568d373a1d
2023-01-05 04:02:02 -05:00
Davide Pesavento fcef058206 build: update waf to version 2.0.24
Change-Id: I2b367680138454e51c7aa82d3b93de70d4573d12
2022-12-06 15:08:05 -05:00
Varun Patil 7d2d689d89 communication: add SVS support
Change-Id: I74c5a091c8b1c05dd186a0c10849aa5bb4f39e50
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
2022-12-05 15:27:56 +00:00
Davide Pesavento 65ee992149 lsdb: use ndn-cxx's Segmenter
This commit also makes lld the preferred linker on Linux

Change-Id: I178ca7d28ad21d8a1e3f3daf99f80206e8b1c54e
2022-11-20 22:08:09 -05:00
Davide Pesavento 69904fcb73 tests: fix compatibility with signed Interests in v0.3 format
Change-Id: I52bd2bfb5d9551614e2cf012b19b966d84306368
2022-10-14 09:45:34 -04:00
Davide Pesavento 1954a0c5ce communication: adapt to API changes in PSync
Pass the KeyChain instance to psync::FullProducer

Change-Id: Ia97356dc364c7bdaf6dc80ad57fa351eeabe997d
2022-09-30 16:40:24 -04:00
Davide Pesavento d1cb063482 docs: simplify conf.py and fix compatibility with upcoming Sphinx 6.0
Change-Id: Ib68b2cf40c9b3e74251bb87aa76ca18b7e371f3c
2022-09-25 14:11:23 -04:00
Davide Pesavento ede5963845 build+ci: support CentOS Stream 9 and macOS/arm64
This commit also syncs the CI config and scripts with ndn-cxx

Change-Id: Ie46b1d4b299bc95b03aa05d48efe366e1c72d54d
2022-08-26 20:35:44 -04:00
Davide Pesavento c1d0e8e34d build: migrate to C++17
Change-Id: Ic9f09efd20b608bfcb713fd319834b2666cf6242
2022-06-29 15:04:57 -04:00
awlane 0c87b12458 lsdb: Fix for issues involving incorrect retransmission behavior
Change-Id: I912ca04ccc8303f0c621cd5065553193d09bd26f
2022-06-17 15:53:10 -05:00
Dylan fabe9729b9 Re-add exception handler for dummy keychain
refs: #5206
Change-Id: I8099a99892e62c9365732a53b20f2f5030a67cc7
2022-05-24 16:51:31 -04:00
Alexander Afanasyev 135288cf4f lsdb: Fetch LSA from the face the notification about LSAs came from
Change-Id: Iadb7a22bcc8b2d7801787e5d88b37eec4eafc974
2022-05-24 16:12:14 -04:00
Davide Pesavento 8de8a8b37a tests: sync common testing infrastructure with ndn-cxx
Change-Id: I1e5cdcda8f6d3d9f9addc7a9f17359aedef9db7e
2022-05-12 01:26:43 -04:00
Junxiao Shi b032fcb38f conf+security: accommodate certificate name in KeyLocator
refs #5195

Change-Id: I88709f891fe78fc9f2699bc021d35ca72ebc6850
2022-04-28 01:28:50 +00:00
Davide Pesavento 583473a76f ci: require gcovr 5.1 for code coverage reports
Stop passing `-j`, it wasn't very useful and it's broken in gcovr 5.1

Change-Id: I265b23eb21a5c229b8ce7b4099b342cecd4925a3
2022-04-20 13:23:06 -04:00
Davide Pesavento e28d8756ce Avoid deprecated ndn-cxx functions
Change-Id: I763368c2ea12902b4ea400f92c23b17ad5a5628e
2022-03-19 03:55:25 -04:00
Davide Pesavento d1f1df802c build: align minimum build dependencies with ndn-cxx
* boost 1.65.1
 * gcc 7.4
 * clang 6.0
 * Xcode 10.0 (11.3 or later recommended)

Also improve some test cases

Change-Id: Ib81d082a19e61940fa6f1d89204ea8de8ed57940
2022-03-12 16:40:37 -05:00
Junxiao Shi a3a63975d1 nlsrc: run command on remote router
refs #4544

Change-Id: I977ebfb94c84730bd2bcc73515f77cc4773ec2de
2022-01-24 02:03:41 +00:00
Davide Pesavento ea94f83039 build: update waf to version 2.0.23
Change-Id: I0d8a12968548fcf183cd2183a53b27690e13237c
2022-01-02 18:46:23 -05:00
Davide Pesavento cf14807f7d ci: add code coverage reporting via gcovr
Change-Id: Idc442d4e960360f0c82bcfda0bc8c97004b5d0aa
2021-11-06 19:38:01 -04:00
Davide Pesavento 7bc3d438e7 Improve error handling and reporting
Change-Id: I41a58409c1d488ab2038ae534851e1ab59c6d952
2021-10-26 23:11:04 -04:00
Davide Pesavento ba8a4ed2d2 ci: replace Travis with GitHub Actions
Change-Id: I6316bc7872fe25644dceafb1e2e2119c9c6e5ac3
2021-10-13 21:58:29 -04:00
Davide Pesavento 7ae8b08fc2 build+docs: align minimum requirements with ndn-cxx/NFD
* Recommend boost >= 1.65.1 and gcc >= 7.4.0
 * Require clang >= 4.0, or Xcode >= 9.0 on macOS
 * Silence an ABI-related diagnostic message from gcc on armv7
 * Update waf to version 2.0.21
 * Make graphviz optional for building documentation
 * Sync sphinx configuration

Change-Id: Ib271da841cd12e7595ae83d75bd0fc681f8c231f
2021-10-13 21:57:36 -04:00
Ashlesh Gawande 6f0f35d96d fib: fix route unregister bug during update
refs: #5179

Change-Id: I19952ebcb0c78c405f3d820694a7b0f1cf7a3fe6
2021-09-06 21:20:31 -07:00
Ashlesh Gawande 3781c7ebc1 NameLsa: fix Lsdb update bug by sorting the NPLs before difference
Change-Id: Ib3d5bbf546de3356e0594732ca09671d7c32dbf1
2021-06-11 07:42:18 -07:00
Davide Pesavento 22520e68f5 Fix build with BOOST_FILESYSTEM_NO_DEPRECATED
Change-Id: Ibdd3e7c4de0e8a0a4d6ae08c26386ea780f97f57
2021-06-08 22:16:52 -04:00
Davide Pesavento 6184c2088b Use InterestSigner instead of deprecated CommandInterestSigner
Change-Id: Idb2f1ee7fe99981c229b4a587ebcf671b876e624
2021-05-17 02:28:03 -04:00
Ashlesh Gawande e63b7fa7dc Fix recurring sync prefix registration on every hello data
refs: #5157

Change-Id: Id0f77789976bd84720d2f96b549013b285e58978
2021-04-11 10:47:00 -07:00
Eric Newberry 04bfe0465a tests: make agnostic to whether name components typed or markers
refs #5044

Change-Id: If776224368556c864d6e1db74260cc00ff68d9fa
2021-04-02 11:03:51 -07:00
Ashlesh Gawande 30d96e4875 Do not compile ChronoSync support by default
ChronoSync dependency is now made optional
and is kept for testing purposes only.

Also change sig-type to ecdsa-sha256 in nlsr.conf
as ndn-cxx now has strict checking for it.

refs: #5147

Change-Id: I95c9fb844681ebf2c4e7bbb03cc7796a0795de83
2021-03-27 11:00:40 -07:00
Davide Pesavento 6002e6ab4b tests: explicitly set CanBePrefix in one more place
Refs: #4582
Change-Id: I000d09a0a936db873d50129b66cadfd21a621200
2021-03-17 15:37:32 -04:00
Ashlesh Gawande 5d93aa5b04 lsdb: emit signals when modified
RoutingTable and NamePrefixTable consume the signal
and behave accordingly.

refs: #4127

Change-Id: I6540f30f0222f804b01dc7d9640831c84e5264cc
2021-02-27 08:04:41 -08:00
Davide Pesavento d90338d230 Replace remaining uses of BOOST_THROW_EXCEPTION with NDN_THROW
Change-Id: I0c149acbe5607d928cdf9e8d73813d5e74ca45d0
2021-01-08 11:50:43 -05:00
Saurab Dulal cf06444860 Prepare release 0.6.0
Change-Id: I8c08855856fe781a244695f3eec702bf8f7ba7cc
2021-01-07 11:46:55 -06:00
Ashlesh Gawande 214032e7ac hello-protocol: fix wrong reaction on hello Interest timeout
refs: #5139

Change-Id: If043a618106633de8d1414c81dddf29af6576dff
2020-12-30 18:33:03 -08:00
Ashlesh Gawande 0af4627ad7 tools: fix compilation for ubuntu 16.04
Change-Id: Ifdbc43994e0060b67ffb94a72fdac026671a3be2
2020-12-12 16:58:57 -05:00
Davide Pesavento e4edb3952c Add missing include
Fixes compilation with gcc 10

Change-Id: I54f0808c7519b8bf1a668f05c4d09d4ca3d3b11f
2020-12-06 14:05:45 -05:00
Davide Pesavento d8d6bbcbe6 tests: fix range-loop-construct warning with clang 10 and later
Change-Id: I69a40705201f07147dccb21b3aea2db4f384b24e
2020-11-24 21:38:44 -05:00
Davide Pesavento 4a90b9ae52 ci: disable frames in lcov HTML coverage report
Change-Id: I82d521b75b9e05aa56f12c19a0b159e2ef966a6d
2020-08-09 02:21:46 -04:00
Ashlesh Gawande 7a231c0dc1 route: replace FibEntry class with struct
fix warnings from ndn-cxx

Change-Id: I1be322251dcfe5d867717a64547e1908b99c78ba
2020-07-28 22:11:20 -07:00
Ashlesh GawandeandNick Gordon 57a8717ec7 lsdb: rebuild using boost::multi_index to replace 3 LSA lists
refs: #4127

Co-authored-by: Nick Gordon <nmgordon@memphis.edu>

Change-Id: Ic179f90019e472157b0d61c6db02a4afaf4843b6
2020-07-18 19:17:26 -07:00
Ashlesh Gawande 0421bc6bcd **breaking** route: consolidate routing tlv into route
refs: #5116

Plus some misc improvements

Change-Id: Id0902fec65160b4368b1b5066f460433aced98ed
2020-06-12 07:09:40 -07:00
Alexander Afanasyev 0ad01f3834 Adjust includes for the updated locations of ndn-cxx security headers
Change-Id: I01787a91cdb70b7136f3c4e9e646e68888e6d064
2020-06-10 12:24:26 -04:00
Alexander Afanasyev 96ebd9b7c3 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: I84d6e37fd5f31666ced4b8b47816ff28dd911f17
2020-06-01 19:16:52 -04:00
Davide Pesavento a122abf5f6 ci: update Travis configuration
* Add testing on arm64, ppc64le, and s390x with select compiler versions
 * Drop clang 3.9
 * Reenable ASan on Linux with clang 7, the upstream bug has been fixed
 * Add clang 11 (development branch)
 * Drop Xcode 9.2 (macOS 10.12 is no longer supported)
 * Replace Xcode 11 with 11.3 and 11.4
 * Various cleanups

Change-Id: I7c27cb7765961eb5b057406b0a69d6e40b0e4ca8
2020-05-01 02:51:34 -04:00
Davide Pesavento 4b9d30f8e2 src: fix -Wrange-loop-construct warning with clang 10
Change-Id: Ife00440ffa456c6ad2119fc656a34681327e0ab3
2020-05-01 02:48:34 -04:00
Davide Pesavento f6be8e37f6 build+ci: switch to python3
Also in this commit:
 * Sync CI scripts with other projects
 * Modernize docs/conf.py
 * Replace redmine_issue extension with sphinx.ext.extlinks
 * Minor updates to docs/doxygen.conf.in
 * Cleanup README.md and INSTALL.rst

Refs: #5095
Change-Id: I614e876e6aed73659f4f4cea01813f4604599263
2020-04-30 19:45:26 -04:00
Ashlesh Gawande 0db4d4d8fc **breaking** consolidate src/tlv/*lsa* into src/lsa/*lsa*
Lsa de/serialize functions are replaced by wireEncode/Decode.
Update LSA wire formats. Change TLV assignments as required.
Update nlsrc to print using new encoding.

refs: #4787

Change-Id: Ie8d40b7836d51ea5bb444c8db208dc2b3a0d1cec
2020-04-14 20:06:01 -07:00
Ashlesh Gawande f89878c12c tlv: remove unused class LsdbStatus
refs: #4787

Change-Id: I9c7ce59238a3bac06d3db32423853f11f22e9160
2020-03-31 19:18:46 -07:00
Davide Pesavento fd021d5e3d build: upgrade waf to version 2.0.19
Change-Id: I34f4e78b109012f44aab597e2990a95dde9162ca
2020-02-24 00:42:41 -05:00
Saurab Dulal 1158c55878 Prepare release 0.5.2
Change-Id: If4489a9fcb7f2bdb9c9f2315dca932aa93f847ed
2020-02-19 09:33:58 -06:00
Saurab Dulal 427e012304 security: refactor CertificateStore class
Refs: #5075

Change-Id: I8ab92012b3acf405503ab33c9320463accc682a9
2020-02-13 23:05:28 -06:00
Eric Newberry 4a5334cba7 docs: restructure and update AUTHORS.md
refs #5078

Change-Id: Id87c4fa070170dc6bcf68d3b27a5ce8e372e9ca3
2020-02-05 17:20:04 -08:00
Ashlesh Gawande 55d1b5c2c0 sequencing-manager: remove support for old combined seq no file
refs: #4143

Change-Id: I3334ef136f75b18225828ebfba17f63c468708db
2020-01-13 21:17:33 -08:00
Davide Pesavento cb065f1773 tests: sync common test infrastructure with ndn-cxx
Change-Id: I6f2ee4b5b644d6fddcebbe1158b1dd9ad2159417
2019-12-27 01:03:34 -05:00
Ashlesh Gawande 328fc11217 conf-file-processor: fix empty file creation if conf file is same as dynamic
refs: #5071

Change-Id: I031381156d3c9aee21bb8ab7d018a37189e4a321
2019-12-12 17:27:48 -06:00
Ashlesh Gawande 6b388fc36d src: change initialization order
Send Hello Interest after route to neighbor is successfully registered
--> First Hello interval is eliminated
--> After Hello Nack, wait exponentially before processing it as a timeout
Register sync route for each neighbor after its Hello Data is validated

refs: #5009

Change-Id: Ice39a591f1e58e474b494d93c913fa45e10f24f2
2019-11-13 19:16:50 -06:00
Davide Pesavento f75bfdaa34 build: pass pkg_config_path to check_cfg()
Instead of modifying os.environ

Refs: #5042
Change-Id: Ibc17cf8f310ccd058ebacc3151fa6b4e3d355319
2019-11-10 18:34:13 -05:00
Ashlesh Gawande 842b1cf1f0 src: do not crash if identity cannot be created
This is useful during testing with dummy keychain to save overhead

Change-Id: I73eee512aba9afc3d768270e0e5b4212c7adf058
2019-10-03 22:16:56 -05:00
Davide Pesavento d21d83d892 ci: upgrade Travis config to Ubuntu 18.04
Also in this commit:

 * 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
 * Add Xcode 11

Change-Id: I5b18eee860dd5e92ec51ae832998b57aa7681854
2019-10-01 01:00:02 -04:00
Ashlesh Gawande 4187857a9a src: onFaceEventNotification only proceed if face id was zero or updated
refs: #5010

Change-Id: Ie5b1f8a5ca2a372890a9ef2a28dc00e1a7c0a366
2019-09-30 13:36:26 -05:00
dulalsaurab d0816a3ced route: handle zero cost links
refs: #4978

Change-Id: I461bdac9e10cb8362a7624b177ee68aa20d3ff3e
2019-09-03 14:53:30 -05:00
Nick Gordon c64bed22a8 publisher: remove unused functions
Change-Id: Ifc9a590de11fa841b1d27027d46a9376c5dff41f
refs: #4127
2019-07-22 09:33:57 -05:00
Tianxing Ma 9ea3639be2 tlv: Use the encoding/decoding functions for "double" from ndn-cxx
refs: #4615

Change-Id: I0bde7085876646f272ee6006f4d3cfbd513d4ffd
2019-07-16 16:32:02 -05:00
Davide Pesavento cf22053914 ci: add gcc-9 to Travis CI build matrix
Change-Id: I9c7d2c42390f1314e57745c7459962dd98788f8a
2019-06-25 13:43:17 -04:00
dulalsaurab 348321368d Prepare release 0.5.1
Change-Id: I96ce5a15fe653cc59650edec2a9e42c2253f99a1
2019-06-12 21:33:06 -05:00
Ashlesh Gawande 08bce9c325 src: set best-route strategy for certificate prefixes
refs: #4881

Change-Id: I655c261233e478bf01ff298b74af5eb62a33ffaf
2019-05-25 08:20:39 -07:00
Junxiao Shi 0b1b7d9ff4 tests: add FreshnessPeriod where MustBeFresh is used
refs #4913

Change-Id: Idf7e85b46ea9530678b51bf1f472ecfcfca5773f
2019-05-22 15:37:18 +00:00
Ashlesh Gawande 15052408e9 src: use InMemoryStoragePersistent instead of custom LsaSegmentStorage
refs: #4788

Change-Id: Ie5d8721915864ead2f30e7f5e6181f56acefc559
2019-03-26 11:02:26 -05:00
Ashlesh Gawande dec85d2da4 src: disable network interest in CertificateFetcherDirectFetch
refs: #4879

Change-Id: I6b34b34710bdfcdf0a82327637be83bc452b16d9
2019-03-22 14:03:59 -05:00
Davide Pesavento af7a2113e4 Follow ndn::Scheduler API changes
Switch from ndn::EventId to ndn::scheduler::EventId
and simplify some code.

Refs: #4883
Change-Id: Ifbd3b00da441ca0a277900265f8f6e31fdcebf2a
2019-03-20 08:01:58 -07:00
Davide Pesavento 0b0eddd60c ci: update .travis.yml and jenkins scripts
Change-Id: I315196cb9d8e96f46e706a78c2d15d856a0a8d8b
2019-03-19 14:42:15 -04:00
Ashlesh Gawande 9ecbdc95c5 src: fix canonization by resetting io service after each neighbor
refs: #4872

Change-Id: I87e83eb36f1a17d0dc2633f04c529f71d751a497
2019-03-12 16:45:12 -05:00
Saurab Dulal b2fea6d79f NLSR Release 0.5.0: Minor change to AUTHORS.md file
Change-Id: I79f62495583a57e24e1c589e80e47d0e1d8095e1
2019-02-24 15:53:00 -06:00
Saurab Dulal d3b60a8b24 Prepare release 0.5.0
Change-Id: I8ebb2f5779d7da0c0b6c2f11cc9c653e8d3b1d90
2019-02-23 17:34:26 -06:00
Davide Pesavento 0da3eab4da Add systemd unit file
Refs: #4594
Change-Id: I415bafa14902e9d43be4891f66349192e12b9166
2019-02-22 13:50:37 -06:00
dulalsaurab 82a34c2cd8 **breaking change** nlsr.conf: rename seq-dir as state-dir
update: conf file in seperate directory for runtime modification

refs:  #4823

Change-Id: I5378d831294814e382ad23a9e522d0b576180f20
2019-02-19 15:49:38 -06:00
Ashlesh Gawande 85998a1dc9 src: decouple classes from Nlsr object
refs: #1952, #2803, #3960, #4288

Change-Id: Ibe3ac3820f11e8107ee4b13e510d53c27467a6cb
2019-02-01 14:23:55 -06:00
Ashlesh Gawande 7e3f6d75c8 src: move and simplify canonize functionality to ConfFileProcessor
refs: #4817

Change-Id: I0a7f448f50994906d0403bcb97a3973dc1a25917
2019-02-01 11:54:48 -06:00
Davide Pesavento e3c741da9a main: fix error handling and normalize exit codes
Change-Id: I3b6d6dd1f5a8fac3ec4998bd81af80a232350337
2019-01-30 23:45:32 -05:00
Davide Pesavento 5859ed3dfb Use the official markdown version of the GPLv3
Change-Id: I5de645c2b29c29e2927e19b12831c0b336ad54b7
2019-01-29 19:49:09 -05:00
Davide Pesavento e556991595 build: various updates
* Upgrade waf to 2.0.14
 * Sync default compiler flags with ndn-cxx

Change-Id: I9e5bbbc7c13d1770e6ac0b0b5f5c0fbe17f89f23
2019-01-29 19:39:06 -05:00
Saurab Dulal 72b2b25cd2 route: remove redundant function
refs: #4811

Change-Id: I31b1031f57a344e7c3176b917ffbad2f6b2bd821
2019-01-25 05:06:50 -06:00
laqinfan 7c13ba5448 nlsrc: demarcate LS and HR routing table in dry run mode
refs: #4452

Change-Id: I522493e473810f90e4e982b35a58310154816cae
2019-01-22 21:47:51 -06:00
Junxiao Shi 008c9b18a5 tests: set CanBePrefix in test suites
refs #4581

Change-Id: Ia53e2a865dbc8a422626640d8d7f3878e49066ba
2019-01-13 23:15:56 +00:00
Saurab Dulal 7526cee087 update: Add/delete prefix to the conf file
refs: #4303

Change-Id: I401885bf76be90a5076365eebc311275461813c4
2019-01-08 20:56:09 -06:00
Ashlesh Gawande 939b6f8652 src: use psync::SegmentPublisher and fix proccessing of interests w/ segments
refs: #4784, #4760

Change-Id: Ia017a6f340e1cd35991068453c9da595c453ca1f
2018-12-22 15:45:50 -06:00
Ashlesh Gawande e5002b3fc4 fib: don't refresh neighbor router's FIB entry (it is already installed w/ expiry=never)
refs: #4799

Change-Id: Ib55687655ccd8673eeae14d8418e458ad8ab00aa
2018-12-21 12:18:49 -06:00
Ashlesh Gawande 32ec3fd51e communication: sync protocol adapater to add psync
refs: #4082

Change-Id: Ibe4649e709dfbc3cdc1f2afbfc4ff03f75a3f136
2018-12-10 10:38:41 -06:00
David Arjona 2fa23ea104 docs: Improving documentation for NLSR
Change-Id: Iada3c9bbc56b53fb66bfea1c99ef2204afaf9039
2018-12-07 12:29:20 -06:00
Ashlesh Gawande 744e481642 ci: enable leak sanitizer
src: fix memory leaks caused by segment fetcher

refs: #4682

Change-Id: I4fdf24f369e2d27845f1f6e6ca9978905110a024
2018-11-25 10:43:40 -08:00
ashiqopu 8433cfeace ci: install gcovr via apt
Change-Id: I0e24a2299c99d4e685a9bb5a1ddba34d06ba2f77
refs: #4771
2018-11-25 06:47:37 +00:00
David Arjona 2e6c8bb896 docs: A beginners' guide to installing and testing on Fedora
Change-Id: I2345fe8443981dab60782f8daa8c4ae0b107a1bf
2018-11-15 16:44:25 -06:00
Ashlesh Gawande 3494f7366a src: disallow interest loopbacks
refs: #4768

Change-Id: If5ec53fc9869b65e318c3eaf950708cfa36e658a
2018-11-06 17:30:40 -06:00
Ashlesh Gawande 05cb728c63 src+tools: use segment fetcher start
jenkins: re-compile ChronoSync on ndn-cxx change

refs: #4464

Change-Id: Ia627e00b8f13bad0068e213a6019f62a84cad41a
2018-09-25 17:55:43 -05:00
Ashlesh Gawande 057005460e hello-protocol: set canBePrefix to true
refs: #4691, #4679

Change-Id: I5f57d7bb6a75af074fc64206fe6061f2fc758b40
2018-08-28 11:13:28 -07:00
Ashlesh Gawande e8d8bd5276 adjacency-list: fix crash in equals operator
some minor code improvements

refs: #4705

Change-Id: I28805981a88a94c79f699956bb7e62a268d9ba49
2018-08-26 13:25:27 -05:00
Ashlesh Gawande 481010723b communication: use ChronoSync Logic instead of Socket
refs: #4623

Change-Id: I6950af9d92a254b4fe05f7570ab6bc8b8a9599c8
2018-06-08 13:12:04 -07:00
Davide Pesavento a08dc3f1f1 build: require gcc >= 5.3 and switch to C++14
Change-Id: I93c8fc238cc2654346bbc69a9d8ea83d1c0b099e
Refs: #3076, #4462
2018-06-06 16:27:47 -04:00
Saurab Dulal 301220346e docs: Prepare version 0.4.3 release notes
Change-Id: I0b3a6166eac489be67ea03ff69a13ffe35616f63
2018-05-21 12:54:11 -05:00
Ashlesh Gawande 8df15986ef tlv: avoid misaligned memory access
They cause unit test crashing on ARM platform.

refs: #4609

Change-Id: Ifdb0401529de48b5c08ebcf6938d80ba87ff883d
2018-05-19 22:21:25 -07:00
Ryan Wickman f3c79a6f87 src: make LSA's isEqualContent methods of type const
refs: #4137
Change-Id: Idb1cdea33d4efbc3af3c07d901a620d3ef253979
2018-05-10 20:15:01 -05:00
Ashlesh Gawande cba0ae2f56 **breaking** Change NLSR to nlsr for various prefixes
src: register router prefix to fix remote requests

refs: #4543

Change-Id: I698484318bf8e641f955ea40e6c51c6865cad8bf
2018-04-19 14:34:29 -05:00
Eric Newberry f1a8ee66de build: find Boost lib architecture automatically
refs #4573

Change-Id: I383f821bc651926ba5d2ed830b20dd3116e8a3fc
2018-04-07 16:38:47 -07:00
Ashlesh Gawande d65786a0ea src/lsa-segment-storage: fix convergence w/o content store
refs: #4430

Change-Id: I5124e9fd49bd9850c904c31d221b42b4249553a3
2018-04-02 22:55:17 -05:00
Ashlesh Gawande e6ba9158e0 Fix build with clang-5.0
refs: #4547

Change-Id: I7fd0411b3dc7c62651875aa035bbfb6ca269bf81
2018-03-30 16:20:27 -05:00
Eric Newberry aa41b04807 docs: disable sphinxcontrib-googleanalytics
refs #4553

Change-Id: I94529272787b0facd9370f9c6fca06435a636093
2018-03-26 15:16:43 -07:00
Alexander Afanasyev 67758b1fba build: update waf to version 2.0.6
Fix discovered build issues

Change-Id: I9a861c955283c1b20cc5065a4baa22bd7c2ab0c1
2018-03-11 12:17:41 -04:00
Ashlesh Gawande 350d58489b docs: Prepare version 0.4.2 release notes
Change-Id: I36780f66b803b6049e5399fde6e1a097c40a65b3
2018-03-05 12:04:31 -06:00
Ashlesh Gawande 8c6d8c831a lsa-segment-storage: fix segfault in scheduled erase of lsa segment
refs: #4520

Change-Id: I597604b4be9e063a08ff5031faa8d305408b676d
2018-03-01 12:54:15 -06:00
Ashlesh Gawande 0b27c1ff5c Update symlink to latest release notes
Change-Id: I0956f0be737af0b4d43810ff7c7c91fd89982c8a
2018-02-26 14:35:53 -06:00
Ashlesh Gawande 39cf81a110 docs: Prepare version 0.4.1 release notes
Change-Id: I91db5b65dfe06187ddb0e9df32905dc2c8797ddc
2018-02-22 17:37:51 -06:00
Alexander Afanasyev b0bf8df1bd Hard-code fixed session name for ChronoSync sockets
This commit reverts behavior of the hard-coded fixed session name that
was feature in old nsync-based implementation.

Also fixing an initialized configuration parameter.

refs: #4513

Change-Id: I44559e729c949f90511a5c53282fd4a240356157
2018-02-21 13:49:40 -08:00
laqinfan a073e2e23e publisher: fix encoding bug in routing table publisher
refs: #4453

Change-Id: I03e819e963f0957f3d40ff25e378f2b9b17357b7
2018-02-16 12:30:36 +00:00
Saurab Dulal 9da6aa7fce Routing: Print labels on adjacency matrix when logging
refs: #2045

Change-Id: I0fa36eed1a6afdca6f135c80a20aa062a5e8cd63
2018-02-15 12:20:15 -08:00
Ashlesh Gawande 304bebf64f Remove some unused functions
Change-Id: Ic99891d2037e928ac927651607559e7660bd677f
2018-02-15 12:41:43 -06:00
Ashlesh Gawande 982a58fae5 Add version number after ChronoSync prefix
Change-Id: I5c6782461e6c00129850ab00df407a1f59f4353b
2018-02-14 17:39:12 -06:00
Alexander Afanasyev 7afe22f410 Output extended diagnostic information on fatal errors
Change-Id: I36bdd60df742837aeffb16ab78a93b93d5b24887
2018-02-13 16:17:40 -05:00
Ashlesh Gawande f7da9c542c conf: make ChronoSync's sync interest lifetime configurable
refs: #4490

Change-Id: Id3eabeed1049d1208ba49c47206f73f798f37a35
2018-02-09 15:24:47 -06:00
Muktadir Chowdhury c3ea26f000 Serve other routers' certificate and LSA
refs #4448, #4430

Change-Id: I3a9a9ae613770774be06effe26dfb866ea49f05a
2018-01-29 23:23:19 +00:00
Ashlesh Gawande 0d2c38299e Change certificate validity period to 1 year
Change certificate freshness period to 1 year
Catch Malformed URI error

refs: #4473, #4474

Change-Id: Ia341cba1e72b541c13eb480dfa53f26f89d854fa
2018-01-25 10:34:01 -06:00
Nick Gordon 563611eb20 communication: improve constness
Change-Id: Iabc5093d3c8e84540ddef4f6f2ff768dd9f3d0da
refs: #4472
2018-01-23 14:08:26 -06:00
Nick Gordon af87575012 nlsr: refactor equality operator
Change-Id: Iaaef9511e6569d597afcc5fa083b98ce86d8f78d
refs: #4127
2018-01-23 11:36:54 -08:00
Nick Gordon 4964870e9d src: improve constness
Change-Id: I8b3084e311642578628ea7c1017dc2a58979ab83
refs: #4472
2018-01-23 08:45:37 -08:00
dmcoomes b2ef6adbd3 Remove log4cxx from Jenkins
refs: #3949

Change-Id: I7ff3da932fe8a011aa391766c501b475118eaea5
2018-01-22 16:22:50 -06:00
dmcoomes cf8d0eda75 Use ndn-cxx logging facility
refs: #3949

Change-Id: I5d0931c3576c88e0c2fa52bdd0a716946400e0bc
2018-01-22 13:24:35 -06:00
Davide Pesavento 437adfeed6 ci: expand Travis-CI build matrix
Change-Id: I6ef5a461eaed9d66bed12189cde28cab30e55df8
2018-01-11 18:57:47 -05:00
laqinfan 357318540d publisher: implement routing table dataset publisher
refs: #3631, #3634

Change-Id: I7e961fdd0857690bee65d2bdfa4cf3de90ccac06
2018-01-11 12:08:27 +00:00
Ashlesh Gawande 14ab329746 Fix NLSR not converging without content store
refs: #4430

Change-Id: I8bff1facf528a07a3c2d90e8f512128c0420d799
2017-12-29 12:03:26 -06:00
Nick Gordon ed473c6c47 docs: mention the contributing guide
Change-Id: Ie14448f2fdf228db380f8332bee3dbe0b769fa50
refs: #4412
2017-12-21 14:02:30 -06:00
laqinfan ac4b65664f communication: fix dry-run mode not working
refs: #4394

Change-Id: I6b7eba5e36af307b9da6b5c198d44f9915db6358
2017-12-08 11:33:52 +00:00
Ashlesh Gawande d88c1dfdc2 ci+docs: remove all references to cryptopp/crypto++
Also update COPYING

refs: #3946

Change-Id: I87ded823f806857bb27079648e51619bb9dde6bc
2017-12-05 16:37:22 -06:00
Ashlesh Gawande 9e955bcec7 docs: Prepare version 0.4.0 release notes
Split the long release notes similar to NFD

Change-Id: If5ce5247bf74a4e402a33d92a35a686e7193dea1
2017-11-30 21:03:03 -06:00
Muktadir Chowdhury f04f98943d Convert to v2::security and adapt to ndn-cxx changes
Change-Id: I54f1b758cfb8f3f6cbc66a1aec5120ae1640b0ec
refs: #3964
2017-11-30 20:54:47 +00:00
Nick Gordon 2f62338d12 lsa: added noexcept and docs
Change-Id: Ic8c8566ced9654185a0619eca614ee1c6d108674
refs: #4354
2017-11-03 13:49:31 -05:00
Nick Gordon ae0a047c41 lsa: improved printing and logging
refs: #4354

Change-Id: I27cc99c6d01ba22668f4f56ad57b6f34f24f8af2
2017-11-02 13:55:56 -05:00
dmcoomes 5bcb39e255 rename log macros to comply with ISO C++ standard
refs: #4341

Change-Id: Idb05f59660f42c01a7bf014c6fff4125a28327f2
2017-11-01 09:36:53 -05:00
Nick Gordon 0fa4c77987 lsa: simplify initializeFromContent and improve naming
refs: #4354

Change-Id: I5ddd5a9f482f59e6ca52061ac92514feab8c3070
2017-10-30 17:09:24 -05:00
Nick Gordon 22cc1a8d17 lsa: simplified key getter
refs: #4354

Change-Id: Id886d41ff98530e1953066593640232d31b93b26
2017-10-27 10:18:57 -07:00
Nick Gordon 96861ca49c npl: npls more conveniently instantiable
NPLs can now be instantiated using brace-init lists, as well as by passing
any iterator-capable container.

refs: #4345

Change-Id: Ib43373d5899d0ac14861027c34431fa928eec191
2017-10-26 15:25:59 -07:00
Nick Gordon faf49f4c32 lsa: leverage class hierarchy when serializing.
refs: #4354

Change-Id: Ia3e79694c785b208184137d8ef0813629d61cc83
2017-10-26 11:08:25 -05:00
Nick Gordon 9212bd43bb lsa: make base class abstract
refs: #4353

Change-Id: If95c1689727f541c123623d21aec78ab8bdd58e6
2017-10-23 13:56:46 -05:00
Nick Gordon 727d4830d7 lsa: change type variable to enum class
Change-Id: I7fba951649771700ce6ccc4be7fb400546607e96
refs: #4340
2017-10-19 15:44:06 -07:00
Nick Gordon ff9a62713b style: made container APIs more consistent.
Change-Id: Ib4feedfc4c9fb497dfcd67e7e6a33ee03db58d7f
refs: #4337
2017-10-13 16:03:27 -07:00
Nick Gordon e18296c270 hello: move constructor definition to implementation file.
Change-Id: Ia176b5cad081a61368f45ac137dc6c9474101751
refs: #4334
2017-10-11 14:41:09 -07:00
Nick Gordon 2a1ac616b3 adjacency-list: improve constness of equality operator
refs: #4331

Change-Id: Ia57a82859abb2a32b22a7dbff471d1843d8237f0
2017-10-11 11:55:49 -07:00
dmcoomes a47255c2c5 docs: add commit ids for dependencies to README.md
refs: #4260

Change-Id: I096d5502a1cdc5fe712021fc0046d883a456173b
2017-10-04 11:24:48 -05:00
dmcoomes ffb62fa3fb docs: update authors
refs: #4231

Change-Id: Idbee3121d59d10ee96ff6b044cc55552f3b64c94
2017-09-29 10:29:17 -05:00
Nick Gordon 114537f6e0 publisher: simplified LSDB dataset interest handler.
refs: #4235

Change-Id: Ia3f606947884304e8b01211b5887ad62488f7167
2017-09-08 14:47:52 -07:00
Nick Gordon 922714a0d9 nlsr: Added a finally() to canonizeNeighborUris
Change-Id: I0046ae7a07be69f20a8f9d2b4acb33d8533a28e7
refs: #4128
2017-09-08 10:25:45 -07:00
Nick Gordon 5867b5233f fib: merged redundant functions
Change-Id: Iebec912fa7a3b8ab2cfe36835868dbdb068d7076
refs: #4105
2017-09-07 08:48:11 -07:00
Nick Gordon d40a588e25 routing: use unique_ptr for signal container
Change-Id: I1912f8630d0e26d8c25c2050208f6b8b0ffd9009
refs: #4268
2017-09-06 14:51:26 -07:00
Nick Gordon 8f23b5d58e sync: improved unit tests
refs: #4264

Change-Id: I981f3d8f653e4750ee6f9d77f2c89188f11d8ebb
2017-09-06 14:23:16 -07:00
Nick Gordon 9eac4d9830 sync: removed ref to lsdb.
Sync now emits to a signal whenever a new LSA is detected, and the LSDB
listens to this signal.  Sync consults a function object gotten at ctor time
to determine LSA newness.  This means Sync no longer needs a reference to
the LSDB, and LSA newness criteria can be freely manipulated.

Change-Id: Ifce3ebfc921ad846fcfa12d99c78f3b337180827
refs: #4264
2017-09-05 12:20:53 -07:00
Davide Pesavento 6ebfd7c182 build+ci: enable code-coverage reporting
This required changing the CI scripts to run the
unit tests against the debug version of NLSR.

Also sync default-compiler-flags.py with NFD.

Change-Id: I31f37e3dfef2c1237393512e0c238f5e6bcbe525
2017-08-31 13:49:13 -04:00
Nick Gordon b7b5839197 route: communicate routing changes using signals
The RoutingTable now has a signal that it emits upon finishing
calculation, which other modules can subscribe to. The NamePrefixTable
now references this emitted container to update its local copies of
routing information.

Change-Id: Id601776258ad0367cc47461ea8f86a710eada132
refs: #4249
2017-08-29 13:18:38 -07:00
Davide Pesavento 813df80e20 ci: sync CI scripts with NFD
Notable changes include:
  - support WAF_JOBS env var
  - use two parallel build jobs on Travis-CI
  - use "limited builds" for code-coverage and Travis-CI
  - upgrade Travis-CI osx from xcode8.2 to xcode8.3
  - enable ASan on Travis-CI

Change-Id: I4101499ebc590478d67ec8134c0395c4aafb8fb6
2017-08-26 17:06:00 -04:00
Davide Pesavento 0bd37314fe ci: speed up Travis-CI osx jobs by upgrading only the packages we need
Synchronize the rest of the file with NFD.

Change-Id: If2f5fba0eb614a881b51396b15a5a30e7939f728
2017-08-26 17:06:00 -04:00
Davide Pesavento 6a81b77260 ci: preserve PATH when running waf under sudo
Change-Id: I85bdc5b69de2c2c7b8c0dc5a7aa2927b495e2168
Refs: #4186
2017-08-26 17:06:00 -04:00
Nick Gordon c0c6bcf7e2 route: updates to name prefixes are more efficent.
With this change, only entries that have changed next-hops will
cause any change in the name prefix table.  Consequently, routing
table calculations no longer cause RIB registrations for unchanged
prefixes.  However, this is not a problem because FIB entries
refresh themselves.  This resulted in the removal of a test from the
TestNlsr suite.

refs: #2864

Change-Id: If28a04cb7bb47a3a6c32cd24578c68885d08d6b3
2017-08-24 16:54:39 -05:00
Nick Gordon 098aae410a tests: make LSDB tests more deterministic
TestLsdb/LsdbSync now iterates over all sent Interests to
check that any of them match, as opposed to checking
positionally, which cannot be guaranteed to pass.

Change-Id: Ib9e3a4b0aea4e1a4dd9f1c7e65d1b2a299863a9c
refs: #4257
2017-08-23 14:47:29 -07:00
Nick Gordon e40377d570 routing: improved routing map data structure.
Change-Id: I1cde5b2b9cffcec5cbfd78c5dd4262b5fb919a73
refs: #4240
2017-08-23 12:57:19 -05:00
Nick Gordon 7afcab4652 tests: make sync tests more deterministic
This change makes the UpdateForOther{LS,HR} tests more deterministic by
removing the temporal ordering requirement of sent interests.

Change-Id: Iceab5735baa2ff2fb97b18babfcf2bb32110a3c2
refs: #4253
2017-08-22 14:05:43 -07:00
Nick Gordon e98480b5d1 nlsr: removed references to ndn-cxx/common aliases and improved namespacing
Change-Id: I65e4691305b0157f334fc68d96998c119ef8b03b
refs: #3406
2017-08-22 13:37:21 -05:00
Nick Gordon d0a7df337f docs: wrote Doxygen comments for all files
refs: #4118

Change-Id: Ib0e7f1926cdabcca5aa401b59b24519412a099f7
2017-08-21 14:30:50 -07:00
Alejandro Gil Torres e0d2048d5f src: Implement packet statistics collection
refs: #2955, #2956

Change-Id: I57476a63562dbd378e566ad0280c89ccc5883e3e
2017-08-17 11:59:53 -07:00
Nick Gordon f14ec357d5 nlsr: Add support for sources to NamePrefixList
Added support for string sources to NamePrefixList entries.  Required was
some tweaking of the API, and refactoring usage around the codebase.

Change-Id: I44813e024a88dc1f591f427b0fad568a7d5353ab
refs: #4177
2017-08-16 15:00:14 -07:00
Davide Pesavento c58cc7f596 build+ci: enable AddressSanitizer and LeakSanitizer for unit tests
Refs: #2589, #4206

Change-Id: Ie9770134ff87fce438029b97c9ed61dbef3a71a3
2017-08-16 12:35:52 -07:00
Nick Gordon 22b5c957c0 routing: made map more container-agnostic
Change-Id: Ib18a41bac7627a9eb0bbafa6ccad0335d420dd68
refs: #4239
2017-08-15 09:06:28 -07:00
Ashlesh Gawande 90173ad966 Resolve ASan errors that will be thrown once it is turned on
Plus few minor spelling and code-style issues

refs: #4230

Change-Id: Ia665bab546a9628347af45836dcbe765dc91c54f
2017-08-14 10:54:15 -05:00
Nick Gordon 608061b95d tests: wrote select-cheapest-hop test.
Change-Id: I1eaed69675010bbf7b85221b72c4fcea71ebd9f0
refs: #4169
2017-08-11 10:38:40 -07:00
Ashlesh Gawande 793e8707a1 src: fix prefix advertise runtime error
Don't schedule Hello after receiving face changes in dataset,
let it be on its schedule. Also don't schedule routing calc (HR)
or AdjLsa (LS) let them be scheduled on Hello Data.

refs: #4215

Change-Id: I5c3881943f83b2f7683316fa3e22e6c280b6b64d
2017-08-10 16:21:34 -05:00
Laqin Fan 54a43f06e1 update: Refactor to use ndn-cxx dispatcher for prefix update/readvertise
refs: #3728

Change-Id: I3186433ed460850753f033a1d03fe27fd1fe889c
2017-08-04 12:46:50 -07:00
Ashlesh Gawande 820bb66350 src/lsdb: fix heap buffer overflow
refs: #4217

Change-Id: I902dfd7fcb856b5fd5cd285ef4d498956029848e
2017-08-03 16:14:19 -05:00
Ashlesh Gawande 9b71bbc970 wscript: install nlsr.conf as sample in the system
refs: #4197

Change-Id: If4fa9282f71661450950d8d6e44bf2ac4fe2bcee
2017-08-01 11:00:44 -07:00
Ashlesh Gawande 3909aa160a src: fix incorrect error on face-dataset-fetch-interval valid values
refs: #4211

Change-Id: I9ec04483a633ecf31797dd1637229d147d436d35
2017-07-31 12:30:13 -05:00
Nick Gordon d5c1a378d1 nlsr: discover Faces from NFD
refs: #2954

Change-Id: I072972d88bce0e1012e96f33577657048b7df1e1
2017-07-21 08:39:11 -07:00
Ashlesh Gawande f6bfb14def src/logger: use unix timestamp as default
refs: #4187

Change-Id: I235c1ba60d981b7c52d50b14b6fefafca049679a
2017-07-19 15:41:44 -05:00
laqinfan d22da51783 publisher: use ndn-cxx dispatcher for dataset publisher
Change-Id: I836a718ba40ff471bcdac7a7cc684c13914c4ea5
refs: #3728
2017-07-07 10:46:25 -05:00
Nick Gordon a75fdb27c5 build: fix build issues with pegged ndn-cxx
Change-Id: I0f000455d1eaf974d85ed76414af8710bc44dad4
2017-07-06 14:10:43 -05:00
laqinfan cd7ca05378 route: refactor Fib::removeOldNextHopsFromFibEntryAndNfd()
Change-Id: I6ef61fcec6b934c0238ecb697c14564c02cacfe2
refs: #3820
2017-06-28 08:45:13 -05:00
Muktadir R Chowdhury b00dc2acea Accommodate n-Dimensional HR coordinates
refs: #3751

Change-Id: Ib705b671daba56f58e09876a48d8b31649bd7ab1
2017-06-26 15:52:48 -05:00
Nick Gordon 0f1bf1dfcd Revert "sync: remove check-for-self in sync updates"
This reverts commit b23f279353.

Change-Id: I8630be544195a01e09b3a2e4d85d102ac00cfc72
refs: #4134
2017-06-22 13:47:55 -07:00
Ashlesh Gawande 8bfd124212 Use network name in sync prefix to avoid sync leaks from other networks
refs: #4101

Change-Id: I97d76d54571a124de33c6e62e07115c0df26882c
2017-06-22 09:15:27 -07:00
Ashlesh Gawande 7600c90882 Complete remaining changes for ChronoSync dependency issue
refs: #2400

Change-Id: If0cf9d3140f3ef65d86394fad3b6a6c7c58064f9
2017-06-21 14:25:03 -05:00
Nick Gordon e9733ed876 nlsr: refactor Adjacent to use FaceUri objects
Change-Id: Ib46f70570669c381572182eeea5c047a38a05104
refs: #4063
2017-06-20 15:02:55 -07:00
Nick Gordon b9e2c650e6 build: Fixed ChronoSync not being found on OS X.
Change-Id: I79dfa5bb8c25d6922c1e7b7529953fb2fb2fcae2
2017-06-20 13:12:02 -07:00
Nick Gordon 494de4033d nlsr: remove writeLog in NamePrefixList
Change-Id: Id54152684d1aa366b5eec8eeb79c046dedf6da7c
refs: #4131
2017-06-15 09:15:29 -07:00
Nick Gordon 56d1fae10a nlsr: implement NameLsa::isEqualContent
Change-Id: Ibf9021144f5ff253515875ac61de97740a1fecd7
refs: #2962
2017-06-15 09:15:24 -07:00
Nick Gordon adad2490e5 nlsr: LSA getData() now uses ostream instead of manually building the string
Change-Id: Ib4f6e27ccbe614140dbda63e6a5c7f4a78baedb7
refs: #2346
2017-06-13 12:15:43 -07:00
Nick Gordon b23f279353 sync: remove check-for-self in sync updates
Change-Id: Iba7e80370acc7c7144725bb6de1d018a8493b9b7
refs: #4117
2017-06-12 17:17:06 -05:00
Ashlesh Gawande 3e105a0493 Use separate name prefix and sequence number for each LSA type
refs: #1523

Change-Id: I9db6b3a3ea9ce5e17e132d2a4e2ae9f30dd4f591
2017-06-09 13:54:24 -05:00
Nick Gordon b9c5cecfb2 build: specify pre-v2 change version of ndn-cxx, ChronoSync in Jenkins file
Change-Id: I4c1a13542444821df6455958cdbbd9685c017337
refs: #3920 #4119
2017-06-09 10:37:12 -05:00
Nick Gordon f8852c2d27 nlsr: change configuration parameter output level to info
Change-Id: I32ec91457aaa45e0dbd87c599b3a6bd0b5ac92a6
refs: #2850
2017-05-25 10:07:53 -05:00
Nick Gordon 9461afb721 nlsr: canonize Adjacent FaceURIs on startup
Change-Id: I6a2b31631918c1ece79c3fc13e392917162efc2d
refs: #4063
2017-05-24 10:42:57 -07:00
Nick Gordon 2108808ae3 nlsr: remove deprecated ndn-cxx header includes
Change-Id: Ia016bf6f29304bbc2232db45003fedb331f43ee6
refs: #4088
2017-05-24 10:57:49 -05:00
Ashlesh Gawande 6fa00d923c Add missing dispatcher header to fix compilation
Change-Id: I7a7c637e74974c546bfc2c70fa39e850e8dbeaa2
2017-05-19 19:31:46 -05:00
Ashlesh Gawande b4567f40fb docs+README: improve documentation
Change-Id: I562508869f7e60ccf465b8c1acdf63e27c905c7a
2017-05-05 10:25:24 -05:00
Ashlesh Gawande 415676b6cc make chronosync a dependency
refs: #2400

Change-Id: I8b488f165a4f9a2c9a7731931be3b6d2e3c43c89
2017-05-02 14:26:16 -05:00
Nick Gordon c780a6986b nlsr: refactor AdjacencyList to use iterators instead of bare ptrs
Change-Id: I42225ee63c3d64eb80e58bc51c8d1afd20dd2ce2
refs: #4068
2017-04-28 10:43:08 -05:00
dmcoomes 9eaf3f4417 nlsr: Improve logging throughout lsdb.cpp and others
refs: #3934

Change-Id: I2365c88b795316c83dbeac2eab82f371c0275f88
2017-04-27 12:37:18 -05:00
dmcoomes c2c3ae0fd2 nlsr: update manpages for nlsrc when security is enabled
refs: #3911

Change-Id: Idf496ed2c3826c2aafd015a42b9a61d9ec4ecceb
2017-04-24 13:34:13 -05:00
Ashlesh Gawande 812af97447 ci: check boost version change on OSX
refs: #4060

Change-Id: I70819d428c6285ed4e18d2da9478d2c99333d37a
2017-04-24 10:31:49 -05:00
dmcoomes e689dd6d8b Make header guards comply with Rule 3.2
refs: #3984

Change-Id: Iec7a0d9ff49cf6124af9e554432ee5f09a199651
2017-04-12 09:24:42 -05:00
Nick Gordon 4d2c6c07ae nlsr: accept NFD-RIB-style register/unregister commands
refs: #3818

Change-Id: I7a5455bdec815bdcbe53ad535dab44249d1a18ce
2017-03-31 12:22:42 -05:00
Ashlesh Gawande 30096b8f37 docs: update NLSR paper
Change-Id: Ia8fda3373c5873db77db43f30165ec41dd4d05b2
2017-03-30 18:16:11 -05:00
Muktadir Chowdhury 3be6466a85 route: Refresh FIB entries independently of routing table calculation
refs: #2778

Change-Id: I3536faa9c097152bfb99ebc0270221ca359cba35
2017-03-28 10:58:30 -05:00
Muktadir R Chowdhury f023a88ec1 docs+build: Prepare release for version 0.3.2
refs: #3995

Change-Id: If9ea3e69eee886abce90700e33f37c0102e367a7
2017-03-16 09:19:50 -07:00
Alexander Afanasyev 4c2bb361ae Remove more use of deprecated code
Change-Id: I4322ab4aedb9287acf2eb608f96b7eefbc5f7dba
Refs: #3988
2017-03-14 12:29:19 -07:00
Alexander Afanasyev 1de901f161 Remove use of deprecated code
Change-Id: I197471c48c54c5671bb8f641c4332b3ac7893824
Refs: #3988
2017-03-11 13:50:28 -08:00
dmcoomes 9f93666519 nlsr: Don't use ndn aliases provided by ndn-cxx/common.hpp
refs: #3983

Change-Id: I31da8d68e0285dcfe9c7d3e5e678c00397d22bef
2017-03-09 12:12:40 -06:00
Nick Gordon 48daea20d7 nlsr: enable dispatcher for LOCALHOST_PREFIX
refs: #3938

Change-Id: I532b69aa7e2ade22929588f42de55366fccb80d2
2017-02-27 15:33:10 -06:00
Ashlesh Gawande 218aaef118 utility: temp fix for face already exists (409)
refs: #3976

Change-Id: I930ae5dae8938c83b7deff5079a499b7c5dcc639
2017-02-25 21:34:36 -06:00
Davide Pesavento 87911dacd5 src: use ndn::nfd::ROUTE_ORIGIN_NLSR instead of a magic number
Change-Id: I88dc8e8bc5893820085f305abb52bfd1b654dfcd
Refs: #3903
2017-02-21 22:13:25 -05:00
Ashlesh Gawande 54e726cf5e update config file for /localhop LSA
refs: #3899

Change-Id: I028ed7067724a2d3506ceca0813aea89efea528d
2017-02-14 11:04:08 -06:00
Laqin Fan a4cf402084 nlsr: Pass keyChain to NLSR constructor
refs: #3742

Change-Id: I186784da2989aa8bcc396c81c4fc80254a6f313a
2017-02-01 10:18:05 -08:00
Nick Gordon f590fecfc2 docs+build: Prepare release for version 0.3.1
Change-Id: I01d0b8e71ee4fdf37957a323e11e87f69672d473
2017-01-22 11:03:28 -08:00
Ashlesh Gawande 6077ea910c src: use /localhop component in LSA prefix
refs: #3899

Change-Id: Ibbb42adf3cc34e4a09e267bd73ffb248aad715d5
2017-01-21 16:23:34 -08:00
Nick Gordon d1f4f33cfd nlsr: Add dispatcher to NLSR class
refs: #3930

Change-Id: I69d3a1a87558118ea25258f08f7441e0d7ebe73d
2017-01-20 14:50:20 -06:00
Laqin Fan d8c9d8cdab Fix typos in the sample configuration file.
Change-Id: I66d66bef84aeb3508af654f7e664ca59bc5fee53
refs: #3113
2017-01-19 15:54:12 +00:00
Nick Gordon feae5574b8 boilerplate: Update copyright year in .cpp files
refs: #3923

Change-Id: I8a46f2634527094d82c85c605384f25ddd172732
2017-01-13 12:18:32 -06:00
Alexander Afanasyev 4fc69e49a9 ci: Fix macOS build with Travis-CI
Change-Id: Iabdfd71c4ba8b3c35f6de117da3b42b61cb1dc4e
2017-01-11 13:31:43 -08:00
Nick Gordon c6a852234d nlsr: Updated license boilerplate for all NLSR files.
refs: #3909

Change-Id: I7186b62e2e3506e23a28c70b95b7e6a225a8d78b
2017-01-03 16:56:17 -06:00
Ashlesh Gawande 44395237b8 src: use /localhop component in Sync prefix
refs: #3627

Change-Id: I666f4072601cf7b66bcde632c31c632fabe6e684
2016-12-13 14:35:44 -06:00
Ashlesh Gawande c5fa320239 hello-protocol: re-calculate HR nexthops on status change of a neighbor
refs: #3874

Change-Id: I8295248d95e047e24cced9700eabd458ab3e9112
2016-12-05 12:06:25 -08:00
Eric Newberry 41330f4256 ci: set Travis CI Xcode version and update NODE_LABELS to 10.11
refs #3833

Change-Id: I4c9f98d11e01ce1b712295c884d49fc14def37e2
2016-11-01 15:33:36 -07:00
Alexander Afanasyev 96bf2f0db8 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: Ibc006a6be6f5d9aba80dfe4b5f9b13a758bafcc7
Refs: #3795
2016-11-01 15:33:20 -07:00
Laqin Fan 2b057af9e1 hello-protocol: delete redundant call to Nlsr::setStragies()
ref: #3743

Change-Id: Ic793b0e78639adceec0932ded5a87514b9af94ea
2016-09-27 18:32:02 +00:00
Nick Gordon b71684744f src: Fib and FaceMap now use map instead of list as their table data structure.
ref: #2781

Change-Id: I93ad23266ee7b79fd5c53b538c30af76565abc4b
2016-09-26 10:54:41 -05:00
Nick Gordon b50e51b374 Name prefix table entries keep pointers instead of keeping a copy of the object for routing table entries.
refs: #2863

Change-Id: I3271c9f96dfc8721a0ca7c900542c6ddb0b321ac
2016-09-12 10:36:32 -07:00
Junxiao Shi 3e5120c543 include ndn-cxx/mgmt/nfd/*
refs #3760

Change-Id: Iaa0e127a2035960fc96a7c6f958538d3bc3cdee6
2016-09-10 16:58:34 +00:00
Vince Lehman ef21d8eab0 src: Sort NextHops on NexthopList insertion
refs: #2721

Change-Id: I39893c5fb6b5fac93220901ab3190090f0d2cc57
2016-09-06 19:41:31 -05:00
Nick G 97e3494256 docs: improve Doxygen comments.
refs: #1435

Change-Id: I21624ef4eec393c82a50229a07e8277fb6ae4ddf
2016-09-02 12:11:42 -07:00
Nick G d69f9a3c82 Copied ndn-cxx's .jenkins script for better compatibility.
refs: #3695

Change-Id: I909fd9b486e16939a58f07d42e356885d809ef9a
2016-08-24 13:25:39 -05:00
Junxiao Shi 63bd0348b3 adapt to Controller::CommandFailCallback with ControlResponse
refs #3739

Change-Id: I193fb11fd96bd91808fc6e3af22a8da2511246e2
2016-08-17 16:57:14 +00:00
Muktadir R Chowdhury b9d43d06cc docs: Mention change in configuration file in release note.
Change-Id: I70dda0a904e03bdd93b3f2f4404f70ecd108b65d
2016-08-15 09:50:39 -07:00
Nick Gordon e2d3fe9d9a Brought script into POSIX-compliance for find.
refs: #3695

Change-Id: Id35218b560f55a19fec81409950fed5a4f8504d5
2016-08-12 14:00:52 -07:00
Nick Gordon 7b5872ec86 face-map.hpp: Fixed class formatting per style rule 1.4
refs: #3737

Change-Id: Iee14f98a967a3887c34700c3c2a004dcb8b6d97d
2016-08-12 13:57:01 -07:00
Nick Gordon fad8e257c0 Fixed namespace formatting across all files.
refs: #3735

Change-Id: Ia04f0895de9906e280d6140f775bb6609db714e6
2016-08-12 13:49:12 -07:00
Nick Gordon f8b5bcd27e Fixed copyright dates across all files.
refs: #3736

Change-Id: Ibe089fd2e8c4ddc8a4c68d073b435f7d3060d1a4
2016-08-11 15:14:18 -05:00
Muktadir R Chowdhury 800833b7ac docs+build+boilerplate: Prepare release of version 0.3.0
Change-Id: I60f359e73b049d844470670a0088a00522f7564e
2016-08-01 13:33:53 -05:00
Nick Gordon e8e03ac303 communication+route: Do not advertise Adjacency LSAs when hyperbolic routing is enabled
refs: #2402

Change-Id: If204807733f858606e31a0ff8231f140905063cf
2016-07-29 12:43:46 -07:00
Alexander Afanasyev 5ec9ae4271 ci: Update Travis CI script to build using Ubuntu 14.04 and OS X 10.9
Change-Id: Ib73bf5a5727c1d9b58a0f2a2fde66249cbc19e3d
2016-07-29 10:32:57 -07:00
Vince Lehman f7eec4f4c0 Make LSA buildable when one node is ACTIVE
refs: #2802

Change-Id: If3f99895522e22103130f32bb6634bf9a5691fe7
2016-07-28 12:41:43 -07:00
Nick Gordon 5c467f0ca8 Do not distribute coordinate LSAs when using link-state routing.
refs: #3661

Change-Id: I6a1467225def5ba04e2179480503cfe01968cede
2016-07-28 12:28:41 -05:00
Muktadir R Chowdhury aa3b085384 lsdb: Segment LSAs larger than max segment size
refs: #2965

Change-Id: I5dd091b663db2cc5e2d925144e57ee55a486b3cd
2016-07-26 12:27:55 -05:00
Ashlesh Gawande d02c3880d5 lsa: Accept LSA type argument in LSA base constructor
refs: #2788

Change-Id: I12d9b26fb9087b037134988f1594576ed7ba90f3
2016-07-25 18:28:39 -05:00
Muktadir R Chowdhury 3ac0728e5a publisher: set router-name command prefix correctly
refs: #3651

Change-Id: Ic3771de5161fc482f76df78035dcb9f5325e1a9d
2016-07-21 10:24:15 -05:00
Junxiao Shi c778e814db tests: don't use DummyClientFace::sentDatas
refs #3383

Change-Id: I7cbe7d147de0b0066ee0ab4c25f2ec707a081f79
2016-07-14 15:44:26 +00:00
Vince Lehman af909fcc13 build: Don't install unit tests; use brew version of openssl on OS X Jenkins
refs: #3359

Change-Id: I0b51ede8be0abafe4cbbe39274b291d3c8549872
2016-01-14 10:33:22 -06:00
Muktadir R Chowdhury c69da0a350 tests: Use ndn-cxx/DummyClientFace
refs: #2637

Change-Id: Ife16a81d08e538b4b0a82f1f5d4cc819fc764257
2016-01-11 12:05:24 -06:00
Vince Lehman 0ff5d45ba8 docs: Prepare version 0.2.2 release notes
Change-Id: I72a1847e7c20d9bac3d85b2263b974ddbcee3431
2016-01-04 17:23:06 -06:00
Ashlesh Gawande 5d9c0573c0 security: Remove unused disabled files
Change-Id: Ifbbe284f5e3586e6256ffa30902926c2d751743e
refs: #2960
2015-12-21 15:45:50 -06:00
Muktadir R Chowdhury 4c7caadb72 nlsrc: adapt to ndn-cxx SegmentFetcher API change
Refs: #2734
Change-Id: I76f1f1a6b95d2df18a8deef545be5027ad6bbc7c
2015-12-04 13:25:43 -08:00
Alexander Afanasyev f9f3910dd2 build+nsync+tests+docs: Fix compilation for boost 1.59, doxygen docs, and other fixes
Requires ndn-cxx:commit:e3e2505aa03e0b298e1a8dfc9876f1f8dafcaaba (ndn-cxx-0.4.0-beta2-11-ge3e2505)
or earlier commit.

Change-Id: I6ad359aa368b3346464f2aa74a1ab319fcd3ab7a
2015-12-04 13:25:28 -08:00
Vince Lehman 53c0e3e9ee Use MulticastStrategy instead of deprecated BroadcastStrategy
refs: #3011

Change-Id: I7c32cf13945853fe76008271a77878d2bf6e9215
2015-09-14 14:36:49 -05:00
Vince Lehman c57c64b633 Refactor initialization of NLSR instance
refs: #3091

Change-Id: I07108015dc0704e85f5c37b91b53838d7b0f41d0
2015-08-11 11:55:29 -05:00
Joao Pereira 97473d47fd nlsr: avoid deprecated prefix registration APIs
refs #2932

Change-Id: Id874d40d3b6209bedc6f92a44b5c49eb9ed31efe
2015-07-06 15:38:23 -04:00
Vince Lehman 5363c7946b docs: Prepare version 0.2.1 release notes
Change-Id: Ibde6faea916ca90f3c11b7d1189c7044ca9bc5ec
2015-06-30 06:51:31 -07:00
Vince Lehman f4772d4f21 Fix compilation after namespace change in ndn-cxx
refs: #2951

Change-Id: Ia9f3caee4733e7f137b5f6f22f7e154069b37f69
2015-06-29 15:06:29 -05:00
alvy 46ccaae829 tests: Remove FaceDestroyEvent test's reliance on nlsrSeqNo.txt
refs: #2881

Change-Id: I32d329d058e9715ca5cdca74867b6588775e93ff
2015-06-26 11:28:20 -05:00
alvy c69c9af931 tests: Check ACTIVE/INACTIVE Adjacencies in LSA construction
refs #2735

Change-Id: I5d0c4940c0bc688a895a71603c9ea93b87cfba42
2015-06-26 10:49:01 -05:00
Vince Lehman d33e5bc475 update: Disable PrefixUpdateProcessor when validator is not in config
refs: 2814

Change-Id: I2669dcd4af36ebe09f3e20189a99c812e0e6ad7b
2015-06-24 11:33:57 -07:00
alvy dce3f18229 src: Fix non-incrementing Adjacency number in AdjLsa::writeLog
refs #2594

Change-Id: I64ae57060ffb95c92e86da356eb6ba80f1d77f06
2015-06-24 10:54:43 -05:00
Vince Lehman cae33b69f2 route: Prevent incomplete removal of NPT entry
refs: #2785

Change-Id: Ic8ff955236784db76c55b94bf9300fb21ea9beae
2015-06-08 11:59:47 -05:00
Vince Lehman 18df0602d3 docs: Change toctree order
Change-Id: I121f41b54afc10225f90ebb0a98ad4e444058bfe
2015-05-13 14:32:29 -07:00
Vince Lehman 41b173ed54 route: Correct bidirectional links with differing costs
refs: #2801

Change-Id: Iacabcb5484f4ccab6c74700dd8ebcf7b1ad99917
2015-05-11 10:11:22 -05:00
Vince Lehman 9630fbf4e0 route: Fix component appending in NamePrefixTable::removeEntry
refs: #2322

Change-Id: I511414be322dccc713d3eaef737edd87a51e8b51
2015-05-09 11:13:42 -07:00
Alexander Afanasyev a6f3e645f5 build: Update waf to version 1.8.9 (with custom patches)
https://github.com/cawka/waf/tree/2a098b1e9bc626c19cbd47c1f670758c17edf54c

Change-Id: Ibacc49368d81e1d2b9059b8153a86bcfc026a295
Refs: #2792
2015-05-06 14:52:35 -07:00
303 changed files with 18527 additions and 21945 deletions

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
name: CI
on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
- '.mailmap'
workflow_dispatch:
permissions: {}
jobs:
Ubuntu:
uses: named-data/actions/.github/workflows/jenkins-script-ubuntu.yml@v1
macOS:
uses: named-data/actions/.github/workflows/jenkins-script-macos.yml@v1
+21
View File
@@ -0,0 +1,21 @@
name: Docs
on:
push:
workflow_dispatch:
inputs:
skip-deploy:
description: 'Skip deployment?'
required: true
type: boolean
permissions: {}
jobs:
html:
uses: named-data/actions/.github/workflows/docs-html.yml@v1
with:
# Deploy only the master branch and release tags
deploy: ${{ !inputs.skip-deploy && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/NLSR-')) }}
secrets: inherit
man:
uses: named-data/actions/.github/workflows/docs-man.yml@v1
+32 -7
View File
@@ -1,7 +1,32 @@
.DS*
.waf-1*
.waf3-*
.lock*
**/*.pyc
build/
VERSION
# Emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
.\#*
# Visual Studio Code
.vscode/
# KDevelop
*.kdev*
# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
# Waf build system
/build/
.waf-*-*/
.waf3-*-*/
.lock-waf*
# Compiled python code
__pycache__/
*.py[cod]
# Other
/VERSION.info
+48 -5
View File
@@ -1,9 +1,52 @@
#!/usr/bin/env bash
set -e
set -eo pipefail
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
case $(uname) in
Linux)
if [[ -e /etc/os-release ]]; then
source /etc/os-release
else
source /usr/lib/os-release
fi
export ID VERSION_ID
export ID_LIKE="${ID} ${ID_LIKE} linux"
export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
;;
Darwin)
# Emulate a subset of os-release(5)
export ID=macos
export VERSION_ID=$(sw_vers -productVersion)
export PATH="/usr/local/bin${PATH:+:}${PATH}"
if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /usr/local/bin/brew ]]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
;;
esac
for i in $( find "$DIR/.jenkins.d" -type f -perm +111 | sort ); do
echo "Run: $i"
"$i"
export CACHE_DIR=${CACHE_DIR:-/tmp}
if [[ $JOB_NAME == *"code-coverage" ]]; then
export DISABLE_ASAN=yes
export DISABLE_HEADERS_CHECK=yes
fi
# https://reproducible-builds.org/docs/source-date-epoch/
export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)
for file in .jenkins.d/*; do
[[ -f $file && -x $file ]] || continue
if [[ -n $GITHUB_ACTIONS ]]; then
label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
echo "::group::${label}"
fi
echo "\$ $file"
"$file"
if [[ -n $GITHUB_ACTIONS ]]; then
echo "::endgroup::"
fi
done
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -eo pipefail
APT_PKGS=(build-essential pkg-config python3-minimal
libboost-all-dev libssl-dev libsqlite3-dev)
FORMULAE=(boost openssl pkg-config)
PIP_PKGS=()
case $JOB_NAME in
*code-coverage)
APT_PKGS+=(lcov python3-pip)
PIP_PKGS+=('gcovr~=5.2')
;;
*Docs)
APT_PKGS+=(doxygen graphviz python3-pip)
FORMULAE+=(doxygen graphviz)
PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
;;
esac
set -x
if [[ $ID == macos ]]; then
if [[ -n $GITHUB_ACTIONS ]]; then
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
fi
brew update
brew install --formula "${FORMULAE[@]}"
elif [[ $ID_LIKE == *debian* ]]; then
sudo apt-get -qq update
sudo apt-get -qy install "${APT_PKGS[@]}"
elif [[ $ID_LIKE == *fedora* ]]; then
sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
boost-devel openssl-devel sqlite-devel
fi
if (( ${#PIP_PKGS[@]} )); then
pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
fi
-27
View File
@@ -1,27 +0,0 @@
#!/usr/bin/env bash
set -e
JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source "$JDIR"/util.sh
if has OSX $NODE_LABELS && ! has OSX-10.8-c++11-64bit $NODE_LABELS; then
# OSX 10.8 requires special handling of dependencies
set -x
brew update
brew upgrade
brew install boost pkg-config sqlite cryptopp log4cxx protobuf openssl
brew cleanup
fi
if has Ubuntu $NODE_LABELS; then
BOOST_PKG=libboost-all-dev
if has Ubuntu-12.04 $NODE_LABELS; then
BOOST_PKG=libboost1.48-all-dev
fi
set -x
sudo apt-get update -qq -y
sudo apt-get -qq -y install build-essential pkg-config $BOOST_PKG \
libcrypto++-dev libsqlite3-dev \
liblog4cxx10-dev protobuf-compiler libprotobuf-dev libssl-dev
fi
+50
View File
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -exo pipefail
pushd "$CACHE_DIR" >/dev/null
INSTALLED_VERSION=
if [[ $ID == macos ]]; then
BOOST=$(brew list --formula --versions boost)
OLD_BOOST=$(cat boost.txt || :)
if [[ $OLD_BOOST != $BOOST ]]; then
echo "$BOOST" > boost.txt
INSTALLED_VERSION=NONE
fi
fi
if [[ -z $INSTALLED_VERSION ]]; then
INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
fi
sudo rm -rf ndn-cxx-latest
git clone --depth 1 https://github.com/named-data/ndn-cxx.git ndn-cxx-latest
LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
sudo rm -rf ndn-cxx
mv ndn-cxx-latest ndn-cxx
else
sudo rm -rf ndn-cxx-latest
fi
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
pushd ndn-cxx >/dev/null
./waf --color=yes configure --without-osx-keychain
./waf --color=yes build
sudo ./waf --color=yes install
popd >/dev/null
popd >/dev/null
if [[ $ID_LIKE == *fedora* ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
if [[ $ID_LIKE == *linux* ]]; then
sudo ldconfig
fi
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
set -exo pipefail
PROJ=ChronoSync
pushd "$CACHE_DIR" >/dev/null
INSTALLED_VERSION=
NDN_CXX=$(ndnsec version)
OLD_NDN_CXX=$(cat "$PROJ-ndn-cxx.txt" || :)
if [[ $OLD_NDN_CXX != $NDN_CXX ]]; then
echo "$NDN_CXX" > "$PROJ-ndn-cxx.txt"
INSTALLED_VERSION=NONE
fi
if [[ -z $INSTALLED_VERSION ]]; then
INSTALLED_VERSION=$(git -C "$PROJ" rev-parse HEAD 2>/dev/null || echo NONE)
fi
sudo rm -rf "$PROJ-latest"
git clone --depth 1 "https://github.com/named-data/$PROJ.git" "$PROJ-latest"
LATEST_VERSION=$(git -C "$PROJ-latest" rev-parse HEAD 2>/dev/null || echo UNKNOWN)
if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
sudo rm -rf "$PROJ"
mv "$PROJ-latest" "$PROJ"
else
sudo rm -rf "$PROJ-latest"
fi
sudo rm -fr /usr/local/include/"$PROJ"
sudo rm -f /usr/local/lib{,64}/lib"$PROJ"*
sudo rm -f /usr/local/lib{,64}/pkgconfig/"$PROJ".pc
pushd "$PROJ" >/dev/null
./waf --color=yes configure
./waf --color=yes build
sudo ./waf --color=yes install
popd >/dev/null
popd >/dev/null
if [[ $ID_LIKE == *fedora* ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
if [[ $ID_LIKE == *linux* ]]; then
sudo ldconfig
fi
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
set -exo pipefail
PROJ=PSync
pushd "$CACHE_DIR" >/dev/null
INSTALLED_VERSION=
NDN_CXX=$(ndnsec version)
OLD_NDN_CXX=$(cat "$PROJ-ndn-cxx.txt" || :)
if [[ $OLD_NDN_CXX != $NDN_CXX ]]; then
echo "$NDN_CXX" > "$PROJ-ndn-cxx.txt"
INSTALLED_VERSION=NONE
fi
if [[ -z $INSTALLED_VERSION ]]; then
INSTALLED_VERSION=$(git -C "$PROJ" rev-parse HEAD 2>/dev/null || echo NONE)
fi
sudo rm -rf "$PROJ-latest"
git clone --depth 1 "https://github.com/named-data/$PROJ.git" "$PROJ-latest"
LATEST_VERSION=$(git -C "$PROJ-latest" rev-parse HEAD 2>/dev/null || echo UNKNOWN)
if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
sudo rm -rf "$PROJ"
mv "$PROJ-latest" "$PROJ"
else
sudo rm -rf "$PROJ-latest"
fi
sudo rm -fr /usr/local/include/"$PROJ"
sudo rm -f /usr/local/lib{,64}/lib"$PROJ"*
sudo rm -f /usr/local/lib{,64}/pkgconfig/"$PROJ".pc
pushd "$PROJ" >/dev/null
./waf --color=yes configure
./waf --color=yes build
sudo ./waf --color=yes install
popd >/dev/null
popd >/dev/null
if [[ $ID_LIKE == *fedora* ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
if [[ $ID_LIKE == *linux* ]]; then
sudo ldconfig
fi
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
set -exo pipefail
PROJ=ndn-svs
pushd "$CACHE_DIR" >/dev/null
INSTALLED_VERSION=
NDN_CXX=$(ndnsec version)
OLD_NDN_CXX=$(cat "$PROJ-ndn-cxx.txt" || :)
if [[ $OLD_NDN_CXX != $NDN_CXX ]]; then
echo "$NDN_CXX" > "$PROJ-ndn-cxx.txt"
INSTALLED_VERSION=NONE
fi
if [[ -z $INSTALLED_VERSION ]]; then
INSTALLED_VERSION=$(git -C "$PROJ" rev-parse HEAD 2>/dev/null || echo NONE)
fi
sudo rm -rf "$PROJ-latest"
git clone --depth 1 "https://github.com/named-data/$PROJ.git" "$PROJ-latest"
LATEST_VERSION=$(git -C "$PROJ-latest" rev-parse HEAD 2>/dev/null || echo UNKNOWN)
if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
sudo rm -rf "$PROJ"
mv "$PROJ-latest" "$PROJ"
else
sudo rm -rf "$PROJ-latest"
fi
sudo rm -fr /usr/local/include/"$PROJ"
sudo rm -f /usr/local/lib{,64}/lib"$PROJ"*
sudo rm -f /usr/local/lib{,64}/pkgconfig/"$PROJ".pc
pushd "$PROJ" >/dev/null
./waf --color=yes configure
./waf --color=yes build
sudo ./waf --color=yes install
popd >/dev/null
popd >/dev/null
if [[ $ID_LIKE == *fedora* ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
if [[ $ID_LIKE == *linux* ]]; then
sudo ldconfig
fi
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -eo pipefail
if [[ -z $DISABLE_ASAN ]]; then
ASAN="--with-sanitizer=address"
fi
if [[ $JOB_NAME == *"code-coverage" ]]; then
COVERAGE="--with-coverage"
fi
set -x
if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
# Build in release mode with tests
./waf --color=yes configure --with-tests
./waf --color=yes build
# Cleanup
./waf --color=yes distclean
# Build in release mode without tests
./waf --color=yes configure
./waf --color=yes build
# Cleanup
./waf --color=yes distclean
fi
# Build in debug mode with tests
./waf --color=yes configure --debug --with-chronosync --with-psync --with-svs --with-tests $ASAN $COVERAGE
./waf --color=yes build
# (tests will be run against the debug version)
# Install
sudo ./waf --color=yes install
-31
View File
@@ -1,31 +0,0 @@
#!/usr/bin/env bash
set -x
set -e
pushd /tmp >/dev/null
INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
sudo rm -Rf ndn-cxx-latest
git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
sudo rm -Rf ndn-cxx
mv ndn-cxx-latest ndn-cxx
else
sudo rm -Rf ndn-cxx-latest
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*
pushd ndn-cxx >/dev/null
./waf configure -j1 --color=yes --without-osx-keychain
./waf -j1 --color=yes
sudo ./waf install -j1 --color=yes
popd >/dev/null
popd >/dev/null
-37
View File
@@ -1,37 +0,0 @@
#!/usr/bin/env bash
set -x
set -e
git submodule init
git submodule sync
git submodule update
COVERAGE=$( python -c "print '--with-coverage' if 'code-coverage' in '$JOB_NAME' else ''" )
# Cleanup
sudo ./waf -j1 --color=yes distclean
# Configure/build in debug mode
./waf -j1 --color=yes configure --with-tests --debug
./waf -j1 --color=yes build
# Cleanup
sudo ./waf -j1 --color=yes distclean
# Configure/build in optimized mode without tests
./waf -j1 --color=yes configure
./waf -j1 --color=yes build
# Cleanup
sudo ./waf -j1 --color=yes distclean
# Configure/build in optimized mode with tests
./waf -j1 --color=yes configure --with-tests $COVERAGE
./waf -j1 --color=yes build
# (tests will be run against optimized version)
./waf configure --color=yes --with-tests $COVERAGE
./waf -j1 --color=yes
sudo ./waf install --color=yes
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -eo pipefail
# 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+=":detect_container_overflow=0"
ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
export ASAN_OPTIONS
# https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/runtime_config/summary.html
export BOOST_TEST_BUILD_INFO=1
export BOOST_TEST_COLOR_OUTPUT=1
export BOOST_TEST_DETECT_MEMORY_LEAK=0
export BOOST_TEST_LOGGER=HRF,test_suite,stdout:XML,all,build/xunit-log.xml
set -x
# Prepare environment
rm -rf ~/.ndn
# Run unit tests
./build/unit-tests-nlsr
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -exo pipefail
if [[ $JOB_NAME == *"code-coverage" ]]; then
# Generate an XML report (Cobertura format) and a detailed HTML report using gcovr
# Note: trailing slashes are important in the paths below. Do not remove them!
gcovr --object-directory build \
--filter src/ \
--exclude-throw-branches \
--exclude-unreachable-branches \
--cobertura build/coverage.xml \
--html-details build/gcovr/ \
--print-summary
# Generate a detailed HTML report using lcov
lcov --quiet \
--capture \
--directory . \
--exclude "$PWD/tests/*" \
--no-external \
--rc lcov_branch_coverage=1 \
--output-file build/coverage.info
genhtml --branch-coverage \
--demangle-cpp \
--legend \
--output-directory build/lcov \
--title "NLSR unit tests" \
build/coverage.info
fi
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -x
set -e
rm -Rf ~/.ndn
./build/unit-tests-nlsr -l test_suite
+36
View File
@@ -0,0 +1,36 @@
# Continuous Integration Scripts
## Environment Variables
- `ID`: lower-case string that identifies the operating system, for example: `ID=ubuntu`,
`ID=centos`. See [os-release(5)] for more information. On macOS, where `os-release` is
not available, we emulate it by setting `ID=macos`.
- `ID_LIKE`: space-separated list of operating system identifiers that are closely related
to the running OS. See [os-release(5)] for more information. The listed values are used
by the CI scripts to select the proper behavior for different platforms and OS flavors.
Examples:
- On CentOS, `ID_LIKE="centos rhel fedora linux"`
- On Ubuntu, `ID_LIKE="ubuntu debian linux"`
- `VERSION_ID`: identifies the operating system version, excluding any release code names.
See [os-release(5)] for more information. Examples: `VERSION_ID=42`, `VERSION_ID=22.04`.
- `JOB_NAME`: defines the type of the current CI job. Depending on the job type, the CI
scripts can perform different tasks.
Supported values:
- empty: default build task
- `code-coverage`: debug build with tests and code coverage analysis
- `limited-build`: only a single debug build with tests
- `CACHE_DIR`: directory containing cached files from previous builds, e.g., a compiled
version of ndn-cxx. If not set, `/tmp` is used.
- `DISABLE_ASAN`: disable building with AddressSanitizer. This is automatically set for
the `code-coverage` job type.
[os-release(5)]: https://www.freedesktop.org/software/systemd/man/os-release.html
-9
View File
@@ -1,9 +0,0 @@
has() {
local p=$1
shift
local x
for x in "$@"; do
[[ "${x}" == "${p}" ]] && return 0
done
return 1
}
+16
View File
@@ -0,0 +1,16 @@
A K M Mahmudul Hoque <akmhoque@gmail.com>
<agawande@memphis.edu> <ashu2493@gmail.com>
Nick Gordon <nmgordon@memphis.edu>
Laqin Fan <lfan1@memphis.edu>
Syed Obaid Amin <soamin@memphis.edu>
Syed Obaid Amin <soamin@memphis.edu> <obaidasyed@gmail.com>
Syed Obaid Amin <soamin@memphis.edu> <obaid@Obaids-MacBook.local>
Syed Obaid Amin <soamin@memphis.edu> <obaid@obaids-macbook.memphis.edu>
Syed Obaid Amin <soamin@memphis.edu> <soamin@mira.cs.memphis.edu>
Syed Obaid Amin <soamin@memphis.edu> <soamin@wd222yx4.memphis.edu>
Muktadir R Chowdhury <mrchwdhr@memphis.edu>
Muktadir R Chowdhury <mrchwdhr@memphis.edu> <muktadir.rahman.c@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>
Md Ashiqur Rahman <marahman@email.arizona.edu>
-15
View File
@@ -1,15 +0,0 @@
sudo: true
language: cpp
os:
- linux
compiler:
- gcc
notifications:
email:
on_success: always
on_failure: always
env:
global:
- NODE_LABELS="Linux Ubuntu Ubuntu-12.04 Ubuntu-12.04-64bit Boost1.48"
script:
- ./.jenkins
+252 -97
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,24 +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/homebrew/lib', '/opt/local/lib', '/sw/lib', '/lib']
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/homebrew/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']
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include', '/usr/local/ndn/include']
BOOST_VERSION_FILE = 'boost/version.hpp'
BOOST_VERSION_CODE = '''
#include <iostream>
#include <boost/version.hpp>
int main() { std::cout << BOOST_LIB_VERSION << ":" << BOOST_VERSION << std::endl; }
'''
BOOST_SYSTEM_CODE = '''
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'
@@ -101,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)
@@ -141,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)
m1 = re_but1.search(txt)
re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+(\\d+)', re.M)
m2 = re_but2.search(txt)
if m1 and m2:
return (m1.group(1), m2.group(1))
return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True).split(":")
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')
@@ -195,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_*')
@@ -208,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)
@@ -226,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:
@@ -248,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):
@@ -282,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
@@ -291,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']
@@ -352,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
+4 -6
View File
@@ -1,17 +1,15 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014, Regents of the University of California
#
# GPL 3.0 license, see the COPYING.md file for more information
from waflib import TaskGen
def options(opt):
opt.add_option('--with-coverage', action='store_true', default=False, dest='with_coverage',
help='''Set compiler flags for gcc to enable code coverage information''')
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)
+213 -46
View File
@@ -1,73 +1,240 @@
# -*- 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 optimizations (-O0 or -Og)''')
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 = ['-std=c++0x', '-std=c++11',
'-stdlib=libc++', # clang on OSX < 10.9 by default uses a non
# C++11-compatible STL library
'-Wall', '-Wno-long-long']
conf.start_msg('Checking C++ compiler version')
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
'-Wno-error=unneeded-internal-declaration', # Bug #1588
'-Wno-nested-anon-types',
]
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)
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 < (7, 4, 0):
errmsg = ('The version of gcc you are using is too old.\n'
'The minimum supported gcc version is 9.3.')
elif ccver < (9, 3, 0):
warnmsg = ('Using a version of gcc older than 9.3 is not '
'officially supported and may result in build failures.')
conf.flags = GccFlags()
elif cxx == 'clang':
if Utils.unversioned_sys_platform() == 'darwin':
if ccver < (10, 0, 0):
errmsg = ('The version of Xcode you are using is too old.\n'
'The minimum supported Xcode version is 12.4.')
elif ccver < (12, 0, 0):
warnmsg = ('Using a version of Xcode older than 12.4 is not '
'officially supported and may result in build failures.')
elif ccver < (7, 0, 0):
errmsg = ('The version of clang you are using is too old.\n'
'The minimum supported clang version is 7.0.')
conf.flags = ClangFlags()
else:
defaultFlags += ['-O2', '-g']
if not areCustomCxxflagsPresent:
conf.add_supported_cxxflags(defaultFlags)
warnmsg = f'{cxx} compiler is unsupported'
conf.flags = CompilerFlags()
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:
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:
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']
# clang on OSX < 10.9 by default uses a non C++11-compatible STL library
conf.add_supported_linkflags(['-stdlib=libc++'])
@Configure.conf
def add_supported_cxxflags(self, cxxflags):
"""
Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
Check which cxxflags are supported by the active compiler and add them to env.CXXFLAGS variable.
"""
self.start_msg('Checking allowed compile-stage 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
Check which linkflags are supported by the active compiler and add them to env.LINKFLAGS variable.
"""
self.start_msg('Checking allowed link-stage flags for c++ compiler')
if len(linkflags) == 0:
return
self.start_msg('Checking supported LINKFLAGS')
supportedFlags = []
for flag in linkflags:
if self.check_cxx(linkflags=['-Werror', flag], mandatory=False):
supportedFlags += [flag]
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.LINKFLAGS = supportedFlags + self.env.LINKFLAGS
self.env.prepend_value('LINKFLAGS', supportedFlags)
class CompilerFlags:
def getCompilerVersion(self, conf):
return tuple(int(i) for i in conf.env.CC_VERSION)
def getGeneralFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
return {
'CXXFLAGS': [],
'LINKFLAGS': [],
'DEFINES': ['BOOST_ASIO_NO_DEPRECATED', 'BOOST_FILESYSTEM_NO_DEPRECATED'],
}
def getDebugFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
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 GccClangCommonFlags(CompilerFlags):
"""
This class defines common flags that work for both gcc and clang compilers.
"""
def getGeneralFlags(self, conf):
flags = super().getGeneralFlags(conf)
flags['CXXFLAGS'] += ['-std=c++17']
if Utils.unversioned_sys_platform() != 'darwin':
flags['LINKFLAGS'] += ['-fuse-ld=lld']
return flags
__cxxFlags = [
'-fdiagnostics-color',
'-Wall',
'-Wextra',
'-Wpedantic',
'-Wenum-conversion',
'-Wextra-semi',
'-Wno-unused-parameter',
]
__linkFlags = ['-Wl,-O1']
def getDebugFlags(self, conf):
flags = super().getDebugFlags(conf)
flags['CXXFLAGS'] += ['-Og', '-g'] + self.__cxxFlags + [
'-Werror',
'-Wno-error=deprecated-declarations', # Bug #3795
'-Wno-error=maybe-uninitialized', # Bug #1615
]
flags['LINKFLAGS'] += self.__linkFlags
return flags
def getOptimizedFlags(self, conf):
flags = super().getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-O2', '-g1'] + self.__cxxFlags
flags['LINKFLAGS'] += self.__linkFlags
return flags
class GccFlags(GccClangCommonFlags):
__cxxFlags = [
'-Wcatch-value=2',
'-Wcomma-subscript', # enabled by default in C++20
'-Wduplicated-branches',
'-Wduplicated-cond',
'-Wlogical-op',
'-Wredundant-tags',
'-Wvolatile', # enabled by default in C++20
]
def getDebugFlags(self, conf):
flags = super().getDebugFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
if platform.machine() == 'armv7l':
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
return flags
def getOptimizedFlags(self, conf):
flags = super().getOptimizedFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
if platform.machine() == 'armv7l':
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
return flags
class ClangFlags(GccClangCommonFlags):
def getGeneralFlags(self, conf):
flags = super().getGeneralFlags(conf)
if Utils.unversioned_sys_platform() == 'darwin':
# Bug #4296
brewdir = '/opt/homebrew' if platform.machine() == 'arm64' else '/usr/local'
flags['CXXFLAGS'] += [
['-isystem', f'{brewdir}/include'], # for Homebrew
['-isystem', '/opt/local/include'], # for MacPorts
]
elif Utils.unversioned_sys_platform() == 'freebsd':
# Bug #4790
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
return flags
__cxxFlags = [
'-Wundefined-func-template',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
def getDebugFlags(self, conf):
flags = super().getDebugFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
return flags
def getOptimizedFlags(self, conf):
flags = super().getOptimizedFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
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', [])
-47
View File
@@ -1,47 +0,0 @@
#! /usr/bin/env python
# encoding: utf-8
'''
When using this tool, the wscript will look like:
def options(opt):
opt.tool_options('openssl')
def configure(conf):
conf.load('compiler_cxx openssl')
conf.check_openssl()
def build(bld):
bld(source='main.cpp', target='app', use='OPENSSL')
'''
from waflib import Options
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,
global_define=True,
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)
def options(opt):
opt.add_option('--with-openssl', type='string', default=None,
dest='with_openssl', help='''Path to OpenSSL''')
-47
View File
@@ -1,47 +0,0 @@
#!/usr/bin/env python
# encoding: utf-8
# Philipp Bender, 2012
# Matt Clarkson, 2012
from waflib.Task import Task
from waflib.TaskGen import extension
"""
A simple tool to integrate protocol buffers into your build system.
def configure(conf):
conf.load('compiler_cxx cxx protoc')
def build(bld):
bld(
features = 'cxx cxxprogram'
source = 'main.cpp file1.proto proto/file2.proto',
include = '. proto',
target = 'executable')
"""
class protoc(Task):
run_str = '${PROTOC} ${PROTOC_FLAGS} ${PROTOC_ST:INCPATHS} ${SRC[0].abspath()}'
color = 'BLUE'
ext_out = ['.h', 'pb.cc']
@extension('.proto')
def process_protoc(self, node):
cpp_node = node.change_ext('.pb.cc')
hpp_node = node.change_ext('.pb.h')
self.create_task('protoc', node, [cpp_node, hpp_node])
self.source.append(cpp_node)
if 'cxx' in self.features and not self.env.PROTOC_FLAGS:
self.env.PROTOC_FLAGS = '--cpp_out=%s' % node.parent.get_bld().abspath()
use = getattr(self, 'use', '')
if not 'PROTOBUF' in use:
self.use = self.to_list(use) + ['PROTOBUF']
def configure(conf):
conf.check_cfg(package="protobuf", uselib_store="PROTOBUF", args=['--cflags', '--libs'])
conf.find_program('protoc', var='PROTOC')
conf.env.PROTOC_ST = '-I%s'
+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)
+34 -40
View File
@@ -1,44 +1,38 @@
NLSR Authors
===========
# NLSR Authors
NLSR is an open source project includes contributions from the members of the
[NDN project team](http://named-data.net/project/participants/).
The following lists maintainers, primary developers, and all much-appreciated contributors to NLSR in alphabetical order.
The specific contributions of individual authors can be obtained from the git history of the [official NLSR repository](https://github.com/named-data/NLSR).
If you would like to become a contributor to the official repository, please follow the recommendations in <https://github.com/named-data/.github/blob/main/CONTRIBUTING.md>.
## Project lead:
* Alexander Afanasyev <https://users.cs.fiu.edu/~afanasyev>
* Adam Alyyan <https://github.com/a64adam>
* Syed Obaid Amin <http://obaidamin.weebly.com/>
* Pedro David Arjona Villicaña <https://github.com/david-arjona>
* Muktadir R. Chowdhury <https://github.com/alvyC>
* Damian Coomes <https://github.com/dmcoomes>
* ***(Maintainer)*** Saurab Dulal <https://dulalsaurab.github.io>
* Laqin Fan <https://github.com/laqinfan>
* Simon Fayer <https://github.com/sfayer>
* ***(Former Maintainer)*** Ashlesh Gawande <https://www.linkedin.com/in/agawande>
* ***(Former Maintainer)*** Nicholas Gordon <https://github.com/gorgonical>
* ***(Former Maintainer)*** A. K. M. Mahmudul Hoque <https://sites.google.com/site/akmhoque/home>
* ***(Former Maintainer)*** Vince Lehman <http://vslehman.com>
* Tianxing Ma <https://github.com/matianxing1992>
* Spyridon Mastorakis <https://sites.google.com/site/spyridonmastorakis>
* Eric Newberry <https://ericnewberry.com>
* João Pereira <http://website.jpereira.co.uk>
* Davide Pesavento <https://github.com/Pesa>
* Md Ashiqur Rahman <https://ashiqrahman.com>
* Junxiao Shi <https://cs.arizona.edu/~shijunxiao>
* Salvatore Signorello <https://wwwen.uni.lu/snt/people/salvatore_signorello>
* Jiewen Tan <https://www.linkedin.com/in/jiewentan>
* Alejandro Gil Torres <https://github.com/gltorres>
* Ryan Wickman <http://rwickman.github.io>
* Yingdi Yu <https://irl.cs.ucla.edu/~yingdi>
* Minsheng Zhang <https://www.linkedin.com/in/minsheng-zhang-032023a1>
* Vince Lehman <http://vslehman.com>
## Technical Advisors
## Past project leads:
* A K M Mahmudul Hoque <https://sites.google.com/site/akmhoque/home>
## Technical advisors:
* Lan Wang <http://www.cs.memphis.edu/~lanwang/>
* Beichuan Zhang <http://www.cs.arizona.edu/~bzhang/>
* Lixia Zhang <http://www.cs.ucla.edu/~lixia/>
## All project authors, contributors and their affiliations:
* The University of Memphis
* A K M Mahmudul Hoque <https://sites.google.com/site/akmhoque/home>
* Ashlesh Gawande <agawande@memphis.edu>
* Minsheng Zhang <mzhang4@memphis.edu>
* Syed Obaid Amin <http://obaidamin.weebly.com/>
* Vince Lehman <http://vslehman.com>
* University of California, Los Angeles
* Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/web/index.html>
* Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
* Spyridon Mastorakis <http://cs.ucla.edu/~mastorakis/>
* Jiewen Tan <alanwake@ucla.edu>
## Queries about NLSR
Any general question related to NLSR should be directed to Vince Lehman
(vslehman@memphis.edu) and security related question should be directed to
Yingdi Yu (yingdi@cs.ucla.edu)
* Lan Wang <http://www.cs.memphis.edu/~lanwang>
* Beichuan Zhang <https://cs.arizona.edu/~bzhang>
* Lixia Zhang <https://web.cs.ucla.edu/~lixia>
+371 -390
View File
File diff suppressed because it is too large. Load diff
+19 -16
View File
@@ -1,15 +1,17 @@
Requirements
------------
# Notes for NLSR developers
Contributions to NLSR must be licensed under GPL 3.0 or compatible license. If you are
choosing GPL 3.0, please use the following license boilerplate in all `.hpp` and `.cpp`
files:
If you are new to the NDN software community, please read our
[Contributor's Guide](https://github.com/named-data/.github/blob/main/CONTRIBUTING.md).
Include the following header in all `.hpp` and `.cpp` files:
## Licensing requirements
Contributions to NLSR must be licensed under the GPL v3 or a compatible license.
If you choose the GPL v3, please use the following license boilerplate in all `.hpp`
and `.cpp` files:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) [Year(s)], [Copyright Holder(s)].
/*
* Copyright (c) [Year(s)], [Copyright Holder(s)].
*
* This file is part of NLSR (Named-data Link State Routing).
* See AUTHORS.md for complete list of NLSR authors and contributors.
@@ -24,14 +26,15 @@ Include the following header in all `.hpp` and `.cpp` files:
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
**/
*/
If you are affiliated with an NSF-supported NDN project institution,
please use the [NDN Team License Boilerplate]
(http://redmine.named-data.net/projects/nlsr/wiki/NDN_Team_License_Boilerplate_(NLSR)).
If you are affiliated with an NSF-supported NDN project institution, please use the [NDN Team License
Boilerplate](https://redmine.named-data.net/projects/nlsr/wiki/NDN_Team_License_Boilerplate_(NLSR)).
Recommendations
---------------
## Recommendations
NSLR code is subject to the code style, defined here:
http://redmine.named-data.net/projects/nfd/wiki/CodeStyle
NLSR code is subject to the code style defined
[here](https://redmine.named-data.net/projects/nfd/wiki/CodeStyle).
NLSR Developer's guide can be found
[here](https://github.com/named-data/NLSR/blob/developers-guide/NLSR-Developers-Guide.pdf).
+36 -28
View File
@@ -1,43 +1,51 @@
NLSR - Named Data Link State Routing Protocol
=============================================
# NLSR: Named Data Link State Routing Protocol
For complete documentation and more extensive information,
please visit the [NLSR homepage](http://named-data.net/doc/NLSR/current/).
[![CI](https://github.com/named-data/NLSR/actions/workflows/ci.yml/badge.svg)](https://github.com/named-data/NLSR/actions/workflows/ci.yml)
[![Docs](https://github.com/named-data/NLSR/actions/workflows/docs.yml/badge.svg)](https://github.com/named-data/NLSR/actions/workflows/docs.yml)
![Language](https://img.shields.io/badge/C%2B%2B-17-blue)
![Latest version](https://img.shields.io/github/v/tag/named-data/NLSR?label=Latest%20version)
> For more extensive documentation, please visit the [NLSR homepage](https://docs.named-data.net/NLSR/current/).
## Overview
NLSR is a routing protocol in NDN that populates NDN's Routing Information Base. NLSR
will continue to evolve alongside the Named Data Networking [protocol](http://named-data.net/doc/ndn-tlv/).
NLSR is a routing protocol for Named Data Networking (NDN) that populates the Routing Information
Base (RIB) of an NDN router, such as [NFD](https://github.com/named-data/NFD). NLSR continues to
evolve alongside the core [NDN protocol](https://docs.named-data.net/NDN-packet-spec/current/).
NLSR is an open and free software package licensed under the GPL 3.0 license and free to all
Internet users and developers. For more information about the licensing details and
limitations, refer to [COPYING.md](https://github.com/named-data/NLSR/blob/master/COPYING.md).
NLSR is developed by the members of the [NSF-sponsored NDN project team](http://named-data.net/project/participants/).
For more details, please refer to [AUTHORS.md](https://github.com/named-data/NLSR/blob/master/AUTHORS.md).
Bug reports and feedback are highly appreciated and can be made through the
[Redmine site](http://redmine.named-data.net/projects/nlsr).
The main design goal of NLSR is to provide a routing protocol to populate NDN's FIB.
The main design goal of NLSR is to provide a routing protocol to populate NDN's RIB.
NLSR calculates the routing table using link-state or hyperbolic routing and produces
multiple faces for each reachable name prefix in a single authoritative domain. NLSR
will continue to evolve over time to include neighbor discovery and to become a full
fledged inter-domain routing protocol for NDN.
NLSR was mainly developed by members of the NSF-sponsored [NDN project team](
https://named-data.net/project/participants/). See [`AUTHORS.md`](AUTHORS.md) for details.
Source releases
---------------
## Source releases
The source code and source-code installation instructions are always available at
the following links:
The source code and installation instructions are available at the following locations:
- [Installation](http://named-data.net/doc/NLSR/current/INSTALL.html)
- [Getting Started with NLSR](http://named-data.net/doc/NLSR/current/GETTING-STARTED.html)
- [GitHub NLSR repository](https://github.com/named-data/NLSR)
- [Installation](https://docs.named-data.net/NLSR/current/INSTALL.html)
- [Getting started with NLSR](https://docs.named-data.net/NLSR/current/GETTING-STARTED.html)
- [NLSR GitHub repository](https://github.com/named-data/NLSR)
Additional information
----------------------
## Reporting bugs
- [NLSR Wiki](http://redmine.named-data.net/projects/nlsr/wiki/)
- Feature requests and bug reports are welcome on our
[NLSR on NDN Redmine](http://redmine.named-data.net/projects/nlsr)
Please submit any bug reports or feature requests to the
[NLSR issue tracker](https://redmine.named-data.net/projects/nlsr/issues).
## Additional resources
- [Contributor's Guide](https://github.com/named-data/.github/blob/main/CONTRIBUTING.md)
- [NLSR Wiki](https://redmine.named-data.net/projects/nlsr/wiki)
- [NLSR Issue Tracker](https://redmine.named-data.net/projects/nlsr/issues)
- [NLSR Mailing List Sign Up](https://listserv.memphis.edu/scripts/wa.exe?GETPW1)
- [NLSR Mailing List](https://listserv.memphis.edu/scripts/wa.exe?SUBED1=NLSR-HELP-L&A=1)
- [NLSR Mailing List Archives](https://listserv.memphis.edu/scripts/wa.exe?A0=NLSR-HELP-L)
- [NLSR Developer's guide](https://github.com/named-data/NLSR/blob/developers-guide/NLSR-Developers-Guide.pdf)
## License
NLSR is free software distributed under the GNU General Public License version 3.
See [`COPYING.md`](COPYING.md) for details.
+44 -3
View File
@@ -7,13 +7,25 @@ Getting Started with NLSR
Getting Source
--------------
- `GitHub NLSR repository <https://github.com/named-data/NLSR>`_
- `GitHub NLSR repository <https://github.com/named-data/NLSR>`__
Installation
------------
:doc:`INSTALL`
Important Notes About Configuration
-----------------------------------
Since v0.4.0, NLSR no longer creates Faces for the neighbors that are
specified in ``nlsr.conf``. Instead, it relies on the pre-existence of
the Faces in NFD. NLSR will obtain this information from NFD, and
configure its neighbors using this information.
For users who were relying on NLSR to automagically configure their networks,
this must now be done with ``nfdc``. See ``man nfdc`` for its documentation
(`online version <https://docs.named-data.net/NFD/current/manpages/nfdc.html>`__).
Configuration
-------------
@@ -39,8 +51,37 @@ You can also run ``nlsr -f`` with the absolute path of the configuration file:
nlsr -f /usr/local/etc/ndn/nlsr.conf
To run NLSR as daemon, use the ``-d`` flag:
Logging
-------
NLSR uses the ndn-cxx logging facility. All levels listed below the selected log-level
value are enabled.
::
nlsr -d
Valid values:
TRACE trace messages (most verbose)
DEBUG debugging messages
INFO informational messages
WARN warning messages
ERROR error messages
FATAL fatal (will be logged unconditionally)
To obtain logs for NLSR, set the ``NDN_LOG`` environment variable with the correct prefix
and log-level settings. For example, running the following command will display all log
messages in NLSR with a DEBUG level or below.
.. code-block:: sh
NDN_LOG='nlsr.*=DEBUG' nlsr
If the user is presented with an error message "User does not have read and write
permission on the directory" it can be circumvented by running the application with sudo:
.. code-block:: sh
sudo env NDN_LOG='nlsr.*=DEBUG' nlsr
See ``man ndn-log`` for more details (`online version
<https://docs.named-data.net/ndn-cxx/current/manpages/ndn-log.html>`__).
+28 -45
View File
@@ -7,72 +7,55 @@ NLSR Installation Instructions
Prerequisites
-------------
- `NFD <http://named-data.net/doc/NFD/current/>`_ and its requirements:
- `NFD <https://github.com/named-data/NFD>`__ and its dependencies.
Refer to `Getting started with NFD <http://named-data.net/doc/NFD/current/INSTALL.html>`_
for detailed installation and running instruction.
Check out the `documentation <https://docs.named-data.net/NFD/current/INSTALL.html>`__
for detailed installation and running instructions.
- log4cxx library
- PSync library [optional but recommended, enabled by default]
On Ubuntu Linux:
Download the PSync library and build it according to the instructions available at
https://github.com/named-data/PSync#build
::
- ChronoSync library [optional, deprecated]
sudo apt-get install liblog4cxx10-dev
For testing purposes, NLSR can be optionally built with ChronoSync support. Download
the ChronoSync library and build it according to the instructions available at
https://github.com/named-data/ChronoSync#build
On OS X with MacPorts:
- SVS library [optional]
::
NLSR can be used with State Vector Sync as the underlying Sync protocol. Download
the ndn-svs library and build it according to the instructions available at
https://github.com/named-data/ndn-svs#installation
sudo port install log4cxx
- protobuf
On Ubuntu Linux:
::
sudo apt-get install libprotobuf-dev protobuf-compiler
On OS X with MacPorts:
::
sudo port install protobuf-cpp
- openssl
On Ubuntu Linux:
::
sudo apt-get install libssl-dev
On OS X with MacPorts:
::
sudo port install openssl
Note that at least one Sync library must be enabled.
Build
-----
Execute the following commands to build NLSR:
::
.. code-block:: sh
./waf configure
./waf
sudo ./waf install
Refer to ``./waf –help`` for more options that can be used during the configure stage and
Refer to ``./waf --help`` for more options that can be used during the configure stage and
how to properly configure NLSR.
If your pkgconfig path is not set properly you can do the following before running ``./waf
configure``
If your pkgconfig path is not set properly, you can do the following before running ``./waf
configure``:
::
.. code-block:: sh
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
or
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# or
export PKG_CONFIG_PATH=/path/to/pkgconfig/on/your/machine
If ChronoSync support is desired, NLSR needs to be configured with the following option:
.. code-block:: sh
./waf configure --with-chronosync
+110 -22
View File
@@ -35,6 +35,9 @@ The number represents the connecting face id. For example,
We will walk through setting up the faces and creating the configuration file for
``/ndn/edu/memphis/%C1.Router/router1``.
It is recommended to configure security as described at :doc:`SECURITY-CONFIG`, before
starting router configuration.
Step 1. Ensuring nfd is running
-------------------------------
@@ -42,11 +45,19 @@ Type the following in the terminal:
::
nfd-status -f
nfd-status
If you see ``ERROR: error while connecting to the forwarder (No such file or directory)``,
If you see ``error while connecting to the forwarder (No such file or directory)``,
``nfd`` is not running. Follow the instructions in `Getting started with NFD
<http://named-data.net/doc/NFD/current/INSTALL.html>`_ to run nfd.
<https://docs.named-data.net/NFD/current/INSTALL.html>`_ to run nfd.
Since v0.4.0, NLSR no longer creates Faces for the neighbors that are
specified in ``nlsr.conf``. Instead, it relies on the pre-existence of
the Faces in NFD. NLSR will obtain this information from NFD, and
configure its neighbors using this information.
To create faces it is now necessary to use the ``nfdc`` command. See ``man nfdc`` for
its documentation (`online version <https://docs.named-data.net/NFD/current/manpages/nfdc.html>`__).
Step 2. Determining FaceUri
---------------------------
@@ -83,10 +94,7 @@ configuration commands follows:
; InterestLifetime (in seconds) for LSA fetching
lsa-interest-lifetime 4 ; default value 4. Valid values 1-60
; log-level is to set the levels of log for NLSR
log-level INFO ; default value INFO, valid value DEBUG, INFO
log-dir /var/log/nlsr/
seq-dir /var/lib/nlsr/
state-dir /var/lib/nlsr/ ; state directory to store all dynamic changes to NLSR
}
; the neighbors section contains the configuration for router's neighbors and hello's behavior
@@ -104,13 +112,25 @@ configuration commands follows:
hello-interval 60 ; interest sending interval in seconds. Default value 60
; valid values 30-90
; adj-lsa-build-interval is the time to wait in seconds after an Adjacency LSA
; build is scheduled before actually building the Adjacency LSA
adj-lsa-build-interval 5 ; default value 5. Valid values 0-5. It is recommended that
; adj-lsa-build-interval have a lower value than
; routing-calc-interval
; first-hello-interval is the time to wait in seconds before sending the first Hello Interest
first-hello-interval 10 ; Default value 10. Valid values 0-10
; neighbor command is used to configure router's neighbor. Each neighbor will need
; one block of neighbor command
neighbor
{
name /ndn/edu/arizona/%C1.Router/router3 ; name prefix of the neighbor router consists
; of network, site-name and router-name
name /ndn/edu/arizona/%C1.Router/router3 ; name prefix of the neighbor router consists
; of network, site-name and router-name
face-uri udp4://router3.arizona.edu ; face uri of the face connected to the neighbor
link-cost 25 ; cost of the connecting link to neighbor
@@ -118,7 +138,7 @@ configuration commands follows:
neighbor
{
name /ndn/edu/colostate/%C1.Router/router2 ; name prefix of the neighbor router consists
name /ndn/edu/colostate/%C1.Router/router2 ; name prefix of the neighbor router consists
; of network, site-name and router-name
face-uri udp4://79.123.10.145 ; face uri of the face connected to the neighbor
@@ -135,9 +155,9 @@ configuration commands follows:
; commands in this section follows a strict order
; the switch is used to set hyperbolic routing calculation in NLSR
state off ; default value 'off', set value 'on' to enable hyperbolic routing table
; calculation which turns link state routing 'off'. set value to 'dry-run'
; to test hyperbolic routing and compare with link state routing.
state off ; default value 'off', set value 'on' to enable hyperbolic routing table
; calculation which turns link state routing 'off'. set value to 'dry-run'
; to test hyperbolic routing and compare with link state routing.
radius 123.456 ; radius of the router in hyperbolic coordinate system
@@ -152,8 +172,8 @@ configuration commands follows:
; the max-faces-per-prefix is used to limit the number of faces for each name prefixes
; by NLSR in ndn FIB
max-faces-per-prefix 3 ; default value 0. Valid value 0-60. By default (value 0) NLSR adds
; all available faces for each reachable name prefixes in NDN FIB
max-faces-per-prefix 3 ; default value 0. Valid value 0-60. By default (value 0) NLSR adds
; all available faces for each reachable name prefixes in NDN FIB
}
@@ -170,10 +190,78 @@ configuration commands follows:
prefix /ndn/news/memphis/politics/lutherking
}
.. note::
By default NLSR's sequence file directory is set to ``/var/lib/nlsr/``. User must create this
directory before starting NLSR. Since this is a system directory, NLSR must either be executed
as root, or NLSR can be run as user "nlsr" after configuring the filesystem to grant "nlsr"
read and write permissions. If user lacks permissions, the following error will occur:
Security configuration is discussed in :doc:`SECURITY-CONFIG`, which will be also part
of this configuration file
::
User does not have read and write permission on the directory
Error in configuration file processing! Exiting from NLSR
To avoid this, the directory can be set in a user-owned directory. For example:
::
general
{
...
state-dir /home/username/nlsr/log ; path for sequence directory and other dynamic changes (Absolute path)
}
...
The user will encounter errors such as the following if security is not configured:
::
Cannot read certificate from file: /home/username/NLSR/root.cert
To get rid of this and similar errors relating to security one has to configure security
as described in :doc:`SECURITY-CONFIG`. Security can be disabled for testing purposes as follows:
::
...
trust-anchor
{
type any
;file-name "root.cert"
}
...
trust-anchor
{
type any
;file-name "site.cert"
}
; cert-to-publish "root.cert"
; cert-to-publish "router.cert"
; cert-to-publish "site.cert"
; cert-to-publish "router.cert"
Or by simply replacing the whole security section with:
::
security
{
validator
{
trust-anchor
{
type any
}
}
prefix-update-validator
{
trust-anchor
{
type any
}
}
}
Step 4: Running NLSR on /ndn/memphis.edu/router1
-------------------------------------------------
@@ -195,9 +283,9 @@ The same process needs to be followed for ``/ndn/arizona.edu/router3`` and
Expected Output
----------------
Assuming that all three routers are configured correctly and routing has converged, ``nfd-status`` in
``/ndn/edu/colostate/%C1.Router/router2`` will have the following entries for the name
advertised by ``/ndn/edu/memphis/%C1.Router/router1``:
Assuming that all three routers are configured correctly and routing has converged,
``nfd-status`` in ``/ndn/edu/colostate/%C1.Router/router2`` will have the following (or similar)
entries for the name advertised by ``/ndn/edu/memphis/%C1.Router/router1``:
RIB:
@@ -207,7 +295,7 @@ RIB:
/ndn/memphis/sports/basketball/grizzlies route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
/ndn/news/memphis/politics/lutherking route={faceid=17 (origin=128 cost=25 ChildInherit, faceid=7 (origin=128 cost=58 ChildInherit)}
This output can be seen by typing ``nfd-status -r`` in the terminal. Please refer to the
This output can be seen by typing ``nfdc route list`` in the terminal. Please refer to the
network figure for face IDs.
.. _hyperbolic routing table calculation: http://arxiv.org/abs/0805.1266
+15 -7
View File
@@ -20,7 +20,7 @@ The trust model of NLSR is semi-hierarchical. An example certificate signing hie
router1 router2 router3 router4 router5 router6 router7
| | | | | | |
+ + + + + + +
NLSR NSLR NSLR NSLR NSLR NSLR NSLR
NLSR NLSR NLSR NLSR NLSR NLSR NLSR
Each entity's name and corresponding certificate name follow the
convention below:
@@ -28,14 +28,22 @@ convention below:
======== ===================================================== ================================= ===============================================
Entity Identity Name Example Certificate Name Example
-------- ----------------------------------------------------- --------------------------------- -----------------------------------------------
root /\<network\> /ndn /ndn/KEY/ksk-1/ID-CERT/%01
site /\<network\>/\<site\> /ndn/edu/ucla /ndn/edu/ucla/KEY/ksk-2/ID-CERT/%01
operator /\<network\>/\<site\>/%C1.Operator/\<operator-name\> /ndn/edu/ucla/%C1.Operator/op1 /ndn/edu/ucla/%C1.Operator/op1/KEY/ksk-3/ID-CERT/%01
router /\<network\>/\<site\>/%C1.Router/\<router-name\> /ndn/edu/ucla/%C1.Router/rt1 /ndn/edu/ucla/%C1.Router/rt1/KEY/ksk-4/ID-CERT/%01
NLSR /\<network\>/\<site\>/%C1.Router/\<router-name\>/NLSR /ndn/edu/ucla/%C1.Router/rt1/NLSR /ndn/edu/ucla/%C1.Router/rt1/NLSR/KEY/ksk-5/ID-CERT/%01
root /\<network\> /ndn /ndn/KEY/1/%00/%01
site /\<network\>/\<site\> /ndn/edu/ucla /ndn/edu/ucla/KEY/2/%00/%01
operator /\<network\>/\<site\>/%C1.Operator/\<operator-name\> /ndn/edu/ucla/%C1.Operator/op1 /ndn/edu/ucla/%C1.Operator/op1/KEY/3/%00/%01
router /\<network\>/\<site\>/%C1.Router/\<router-name\> /ndn/edu/ucla/%C1.Router/rt1 /ndn/edu/ucla/%C1.Router/rt1/KEY/4/%00/%01
NLSR /\<network\>/\<site\>/%C1.Router/\<router-name\>/NLSR /ndn/edu/ucla/%C1.Router/rt1/NLSR /ndn/edu/ucla/%C1.Router/rt1/NLSR/KEY/5/%00/%01
======== ===================================================== ================================= ===============================================
Users should create keys according to the naming and signing hierarchies above.
Users should create keys according to the naming and signing hierarchies above. The
``%C1.Operator`` and ``%C1.Router`` labels are NDN keywords that should not be modified
by the user.
.. note::
Detailed information about key setup is given in NLSR Developer's Guide and the
:doc:`beginners-guide`.
Certificate Publishing
----------------------
View File
Whitespace-only changes.
+887
View File
@@ -0,0 +1,887 @@
==========================================================
A beginners guide to installing and testing NLSR on Fedora
==========================================================
:Authors: David Arjona-Villicaña, Octavio Renteria-Vidales, Ashlesh Gawande
:Date: November, 2018
:Abstract: This is an easy to follow guide on how to install and test the NLSR routing protocol for NDN using two Fedora 28 machines. The commands and the paths used in this guide have been tested only in Fedora, although a similar procedure should be used for other linux systems. Specifically, the testing section (§ `5 <#test>`__) is platform independent. Therefore users who have NLSR already installed may skip to this section. Since neither NDN, NLSR nor Fedora are static software developments, it is expected that some commands and features in this guide will change over time. However, this guide is as accurate as it could be at the time it was published.
.. role:: raw-latex(raw)
:format: latex
.. _intro:
1. Introduction
===============
The following instructions are based on the information provided at the
Named Data Networking project web page [NDNmain]_.
Before installing NLSR it is necessary to install different libraries and
programs: ndn-cxx, NFD, ChronoSync [optional], ndn-svs [optional] and PSync.
This document describes the necessary steps to correctly install these
programs (§ `2 <#ndncxx>`__, `3 <#nfd>`__ and `4 <#nlsr>`__) and a brief
guide on how to configure and test NLSR using a simple two-node
network (§ `5 <#test>`__).
Many of the commands in this guide need to be executed as *root*.
Starting from Fedora 28, there is no need to set a root user
[Kolman2018]_. However it is possible to define it,
using the following command:
::
$ sudo -i
And then using the ``passwd`` command to set up a password. After setting
up the root user, it is possible to become root by employing the
following command and providing the root password when prompted:
::
$ su -
Fedora employs the ``dnf`` command to install and verify installed
packages. The following commands may become useful during the
installation process and should be executed as root:
- To verify that all installed packages are up to date
::
$ dnf update
- To verify if a package is already installed in the system
::
$ dnf list --installed <package-name>
- To search for information about a package or family of packages (not
necessarily installed in the system).
::
$ dnf info <package-name>
- To install a package in the system.
::
$ dnf install <package-name>
It is also a good installation practice to download and install all the
NDN programs in a common directory. Therefore, it is recommended to
create a directory at the home directory where all the following
programs may get installed. The name of this directory is not important.
However, the following are provided as suggestions: project, NDNproject,
NDNprograms. Each of the programs in the following sections should be
downloaded to their own directory using the ``git`` command, and then
compiled in this directory.
.. _ndncxx:
2. Installing ndn-cxx
=====================
2.1 Before installing ndn-cxx
-----------------------------
An updated list of the packages and programs that need to be installed
before installing ndn-cxx, is provided at [NDN-cxx]_.
This list is also reproduced below with the commands to verify that all
the packages have been installed in the system. The following commands
should be run as root:
#. gcc and gcc-c++
::
$ dnf list --installed gcc
$ dnf list --installed gcc-c++
#. Python version 3.8 or later
::
$ python3 -V
#. SQLite 3.x
::
$ dnf list --installed sqlite-devel
#. OpenSSL version 1.1.1 or later
::
$ dnf list --installed openssl-devel
#. pkgconf that replaces pkg-config
::
$ dnf list --installed pkgconf*
#. Boost libraries version 1.71.0 or later
::
$ dnf list --installed boost-devel
#. git
::
$ dnf list --installed git
#. doxygen (optional)
::
$ dnf list --installed doxygen
#. graphviz (optional)
::
$ dnf list --installed graphviz
#. python3-pip (optional)
::
$ dnf list --installed python3-pip
#. After verifying that the python3-pip package has been installed, it
is necessary to run the following command:
::
$ pip install sphinx sphinxcontrib-doxylink
2.2 Downloading and installing ndn-cxx
--------------------------------------
The ``git`` command allows to download the ndn-cxx library in its own
folder, also called *ndn-cxx*. Therefore it is recommended to execute
this command at the directory created at § `1 <#intro>`__:
::
$ git clone --depth 1 https://github.com/named-data/ndn-cxx.git
Move to the ndn-cxx directory:
::
$ cd ndn-cxx
Use the following command to verify that everything is ready to compile.
If an error message displays, it is necessary to fix it before
continuing:
::
$ ./waf configure --with-examples
Compile the ndn-cxx library and install the compiled files at the
system's directories:
::
$ ./waf
$ sudo ./waf install
2.3 Configuring ndn-cxx
-----------------------
The commands in this subsection need to be run as root. First, it is
necessary to create file *local.conf*, which contains a line with the
location for the ndn-cxx library:
::
$ echo /usr/local/lib64 >> /etc/ld.so.conf.d/local.conf
The following command configures the libraries:
::
$ ldconfig -v | grep ndn
This command should display a line similar to the following:
::
libndn-cxx.so.0.6.1 -> libndn-cxx.so.0.6.1
Configure the NDN path:
::
$ echo export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig >> /etc/profile.d/ndn.sh
After this command has been executed, it is necessary to apply the
changes by either logging out and back in, and then running the
following command:
::
$ printenv | grep PKG
Or by executing the following command:
::
$ ./etc/profile.d/ndn.sh
For more information and examples about how to compile and configure
this library, users should read the ndn-cxx guide at
[NDN-cxx]_.
.. _nfd:
3. Installing NFD
=================
3.1 Before installing NFD
-------------------------
An updated list of the packages and programs that need to be installed
before NFD is provided at [NDNNFD]_. Before installing
NFD it is necessary to verify that the following packages are installed:
#. pcap library
::
$ dnf list --installed libpcap-devel
3.2 Downloading and installing NFD
----------------------------------
This software is downloaded and installed in a folder called *NFD*, which
should be created at the directory defined at § `1 <#intro>`__. The
following commands need to be run as a regular user:
::
$ git clone --depth 1 https://github.com/named-data/NFD.git
$ cd NFD
$ ./waf configure
If the previous command prints an error message saying that waf cannot
find WebSocket, it is necessary to follow the instructions provided by
this same output, which tells the user to run the following command:
::
$ git submodule update --init
After executing these instructions, complete the configuration by running
``./waf configure`` again. Then complete the installation by means of the
following commands:
::
$ ./waf
$ sudo ./waf install
3.3 Configuring NFD
-------------------
Create a configuration file by running the following command as root:
::
$ cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
After the configuration file has been created, NFD's behavior may be
changed by modifying this file. Once the configuration file has been
created, it is recommended to start NFD by using the following command:
::
$ nfd-start
This command does not properly allow to employ the command window to
enter new commands; however it displays the NFD logs. Therefore, it is
recommended to open a new command window. This second window may be used
to verify NDF's status and then stop NFD by using the following
commands:
::
$ nfd-status
$ nfd-stop
.. _nlsr:
4. Installing NLSR
==================
4.1 Installing PSync
--------------------
Before installing NLSR, it is also necessary to download and install
PSync. PSync is a synchronization library which allows NLSR to synchronize LSAs
similar to ChronoSync. More information about PSync may be found at [PSync]_.
This library may be installed by running the following commands as a regular
user and at the directory defined at § `1 <#intro>`__:
::
$ git clone --depth 1 https://github.com/named-data/PSync.git
$ cd PSync
$ ./waf configure
$ ./waf
$ sudo ./waf install
The following command needs to be used again to configure the libraries:
::
$ sudo ldconfig -v | grep -i psync
This command should display a line similar to the following:
::
libPSync.so.0.1.0 -> libPSync.so.0.1.0
4.2 [Optional] Installing ChronoSync
------------------------------------
By default NLSR no longer builds with ChronoSync support.
Since ChronoSync is deprecated, only install it for testing purposes.
Before installing NLSR, it is necessary to first download and install
ChronoSync, which is a synchronization library which allows NLSR routers
to synchronize Link State Advertisements (LSAs). More information about
ChronoSync may be found at [Chronosync]_. This library may be
installed by running the following commands as a regular user and at the
directory defined at § `1 <#intro>`__:
::
$ git clone --depth 1 https://github.com/named-data/ChronoSync.git
$ cd ChronoSync
$ ./waf configure
$ ./waf
$ sudo ./waf install
The following command needs to be used again to configure the libraries:
::
$ sudo ldconfig -v | grep -i chronosync
This command should display a line similar to the following:
::
libChronoSync.so.0.5.0 -> libChronoSync.so.0.5.0
4.3 [Optional] Installing SVS
-----------------------------
NLSR can also use State Vector Sync as the underlying Sync protocol,
using the ndn-svs library.
This library may be installed by running the following commands as a
regular user and at the directory defined at § `1 <#intro>`__:
::
$ git clone --depth 1 https://github.com/named-data/ndn-svs.git
$ cd ndn-svs
$ ./waf configure
$ ./waf
$ sudo ./waf install
The following command needs to be used again to configure the libraries:
::
$ sudo ldconfig -v | grep ndn-svs
This command should display a line similar to the following:
::
libndn-svs.so.0.0.1 -> libndn-svs.so.0.0.1
4.4 Downloading and installing NLSR
-----------------------------------
NLSR is downloaded and installed in a folder called *NLSR* which should
be created at the directory defined at § `1 <#intro>`__. The following
commands need to be run as a regular user:
::
$ git clone --depth 1 https://github.com/named-data/NLSR.git
$ cd NLSR
$ ./waf configure
$ ./waf
$ sudo ./waf install
If ChronoSync support is needed for testing, please configure NLSR with:
::
$ ./waf configure --with-chronosync
4.5 Configuring NLSR
--------------------
Create and configure the following directory by running the following
commands as root:
::
$ mkdir /var/lib/nlsr
$ chmod 777 /var/lib/nlsr
.. _test:
5. Configuring and Testing NLSR
===============================
To test NLSR, the first step is to configure the keys and certificates
that implement a secure communication between the routers. Then it is
necessary to verify that the computers in the test network are
connected, that NFD is running and the faces between the computers are
configured. Finally, the NLSR configuration file has to be edited before
running NLSR. The following subsections are provided as a guide to
define and configure a simple computer network between two computers:
router1 and router2.
.. _security:
5.1 Setting up the security
---------------------------
Configuring security in an NDN network requires to generate, exchange
and install, keys and certificates between the root, site, operator and
router computers that form the network
[NLSRsecconf]_, [NLSRdevguide]_, although in practice, it
is possible to keep more than one of these entities in a single machine.
The following example and *Figure 1* show how to configure security
for a single router, called Router X. In this example, the root, site,
operator and Router X are in different computers:
.. figure:: security_comp.png
:alt: Security configuration example for Router X.
:width: 19cm
:align: center
Fig. 1. Security configuration example for Router X.
#. At the root server, generate the root key:
::
$ ndnsec-key-gen /ndn/ > root.key
#. Generate the certificate for the root key at the root server:
::
$ ndnsec-cert-dump -i /ndn/ > root.cert
#. Install the root certificate at the root server:
::
$ ndnsec-cert-install -f root.cert
#. At the site server, generate the site key:
::
$ ndnsec-key-gen /ndn/edu/uaslp > site.key
#. Copy the site key to the root server and generate the certificate for
the site server:
::
$ ndnsec-cert-gen -s /ndn/ site.key > site.cert
#. Copy the site certificate to the site server and install it:
::
$ ndnsec-cert-install -f site.cert
#. At the operator server, generate the operator key:
::
$ ndnsec-key-gen /ndn/edu/uaslp/%C1.Operator/op > op.key
#. Copy the operator key to the site server and generate the certificate
for the operator server:
::
$ ndnsec-cert-gen -s /ndn/edu/uaslp op.key > op.cert
#. Copy the operator certificate to the operator server and install it:
::
$ ndnsec-cert-install -f op.cert
#. At the router, generate the router key:
::
$ ndnsec-key-gen /ndn/edu/uaslp/%C1.Router/routerX > routerX.key
#. Copy the router key to the operator server and generate the
certificate for the router:
::
$ ndnsec-cert-gen -s /ndn/edu/uaslp/%C1.Operator/op routerX.key >
routerX.cert
#. Copy the router certificate to the router and install it:
::
$ ndnsec-cert-install -f routerX.cert
In the previous steps, the *%C1.Router* and *%C1.Operator* labels are
NDN keywords and should not be changed. These labels will be also used
by the configuration file (§ `5.4 <#configfile>`__)
The following command may be used to verify that the certificates have
been installed in a computer:
::
$ ndnsec-list
This guide recommends that one machine functions as the root, site,
operator and router1, while a different computer only functions as
router2. *Figure 2* shows this
configuration. For router1, the twelve steps described before need to be
executed except for exchanging files between computers. For the router2,
only steps 10 to 12 are needed to generate this router's certificate.
Additionally, the following command may be used to print a list and a
brief description of all the ``ndnsec`` commands:
::
$ man ndnsec
.. figure:: netwk1.png
:alt: Example network.
:width: 19cm
:align: center
Fig. 2. Example network.
5.2 Configuring the network
---------------------------
The first step is to configure the physical network. If two computers
are going to get connected using a single Ethernet cable, it is
necessary to verify that this cable is a crossover. The other option is
to employ a switch between two computers that are then connected using
two regular Ethernet cables.
After the physical network has been assembled, it is necessary to
configure the network addresses and cards for all the computers in the
network. It is important to remember that computers that are connected
to each other should use the same subnetwork address. It is possible to
verify the network configuration in a Linux computer by means of the
``ip addr`` command.
Once the physical network and network cards have been configured, it is
necessary to verify that the computers can communicate with each other.
The simplest way to do this is by using the ``ping`` command:
::
$ ping <remote-ip-address>
5.3 Starting and configuring NFD
--------------------------------
To start and configure NFD it is necessary to open two terminal windows.
The first one will be used to start NFD by means of the ``nfd-start``
command. This terminal will also display the logs that NFD generates. By
default, NFD only generates informational logs (INFO). However, it is
possible to obtain different levels of verbosity for these logs. These
levels can be set before NFD starts by editing the
*/usr/local/etc/ndn/nfd.conf* file. Open this file using a regular text
editor, read the information provided about logging and then modify the
*default-level* variable at the *log* section according to the
instructions provided in the file. Additional information about NFD
configuration may be found at [NDNNFDusage]_.
The second terminal will be used to monitor the NFD status:
::
$ nfd-status
Employ the following command to configure each face that a computer uses
to connect to a neighboring computer:
::
$ nfdc face create udp4://<remote-ip-address>
The face id may be displayed by running:
::
$ nfdc face list
The status of the face may be verified by using the following command:
::
$ nfdc face show id <face-id>
After finishing NLSR testing, it is necessary to destroy the face before
stopping NFD. This operation is described at § `5.6 <#turn_off>`__. For
the two computer network provided as an example (*Figure 2*), it is necessary that both
machines run NFD and that each one configures a face that connects to
the other machine.
.. _configfile:
5.4 Setting up the configuration file
-------------------------------------
Instructions on how to use the configuration file are already provided
at the NLSR's Router Configuration page [NLSRrtrconf]_.
Read the information in this page to understand NLSR router
configuration. The following text describes the instructions that have
been modified at the default nlsr.conf file for router1:
::
; AT general SECTION:
{
network /ndn/ ; name of the network
site /edu/uaslp ; name of the site
router /%C1.Router/router1 ; name of the router: router1
}
;AT neighbors SECTION:
neighbors
{
neighbor
{
name /ndn/edu/uaslp/%C1.Router/router2 ; Neighbor router: router2
face-uri udp://140.220.80.124 ; face to the neighbor
link-cost 30 ; cost of the link
}
}
; AT advertising SECTION:
advertising
{
prefix /ndn/edu/uaslp/office/bldg1 ; Advertising destinations
prefix /ndn/edu/uaslp/office/bldg2 ; for router1
}
; AT security SECTION:
security
{
validator
{
...
trust-anchor
{
type file
file-name "root.cert" ; root certificate file
}
}
prefix-update-validator
{
...
trust-anchor
{
type file
file-name "site.cert" ; site certificate file
}
}
cert-to-publish "root.cert" ; root certificate file
cert-to-publish "site.cert" ; site certificate file
cert-to-publish "op.cert" ; operator certificate file
cert-to-publish "router1.cert" ; router1 certificate file
}
The following text shows the modified instructions for router2:
::
; AT general SECTION:
{
network /ndn/ ; name of the network
site /edu/uaslp ; name of the site
router /%C1.Router/router2 ; name of the router: router2
}
;AT neighbors SECTION:
neighbors
{
neighbor
{
name /ndn/edu/uaslp/%C1.Router/router1 ; Neighbor router: router1
face-uri udp://140.220.80.121 ; face to the neighbor
link-cost 30 ; cost of the link
}
}
; AT advertising SECTION:
advertising
{
prefix /ndn/edu/uaslp/labs/networks ; Advertising destinations
prefix /ndn/edu/uaslp/labs/hardware ; for router2
}
; AT security SECTION:
security
{
validator
{
...
trust-anchor
{
type file
file-name "root.cert" ; root certificate file
} ; this file needs to be copied to
} ; router2
prefix-update-validator
{
...
trust-anchor
{
type file
file-name "site.cert" ; site certificate file
} ; this file needs to be copied to
} ; router2
...
cert-to-publish "router2.cert" ; router2 certificate file
}
Notice that files *root.cert* and *site.cert*, which were generated at
router1, need to be copied to router2. Also notice that the *%C1.Router*
and *%C1.Operator* keywords employed at § `5.1 <#security>`__ are also
referenced by these configuration files.
.. _starting_nlsr:
5.5 Starting NLSR
-----------------
It is recommended to open a third command terminal and run NLSR in this
window. After the NLSR configuration file has been edited and saved as
*nlsr.conf*, it is possible to start NLSR by running either of the
following two commands:
::
$ nlsr
$ nlsr -f <configuration-file>
However, to verify what is NLSR doing, it becomes necessary to employ
NLSR's logging facility [NLSRstarting]_. A brief
description on how to use NDN's logging facility may be displayed by
entering the ``man ndn-log`` command. This guide recommends using one
of the following two instructions to start NLSR:
::
$ export NDN_LOG=nlsr.*=TRACE && nlsr
$ export NDN_LOG=nlsr.*=TRACE && nlsr -f <configuration-file>
The second terminal window may be used to run ``nfd-status`` again and
it should be possible to verify that the status has changed, specially
at the FIB and RIB sections of the generated report.
.. _turn_off:
5.6 Turning everything off
--------------------------
In order to stop NLSR and NFD, the following sequence of events is
recommended:
#. Stop NLSR by pressing the Ctrl+C keys at the third terminal window.
#. Destroy the face to the remote computers using either of the
following two commands at the second terminal window:
::
$ nfdc face destroy <face-id>
$ nfdc face destroy udp4://<remote-ip-address>
#. Stop NFD by entering the following command at the second terminal
window:
::
$ nfd-stop
#. The crossover Ethernet cable may be unplugged and the computers'
network configuration restored to its original settings.
5.7 Where to go from here
-------------------------
Users interested in building and configuring larger networks may want to
take a look at the NDN Ansible repository
[NDNAnsible]_. This repository uses Ansible, which is a
configuration management tool, to manage the official NDN testbed
deployment [NDNTestbed]_.
.. [NDNmain] *Named Data Networking*, https://named-data.net/, March 2018.
.. [Kolman2018] M. Kolman. *Anaconda improvements in Fedora 28*, Fedora Magazine, June 2018.
.. [NDN-cxx] *Getting started with ndn-cxx*, https://docs.named-data.net/ndn-cxx/current/INSTALL.html, April 2018.
.. [NDNNFD] *Getting started with NFD*, https://docs.named-data.net/NFD/current/INSTALL.html, April 2018.
.. [NDNNFDusage] *NFD usage*, https://docs.named-data.net/NFD/current/manpages/nfd.html, May 2018.
.. [Chronosync] Z. Zhu and A. Afanasyev. *Let's ChronoSync: Decentralized dataset state synchronization in Named Data Networking*, in IEEE ICNP, October 2013.
.. [PSync] M. Zhang, V. Lehman, and L. Wang. *Scalable Name-based Data Synchronization for Named Data Networking*, in IEEE INFOCOM, May 2017.
.. [NLSRsecconf] *NLSR Security Configuration*, https://docs.named-data.net/NLSR/current/SECURITY-CONFIG.html June 2018.
.. [NLSRdevguide] V. Lehman, M. Chowdhury, N. Gordon, A. Gawande. *NLSR Developer's Guide*, University of Memphis, November 2017.
.. [NLSRrtrconf] *NLSR Router Configuration*, https://docs.named-data.net/NLSR/current/ROUTER-CONFIG.html, April 2018.
.. [NLSRstarting] *Getting Started with NLSR*, https://docs.named-data.net/NLSR/current/GETTING-STARTED.html, May 2018.
.. [NDNAnsible] *NDN Ansible repository*, https://github.com/WU-ARL/NDN_Ansible, October 2018.
.. [NDNTestbed] *NDN Testbed*, https://named-data.net/ndn-testbed/, October 2018.
+58 -220
View File
@@ -1,254 +1,92 @@
# -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
#
# NLSR - Named Data Link State Routing Protocol 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.
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import importlib.util
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
# -- General configuration ------------------------------------------------
project = 'Named Data Link State Routing Protocol (NLSR)'
copyright = 'Copyright © 2014-2023 Named Data Networking Project.'
author = 'Named Data Networking Project'
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# The short X.Y version.
#version = ''
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.todo',
'redmine_issue',
]
def addExtensionIfExists(extension):
try:
__import__(extension)
extensions.append(extension)
except ImportError:
sys.stderr.write("Extension '%s' in not available. "
"Some documentation may not build correctly.\n" % extension)
sys.stderr.write("To install, use \n"
" sudo pip install %s\n" % extension.replace('.', '-'))
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'NLSR - Named Data Link State Routing Protocol'
copyright = u'2014-2015, Named Data Networking Project'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# 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 = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
today_fmt = '%Y-%m-%d'
# -- Options for HTML output ----------------------------------------------
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
needs_sphinx = '4.0'
extensions = [
'sphinx.ext.extlinks',
'sphinx.ext.todo',
]
def addExtensionIfExists(extension: str):
try:
if importlib.util.find_spec(extension) is None:
raise ModuleNotFoundError(extension)
except (ImportError, ValueError):
sys.stderr.write(f'WARNING: Extension {extension!r} not found. '
'Some documentation may not build correctly.\n')
else:
extensions.append(extension)
addExtensionIfExists('sphinxcontrib.doxylink')
templates_path = ['_templates']
exclude_patterns = ['Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# html_theme = '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 = 'nlsr-docs'
# Disable syntax highlighting of code blocks by default.
highlight_language = 'none'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'nlsr-docs.tex', u'NLSR - Named Data Link State Routing Protocol Documentation',
u'Named Data Networking Project', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# -- Options for manual page output ------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-manual-page-output
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('manpages/nlsr', 'nlsr', u'Named Data Link State Routing Protocol Daemon', None, 1),
('manpages/nlsr.conf', 'nlsr.conf', u'Named Data Link State Routing Protocol Daemon config file', None, 5),
('manpages/nlsrc', 'nlsrc', u'Command-line utility to interact with and collect statistics from NLSR', None, 1),
('manpages/nlsr', 'nlsr', 'Named Data Link State Routing daemon', [], 1),
('manpages/nlsr.conf', 'nlsr.conf', 'Named Data Link State Routing daemon configuration file', [], 5),
('manpages/nlsrc', 'nlsrc', 'command-line utility to interact with and collect statistics from NLSR', [], 1),
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Misc options ------------------------------------------------------------
if os.getenv('GOOGLE_ANALYTICS', None):
googleanalytics_id = os.environ['GOOGLE_ANALYTICS']
googleanalytics_enabled = True
doxylink = {
'nlsr': ('NLSR.tag', 'doxygen/'),
}
redmine_project_url = "http://redmine.named-data.net/"
extlinks = {
'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'),
}
+20 -108
View File
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "NLSR - Named Data Link State Routing Protocol"
PROJECT_NAME = "NLSR: Named Data Link State Routing Protocol"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@@ -68,7 +68,7 @@ OUTPUT_DIRECTORY = docs/doxygen
# performance problems for the file system.
# The default value is: NO.
CREATE_SUBDIRS = YES
CREATE_SUBDIRS = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
@@ -220,19 +220,13 @@ TAB_SIZE = 4
ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
@@ -422,7 +416,7 @@ EXTRACT_STATIC = YES
# for Java sources.
# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_CLASSES = NO
# This flag is only useful for Objective-C code. When set to YES local methods,
# which are defined in the implementation section but not in the interface are
@@ -485,7 +479,7 @@ INTERNAL_DOCS = NO
# and Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = YES
CASE_SENSE_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
# their full class and namespace scopes in the documentation. If set to YES the
@@ -524,7 +518,7 @@ SORT_MEMBER_DOCS = YES
# name. If set to NO the members will appear in declaration order.
# The default value is: NO.
SORT_BRIEF_DOCS = NO
SORT_BRIEF_DOCS = YES
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
# (brief and detailed) documentation of class members so that constructors and
@@ -536,7 +530,7 @@ SORT_BRIEF_DOCS = NO
# detailed member documentation.
# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
SORT_MEMBERS_CTORS_1ST = YES
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
# of group names into alphabetical order. If set to NO the group names will
@@ -968,13 +962,6 @@ VERBATIM_HEADERS = YES
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
@@ -1103,21 +1090,13 @@ HTML_COLORSTYLE_SAT = 0
HTML_COLORSTYLE_GAMMA = 91
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
HTML_DYNAMIC_SECTIONS = YES
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
@@ -1355,7 +1334,7 @@ GENERATE_TREEVIEW = YES
# Minimum value: 0, maximum value: 20, default value: 4.
# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
ENUM_VALUES_PER_LINE = 1
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
# to set the initial width (in pixels) of the frame in which the tree is shown.
@@ -1380,17 +1359,6 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
@@ -1653,16 +1621,6 @@ LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
@@ -1782,18 +1740,6 @@ GENERATE_XML = NO
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
# validating XML parser to check the syntax of the XML files.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_SCHEMA =
# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
# validating XML parser to check the syntax of the XML files.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
# the XML output. Note that enabling this will significantly increase the size
@@ -1928,7 +1874,14 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED =
PREDEFINED = DOXYGEN \
INIT_LOGGER(x)= \
BOOST_CONCEPT_ASSERT(x)= \
BOOST_CONCEPT_REQUIRES(x)= \
PUBLIC_WITH_TESTS_ELSE_PRIVATE=private \
PUBLIC_WITH_TESTS_ELSE_PROTECTED=protected \
PROTECTED_WITH_TESTS_ELSE_PRIVATE=private \
VIRTUAL_WITH_TESTS=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -1994,39 +1947,15 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of 'which perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# If set to YES, the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
HIDE_UNDOC_RELATIONS = NO
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
@@ -2035,7 +1964,7 @@ HIDE_UNDOC_RELATIONS = YES
# set to NO
# The default value is: NO.
HAVE_DOT = YES
HAVE_DOT = @HAVE_DOT@
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
@@ -2047,23 +1976,6 @@ HAVE_DOT = YES
DOT_NUM_THREADS = 0
# When you want a differently looking font n the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
@@ -2265,7 +2177,7 @@ DOT_TRANSPARENT = YES
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
+66 -38
View File
@@ -1,19 +1,22 @@
NLSR - Named Data Link State Routing Protocol
=============================================
NLSR: Named Data Link State Routing Protocol
============================================
NLSR is a routing protocol in NDN that populates NDN's Routing Information Base. NLSR will
continue to evolve alongside the Named Data Networking `protocol
<http://named-data.net/doc/ndn-tlv/>`_.
.. toctree::
:hidden:
:maxdepth: 2
NLSR is an open and free software package licensed under the GPL 3.0 license and free to
all Internet users and developers. For more information about the licensing details and
limitations, refer to `COPYING.md
<https://github.com/named-data/NLSR/blob/master/COPYING.md>`_.
GETTING-STARTED
INSTALL
SECURITY-CONFIG
ROUTER-CONFIG
beginners-guide
manpages
release-notes
releases
NLSR is developed by the members of the `NSF-sponsored NDN project team
<http://named-data.net/project/participants/>`_. For more details, please refer to
`AUTHORS.md <https://github.com/named-data/NLSR/blob/master/AUTHORS.md>`_. Bug reports and
feedback are highly appreciated and can be made through the `NLSR Wiki`_.
**NLSR** is a routing protocol for Named Data Networking (NDN) that populates the Routing
Information Base (RIB) of an NDN router, such as `NFD`_. NLSR continues to evolve alongside
the core `NDN protocol`_.
The main design goal of NLSR is to provide a routing protocol to populate NDN's FIB. NLSR
calculates the routing table using link-state or hyperbolic routing and produces multiple
@@ -22,40 +25,65 @@ to evolve over time to include neighbor discovery and to become a full fledged
inter-domain routing protocol for NDN. The protocol design is presented in full detail in
the `NLSR Paper`_.
NLSR Documentation
-------------------
NLSR was mainly developed by members of the NSF-sponsored `NDN project team
<https://named-data.net/project/participants/>`__. See `AUTHORS.md
<https://github.com/named-data/NLSR/blob/master/AUTHORS.md>`__ for details.
.. toctree::
:hidden:
:maxdepth: 3
Bug reports and feedback are highly appreciated and can be made through the `NLSR Redmine`_.
RELEASE-NOTES
INSTALL
GETTING-STARTED
ROUTER-CONFIG
SECURITY-CONFIG
manpages
Documentation
-------------
- :doc:`INSTALL`
- :doc:`GETTING-STARTED`
- :doc:`ROUTER-CONFIG`
- :doc:`SECURITY-CONFIG`
- :doc:`RELEASE-NOTES`
- :doc:`manpages`
- :doc:`GETTING-STARTED`
- :doc:`INSTALL`
- :doc:`SECURITY-CONFIG`
- :doc:`ROUTER-CONFIG`
- :doc:`beginners-guide`
- :doc:`manpages`
- :doc:`release-notes`
- :doc:`releases`
Downloading
-----------
- `GitHub NLSR repository <https://github.com/named-data/NLSR>`_
- `Source code git repository <https://github.com/named-data/NLSR>`__
Additional information
----------------------
NLSR mailing list
-----------------
- `NLSR Wiki`_
- `NLSR Mailing List`_
- `NLSR Mailing List Archives`_
- `NLSR Paper`_
Detailed explanation of the NLSR design
`Sign up`_ is needed to post to the list or access the archives.
Additional resources
--------------------
.. _NLSR Wiki: http://redmine.named-data.net/projects/nlsr
.. _NLSR Paper: http://www.cs.memphis.edu/~lanwang/paper/nlsr-final.pdf
- `NLSR Wiki`_
- `NLSR Redmine`_
Feature requests and bug reports
- `NLSR Paper`_
Detailed explanation of NLSR's design
- `NLSR Developer's Guide`_
For NLSR development
- `API documentation (doxygen) <doxygen/annotated.html>`__
License
-------
NLSR is free software distributed under the GNU General Public License version 3.
See `COPYING.md <https://github.com/named-data/NLSR/blob/master/COPYING.md>`__ for details.
.. _NDN protocol: https://docs.named-data.net/NDN-packet-spec/current/
.. _NFD: https://github.com/named-data/NFD
.. _NLSR Wiki: https://redmine.named-data.net/projects/nlsr/wiki
.. _NLSR Paper: https://named-data.net/wp-content/uploads/2016/01/ndn-0037-1-nlsr.pdf
.. _NLSR Mailing List: https://listserv.memphis.edu/scripts/wa.exe?SUBED1=NLSR-HELP-L&A=1
.. _NLSR Mailing List Archives: https://listserv.memphis.edu/scripts/wa.exe?A0=NLSR-HELP-L
.. _NLSR Developer's Guide: https://github.com/named-data/NLSR/blob/developers-guide/NLSR-Developers-Guide.pdf
.. _Sign up: https://listserv.memphis.edu/scripts/wa.exe?GETPW1
.. _NLSR Redmine: https://redmine.named-data.net/projects/nlsr
+5 -7
View File
@@ -1,10 +1,8 @@
.. _Manpages:
Manpages
========
Man pages
=========
.. toctree::
manpages/nlsr
manpages/nlsr.conf
manpages/nlsrc
:glob:
:maxdepth: 1
manpages/*
+2 -12
View File
@@ -12,16 +12,12 @@ Usage
Description
-----------
``nlsr`` is a daemon that implements routing protocol in NDN to populates NDN's Routing
``nlsr`` is a process that implements routing protocol in NDN to populate NDN's Routing
Information Base.
Options:
--------
``-d``
Run in daemon mode
``-f <FILE>``
Specify configuration file name (default: ``./nlsr.conf``)
@@ -34,14 +30,8 @@ Options:
Examples
--------
To run NLSR daemon and use a configuration file from the ``/path/to`` directory.
To run NLSR and use a configuration file from the ``/path/to`` directory.
::
nlsr -f /path/to/nlsr.conf
To run NLSR as daemon, use the ``-d`` flag:
::
nlsr -d
+44 -5
View File
@@ -6,7 +6,8 @@ Usage
::
nlsrc [-h] [-V] COMMAND [<Command Options>]
nlsrc [-h | -V]
nlsrc [-R <router prefix> [-c <nlsr.conf path> | -k]] COMMAND [<Command Options>]
Description
@@ -24,11 +25,28 @@ Options
``-V``
Show NLSRC version information
``-R <router prefix>``
Target a remote NLSR instance.
The default is the local NLSR instance ``/localhost``.
``-c <nlsr.conf path>``
Verify remote status information with the trust schema loaded from ``security.validator`` section of specified nlsr.conf config file.
The default is loading from ``/etc/ndn/nlsr.conf``.
``-k``
Insecure: do not verify signature on status information retrieved from remote router.
``COMMAND``
``status``
``lsdb``
Retrieve LSDB status information
``routing``
Retrieve routing table status information
``status``
Retrieve LSDB status and routing table status information
``advertise``
Add a Name prefix to be advertised by NLSR
@@ -37,6 +55,11 @@ Options
``name``
The Name prefix to be advertised
``advertise <name> save``
``save``
Advertise a prefix and also save it to the nlsr.conf file residing in the state-dir for the next start of NLSR that operator may copy and use for the next start of NLSR
``withdraw``
Remove a Name prefix advertised through NLSR
@@ -45,11 +68,27 @@ Options
``name``
The Name prefix to be withdrawn
``withdraw <name> delete``
``delete``
Withdraw a prefix and also delete it from the nlsr.conf file residing in the state-dir
Notes
-----
When security is enabled, NLSR will not be allowed to successfully
advertise/withdraw names without first setting a default identity of operator.
If default identity is not set as operator, the user will be presented with the
error message: "Name prefix update error (code: 403)". To remedy this
issue, use the command ``ndnsec set-default``. Example::
ndnsec set-default /ndn/a-site/%C1.Operator/op
Exit Status
-----------
nlsrc exits with one of the following values:
::
nlsrc exits with one of the following values::
0 nlsrc exited successfully
>0 An error occurred
1 generic error
2 bad command line
+5 -15
View File
@@ -12,7 +12,7 @@
<div class="row">
<div class="three columns">
<div id="logo">
<a href="http://named-data.net" title="A Future Internet Architecture"><img src="http://named-data.net/wp-content/uploads/cropped-20130722_Logo2.png" alt="" /></a>
<a href="https://named-data.net" title="A Future Internet Architecture"><img src="https://named-data.net/wp-content/uploads/cropped-20130722_Logo2.png" alt="" /></a>
</div><!--logo end-->
</div>
@@ -38,12 +38,13 @@
<h3>{{ _('Table Of Contents') }}</h3>
{{ toctree(includehidden=True) }}
<h3>{{ _('Additional documenation') }}</h3>
<h3>{{ _('Developer documentation') }}</h3>
<ul>
<li class="toctree-l1"><a class="reference external" href="http://redmine.named-data.net/projects/nlsr/wiki">NLSR Wiki</a></li>
<li class="toctree-l1"><a class="reference internal" href="doxygen/annotated.html">API documentation (doxygen)</a></li>
<li class="toctree-l1"><a class="reference external" href="https://redmine.named-data.net/projects/nlsr/wiki">NLSR Wiki</a></li>
</ul>
{%- endblock %}
{%- block sidebarsearch %}
<h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
<form class="search" action="{{ pathto('search') }}" method="get">
@@ -74,22 +75,11 @@
<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 id="copyright">This research is partially supported by NSF (Award <a href="https://www.nsf.gov/awardsearch/showAward?AWD_ID=1040868" target="_blank>">CNS-1040868</a>)<br/><br/><a rel="license" href="https://creativecommons.org/licenses/by/3.0/deed.en_US" target="_blank">Creative Commons Attribution 3.0 Unported License</a> except where noted.</div>
</div>
</div>
</div><!--footer info end-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22320603-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
{% endblock %}
{% block relbar1 %}{% endblock %}
@@ -0,0 +1,32 @@
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby
<a href="https://www.doxygen.org/index.html">
<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/>
<address class="footer"><small>
$generatedby &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/>
</a> $doxygenversion
</small></address>
<!--END !GENERATE_TREEVIEW-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '@GOOGLE_ANALYTICS@', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
+3 -1
View File
@@ -4,7 +4,7 @@
<ul>
$navpath
<li class="footer">$generatedby
<a href="http://www.doxygen.org/index.html">
<a href="https://www.doxygen.org/index.html">
<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
@@ -18,5 +18,7 @@ $generatedby &#160;<a href="http://www.doxygen.org/index.html">
</small></address>
<!--END !GENERATE_TREEVIEW-->
<script type="text/javascript">
</script>
</body>
</html>
+4 -4
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
@@ -26,13 +26,13 @@ $mathjax
<div class="row">
<div class="three columns">
<div id="logo">
<a href="http://named-data.net" title="A Future Internet Architecture"><img src="http://named-data.net/wp-content/uploads/cropped-20130722_Logo2.png" alt="" /></a>
<a href="https://named-data.net" title="A Future Internet Architecture"><img src="https://named-data.net/wp-content/uploads/cropped-20130722_Logo2.png" alt="" /></a>
</div><!--logo end-->
</div>
<!--top menu-->
<div class="nine columns" id="menu_container" >
<h1><a href="http://named-data.net/doc/NFD/$projectnumber/">$projectname $projectnumber documentation</a></h1>
<h1><a href="https://named-data.net/doc/NLSR/$projectnumber/">$projectname $projectnumber documentation</a></h1>
</div>
</div>
</div><!--header container end-->
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

-70
View File
@@ -1,70 +0,0 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# Based on http://doughellmann.com/2010/05/09/defining-custom-roles-in-sphinx.html
"""Integration of Sphinx with Redmine.
"""
from docutils import nodes, utils
from docutils.parsers.rst.roles import set_classes
def redmine_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
"""Link to a Redmine issue.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty.
:param name: The role name used in the document.
:param rawtext: The entire markup snippet, with role.
:param text: The text marked with the role.
:param lineno: The line number where rawtext appears in the input.
:param inliner: The inliner instance that called us.
:param options: Directive options for customization.
:param content: The directive content for customization.
"""
try:
issue_num = int(text)
if issue_num <= 0:
raise ValueError
except ValueError:
msg = inliner.reporter.error(
'Redmine issue number must be a number greater than or equal to 1; '
'"%s" is invalid.' % text, line=lineno)
prb = inliner.problematic(rawtext, rawtext, msg)
return [prb], [msg]
app = inliner.document.settings.env.app
node = make_link_node(rawtext, app, 'issues', str(issue_num), options)
return [node], []
def make_link_node(rawtext, app, type, slug, options):
"""Create a link to a Redmine resource.
:param rawtext: Text being replaced with link node.
:param app: Sphinx application context
:param type: Link type (issue, changeset, etc.)
:param slug: ID of the thing to link to
:param options: Options dictionary passed to role func.
"""
#
try:
base = app.config.redmine_project_url
if not base:
raise AttributeError
except AttributeError, err:
raise ValueError('redmine_project_url configuration value is not set (%s)' % str(err))
#
slash = '/' if base[-1] != '/' else ''
ref = base + slash + type + '/' + slug + '/'
set_classes(options)
node = nodes.reference(rawtext, 'Issue #' + utils.unescape(slug), refuri=ref,
**options)
return node
def setup(app):
"""Install the plugin.
:param app: Sphinx application context.
"""
app.add_role('issue', redmine_role)
app.add_config_value('redmine_project_url', None, 'env')
return
+4
View File
@@ -0,0 +1,4 @@
Release Notes
=============
.. include:: release-notes/release-notes-0.7.0.rst
@@ -0,0 +1,31 @@
NLSR version 0.1.0 (initial release)
++++++++++++++++++++++++++++++++++++
Release date: August 25, 2014
The main design goal of NLSR is to provide a routing protocol to populate `NFD's
<https://github.com/named-data/NFD>`__ RIB. NLSR calculates the routing table using
link-state or hyperbolic routing and produces multiple faces for each reachable name
prefix in a single authoritative domain.
Included features
^^^^^^^^^^^^^^^^^
- Advertise availability of content through the configured router
- Use `ChronoSync <https://github.com/named-data/ChronoSync>`__ to synchronize routers' LSA sequence numbers and Interest/Data to retrieve LSAs
- Produce a list of ranked forwarding options for each name prefix to facilitate NDN's adaptive forwarding strategies
- Configure maximum number of faces per prefix in NFD's RIB
- Set up NFD tunnels to neighbors automatically and maintain the tunnels to neighbors
- Provide two routing protocols:
+ Link State routing: calculate route cost based on link costs
+ Hyperbolic routing: calculate route cost based on hyperbolic coordinates
- Use a hierarchical trust model for routing within a single administrative domain
- Keep NFD's RIB updated on failure and recovery
@@ -1,6 +1,3 @@
Release Notes
=============
NLSR version 0.2.0 (changes since version 0.1.0)
++++++++++++++++++++++++++++++++++++++++++++++++
@@ -94,35 +91,4 @@ Release date: April 30, 2015
- Correct mistakes in documentation
- Correct bitmask used to copy Name LSA sequence number (:issue:`2323`)
NLSR version 0.1.0 (initial release)
++++++++++++++++++++++++++++++++++++
Release date: August 25, 2014
The main design goal of NLSR is to provide a routing protocol to populate `NFD's
<http://named-data.net/doc/NFD/current/>`_ RIB. NLSR calculates the routing table using
link-state or hyperbolic routing and produces multiple faces for each reachable name
prefix in a single authoritative domain.
**Included features**:
- Advertise availability of content through the configured router
- Use `ChronoSync <https://github.com/named-data/ChronoSync>`_ to synchronize routers' LSA sequence numbers and Interest/Data to retrieve LSAs
- Produce a list of ranked forwarding options for each name prefix to facilitate NDN's adaptive forwarding strategies
- Configure maximum number of faces per prefix in NFD’s RIB
- Set up NFD tunnels to neighbors automatically and maintain the tunnels to neighbors
- Provide two routing protocols:
+ Link State routing: calculate route cost based on link costs
+ Hyperbolic routing: calculate route cost based on hyperbolic coordinates
- Use a hierarchical trust model for routing within a single administrative domain
- Keep NFD’s RIB updated on failure and recovery
- Correct bitmask used to copy Name LSA sequence number (:issue:`2323`)
@@ -0,0 +1,20 @@
NLSR version 0.2.1 (changes since version 0.2.0)
++++++++++++++++++++++++++++++++++++++++++++++++
Release date: June 30, 2015
**Code changes**:
- Using a configuration file without ``prefix-update-validator`` disables runtime advertise/withdraw instead of exiting (:issue:`2814`)
**Bug fixes**:
- Prevent incomplete removal of NPT entry (:issue:`2785`)
- Correct bidirectional links with differing costs (:issue:`2801`)
- Fix non-incrementing Adjacency number in AdjLsa::writeLog (:issue:`2594`)
- Remove FaceDestroyEvent test's reliance on nlsrSeqNo.txt (:issue:`2881`)
- Test ACTIVE/INACTIVE Adjacencies in LSA construction (:issue:`2735`)
@@ -0,0 +1,8 @@
NLSR version 0.2.2 (changes since version 0.2.1)
++++++++++++++++++++++++++++++++++++++++++++++++
Release date: January 5, 2016
**Code changes**:
- Adapt code to changes in NFD/ndn-cxx version 0.4.0 release
@@ -0,0 +1,26 @@
NLSR version 0.3.0 (changes since version 0.2.2)
++++++++++++++++++++++++++++++++++++++++++++++++
Release date: August 1, 2016
**Code changes**:
- Updated validation checker for LSA rule in the configuration file (:issue:`2965`)
- Do not advertise Adjacency LSAs when hyperbolic routing is enabled (:issue:`2402`)
- Do not distribute coordinate LSAs when using link-state routing. (:issue:`3661`)
- LSAs should be segmented before they are published (:issue:`2965`)
- Don't use DummyClientFace::sentDatas (:issue:`3383`)
- Remove disabled security files (:issue:`2960`)
- Lsa type should be argument for base class LSA constructor (:issue:`2788`)
- Use ndn-cxx/DummyClientFace (:issue:`2637`)
**Bug fixes**:
- Unit tests cases are installed with `./waf install` (:issue:`3359`)
@@ -0,0 +1,34 @@
NLSR version 0.3.1 (changes since version 0.3.0)
++++++++++++++++++++++++++++++++++++++++++++++++
Release date: January 22, 2017
**Changes**
- **breaking change** Sync uses /localhop component in prefix to reduce duplicate NACKs (:issue:`3627`)
- **breaking change** LSA uses /localhop component in prefix to reduce duplicate NACKs (:issue:`3899`)
**Code Changes**:
- Fib and FaceMap use std::map instead of std::list (:issue:`2781`)
- NamePrefixTableEntries store RoutingTableEntries using a pointer (:issue:`2863`)
- Namespace closing comments are now consistent with ndn-cxx guidelines (:issue:`3735`)
- Update copyright date across all files (:issue:`3736`, `3909`, `3923`)
- Improve formatting of FaceMap and FaceMapEntry (:issue:`3737`)
- Sort NextHops on NexthopList insertion (:issue:`2721`)
**Bug fixes**:
- HR now recalculates paths after status change of a neighbor (:issue:`3874`)
- NLSR no longer sets strategies multiple times (:issue:`3743`)
- NLSR should enable use of ndn-cxx dispatcher (:issue:`3930`)
- Fix typos in the sample configuration file (:issue:`3113`)
@@ -0,0 +1,20 @@
NLSR version 0.3.2 (changes since version 0.3.1)
++++++++++++++++++++++++++++++++++++++++++++++++
Release date: March 15, 2017
**Changes**
- NLSR constructor now accept a KeyChain argument. (:issue:`3742`)
- Fix security rule for /localhop LSA prefix (:issue:`3899`)
- Use ndn::nfd::ROUTE_ORIGIN_NLSR instead of a magic number. (:issue:`3903`)
- Handle "Face Already Exists" error (error code 409) in NFD. (:issue:`3976`)
- Enable NLSR to register localhost prefix with dispatcher before top-level prefix. (:issue:`3938`)
- Don't use ndn aliases provided by ndn-cxx/common.hpp. (:issue:`3983`)
- Remove use of deprecated code. (:issue:`3988`)
@@ -0,0 +1,79 @@
NLSR version 0.4.0
++++++++++++++++++
**New features**:
- **breaking change** Discover Faces from NFD (:issue:`2954`)
- **breaking change** Accommodate n-Dimensional HR coordinates (:issue:`3751`)
**Changes**:
- **breaking change** Make chronosync a dependency (:issue:`2400`)
- **breaking change** Use separate name prefix and sequence number
for each LSA type (:issue:`3964`)
- **breaking change** Convert to ``v2::security`` and adapt to ndn-cxx changes (:issue:`3964`)
- Use unix timestamp as default (:issue:`4187`)
**Bug Fixes**:
- Add support for sources to NamePrefixList (:issue:`4177`)
- Fix incorrect error on face-dataset-fetch-interval valid values (:issue:`4211`)
- Fix prefix advertise runtime error (:issue:`4215`)
- Fix heap buffer overflow error (:issue:`4217`)
**Code Changes**:
- LSA getData() now uses ostream instead of manually building the string (:issue:`2346`)
- Refresh FIB entries independently of routing table calculation (:issue:`2778`)
- Change configuration parameter output level to info (:issue:`2850`)
- Updates to name prefixes are more efficient (:issue:`2864`)
- Implement statistics collector/recorder (:issue:`2956`)
- Implement ``NameLsa::isEqualContent`` (:issue:`2962`)
- Refactor ``Fib::removeOldNextHopsFromFibEntryAndNfd()`` for simplicity, readability. (:issue:`3820`)
- Improve logging throughout lsdb.cpp and others (:issue:`3934`)
- Enable dispatcher for LOCALHOST_PREFIX (:issue:`3938`)
- Don't use ndn aliases provided by ndn-cxx/common.hpp (:issue:`3983`)
- Canonize Adjacent FaceURIs on startup (:issue:`4063`)
- Refactor AdjacencyList to use iterators instead of bare ptrs (:issue:`4068`)
- Merge redundant functions (:issue:`4105`)
- Remove writeLog in NamePrefixList (:issue:`4131`)
- Check for self in ChronoSync updates (:issue:`4134`)
- Install nlsr.conf as sample in the system (:issue:`4197`)
- Enable AddressSanitizer and LeakSanitizer for unit tests (:issue:`4206`)
- Resolve all ASan errors in unit tests (:issue:`4230`)
- Simplified LSDB dataset interest handler. (:issue:`4235`)
- Made map more container-agnostic (:issue:`4239`)
- Improved routing map data structure. (:issue:`4240`)
- Increased independence of SyncLogicHandler (:issue:`4264`)
- Use unique_ptr for signal container (:issue:`4268`)
- Use network name in sync prefix to avoid sync leaks from other networks (:issue:`4101`)
@@ -0,0 +1,24 @@
NLSR version 0.4.1
++++++++++++++++++
**New features**:
- The routing table dataset publisher (:issue:`3630`)
- Use ndn-cxx logging facility, remove log4cxx dependency (:issue:`3949`)
- Automatic serving of other routers' certificates (:issue:`4448`)
**Bug Fixes**:
- Hard-code a fixed session name for ChronoSync sockets (:issue:`4513`)
- Fix encoding bug in the routing table publisher (:issue:`4453`)
- Fix NLSR not converging without content store (:issue:`4430`)
**Miscellaneous Changes**:
- Make ChronoSync's sync interest lifetime configurable (:issue:`4490`)
- Print labels on adjacency matrix when logging (:issue:`2045`)
@@ -0,0 +1,6 @@
NLSR version 0.4.2
++++++++++++++++++
**Bug Fixes**:
- Fix segfault in scheduled erase of lsa segment (:issue:`4520`)
@@ -0,0 +1,14 @@
NLSR version 0.4.3
++++++++++++++++++
**Changes**:
- **breaking change** Change NLSR to nlsr for various prefixes (:issue:`4543`)
**Bug Fixes**:
- Fix dry-run mode not working (:issue:`4394`)
- Fix convergence w/o content store (:issue:`4430`)
- Register router prefix to fix remote requests (:issue:`4543`)
- Fix build with clang-5.0 (:issue:`4547`)
- Avoid misaligned memory access (:issue:`4609`)
@@ -0,0 +1,35 @@
NLSR version 0.5.0
++++++++++++++++++
**New Features**
- Set CanBePrefix to false on Hello Interest (:issue:`4581`)
- Optionally write prefixes to a copy of config file via nlsrc advertise (:issue:`4303`)
- Use SegmentPublisher utility from PSync to publish LSA data (:issue:`4760`)
- Add PSync as a dependency and switch it as default in conf file. (:issue:`4082`)
**Changes**
- Decouple classes from Nlsr object for easier unit testing (:issue:`1952`)
- Set sequence number file in SequencingManager constructor. (:issue:`4288`)
- Read conf file in test prefix update processor instead of static string (:issue:`3960`)
- Canonize FaceUri in conf file processor (:issue:`4817`)
- Remove redundant function "calculateHypDryRoutingTable" (:issue:`4811`)
- In dry run mode, print HR and LS routing table in nlsrc separately (:issue:`4452`)
- Fix ASan memory leaks in unit tests (:issue:`4682`)
- Systemd service files dependency corrections for Ubuntu 18.04 (:issue:`4594`)
**Bug Fixes**
- Fix processing of interest w/ segments for segmented LSA data (:issue:`4784`)
- Fib: don't refresh neighbor router's FIB entry (:issue:`4799`)
- Disable Interest filter loopback where ever not needed (:issue:`4768`)
- Avoid crash when ndn-cxx is compiled with tests by setting canBePrefix (:issue:`4691`)
- Make sure NLSR is not using any deprecated API (:issue:`4679`)
- Fix crash in equals operator of adjacency-list (:issue:`4705`)
- Fix error handling and normalize exit codes
**Miscellaneous**
- Improving documentation for NLSR
- A beginners' guide to installing and testing on Fedora
@@ -0,0 +1,15 @@
NLSR version 0.5.1
++++++++++++++++++
**Changes**
- Set best-route strategy for certificate prefixes (:issue:`4881`)
- Use ndn-cxx InMemoryStorage for LsaSegmentStorage (:issue:`4788`)
- Switch from ndn::EventId to ndn::scheduler::EventId (:issue:`4883`)
- Add FreshnessPeriod where MustBeFresh is used (:issue:`4913`)
**Bug Fixes**
- Fix canonization by resetting io service after each neighbor (:issue:`4872`)
- Disable network interest in while fetching NLSR certificate (:issue:`4879`)
@@ -0,0 +1,23 @@
NLSR version 0.5.2
++++++++++++++++++
**Breaking Changes**
The following breaking changes make this release incompatible with the previous version.
- Use PSync version 0.2.0, sync data compression in full sync is enabled by default (:issue:`5061`, :issue:`4917`)
- Use the floating point encoding/decoding functions for hyperbolic coordinates (:issue:`4615`)
**New Features**
- Handle zero cost links in Link State Routing (:issue:`4978`)
**Improvements and Bug Fixes**
- Remove support for old combined seq no file (:issue:`4143`)
- Sync common test infrastructure with ndn-cxx
- Refactor Certificate Storage class (:issue:`5075`)
- Avoid crashing NLSR if identity cannot be created
- Change init order to register sync routes after hello data has been verified (:issue:`5009`)
- Fix empty file creation if conf file is same as dynamic (:issue:`5071`)
- On face event notification, only proceed if face id was zero or updated (:issue:`4394`)
@@ -0,0 +1,12 @@
NLSR version 0.6.0
------------------
Improvements and bug fixes
^^^^^^^^^^^^^^^^^^^^^^^^^^
- *(breaking change)* Major changes in the TLV structure and classes. Reduced codebase size and
improved compilation times. LSA de/serialize functions are replaced by wireEncode/Decode.
Updated LSA wire formats and TLV assignments. Updated nlsrc to print using the new encoding.
(:issue:`4787`, :issue:`5116`)
- LSDB refactor: switch to ``boost::multi_index`` to replace 3 LSA lists (:issue:`4127`)
- Fix wrong reaction on hello Interest timeout (:issue:`5139`)
@@ -0,0 +1,44 @@
NLSR version 0.7.0
------------------
Release date: August 18, 2023
New features
^^^^^^^^^^^^
- Add experimental support for State Vector Sync (SVS) (:issue:`5248`)
- ``nlsrc``: Add an option to query the status from remote routers (:issue:`4544`)
Notable changes and improvements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- **Deprecate ChronoSync support**: ChronoSync support is now optional and excluded from the
default build; it remains available mainly for testing purposes (:issue:`5147`)
- Switched to the C++17 standard
- The minimum build requirements have been increased as follows:
- Either GCC >= 7.4.0 or Clang >= 6.0 is required on Linux
- On macOS, Xcode 11.3 or later is recommended; older versions may still work but are not
officially supported
- Boost >= 1.65.1 and ndn-cxx >= 0.8.1 are required on all platforms
- Sphinx 4.0 or later is required to build the documentation
- Refactor LSDB for readability and add signals to notify of modifications (:issue:`4127`)
- Retrieve LSA from the face that triggered the notification of LSA changes
- Accommodate certificate name in ``KeyLocator`` (:issue:`5195`)
- Change ``sig-type`` to ``ecdsa-sha256`` in ``nlsr.conf`` as ndn-cxx now has strict checking for it
- Improve error handling and reporting
- Stop using the ``gold`` linker on Linux; prefer instead linking with ``lld`` if installed
- Update waf build system to version 2.0.24
- Various test suite and documentation improvements
Bug fixes
^^^^^^^^^
- lsdb: Fix for issues involving incorrect retransmission behavior in segment fetcher
- Prevent NLSR from unregistering route during update for router that advertised it initially
(:issue:`5179`)
- NameLsa: fix LSDB update bug by sorting the NPLs before difference
- Fix recurring sync prefix registration on every hello data (:issue:`5157`)
- Return the appropriate exit codes when executing ``nlsrc`` advertise/withdraw commands
(:issue:`5271`)
+106
View File
@@ -0,0 +1,106 @@
All NLSR Releases
=================
.. toctree::
:glob:
:hidden:
:maxdepth: 1
:reversed:
release-notes/*
* **NLSR version 0.7.0**
(:doc:`Release Notes <release-notes/release-notes-0.7.0>`, `Documentation <https://docs.named-data.net/NLSR/0.7.0/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.7.0>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.7.0.tar.xz>`__ (`checksum <https://named-data.net/downloads/nlsr-0.7.0.tar.xz.sha256>`__)
* **NLSR version 0.6.0**
(:doc:`Release Notes <release-notes/release-notes-0.6.0>`, `Documentation <https://docs.named-data.net/NLSR/0.6.0/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.6.0>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.6.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.6.0.tar.bz2.sha256>`__)
* **NLSR version 0.5.2**
(:doc:`Release Notes <release-notes/release-notes-0.5.2>`, `Documentation <https://docs.named-data.net/NLSR/0.5.2/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.5.2>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.5.2.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.5.2.tar.bz2.sha256>`__)
* **NLSR version 0.5.1**
(:doc:`Release Notes <release-notes/release-notes-0.5.1>`, `Documentation <https://docs.named-data.net/NLSR/0.5.1/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.5.1>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.5.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.5.1.tar.bz2.sha256>`__)
* **NLSR version 0.5.0**
(:doc:`Release Notes <release-notes/release-notes-0.5.0>`, `Documentation <https://docs.named-data.net/NLSR/0.5.0/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.5.0>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.5.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.5.0.tar.bz2.sha256>`__)
* **NLSR version 0.4.3**
(:doc:`Release Notes <release-notes/release-notes-0.4.3>`, `Documentation <https://docs.named-data.net/NLSR/0.4.3/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.4.3>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.4.3.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.4.3.tar.bz2.sha256>`__)
* **NLSR version 0.4.2**
(:doc:`Release Notes <release-notes/release-notes-0.4.2>`, `Documentation <https://docs.named-data.net/NLSR/0.4.2/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.4.2>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.4.2.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.4.2.tar.bz2.sha256>`__)
* **NLSR version 0.4.1**
(:doc:`Release Notes <release-notes/release-notes-0.4.1>`, `Documentation <https://docs.named-data.net/NLSR/0.4.1/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.4.1>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.4.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.4.1.tar.bz2.sha256>`__)
* **NLSR version 0.4.0**
(:doc:`Release Notes <release-notes/release-notes-0.4.0>`, `Documentation <https://docs.named-data.net/NLSR/0.4.0/>`__)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.4.0>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.4.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.4.0.tar.bz2.sha256>`__)
* **NLSR version 0.3.2**
(:doc:`Release Notes <release-notes/release-notes-0.3.2>`)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.3.2>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.3.2.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.3.2.tar.bz2.sha256>`__)
* **NLSR version 0.3.1**
(:doc:`Release Notes <release-notes/release-notes-0.3.1>`)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.3.1>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.3.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.3.1.tar.bz2.sha256>`__)
* **NLSR version 0.3.0**
(:doc:`Release Notes <release-notes/release-notes-0.3.0>`)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.3.0>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.3.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.3.0.tar.bz2.sha256>`__)
* **NLSR version 0.2.2**
(:doc:`Release Notes <release-notes/release-notes-0.2.2>`)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.2.2>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.2.2.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.2.2.tar.bz2.sha256>`__)
* **NLSR version 0.2.1**
(:doc:`Release Notes <release-notes/release-notes-0.2.1>`)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.2.1>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.2.1.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.2.1.tar.bz2.sha256>`__)
* **NLSR version 0.2.0**
(:doc:`Release Notes <release-notes/release-notes-0.2.0>`)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.2.0>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.2.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.2.0.tar.bz2.sha256>`__)
* **NLSR version 0.1.0**
(:doc:`Release Notes <release-notes/release-notes-0.1.0>`)
`src (git) <https://github.com/named-data/NLSR/releases/tag/NLSR-0.1.0>`__,
`src (tarball) <https://named-data.net/downloads/nlsr-0.1.0.tar.bz2>`__ (`checksum <https://named-data.net/downloads/nlsr-0.1.0.tar.bz2.sha256>`__)
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

-11
View File
@@ -1,11 +0,0 @@
log4j.rootLogger=DEBUG, Rolling
log4j.appender.Rolling=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.Rolling.File=/tmp/testnlsrproperties.log
log4j.appender.Rolling.MaxSize=1MB
log4j.appender.Rolling.MaxBackupIndex=10
log4j.appender.Rolling.layout=PatternLayout
log4j.appender.Rolling.layout.ContextPrinting=enabled
log4j.appender.Rolling.layout.DateFormat=ISO8601
log4j.appender.Rolling.layout.ConversionPattern=%date{yyyyMMddHHmmssSSS} %p: [%c] %m%n
+75 -49
View File
@@ -4,14 +4,14 @@ general
{
; mandatory configuration command section network, site and router
network /ndn/ ; name of the network the router belongs to in ndn URI format
network /ndn ; name of the network the router belongs to in ndn URI format
site /edu/memphis ; name of the site the router belongs to in ndn URI format
router /%C1.Router/cs/pollux ; name of the router in ndn URI format
; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs
lsa-refresh-time 1800 ; default value 1800. Valid values 240-7200
; router-dead-interval is the time in seconds after which an inactive router's
; router-dead-interval is the time in seconds after which an inactive routers
; LSAs are removed
;router-dead-interval 3600 ; default value: 2*lsa-refresh-time. Value must be larger
; than lsa-refresh-time
@@ -19,27 +19,16 @@ general
; InterestLifetime (in seconds) for LSA fetching
lsa-interest-lifetime 4 ; default value 4. Valid values 1-60
; log-level is used to set the logging level for NLSR.
; All debugging levels listed above the selected value are enabled.
;
; Valid values:
;
; NONE ; no messages
; ERROR ; error messages
; WARN ; warning messages
; INFO ; informational messages (default)
; DEBUG ; debugging messages
; TRACE ; trace messages (most verbose)
; ALL ; all messages
; select sync protocol: chronosync / psync / svs
sync-protocol psync
log-level INFO
; sync interest lifetime of ChronoSync/PSync in milliseconds
sync-interest-lifetime 60000 ; default value 60000. Valid values 1000-120,000
log-dir /var/log/nlsr/ ; path for log directory (Absolute path)
seq-dir /var/lib/nlsr/ ; path for sequence directory (Absolute path)
;log4cxx-conf /path/to/log4cxx-conf ; path for log4cxx configuration file (Absolute path)
state-dir /var/lib/nlsr ; path for intermediate state files including sequence directory (Absolute path)
}
; the neighbors section contains the configuration for router's neighbors and hello's behavior
; the neighbors section contains the configuration for router's neighbors and hello protocol behavior
neighbors
{
@@ -49,7 +38,7 @@ neighbors
hello-retries 3 ; interest retries number in integer. Default value 3
; valid values 1-10
hello-timeout 1 ; interest time out value in integer. Default value 1
hello-timeout 1 ; interest time out value in seconds. Default value 1
; Valid values 1-15
hello-interval 60 ; interest sending interval in seconds. Default value 60
@@ -58,12 +47,17 @@ neighbors
; adj-lsa-build-interval is the time to wait in seconds after an Adjacency LSA build is scheduled
; before actually building the Adjacency LSA
adj-lsa-build-interval 5 ; default value 5. Valid values 0-5. It is recommended that
; adj-lsa-build-interval have a lower value than routing-calc-interval
adj-lsa-build-interval 10 ; default value 10. Valid values 5-30.
; first-hello-interval is the time to wait in seconds before sending the first Hello Interest
face-dataset-fetch-tries 3 ; default is 3. Valid values 1-10. The FaceDataset is
; gotten from NFD, and is needed to configure NLSR
; correctly. It is recommended not to set this
; variable too high, because it could cause
; congestion for NFD.
first-hello-interval 10 ; Default value 10. Valid values 0-10
face-dataset-fetch-interval 3600 ; default is 3600. Valid values 1800-5400.
; This controls how often (in seconds) NLSR will attempt to
; fetch a FaceStatus dataset from NFD.
; neighbor command is used to configure router's neighbor. Each neighbor will need
; one block of neighbor command
@@ -101,11 +95,11 @@ hyperbolic
radius 123.456 ; radius of the router in hyperbolic coordinate system
angle 1.45 ; angle of the router in hyperbolic coordinate system
angle 1.45,2.36 ; angle of the router in hyperbolic coordinate system
}
; the fib section is used to configure fib entry's type to ndn FIB updated by NLSR
; the fib section is used to configure fib entrys type to ndn FIB updated by NLSR
fib
{
@@ -140,26 +134,26 @@ security
{
rule
{
id "NSLR Hello Rule"
id "NLSR Hello Rule"
for data
filter
{
type name
regex ^[^<NLSR><INFO>]*<NLSR><INFO><><>$
regex ^[^<nlsr><INFO>]*<nlsr><INFO><><>$
}
checker
{
type customized
sig-type rsa-sha256
sig-type ecdsa-sha256
key-locator
{
type name
hyper-relation
{
k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><ksk-.*><ID-CERT>$
k-regex ^([^<KEY><nlsr>]*)<nlsr><KEY><>{1,3}$
k-expand \\1
h-relation equal
p-regex ^([^<NLSR><INFO>]*)<NLSR><INFO><><>$
p-regex ^([^<nlsr><INFO>]*)<nlsr><INFO><><>$
p-expand \\1
}
}
@@ -168,26 +162,27 @@ security
rule
{
id "NSLR LSA Rule"
id "NLSR LSA Rule"
for data
filter
{
type name
regex ^[^<NLSR><LSA>]*<NLSR><LSA>
regex ^[^<nlsr><LSA>]*<nlsr><LSA>
}
checker
{
type customized
sig-type rsa-sha256
sig-type ecdsa-sha256
key-locator
{
type name
hyper-relation
{
k-regex ^([^<KEY><NLSR>]*)<NLSR><KEY><ksk-.*><ID-CERT>$
k-regex ^([^<KEY><nlsr>]*)<nlsr><KEY><>{1,3}$
k-expand \\1
h-relation equal
p-regex ^([^<NLSR><LSA>]*)<NLSR><LSA>(<>*)<><><>$
; the last four components in the prefix should be <lsaType><seqNo><version><segmentNo>
p-regex ^<localhop>([^<nlsr><LSA>]*)<nlsr><LSA>(<>*)<><><><>$
p-expand \\1\\2
}
}
@@ -196,26 +191,26 @@ security
rule
{
id "NSLR Hierarchy Exception Rule"
id "NLSR datasets"
for data
filter
{
type name
regex ^[^<KEY><%C1.Router>]*<%C1.Router>[^<KEY><NLSR>]*<KEY><ksk-.*><ID-CERT><>$
regex ^[^<nlsr>]*<nlsr>[<lsdb><routing-table>]
}
checker
{
type customized
sig-type rsa-sha256
sig-type ecdsa-sha256
key-locator
{
type name
hyper-relation
{
k-regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><ksk-.*><ID-CERT>$
k-regex ^([^<KEY>]*)<KEY><>{1,3}$ ; router key or certificate
k-expand \\1
h-relation equal
p-regex ^([^<KEY><%C1.Router>]*)<%C1.Router>[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
p-regex ^([^<nlsr>]*)<nlsr>[<lsdb><routing-table>]
p-expand \\1
}
}
@@ -224,17 +219,45 @@ security
rule
{
id "NSLR Hierarchical Rule"
id "NLSR Hierarchy Exception Rule"
for data
filter
{
type name
regex ^[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
regex ^[^<KEY><%C1.Router>]*<%C1.Router>[^<KEY><nlsr>]*<KEY><><><>$
}
checker
{
type customized
sig-type ecdsa-sha256
key-locator
{
type name
hyper-relation
{
k-regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><>{1,3}$
k-expand \\1
h-relation equal
p-regex ^([^<KEY><%C1.Router>]*)<%C1.Router>[^<KEY>]*<KEY><><><>$
p-expand \\1
}
}
}
}
rule
{
id "NLSR Hierarchical Rule"
for data
filter
{
type name
regex ^[^<KEY>]*<KEY><><><>$
}
checker
{
type hierarchical
sig-type rsa-sha256
sig-type ecdsa-sha256
}
}
@@ -254,16 +277,18 @@ security
filter
{
type name
regex ^<localhost><nlsr><prefix-update>[<advertise><withdraw>]<>$
; /<prefix>/<management-module>/<command-verb>/<control-parameters>
; /<timestamp>/<random-value>/<signed-interests-components>
regex ^<localhost><nlsr><prefix-update>[<advertise><withdraw>]<><><>$
}
checker
{
type customized
sig-type rsa-sha256
sig-type ecdsa-sha256
key-locator
{
type name
regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><ksk-.*><ID-CERT>$
regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><>{1,3}$
}
}
}
@@ -275,12 +300,12 @@ security
filter
{
type name
regex ^[^<KEY>]*<KEY><ksk-.*><ID-CERT><>$
regex ^[^<KEY>]*<KEY><><><>$
}
checker
{
type hierarchical
sig-type rsa-sha256
sig-type ecdsa-sha256
}
}
@@ -290,6 +315,7 @@ security
file-name "site.cert"
}
}
; cert-to-publish "root.cert" ; optional, a file containing the root certificate
; Only the router that is designated to publish the root cert
; needs to specify this
-3
View File
@@ -1,3 +0,0 @@
nsync is a copy of ChronoSync (https://github.com/bruinfish/ChronoSync/tree/master).
ChonoSync's license is GPL2.
-15
View File
@@ -1,15 +0,0 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2014 University of Memphis,
* Regents of the University of California
*
* See COPYING.md for copyright and distribution information.
*/
// suppress Boost::archive warnings
#pragma GCC system_header
#pragma clang system_header
#include <boost/archive/iterators/transform_width.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/archive/iterators/dataflow_exception.hpp>
-21
View File
@@ -1,21 +0,0 @@
#ifndef NSYNC_OPENSSL_H
#define NSYNC_OPENSSL_H
// suppress deprecation warnings in OSX >= 10.7
#if defined(__APPLE__)
#ifdef __clang__
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif // __clang__
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif // __GNUC__
#endif
#include <openssl/evp.h>
#endif // NSYNC_OPENSSL_H
-49
View File
@@ -1,49 +0,0 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2014 University of Memphis,
* Regents of the University of California
*
* This file is part of NLSR (Named-data Link State Routing).
* See AUTHORS.md for complete list of NLSR authors and contributors.
*
* NLSR is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef NSYNC_SYNC_COMMON_HPP
#define NSYNC_SYNC_COMMON_HPP
#include <boost/exception/all.hpp>
#include <ndn-cxx/common.hpp>
#include <tuple>
namespace Sync {
using std::bind;
using std::function;
using std::make_shared;
using std::shared_ptr;
using std::weak_ptr;
using std::dynamic_pointer_cast;
using std::static_pointer_cast;
using std::tuple;
using std::make_tuple;
using std::tie;
} // namespace Sync
#endif // NSYNC_SYNC_COMMON_HPP
-74
View File
@@ -1,74 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-diff-leaf.h"
#include <boost/throw_exception.hpp>
typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info;
using namespace Sync::Error;
namespace Sync {
DiffLeaf::DiffLeaf (NameInfoConstPtr info, const SeqNo &seq)
: Leaf (info, seq)
, m_op (UPDATE)
{
}
DiffLeaf::DiffLeaf (NameInfoConstPtr info)
: Leaf (info, SeqNo (0,0))
, m_op (REMOVE)
{
}
std::ostream &
operator << (std::ostream &os, Operation op)
{
switch (op)
{
case UPDATE:
os << "update";
break;
case REMOVE:
os << "remove";
break;
}
return os;
}
std::istream &
operator >> (std::istream &is, Operation &op)
{
std::string operation;
is >> operation;
if (operation == "update")
op = UPDATE;
else if (operation == "remove")
op = REMOVE;
else
BOOST_THROW_EXCEPTION (SyncDiffLeafOperationParseError () << errmsg_info (operation));
return is;
}
}
-91
View File
@@ -1,91 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_DIFF_LEAF_H
#define SYNC_DIFF_LEAF_H
#include "sync-leaf.h"
#include <boost/exception/all.hpp>
namespace Sync {
/**
* @ingroup sync
* @brief Annotation for SYNC leaf
*/
enum Operation
{
UPDATE, ///< @brief Leaf was added or updated
REMOVE ///< @brief Leaf was removed
};
/**
* @ingroup sync
* @brief Annotated SYNC leaf
*/
class DiffLeaf : public Leaf
{
public:
/**
* @brief Constructor to create an UPDATE diff leaf
* @param info Smart pointer to leaf's name
* @param seq Initial sequence number of the pointer
*/
DiffLeaf (NameInfoConstPtr info, const SeqNo &seq);
/**
* @brief Constructor to create an REMOVE diff leaf
* @param info Smart pointer to leaf's name
*
* This constructor creates a leaf with phony sequence number
* with 0 session ID and 0 sequence number
*/
DiffLeaf (NameInfoConstPtr info);
virtual ~DiffLeaf () { }
/**
* @brief Get diff leaf type
*/
Operation
getOperation () const { return m_op; }
private:
Operation m_op;
};
typedef shared_ptr<DiffLeaf> DiffLeafPtr;
typedef shared_ptr<const DiffLeaf> DiffLeafConstPtr;
std::ostream &
operator << (std::ostream &os, Operation op);
std::istream &
operator >> (std::istream &is, Operation &op);
namespace Error {
struct SyncDiffLeafOperationParseError : virtual boost::exception, virtual std::exception { };
} // Error
} // Sync
#endif // SYNC_DIFF_LEAF_H
-72
View File
@@ -1,72 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_DIFF_STATE_CONTAINER_H
#define SYNC_DIFF_STATE_CONTAINER_H
#include "sync-diff-state.h"
#include "sync-digest.h"
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/tag.hpp>
// #include <boost/multi_index/ordered_index.hpp>
// #include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
// #include <boost/multi_index/random_access_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/mem_fun.hpp>
namespace mi = boost::multi_index;
namespace Sync {
/// @cond include_hidden
struct sequenced { };
struct timed { };
/// @endcond
/**
* \ingroup sync
* @brief Container for differential states
*/
struct DiffStateContainer : public mi::multi_index_container<
DiffStatePtr,
mi::indexed_by<
// For fast access to elements using DiffState hashes
mi::hashed_unique<
mi::tag<hashed>,
mi::const_mem_fun<DiffState, DigestConstPtr, &DiffState::getDigest>,
DigestPtrHash,
DigestPtrEqual
>
,
// sequenced index to access older/newer element (like in list)
mi::sequenced<mi::tag<sequenced> >
>
>
{
};
} // Sync
#endif // SYNC_DIFF_STATE_CONTAINER_H
-98
View File
@@ -1,98 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-diff-state.h"
#include "sync-diff-leaf.h"
#include <boost/foreach.hpp>
#include <boost/assert.hpp>
namespace Sync {
DiffState::DiffState ()
{
}
DiffState::~DiffState ()
{
}
DiffStatePtr
DiffState::diff () const
{
DiffStatePtr ret = make_shared<DiffState> ();
DiffStatePtr state = m_next;
while (state != 0)
{
*ret += *state;
state = state->m_next;
}
return ret;
}
DiffState &
DiffState::operator += (const DiffState &state)
{
BOOST_FOREACH (LeafConstPtr _leaf, state.getLeaves ())
{
DiffLeafConstPtr leaf = dynamic_pointer_cast<const DiffLeaf> (_leaf);
BOOST_ASSERT (leaf != 0);
if (leaf->getOperation () == UPDATE)
update (leaf->getInfo (), leaf->getSeq ());
else if (leaf->getOperation () == REMOVE)
remove (leaf->getInfo ());
else
{
BOOST_ASSERT (false);
}
}
return *this;
}
// from State
tuple<bool/*inserted*/, bool/*updated*/, SeqNo/*oldSeqNo*/>
DiffState::update (NameInfoConstPtr info, const SeqNo &seq)
{
m_leaves.erase (info);
DiffLeafPtr leaf = make_shared<DiffLeaf> (info, seq);
m_leaves.insert (leaf);
return make_tuple (true, false, SeqNo ());
}
bool
DiffState::remove (NameInfoConstPtr info)
{
m_leaves.erase (info);
DiffLeafPtr leaf = make_shared<DiffLeaf> (info);
m_leaves.insert (leaf);
return true;
}
} // ns3
-102
View File
@@ -1,102 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_DIFF_STATE_H
#define SYNC_DIFF_STATE_H
#include "sync-state.h"
#include <iostream>
namespace Sync {
class DiffState;
typedef shared_ptr<DiffState> DiffStatePtr;
typedef shared_ptr<DiffState> DiffStateConstPtr;
/**
* @ingroup ccnx
* @brief Differential SYNC state
*/
class DiffState : public State
{
public:
/**
* @see Default constructor
*/
DiffState ();
virtual ~DiffState ();
/**
* @brief Set successor for the diff state
* @param next successor state
*/
void
setNext (DiffStatePtr next)
{
m_next = next;
}
/**
* @brief Set digest for the diff state (obtained from a corresponding full state)
* @param digest A read only smart pointer to a digest object (that should be unmodified anywhere else)
*/
void
setDigest (DigestConstPtr digest) { m_digest = digest; }
/**
* @brief Get digest for the diff state
*/
DigestConstPtr
getDigest () const { return m_digest; }
/**
* @brief Accumulate differences from `this' state to the most current state
* @returns Accumulated differences from `this' state to the most current state
*/
DiffStatePtr
diff () const;
/**
* @brief Combine differences from `this' and `state'
* @param state Differential state to combine with
* @return Combined differences
*
* In case of collisions, `this' leaf will be replaced with the leaf of `state'
*/
DiffState&
operator += (const DiffState &state);
// from State
virtual tuple<bool/*inserted*/, bool/*updated*/, SeqNo/*oldSeqNo*/>
update (NameInfoConstPtr info, const SeqNo &seq);
virtual bool
remove (NameInfoConstPtr info);
private:
DiffStatePtr m_next;
DigestConstPtr m_digest;
};
} // Sync
#endif // SYNC_DIFF_STATE_H
-262
View File
@@ -1,262 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-digest.h"
#include <string.h>
#include <boost/assert.hpp>
#include <boost/throw_exception.hpp>
typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str;
typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int;
// for printing, may be disabled in optimized build
// #ifdef DIGEST_BASE64
// #include <boost/archive/iterators/base64_from_binary.hpp>
// #include <boost/archive/iterators/binary_from_base64.hpp>
// #endif
#include "boost-archive.h"
using namespace boost;
using namespace boost::archive::iterators;
using namespace std;
// Other options: VP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_sha256, EVP_dss, EVP_dss1, EVP_mdc2, EVP_ripemd160
#define HASH_FUNCTION EVP_sha256
#define HASH_FUNCTION_LEN 32
// #ifndef DIGEST_BASE64
template<class CharType>
struct hex_from_4_bit
{
typedef CharType result_type;
CharType operator () (CharType ch) const
{
const char *lookup_table = "0123456789abcdef";
// cout << "New character: " << (int) ch << " (" << (char) ch << ")" << "\n";
BOOST_ASSERT (ch < 16);
return lookup_table[static_cast<size_t>(ch)];
}
};
typedef transform_iterator<hex_from_4_bit<std::vector<uint8_t>::const_iterator::value_type>,
transform_width<std::vector<uint8_t>::const_iterator, 4, 8, std::vector<uint8_t>::const_iterator::value_type> > string_from_binary;
template<class CharType>
struct hex_to_4_bit
{
typedef CharType result_type;
CharType operator () (CharType ch) const
{
const signed char lookup_table [] = {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
};
// cout << "New character: " << hex << (int) ch << " (" << (char) ch << ")" << "\n";
signed char value = -1;
if ((unsigned)ch < 128)
value = lookup_table [(unsigned)ch];
if (value == -1)
BOOST_THROW_EXCEPTION (Sync::Error::DigestCalculationError () << errmsg_info_int ((int)ch));
return value;
}
};
typedef transform_width<transform_iterator<hex_to_4_bit<string::const_iterator::value_type>, string::const_iterator>, 8, 4> string_to_binary;
namespace Sync {
Digest::Digest ()
{
m_context = EVP_MD_CTX_create ();
reset ();
}
Digest::~Digest ()
{
EVP_MD_CTX_destroy (m_context);
}
bool
Digest::empty () const
{
return m_buffer.empty ();
}
bool
Digest::isZero () const
{
if (m_buffer.empty ())
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Digest has not been yet finalized"));
return (m_buffer.size () == 1 && m_buffer[0] == 0);
}
void
Digest::reset ()
{
m_buffer.clear ();
int ok = EVP_DigestInit_ex (m_context, HASH_FUNCTION (), 0);
if (!ok)
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("EVP_DigestInit_ex returned error")
<< errmsg_info_int (ok));
}
void
Digest::finalize ()
{
if (!m_buffer.empty ()) return;
m_buffer.resize (HASH_FUNCTION_LEN);
unsigned int tmp;
int ok = EVP_DigestFinal_ex (m_context,
&m_buffer[0], &tmp);
if (!ok)
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("EVP_DigestFinal_ex returned error")
<< errmsg_info_int (ok));
}
std::size_t
Digest::getHash () const
{
if (isZero ()) return 0;
if (sizeof (std::size_t) > m_buffer.size ())
{
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Hash is not zero and length is less than size_t")
<< errmsg_info_int (m_buffer.size ()));
}
// just getting first sizeof(std::size_t) bytes
// not ideal, but should work pretty well
return *(reinterpret_cast<const std::size_t*> (&m_buffer[0]));
}
bool
Digest::operator == (const Digest &digest) const
{
if (m_buffer.empty ())
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Digest1 is empty"));
if (digest.m_buffer.empty ())
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Digest2 is empty"));
return m_buffer == digest.m_buffer;
}
void
Digest::update (const uint8_t *buffer, size_t size)
{
// cout << "Update: " << (void*)buffer << " / size: " << size << "\n";
// cannot update Digest when it has been finalized
if (!m_buffer.empty ())
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Digest has been already finalized"));
bool ok = EVP_DigestUpdate (m_context, buffer, size);
if (!ok)
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("EVP_DigestUpdate returned error")
<< errmsg_info_int (ok));
}
Digest &
Digest::operator << (const Digest &src)
{
if (src.m_buffer.empty ())
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Digest has not been yet finalized"));
update (&src.m_buffer[0], src.m_buffer.size ());
return *this;
}
std::ostream &
operator << (std::ostream &os, const Digest &digest)
{
BOOST_ASSERT (!digest.m_buffer.empty ());
ostreambuf_iterator<char> out_it (os); // ostream iterator
// need to encode to base64
copy (string_from_binary (digest.m_buffer.begin ()),
string_from_binary (digest.m_buffer.end ()),
out_it);
return os;
}
std::istream &
operator >> (std::istream &is, Digest &digest)
{
string str;
is >> str; // read string first
if (str.size () == 0)
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Input is empty"));
// uint8_t padding = (3 - str.size () % 3) % 3;
// for (uint8_t i = 0; i < padding; i++) str.push_back ('=');
// only empty digest object can be used for reading
if (!digest.m_buffer.empty ())
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Digest has been already finalized"));
digest.m_buffer.clear ();
copy (string_to_binary (str.begin ()),
string_to_binary (str.end ()),
std::back_inserter (digest.m_buffer));
return is;
}
} // Sync
-199
View File
@@ -1,199 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_DIGEST_H
#define SYNC_DIGEST_H
#include "sync-common.h"
#include <vector>
#include "openssl.h"
namespace Sync {
/**
* @ingroup sync
* @brief A simple wrapper for libcrypto hash functions
*/
class Digest
{
public:
/**
* @brief Default constructor. Will initialize internal libssl structures
*/
Digest ();
/**
* @brief Check if digest is empty
*/
bool
empty () const;
/**
* @brief Reset digest to the initial state
*/
void
reset ();
/**
* @brief Destructor
*/
~Digest ();
/**
* @brief Obtain a short version of the hash (just first sizeof(size_t) bytes
*
* Side effect: finalize() will be called on `this'
*/
std::size_t
getHash () const;
/**
* @brief Finalize digest. All subsequent calls to "operator <<" will fire an exception
*/
void
finalize ();
/**
* @brief Compare two full digests
*
* Side effect: Finalize will be called on `this' and `digest'
*/
bool
operator == (const Digest &digest) const;
bool
operator != (const Digest &digest) const
{ return ! (*this == digest); }
/**
* @brief Add existing digest to digest calculation
* @param src digest to combine with
*
* The result of this combination is hash (hash (...))
*/
Digest &
operator << (const Digest &src);
/**
* @brief Add string to digest calculation
* @param str string to put into digest
*/
inline Digest &
operator << (const std::string &str);
/**
* @brief Add uint64_t value to digest calculation
* @param value uint64_t value to put into digest
*/
inline Digest &
operator << (uint64_t value);
/**
* @brief Checks if the stored hash is zero-root hash
*
* Zero-root hash is a valid hash that optimally represents an empty state
*/
bool
isZero () const;
private:
Digest &
operator = (Digest &digest) { (void)digest; return *this; }
/**
* @brief Add size bytes of buffer to the hash
*/
void
update (const uint8_t *buffer, size_t size);
friend std::ostream &
operator << (std::ostream &os, const Digest &digest);
friend std::istream &
operator >> (std::istream &is, Digest &digest);
private:
EVP_MD_CTX *m_context;
std::vector<uint8_t> m_buffer;
};
namespace Error {
struct DigestCalculationError : virtual boost::exception, virtual std::exception { };
}
typedef shared_ptr<Digest> DigestPtr;
typedef shared_ptr<const Digest> DigestConstPtr;
Digest &
Digest::operator << (const std::string &str)
{
update (reinterpret_cast<const uint8_t*> (str.c_str ()), str.size ());
return *this;
}
inline Digest &
Digest::operator << (uint64_t value)
{
update (reinterpret_cast<const uint8_t*> (&value), sizeof (uint64_t));
return *this;
}
std::ostream &
operator << (std::ostream &os, const Digest &digest);
std::istream &
operator >> (std::istream &is, Digest &digest);
// template<class INT>
// Digest &
// Digest::operator << (INT value)
// {
// update (&value, sizeof (INT));
// return *this;
// }
struct DigestPtrHash : public std::unary_function<Digest, std::size_t>
{
std::size_t
operator() (DigestConstPtr digest) const
{
// std::cout << "digest->getHash: " << digest->getHash () << " (" << *digest << ")" << std::endl;
return digest->getHash ();
}
};
struct DigestPtrEqual : public std::unary_function<Digest, std::size_t>
{
bool
operator() (DigestConstPtr digest1, DigestConstPtr digest2) const
{
// std::cout << boost::cref(*digest1) << " == " << boost::cref(*digest2) << " : " << (*digest1 == *digest2) << std::endl;
return *digest1 == *digest2;
}
};
} // Sync
#endif // SYNC_DIGEST_H
-35
View File
@@ -1,35 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_EVENT_H
#define SYNC_EVENT_H
#include "sync-common.h"
namespace Sync
{
typedef function< void ( ) > Event;
} // Sync
#endif // SYNC_EVENT_H
-49
View File
@@ -1,49 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-full-leaf.h"
namespace Sync {
FullLeaf::FullLeaf (NameInfoConstPtr info, const SeqNo &seq)
: Leaf (info, seq)
{
updateDigest ();
}
void
FullLeaf::updateDigest ()
{
m_digest.reset ();
m_digest << getInfo ()->getDigest () << *getSeq ().getDigest ();
m_digest.finalize ();
}
// from Leaf
void
FullLeaf::setSeq (const SeqNo &seq)
{
Leaf::setSeq (seq);
updateDigest ();
}
} // Sync
-71
View File
@@ -1,71 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_FULL_LEAF_H
#define SYNC_FULL_LEAF_H
#include "sync-leaf.h"
namespace Sync {
/**
* @ingroup sync
* @brief SYNC leaf for the full state (with support of Digest calculation)
*/
class FullLeaf : public Leaf
{
public:
/**
* @brief Constructor to create an UPDATE diff leaf
* @param info Smart pointer to leaf's name
* @param seq Initial sequence number of the pointer
*/
FullLeaf (NameInfoConstPtr info, const SeqNo &seq);
virtual ~FullLeaf () { }
/**
* @brief Get hash digest of the leaf
*
* The underlying Digest object is recalculated on every update or removal
* (including updates of child classes)
*/
const Digest &
getDigest () const { return m_digest; }
// from Leaf
virtual void
setSeq (const SeqNo &seq);
private:
void
updateDigest ();
private:
Digest m_digest;
};
typedef shared_ptr<FullLeaf> FullLeafPtr;
typedef shared_ptr<const FullLeaf> FullLeafConstPtr;
} // Sync
#endif // SYNC_FULL_LEAF_H
-118
View File
@@ -1,118 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-full-state.h"
#include <boost/assert.hpp>
#include "sync-full-leaf.h"
namespace Sync {
FullState::FullState ()
// m_lastUpdated is initialized to "not_a_date_time" in normal lib mode and to "0" time in NS-3 mode
{
}
FullState::~FullState ()
{
}
ndn::time::system_clock::Duration
FullState::getTimeFromLastUpdate () const
{
return ndn::time::system_clock::now() - m_lastUpdated;
}
DigestConstPtr
FullState::getDigest ()
{
if (!m_digest)
{
m_digest = make_shared<Digest> ();
if (m_leaves.get<ordered> ().size () > 0)
{
for (LeafConstPtr leaf : m_leaves.get<ordered> ())
{
FullLeafConstPtr fullLeaf = dynamic_pointer_cast<const FullLeaf> (leaf);
BOOST_ASSERT (fullLeaf != 0);
*m_digest << fullLeaf->getDigest ();
}
m_digest->finalize ();
}
else
{
std::istringstream is ("00"); //zero state
is >> *m_digest;
}
}
return m_digest;
}
// from State
tuple<bool/*inserted*/, bool/*updated*/, SeqNo/*oldSeqNo*/>
FullState::update (NameInfoConstPtr info, const SeqNo &seq)
{
m_lastUpdated = ndn::time::system_clock::now();
m_digest.reset ();
LeafContainer::iterator item = m_leaves.find (info);
if (item == m_leaves.end ())
{
m_leaves.insert (make_shared<FullLeaf> (info, seq));
return make_tuple (true, false, SeqNo ());
}
else
{
if ((*item)->getSeq () == seq || seq < (*item)->getSeq ())
{
return make_tuple (false, false, SeqNo ());
}
SeqNo old = (*item)->getSeq ();
m_leaves.modify (item, [&seq](LeafPtr data){ data->setSeq(seq); });
return make_tuple (false, true, old);
}
}
bool
FullState::remove (NameInfoConstPtr info)
{
m_lastUpdated = ndn::time::system_clock::now();
m_digest.reset ();
LeafContainer::iterator item = m_leaves.find (info);
if (item != m_leaves.end ())
{
m_leaves.erase (item);
return true;
}
else
return false;
}
} // Sync
-79
View File
@@ -1,79 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_FULL_STATE_H
#define SYNC_FULL_STATE_H
#include <ndn-cxx/util/time.hpp>
#include "sync-state.h"
namespace Sync {
class FullState;
typedef shared_ptr<FullState> FullStatePtr;
typedef shared_ptr<FullState> FullStateConstPtr;
/**
* \ingroup sync
* @brief Cumulative SYNC state
*/
class FullState : public State
{
public:
/**
* @brief Default constructor
*/
FullState ();
virtual ~FullState ();
/**
* @brief Get time period since last state update
*
* This value can be used to randomize reconciliation waiting time in SyncApp
*/
ndn::time::system_clock::Duration
getTimeFromLastUpdate () const;
/**
* @brief Obtain a read-only copy of the digest
*
* If m_digest is 0, then it is automatically created. On every update and removal, m_digest is reset to 0
*/
DigestConstPtr
getDigest ();
// from State
virtual tuple<bool/*inserted*/, bool/*updated*/, SeqNo/*oldSeqNo*/>
update (NameInfoConstPtr info, const SeqNo &seq);
virtual bool
remove (NameInfoConstPtr info);
private:
ndn::time::system_clock::TimePoint m_lastUpdated; ///< @brief Time when state was updated last time
DigestPtr m_digest;
};
} // Sync
#endif // SYNC_STATE_H
-99
View File
@@ -1,99 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_INTEREST_CONTAINER_H
#define SYNC_INTEREST_CONTAINER_H
#include <ndn-cxx/util/time.hpp>
#include "sync-digest.h"
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/tag.hpp>
// #include <boost/multi_index/ordered_index.hpp>
// #include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
// #include <boost/multi_index/random_access_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/mem_fun.hpp>
namespace mi = boost::multi_index;
namespace Sync {
struct Interest
{
Interest (DigestConstPtr digest, const std::string &name, bool unknown=false)
: m_digest (digest)
, m_name (name)
, m_time (ndn::time::system_clock::now())
, m_unknown (unknown)
{
}
DigestConstPtr m_digest;
std::string m_name;
ndn::time::system_clock::TimePoint m_time;
bool m_unknown;
};
/// @cond include_hidden
struct named { };
struct hashed;
struct timed;
/// @endcond
/**
* \ingroup sync
* @brief Container for interests (application PIT)
*/
struct InterestContainer : public mi::multi_index_container<
Interest,
mi::indexed_by<
mi::hashed_unique<
mi::tag<named>,
BOOST_MULTI_INDEX_MEMBER(Interest, std::string, m_name)
>
,
mi::hashed_non_unique<
mi::tag<hashed>,
BOOST_MULTI_INDEX_MEMBER(Interest, DigestConstPtr, m_digest),
DigestPtrHash,
DigestPtrEqual
>
,
mi::ordered_non_unique<
mi::tag<timed>,
BOOST_MULTI_INDEX_MEMBER(Interest, ndn::time::system_clock::TimePoint, m_time)
>
>
>
{
};
} // Sync
#endif // SYNC_INTEREST_CONTAINER_H
-126
View File
@@ -1,126 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-interest-table.h"
#include "sync-logging.h"
using namespace std;
INIT_LOGGER("SyncInterestTable");
namespace Sync
{
SyncInterestTable::SyncInterestTable(boost::asio::io_service& io, ndn::time::system_clock::Duration lifetime)
: m_entryLifetime(lifetime)
, m_scheduler(io)
{
m_scheduler.scheduleEvent(ndn::time::seconds(4),
ndn::bind(&SyncInterestTable::expireInterests, this));
}
SyncInterestTable::~SyncInterestTable()
{
}
Interest
SyncInterestTable::pop()
{
if (m_table.size() == 0)
BOOST_THROW_EXCEPTION(Error::InterestTableIsEmpty());
Interest ret = *m_table.begin();
m_table.erase(m_table.begin());
return ret;
}
bool
SyncInterestTable::insert(DigestConstPtr digest, const string &name, bool unknownState/*=false*/)
{
bool existent = false;
InterestContainer::index<named>::type::iterator it = m_table.get<named>().find(name);
if (it != m_table.end())
{
existent = true;
m_table.erase(it);
}
m_table.insert(Interest(digest, name, unknownState));
return existent;
}
uint32_t
SyncInterestTable::size() const
{
return m_table.size();
}
bool
SyncInterestTable::remove(const string &name)
{
InterestContainer::index<named>::type::iterator item = m_table.get<named>().find(name);
if (item != m_table.get<named>().end())
{
m_table.get<named>().erase(name);
return true;
}
return false;
}
bool
SyncInterestTable::remove(DigestConstPtr digest)
{
InterestContainer::index<hashed>::type::iterator item = m_table.get<hashed>().find(digest);
if (item != m_table.get<hashed>().end())
{
m_table.get<hashed>().erase(digest); // erase all records associated with the digest
return true;
}
return false;
}
void SyncInterestTable::expireInterests()
{
uint32_t count = 0;
ndn::time::system_clock::TimePoint expireTime = ndn::time::system_clock::now() - m_entryLifetime;
while (m_table.size() > 0)
{
InterestContainer::index<timed>::type::iterator item = m_table.get<timed>().begin();
if (item->m_time <= expireTime)
{
m_table.get<timed>().erase(item);
count ++;
}
else
break;
}
m_scheduler.scheduleEvent(ndn::time::seconds(4),
ndn::bind(&SyncInterestTable::expireInterests, this));
}
}
-96
View File
@@ -1,96 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_INTEREST_TABLE_H
#define SYNC_INTEREST_TABLE_H
#include <ndn-cxx/util/scheduler.hpp>
#include <string>
#include <vector>
#include "sync-digest.h"
#include "sync-interest-container.h"
namespace Sync {
/**
* \ingroup sync
* @brief A table to keep unanswered Sync Interest
* all access operation to the table should grab the
* mutex first
*/
class SyncInterestTable
{
public:
SyncInterestTable (boost::asio::io_service& io, ndn::time::system_clock::Duration lifetime);
~SyncInterestTable ();
/**
* @brief Insert an interest, if interest already exists, update the
* timestamp
*/
bool
insert (DigestConstPtr interest, const std::string &name, bool unknownState=false);
/**
* @brief Remove interest by digest (e.g., when it was satisfied)
*/
bool
remove (DigestConstPtr interest);
/**
* @brief Remove interest by name (e.g., when it was satisfied)
*/
bool
remove (const std::string &name);
/**
* @brief pop a non-expired Interest from PIT
*/
Interest
pop ();
uint32_t
size () const;
private:
/**
* @brief periodically called to expire Interest
*/
void
expireInterests ();
private:
ndn::time::system_clock::Duration m_entryLifetime;
InterestContainer m_table;
ndn::Scheduler m_scheduler;
};
namespace Error {
struct InterestTableIsEmpty : virtual boost::exception, virtual std::exception { };
}
} // Sync
#endif // SYNC_INTEREST_TABLE_H
-43
View File
@@ -1,43 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-leaf.h"
namespace Sync {
Leaf::Leaf (NameInfoConstPtr info, const SeqNo &seq)
: m_info (info)
, m_seq (seq)
{
}
Leaf::~Leaf ()
{
}
void
Leaf::setSeq (const SeqNo &seq)
{
m_seq = std::max (m_seq, seq);
}
} // Sync
-84
View File
@@ -1,84 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_LEAF_H
#define SYNC_LEAF_H
#include "sync-seq-no.h"
#include "sync-name-info.h"
namespace Sync {
/**
* \ingroup sync
* @brief Sync tree leaf
*/
class Leaf
{
public:
/**
* @brief Constructor
* @param info Smart pointer to leaf's name
* @param seq Initial sequence number of the pointer
*/
Leaf (NameInfoConstPtr info, const SeqNo &seq);
virtual ~Leaf ();
/**
* @brief Get name of the leaf
*/
NameInfoConstPtr
getInfo () const { return m_info; }
/**
* @brief Get sequence number of the leaf
*/
const SeqNo&
getSeq () const { return m_seq; }
/**
* @brief Update sequence number of the leaf
* @param seq Sequence number
*
* Sequence number is updated to the largest value among this->m_seq and seq
*/
virtual void
setSeq (const SeqNo &seq);
private:
NameInfoConstPtr m_info;
SeqNo m_seq;
};
typedef shared_ptr<Leaf> LeafPtr;
typedef shared_ptr<const Leaf> LeafConstPtr;
inline std::ostream &
operator << (std::ostream &os, const Leaf &leaf)
{
os << *leaf.getInfo () << "(" << leaf.getSeq () << ")";
return os;
}
} // Sync
#endif // SYNC_LEAF_H
-61
View File
@@ -1,61 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-logging.h"
#ifdef HAVE_LOG4CXX
#include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>
#include <log4cxx/consoleappender.h>
#include <log4cxx/patternlayout.h>
#include <log4cxx/level.h>
#include <log4cxx/propertyconfigurator.h>
#include <log4cxx/defaultconfigurator.h>
#include <log4cxx/helpers/exception.h>
using namespace log4cxx;
using namespace log4cxx::helpers;
#include <unistd.h>
void
INIT_LOGGERS ()
{
static bool configured = false;
if (configured) return;
if (access ("log4cxx.properties", R_OK)==0)
PropertyConfigurator::configureAndWatch ("log4cxx.properties");
else
{
PatternLayoutPtr layout (new PatternLayout ("%d{HH:mm:ss} %p %c{1} - %m%n"));
ConsoleAppenderPtr appender (new ConsoleAppender (layout));
BasicConfigurator::configure( appender );
Logger::getRootLogger()->setLevel (log4cxx::Level::getInfo ());
}
configured = true;
}
#endif
-74
View File
@@ -1,74 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_LOG_H
#define SYNC_LOG_H
#ifdef HAVE_LOG4CXX
#include <log4cxx/logger.h>
#define INIT_LOGGER(name) \
static log4cxx::LoggerPtr staticModuleLogger = log4cxx::Logger::getLogger (name);
#define _LOG_DEBUG(x) \
LOG4CXX_DEBUG(staticModuleLogger, x);
#define _LOG_TRACE(x) \
LOG4CXX_TRACE(staticModuleLogger, x);
#define _LOG_FUNCTION(x) \
LOG4CXX_TRACE(staticModuleLogger, __FUNCTION__ << "(" << x << ")");
#define _LOG_FUNCTION_NOARGS \
LOG4CXX_TRACE(staticModuleLogger, __FUNCTION__ << "()");
#define _LOG_ERROR(x) \
LOG4CXX_ERROR(staticModuleLogger, x);
void
INIT_LOGGERS ();
#else
#define INIT_LOGGER(name)
#define _LOG_FUNCTION(x)
#define _LOG_FUNCTION_NOARGS
#define _LOG_TRACE(x)
#define INIT_LOGGERS(x)
#define _LOG_ERROR(x)
#ifdef _DEBUG
#include <boost/date_time/posix_time/posix_time.hpp>
#include <iostream>
#define _LOG_DEBUG(x) \
std::clog << boost::get_system_time () << " " << boost::this_thread::get_id () << " " << x << endl;
#else
#define _LOG_DEBUG(x)
#endif
#endif // HAVE_LOG4CXX
#endif // SYNC_LOG_H
-84
View File
@@ -1,84 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_LOGIC_EVENT_CONTAINER_H
#define SYNC_LOGIC_EVENT_CONTAINER_H
#include "sync-event.h"
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/multi_index_container.hpp>
// #include <boost/multi_index/tag.hpp>
#include <boost/multi_index/ordered_index.hpp>
// #include <boost/multi_index/composite_key.hpp>
// #include <boost/multi_index/hashed_index.hpp>
// #include <boost/multi_index/random_access_index.hpp>
#include <boost/multi_index/member.hpp>
// #include <boost/multi_index/mem_fun.hpp>
namespace mi = boost::multi_index;
namespace Sync
{
struct LogicEvent
{
LogicEvent (const boost::system_time &_time, Event _event, uint32_t _label)
: time (_time)
, event (_event)
, lbl (_label)
{ }
boost::system_time time;
Event event;
uint32_t lbl;
};
/// @cond include_hidden
struct byLabel { } ;
/// @endcond
/**
* \ingroup sync
* @brief ???
*/
struct EventsContainer : public mi::multi_index_container<
LogicEvent,
mi::indexed_by<
mi::ordered_non_unique<
mi::member<LogicEvent, boost::system_time, &LogicEvent::time>
>,
mi::ordered_non_unique<
mi::tag<byLabel>,
mi::member<LogicEvent, uint32_t, &LogicEvent::lbl>
>
>
>
{
};
} // Sync
#endif // SYNC_LOGIC_EVENT_CONTAINER_H
-749
View File
@@ -1,749 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
* Yingdi Yu <yingdi@cs.ucla.edu>
*/
#include "sync-logic.h"
#include "sync-diff-leaf.h"
#include "sync-full-leaf.h"
#include "sync-logging.h"
#include "sync-state.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <vector>
using namespace std;
using ndn::Data;
using ndn::EventId;
using ndn::KeyChain;
using ndn::Face;
using ndn::Name;
using ndn::OnDataValidated;
using ndn::OnDataValidationFailed;
using ndn::Validator;
INIT_LOGGER ("SyncLogic");
#ifdef _DEBUG
#define _LOG_DEBUG_ID(v) _LOG_DEBUG(m_instanceId << " " << v)
#else
#define _LOG_DEBUG_ID(v) _LOG_DEBUG(v)
#endif
#define GET_RANDOM(var) var ()
#define TIME_SECONDS_WITH_JITTER(sec) \
(ndn::time::seconds(sec) + ndn::time::milliseconds(GET_RANDOM (m_reexpressionJitter)))
#define TIME_MILLISECONDS_WITH_JITTER(ms) \
(ndn::time::seconds(ms) + ndn::time::milliseconds(GET_RANDOM (m_reexpressionJitter)))
namespace Sync {
using ndn::shared_ptr;
int SyncLogic::m_instanceCounter = 0;
const int SyncLogic::m_syncResponseFreshness = 1000; // MUST BE dividable by 1000!!!
const int SyncLogic::m_syncInterestReexpress = 4; // seconds
SyncLogic::SyncLogic (const Name& syncPrefix,
shared_ptr<Validator> validator,
shared_ptr<Face> face,
LogicUpdateCallback onUpdate,
LogicRemoveCallback onRemove)
: m_state (new FullState)
, m_syncInterestTable (face->getIoService(), ndn::time::seconds(m_syncInterestReexpress))
, m_syncPrefix (syncPrefix)
, m_onUpdate (onUpdate)
, m_onRemove (onRemove)
, m_perBranch (false)
, m_validator(validator)
, m_keyChain(new KeyChain())
, m_face(face)
, m_scheduler(face->getIoService())
, m_randomGenerator (static_cast<unsigned int> (std::time (0)))
, m_rangeUniformRandom (m_randomGenerator, boost::uniform_int<> (200,1000))
, m_reexpressionJitter (m_randomGenerator, boost::uniform_int<> (100,500))
, m_recoveryRetransmissionInterval (m_defaultRecoveryRetransmitInterval)
{
m_syncRegisteredPrefixId = m_face->setInterestFilter (m_syncPrefix,
bind(&SyncLogic::onSyncInterest,
this, _1, _2),
bind(&SyncLogic::onSyncRegisterSucceed,
this, _1),
bind(&SyncLogic::onSyncRegisterFailed,
this, _1, _2));
m_reexpressingInterestId = m_scheduler.scheduleEvent (ndn::time::seconds (0),
bind (&SyncLogic::sendSyncInterest, this));
m_instanceId = string("Instance " + boost::lexical_cast<string>(m_instanceCounter++) + " ");
}
SyncLogic::SyncLogic (const Name& syncPrefix,
shared_ptr<Validator> validator,
shared_ptr<Face> face,
LogicPerBranchCallback onUpdateBranch)
: m_state (new FullState)
, m_syncInterestTable (face->getIoService(), ndn::time::seconds (m_syncInterestReexpress))
, m_syncPrefix (syncPrefix)
, m_onUpdateBranch (onUpdateBranch)
, m_perBranch(true)
, m_validator(validator)
, m_keyChain(new KeyChain())
, m_face(face)
, m_scheduler(face->getIoService())
, m_randomGenerator (static_cast<unsigned int> (std::time (0)))
, m_rangeUniformRandom (m_randomGenerator, boost::uniform_int<> (200,1000))
, m_reexpressionJitter (m_randomGenerator, boost::uniform_int<> (100,500))
, m_recoveryRetransmissionInterval (m_defaultRecoveryRetransmitInterval)
{
m_syncRegisteredPrefixId = m_face->setInterestFilter (m_syncPrefix,
bind(&SyncLogic::onSyncInterest,
this, _1, _2),
bind(&SyncLogic::onSyncRegisterSucceed,
this, _1),
bind(&SyncLogic::onSyncRegisterFailed,
this, _1, _2));
m_reexpressingInterestId = m_scheduler.scheduleEvent (ndn::time::seconds (0),
bind (&SyncLogic::sendSyncInterest, this));
}
SyncLogic::~SyncLogic ()
{
m_face->unsetInterestFilter(m_syncRegisteredPrefixId);
m_scheduler.cancelEvent (m_reexpressingInterestId);
m_scheduler.cancelEvent (m_delayedInterestProcessingId);
}
/**
* Two types of intersts
*
* Normal name: .../<hash>
* Recovery name: .../recovery/<hash>
*/
tuple<DigestConstPtr, std::string>
SyncLogic::convertNameToDigestAndType (const Name &name)
{
BOOST_ASSERT (m_syncPrefix.isPrefixOf(name));
int nameLengthDiff = name.size() - m_syncPrefix.size();
BOOST_ASSERT (nameLengthDiff > 0);
BOOST_ASSERT (nameLengthDiff < 3);
string hash = name.get(-1).toUri();
string interestType;
if(nameLengthDiff == 1)
interestType = "normal";
else
interestType = name.get(-2).toUri();
_LOG_DEBUG_ID (hash << ", " << interestType);
DigestPtr digest = make_shared<Digest> ();
istringstream is (hash);
is >> *digest;
return make_tuple(digest, interestType);
}
void
SyncLogic::onSyncInterest (const Name& prefix, const ndn::Interest& interest)
{
Name name = interest.getName();
_LOG_DEBUG_ID("respondSyncInterest: " << name);
try
{
_LOG_DEBUG_ID ("<< I " << name);
DigestConstPtr digest;
string type;
tie (digest, type) = convertNameToDigestAndType (name);
if (type == "normal") // kind of ineffective...
{
processSyncInterest (name, digest);
}
else if (type == "recovery")
{
processSyncRecoveryInterest (name, digest);
}
}
catch (Error::DigestCalculationError &e)
{
_LOG_DEBUG_ID ("Something fishy happened...");
// log error. ignoring it for now, later we should log it
return ;
}
}
void
SyncLogic::onSyncRegisterSucceed(const Name& prefix)
{
_LOG_DEBUG_ID("Sync prefix registration succeeded! " << prefix);
}
void
SyncLogic::onSyncRegisterFailed(const Name& prefix, const string& msg)
{
_LOG_DEBUG_ID("Sync prefix registration failed! " << msg);
}
void
SyncLogic::onSyncData(const ndn::Interest& interest, Data& data)
{
OnDataValidated onValidated = bind(&SyncLogic::onSyncDataValidated, this, _1);
OnDataValidationFailed onValidationFailed = bind(&SyncLogic::onSyncDataValidationFailed, this, _1);
m_validator->validate(data, onValidated, onValidationFailed);
}
void
SyncLogic::onSyncTimeout(const ndn::Interest& interest)
{
// It is OK. Others will handle the time out situation.
}
void
SyncLogic::onSyncDataValidationFailed(const shared_ptr<const Data>& data)
{
_LOG_DEBUG_ID("Sync data cannot be verified!");
}
void
SyncLogic::onSyncDataValidated(const shared_ptr<const Data>& data)
{
Name name = data->getName();
const char* wireData = (const char*)data->getContent().value();
size_t len = data->getContent().value_size();
try
{
_LOG_DEBUG_ID ("<< D " << name);
DigestConstPtr digest;
string type;
tie (digest, type) = convertNameToDigestAndType (name);
if (type == "normal")
{
processSyncData (name, digest, wireData, len);
}
else
{
// timer is always restarted when we schedule recovery
m_scheduler.cancelEvent (m_reexpressingRecoveryInterestId);
processSyncData (name, digest, wireData, len);
}
}
catch (Error::DigestCalculationError &e)
{
_LOG_DEBUG_ID ("Something fishy happened...");
// log error. ignoring it for now, later we should log it
return;
}
}
void
SyncLogic::processSyncInterest (const Name &name, DigestConstPtr digest,
bool timedProcessing/*=false*/)
{
_LOG_DEBUG_ID("processSyncInterest");
DigestConstPtr rootDigest;
{
rootDigest = m_state->getDigest();
}
// Special case when state is not empty and we have received request with zero-root digest
if (digest->isZero () && !rootDigest->isZero ())
{
SyncStateMsg ssm;
{
ssm << (*m_state);
}
sendSyncData (name, digest, ssm);
return;
}
if (*rootDigest == *digest)
{
_LOG_DEBUG_ID ("processSyncInterest (): Same state. Adding to PIT");
m_syncInterestTable.insert (digest, name.toUri(), false);
return;
}
DiffStateContainer::iterator stateInDiffLog = m_log.find (digest);
if (stateInDiffLog != m_log.end ())
{
DiffStateConstPtr stateDiff = (*stateInDiffLog)->diff ();
sendSyncData (name, digest, stateDiff);
return;
}
if (!timedProcessing)
{
bool exists = m_syncInterestTable.insert (digest, name.toUri(), true);
if (exists) // somebody else replied, so restart random-game timer
{
_LOG_DEBUG_ID("Unknown digest, but somebody may have already replied, " <<
"so restart our timer");
m_scheduler.cancelEvent (m_delayedInterestProcessingId);
}
uint32_t waitDelay = GET_RANDOM (m_rangeUniformRandom);
_LOG_DEBUG_ID("Digest is not in the log. Schedule processing after small delay: " <<
ndn::time::milliseconds (waitDelay));
m_delayedInterestProcessingId =
m_scheduler.scheduleEvent(ndn::time::milliseconds (waitDelay),
bind (&SyncLogic::processSyncInterest, this, name, digest, true));
}
else
{
_LOG_DEBUG_ID(" (timed processing)");
m_recoveryRetransmissionInterval = m_defaultRecoveryRetransmitInterval;
sendSyncRecoveryInterests (digest);
}
}
void
SyncLogic::processSyncData (const Name &name, DigestConstPtr digest,
const char *wireData, size_t len)
{
DiffStatePtr diffLog = make_shared<DiffState> ();
bool ownInterestSatisfied = false;
try
{
m_syncInterestTable.remove (name.toUri()); // Remove satisfied interest from PIT
ownInterestSatisfied = (name == m_outstandingInterestName);
DiffState diff;
SyncStateMsg msg;
if (!msg.ParseFromArray(wireData, len) || !msg.IsInitialized())
{
//Throw
BOOST_THROW_EXCEPTION (Error::SyncStateMsgDecodingFailure () );
}
msg >> diff;
vector<MissingDataInfo> v;
BOOST_FOREACH (LeafConstPtr leaf, diff.getLeaves().get<ordered>())
{
DiffLeafConstPtr diffLeaf = dynamic_pointer_cast<const DiffLeaf> (leaf);
BOOST_ASSERT (diffLeaf != 0);
NameInfoConstPtr info = diffLeaf->getInfo();
if (diffLeaf->getOperation() == UPDATE)
{
SeqNo seq = diffLeaf->getSeq();
bool inserted = false;
bool updated = false;
SeqNo oldSeq;
{
tie (inserted, updated, oldSeq) = m_state->update (info, seq);
}
if (inserted || updated)
{
diffLog->update (info, seq);
if (!oldSeq.isValid())
{
oldSeq = SeqNo(seq.getSession(), 0);
}
else
{
++oldSeq;
}
// there is no need for application to process update on forwarder node
if (info->toString() != forwarderPrefix)
{
MissingDataInfo mdi = {info->toString(), oldSeq, seq};
{
ostringstream interestName;
interestName << mdi.prefix <<
"/" << mdi.high.getSession() <<
"/" << mdi.high.getSeq();
_LOG_DEBUG_ID("+++++++++++++++ " + interestName.str());
}
if (m_perBranch)
{
ostringstream interestName;
interestName << mdi.prefix <<
"/" << mdi.high.getSession() <<
"/" << mdi.high.getSeq();
m_onUpdateBranch(interestName.str());
}
else
{
v.push_back(mdi);
}
}
}
}
else if (diffLeaf->getOperation() == REMOVE)
{
if (m_state->remove (info))
{
diffLog->remove (info);
if (!m_perBranch)
{
m_onRemove (info->toString ());
}
}
}
else
{
}
}
if (!v.empty())
{
if (!m_perBranch)
{
m_onUpdate(v);
}
}
insertToDiffLog (diffLog);
}
catch (Error::SyncStateMsgDecodingFailure &e)
{
_LOG_DEBUG_ID ("Something really fishy happened during state decoding " <<
diagnostic_information (e));
diffLog.reset ();
// don't do anything
}
if ((diffLog != 0 && diffLog->getLeaves ().size () > 0) ||
ownInterestSatisfied)
{
_LOG_DEBUG_ID(" +++++++++++++++ state changed!!!");
// Do it only if everything went fine and state changed
// this is kind of wrong
// satisfyPendingSyncInterests (diffLog); // if there are interests in PIT,
// // there is a point to satisfy them using new state
// if state has changed, then it is safe to express a new interest
ndn::time::system_clock::Duration after =
ndn::time::milliseconds(GET_RANDOM (m_reexpressionJitter));
// cout << "------------ reexpress interest after: " << after << endl;
EventId eventId = m_scheduler.scheduleEvent (after,
bind (&SyncLogic::sendSyncInterest, this));
m_scheduler.cancelEvent (m_reexpressingInterestId);
m_reexpressingInterestId = eventId;
}
}
void
SyncLogic::processSyncRecoveryInterest (const Name &name, DigestConstPtr digest)
{
_LOG_DEBUG_ID("processSyncRecoveryInterest");
DiffStateContainer::iterator stateInDiffLog = m_log.find (digest);
if (stateInDiffLog == m_log.end ())
{
_LOG_DEBUG_ID ("Could not find " << *digest << " in digest log");
return;
}
SyncStateMsg ssm;
{
ssm << (*m_state);
}
sendSyncData (name, digest, ssm);
}
void
SyncLogic::satisfyPendingSyncInterests (DiffStateConstPtr diffLog)
{
DiffStatePtr fullStateLog = make_shared<DiffState> ();
{
BOOST_FOREACH (LeafConstPtr leaf, m_state->getLeaves ()/*.get<timed> ()*/)
{
fullStateLog->update (leaf->getInfo (), leaf->getSeq ());
/// @todo Impose limit on how many state info should be send out
}
}
try
{
uint32_t counter = 0;
while (m_syncInterestTable.size () > 0)
{
Sync::Interest interest = m_syncInterestTable.pop ();
if (!interest.m_unknown)
{
_LOG_DEBUG_ID (">> D " << interest.m_name);
sendSyncData (interest.m_name, interest.m_digest, diffLog);
}
else
{
_LOG_DEBUG_ID (">> D (unknown)" << interest.m_name);
sendSyncData (interest.m_name, interest.m_digest, fullStateLog);
}
counter ++;
}
_LOG_DEBUG_ID ("Satisfied " << counter << " pending interests");
}
catch (Error::InterestTableIsEmpty &e)
{
// ok. not really an error
}
}
void
SyncLogic::insertToDiffLog (DiffStatePtr diffLog)
{
diffLog->setDigest (m_state->getDigest());
if (m_log.size () > 0)
{
m_log.get<sequenced> ().front ()->setNext (diffLog);
}
m_log.erase (m_state->getDigest()); // remove diff state with the same digest.
// next pointers are still valid
/// @todo Optimization
m_log.get<sequenced> ().push_front (diffLog);
}
void
SyncLogic::addLocalNames (const Name &prefix, uint64_t session, uint64_t seq)
{
DiffStatePtr diff;
{
//cout << "Add local names" <<endl;
NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix.toUri());
_LOG_DEBUG_ID ("addLocalNames (): old state " << *m_state->getDigest ());
SeqNo seqN (session, seq);
m_state->update(info, seqN);
_LOG_DEBUG_ID ("addLocalNames (): new state " << *m_state->getDigest ());
diff = make_shared<DiffState>();
diff->update(info, seqN);
insertToDiffLog (diff);
}
// _LOG_DEBUG_ID ("PIT size: " << m_syncInterestTable.size ());
satisfyPendingSyncInterests (diff);
}
void
SyncLogic::remove(const Name &prefix)
{
DiffStatePtr diff;
{
NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix.toUri());
m_state->remove(info);
// increment the sequence number for the forwarder node
NameInfoConstPtr forwarderInfo = StdNameInfo::FindOrCreate(forwarderPrefix);
LeafContainer::iterator item = m_state->getLeaves ().find (forwarderInfo);
SeqNo seqNo (0);
if (item != m_state->getLeaves ().end ())
{
seqNo = (*item)->getSeq ();
++seqNo;
}
m_state->update (forwarderInfo, seqNo);
diff = make_shared<DiffState>();
diff->remove(info);
diff->update(forwarderInfo, seqNo);
insertToDiffLog (diff);
}
satisfyPendingSyncInterests (diff);
}
void
SyncLogic::sendSyncInterest ()
{
_LOG_DEBUG_ID("sendSyncInterest");
{
m_outstandingInterestName = m_syncPrefix;
ostringstream os;
os << *m_state->getDigest();
m_outstandingInterestName.append(os.str());
_LOG_DEBUG_ID (">> I " << m_outstandingInterestName);
}
_LOG_DEBUG_ID("sendSyncInterest: " << m_outstandingInterestName);
EventId eventId =
m_scheduler.scheduleEvent(ndn::time::seconds(m_syncInterestReexpress) +
ndn::time::milliseconds(GET_RANDOM(m_reexpressionJitter)),
bind (&SyncLogic::sendSyncInterest, this));
m_scheduler.cancelEvent (m_reexpressingInterestId);
m_reexpressingInterestId = eventId;
ndn::Interest interest(m_outstandingInterestName);
interest.setMustBeFresh(true);
m_face->expressInterest(interest,
bind(&SyncLogic::onSyncData, this, _1, _2),
bind(&SyncLogic::onSyncTimeout, this, _1));
}
void
SyncLogic::sendSyncRecoveryInterests (DigestConstPtr digest)
{
ostringstream os;
os << *digest;
Name interestName = m_syncPrefix;
interestName.append("recovery").append(os.str());
ndn::time::system_clock::Duration nextRetransmission =
ndn::time::milliseconds(m_recoveryRetransmissionInterval + GET_RANDOM (m_reexpressionJitter));
m_recoveryRetransmissionInterval <<= 1;
m_scheduler.cancelEvent (m_reexpressingRecoveryInterestId);
if (m_recoveryRetransmissionInterval < 100*1000) // <100 seconds
m_reexpressingRecoveryInterestId =
m_scheduler.scheduleEvent (nextRetransmission,
bind (&SyncLogic::sendSyncRecoveryInterests, this, digest));
ndn::Interest interest(interestName);
interest.setMustBeFresh(true);
m_face->expressInterest(interest,
bind(&SyncLogic::onSyncData, this, _1, _2),
bind(&SyncLogic::onSyncTimeout, this, _1));
}
void
SyncLogic::sendSyncData (const Name &name, DigestConstPtr digest, StateConstPtr state)
{
SyncStateMsg msg;
msg << (*state);
sendSyncData(name, digest, msg);
}
// pass in state msg instead of state, so that there is no need to lock the state until
// this function returns
void
SyncLogic::sendSyncData (const Name &name, DigestConstPtr digest, SyncStateMsg &ssm)
{
_LOG_DEBUG_ID (">> D " << name);
int size = ssm.ByteSize();
char *wireData = new char[size];
ssm.SerializeToArray(wireData, size);
//Data syncData(name);
ndn::shared_ptr<ndn::Data> syncData = ndn::make_shared<ndn::Data>();
syncData->setName(name);
syncData->setContent(reinterpret_cast<const uint8_t*>(wireData), size);
syncData->setFreshnessPeriod(ndn::time::seconds(m_syncResponseFreshness));
m_keyChain->sign(*syncData);
m_face->put(*syncData);
delete []wireData;
// checking if our own interest got satisfied
bool satisfiedOwnInterest = false;
{
satisfiedOwnInterest = (m_outstandingInterestName == name);
}
if (satisfiedOwnInterest)
{
_LOG_DEBUG_ID ("Satisfied our own Interest. Re-expressing (hopefully with a new digest)");
ndn::time::system_clock::Duration after =
ndn::time::milliseconds(GET_RANDOM(m_reexpressionJitter));
// cout << "------------ reexpress interest after: " << after << endl;
EventId eventId = m_scheduler.scheduleEvent (after,
bind (&SyncLogic::sendSyncInterest, this));
m_scheduler.cancelEvent (m_reexpressingInterestId);
m_reexpressingInterestId = eventId;
}
}
string
SyncLogic::getRootDigest()
{
ostringstream os;
os << *m_state->getDigest();
return os.str();
}
size_t
SyncLogic::getNumberOfBranches () const
{
return m_state->getLeaves ().size ();
}
void
SyncLogic::printState () const
{
BOOST_FOREACH (const shared_ptr<Sync::Leaf> leaf, m_state->getLeaves ())
{
std::cout << *leaf << std::endl;
}
}
std::map<std::string, bool>
SyncLogic::getBranchPrefixes() const
{
std::map<std::string, bool> m;
BOOST_FOREACH (const shared_ptr<Sync::Leaf> leaf, m_state->getLeaves ())
{
std::string prefix = leaf->getInfo()->toString();
// do not return forwarder prefix
if (prefix != forwarderPrefix)
{
m.insert(pair<std::string, bool>(prefix, false));
}
}
return m;
}
}
-223
View File
@@ -1,223 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
* Yingdi Yu <yingdi@cs.ucla.edu>
*/
#ifndef SYNC_LOGIC_H
#define SYNC_LOGIC_H
#include <boost/random.hpp>
#include <memory>
#include <map>
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/validator.hpp>
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include "sync-interest-table.h"
#include "sync-diff-state.h"
#include "sync-full-state.h"
#include "sync-std-name-info.h"
#include "sync-diff-state-container.h"
#ifdef _DEBUG
#ifdef HAVE_LOG4CXX
#include <log4cxx/logger.h>
#endif
#endif
namespace Sync {
struct MissingDataInfo {
std::string prefix;
SeqNo low;
SeqNo high;
};
/**
* \ingroup sync
* @brief A wrapper for SyncApp, which handles ccnx related things (process
* interests and data)
*/
class SyncLogic
{
public:
typedef function< void (const std::vector<MissingDataInfo> & ) > LogicUpdateCallback;
typedef function< void (const std::string &/*prefix*/ ) > LogicRemoveCallback;
typedef function< void (const std::string &)> LogicPerBranchCallback;
/**
* @brief Constructor
* @param syncPrefix the name prefix to use for the Sync Interest
* @param onUpdate function that will be called when new state is detected
* @param onRemove function that will be called when state is removed
* @param ccnxHandle ccnx handle
* the app data when new remote names are learned
*/
SyncLogic (const ndn::Name& syncPrefix,
ndn::shared_ptr<ndn::Validator> validator,
ndn::shared_ptr<ndn::Face> face,
LogicUpdateCallback onUpdate,
LogicRemoveCallback onRemove);
SyncLogic (const ndn::Name& syncPrefix,
ndn::shared_ptr<ndn::Validator> validator,
ndn::shared_ptr<ndn::Face> face,
LogicPerBranchCallback onUpdateBranch);
~SyncLogic ();
/**
* a wrapper for the same func in SyncApp
*/
void addLocalNames (const ndn::Name &prefix, uint64_t session, uint64_t seq);
/**
* @brief remove a participant's subtree from the sync tree
* @param prefix the name prefix for the participant
*/
void remove (const ndn::Name &prefix);
std::string
getRootDigest();
#ifdef _DEBUG
ndn::Scheduler &
getScheduler () { return m_scheduler; }
#endif
void
printState () const;
std::map<std::string, bool>
getBranchPrefixes() const;
private:
void
delayedChecksLoop ();
void
onSyncInterest (const ndn::Name& prefix, const ndn::Interest& interest);
void
onSyncRegisterSucceed(const ndn::Name& prefix);
void
onSyncRegisterFailed(const ndn::Name& prefix, const std::string& msg);
void
onSyncData(const ndn::Interest& interest, ndn::Data& data);
void
onSyncTimeout(const ndn::Interest& interest);
void
onSyncDataValidationFailed(const ndn::shared_ptr<const ndn::Data>& data);
void
onSyncDataValidated(const ndn::shared_ptr<const ndn::Data>& data);
void
processSyncInterest (const ndn::Name &name,
DigestConstPtr digest, bool timedProcessing=false);
void
processSyncData (const ndn::Name &name,
DigestConstPtr digest, const char *wireData, size_t len);
void
processSyncRecoveryInterest (const ndn::Name &name,
DigestConstPtr digest);
void
insertToDiffLog (DiffStatePtr diff);
void
satisfyPendingSyncInterests (DiffStateConstPtr diff);
tuple<DigestConstPtr, std::string>
convertNameToDigestAndType (const ndn::Name &name);
void
sendSyncInterest ();
void
sendSyncRecoveryInterests (DigestConstPtr digest);
void
sendSyncData (const ndn::Name &name,
DigestConstPtr digest, StateConstPtr state);
void
sendSyncData (const ndn::Name &name,
DigestConstPtr digest, SyncStateMsg &msg);
size_t
getNumberOfBranches () const;
private:
FullStatePtr m_state;
DiffStateContainer m_log;
ndn::Name m_outstandingInterestName;
SyncInterestTable m_syncInterestTable;
ndn::Name m_syncPrefix;
LogicUpdateCallback m_onUpdate;
LogicRemoveCallback m_onRemove;
LogicPerBranchCallback m_onUpdateBranch;
bool m_perBranch;
std::shared_ptr<ndn::Validator> m_validator;
std::shared_ptr<ndn::KeyChain> m_keyChain;
std::shared_ptr<ndn::Face> m_face;
const ndn::RegisteredPrefixId* m_syncRegisteredPrefixId;
ndn::Scheduler m_scheduler;
boost::mt19937 m_randomGenerator;
boost::variate_generator<boost::mt19937&, boost::uniform_int<> > m_rangeUniformRandom;
boost::variate_generator<boost::mt19937&, boost::uniform_int<> > m_reexpressionJitter;
static const int m_unknownDigestStoreTime = 10; // seconds
static const int m_syncResponseFreshness; // MUST BE dividable by 1000!!!
static const int m_syncInterestReexpress; // seconds
static const int m_defaultRecoveryRetransmitInterval = 200; // milliseconds
uint32_t m_recoveryRetransmissionInterval; // milliseconds
ndn::EventId m_delayedInterestProcessingId;
ndn::EventId m_reexpressingInterestId;
ndn::EventId m_reexpressingRecoveryInterestId;
std::string m_instanceId;
static int m_instanceCounter;
};
} // Sync
#endif // SYNC_APP_WRAPPER_H
-32
View File
@@ -1,32 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-name-info.h"
// #include <boost/lexical_cast.hpp>
namespace Sync {
NameInfo::NameMap NameInfo::m_names;
size_t NameInfo::m_ids = 0;
} // Sync
-102
View File
@@ -1,102 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#ifndef SYNC_NAME_INFO_H
#define SYNC_NAME_INFO_H
#include "sync-common.h"
#include <map>
#include <string>
#include "sync-digest.h"
namespace Sync {
/**
* @ingroup sync
* @brief Templated class for the leaf name
*/
class NameInfo
{
private:
typedef weak_ptr<const NameInfo> const_weak_ptr;
public:
virtual ~NameInfo () { };
/**
* @brief Get ID of the record (should be locally-unique, but not really necessary---this is be used for hashing purposes)
*/
size_t
getHashId () const { return m_id; }
/**
* @brief Check if two names are equal
* @param info name to check with
*/
virtual bool
operator == (const NameInfo &info) const = 0;
/**
* @brief Check if two names are in order
* @param info name to check with
*/
virtual bool
operator < (const NameInfo &info) const = 0;
/**
* @brief Calculates digest of the name
*/
const Digest &
getDigest () const { return m_digest; }
/**
* @brief Convert prefix to string
* @returns string representation of prefix
*/
virtual std::string
toString () const = 0;
protected:
// actual stuff
size_t m_id; ///< @brief Identifies NameInfo throughout the library (for hash container, doesn't need to be strictly unique)
Digest m_digest;
// static stuff
typedef std::map<std::string, const_weak_ptr> NameMap;
static size_t m_ids;
static NameMap m_names;
};
typedef shared_ptr<NameInfo> NameInfoPtr;
typedef shared_ptr<const NameInfo> NameInfoConstPtr;
inline std::ostream &
operator << (std::ostream &os, const NameInfo &info)
{
os << info.toString ();
return os;
}
} // Sync
#endif // SYNC_NAME_INFO_H
-36
View File
@@ -1,36 +0,0 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 University of California, Los Angeles
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
* Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-seq-no.h"
namespace Sync {
DigestConstPtr
SeqNo::getDigest () const
{
DigestPtr digest = make_shared<Digest> ();
*digest << m_session << m_seq;
digest->finalize ();
return digest;
}
} // Sync
Loaded 100 of 303 files, more files were not shown because too many files have changed in this diff. Show more