Commit Graph

169 Commits

Author SHA1 Message Date
Junxiao Shi 55e21b9e17 table: clear StrategyInfo only if Strategy type differs
refs #3868

Change-Id: I164ccba3bd6c69cef9d2ebba303f8d8d941aac99
2017-01-25 09:29:02 -05:00
Junxiao Shi 530cf00d68 table: StrategyChoice::insert return value includes error description
The error description is used in the response to a strategy-choice/set
management command failure.

refs #3868

Change-Id: I14e0eb4dc311806a90ebfe60fa17177d2809d104
2017-01-03 14:43:16 +00:00
Junxiao Shi 7f566dd0e5 table: StrategyChoice no longer supports installed instances
All strategies should be registered in the strategy registry.

refs #3868

Change-Id: Ie89b0ffaf9943e591f9f2d80546b013d5cc16ff8
2016-12-27 02:28:31 +00:00
Junxiao Shi 4cb74319f9 fw: delete deprecated Strategy::getName in favor of getInstanceName
This commit also renames strategy_choice::Entry::getStrategyName
to getStrategyInstanceName.

refs #3868

Change-Id: I40301e744fc236918d6be1c1262eba952198e22f
2016-12-25 20:48:47 +00:00
Junxiao Shi 3aba7548f4 table: make FIB and StrategyChoice iterators default-constructible
They were previously not default-constructible when compiled with gcc 4.8.4.

refs #3882

Change-Id: I2431c869fb61b7adbe83d5551705981bf8618280
2016-12-24 02:42:52 +00:00
Junxiao Shi 0e4a1f112d tests: register instead of install DummyStrategy
refs #3868

Change-Id: I5e44582625be51ef874e2a92e4bb7cc22d5b607b
2016-12-24 02:39:01 +00:00
Junxiao Shi 18739c4ac1 fw: pass parameters to Strategy subclass constructors
refs #3868

Change-Id: I1a09e7353c047d548065c4ed669d1f7993676428
2016-12-22 08:03:00 +00:00
Junxiao Shi f15058ab06 table: don't share Strategy instance among StrategyChoice entries
For a Strategy type registered in the strategy registry,
a new instance is created for each StrategyChoice entry that uses it.

StrategyChoice::install is deprecated. An installed strategy instance
is still shared among StrategyChoice entries that use it. This will
be removed after unit tests switch to use the strategy registry.

refs #3868

Change-Id: Ibca685e6b6668f64fa1a503e3575867e8babdfe1
2016-12-11 20:15:05 +00:00
Junxiao Shi c34d167b91 fw: refactor Strategy registry
Strategy registry is moved into Strategy class.
Strategy instantiation logic is implemented in Strategy::create.
These are in preparation of supporting Strategy parameters.

refs #3868

Change-Id: If36a08ad25a00a7008a5eccc8cfe4f6c63638676
2016-12-09 15:57:59 +00:00
Junxiao Shi b4a5acd890 mgmt: tables.cs_policy config option
refs #3148

Change-Id: Icf30bbe508c1c491949d9fcb433fdfa16842d312
2016-12-07 19:59:18 +00:00
Junxiao Shi 7ee00fb680 table: cs::Policy::getPolicyNames
refs #3148

Change-Id: I06f66e9780b9c5c4820ba18cca5fbc9b1061eae0
2016-12-04 21:23:00 +00:00
Junxiao Shi 52555b06d4 table: CS policy registry
refs #3148

Change-Id: I058357839e514787405952569d1abf402375d1ea
2016-11-25 21:39:06 +00:00
Junxiao Shi a274292b93 table: pit::Entry checks Interest matches entry when updating in/out-record
pit::Entry::canMatch is the single place to determine whether an Interest
matches an Interest table entry. This condition is asserted when an in/out-
record is inserted or updated. This prevents a strategy from incorrectly
picking an Interest that is incompatible with the Interest table entry.

refs #1756

Change-Id: Ibf61a0e2e32b7a0e04e581f01ef07b791c6010a2
2016-11-17 22:53:23 +00:00
Junxiao Shi cbc8e947bf daemon+rib: add proper #include line for NDNLPv2 tags
refs #3755

Change-Id: I3ab279405aca7c7139e8d0e8e662eb3ea7200045
2016-09-06 03:17:45 +00:00
Junxiao Shi fc02186460 table: StrategyInfoHost stores StrategyInfo as unique_ptr
refs #3205

Change-Id: Ia194ca94717347848d257096549cfec5df1ba6c9
2016-08-25 21:51:18 +00:00
Junxiao Shi 2af9ca368b table: move CS limit change logging to cs::Policy
refs #2181

Change-Id: Ifffc72b4f8c84b9caa254ce30b57a42d83fa5b11
2016-08-25 21:51:02 +00:00
Junxiao Shi 5b3feb6008 table: rename StrategyInfoHost::getOrCreateStrategyInfo to insertStrategyInfo
refs #3205

Change-Id: Icd3ab9e4fdb5a2ffc39a8d0e0c713e22f13fe28c
2016-08-19 01:51:41 +00:00
Junxiao Shi f5409d434a table: Pit::deleteInOutRecords accepts Entry* instead of shared_ptr
refs #3164

Change-Id: I512da6200d4d744d5631fc78900795d19ad5dd52
2016-08-17 02:47:12 +00:00
Davide Pesavento 1c2c6c45e2 table: silence unused variable warning in release builds
Warning introduced in commit 80f9fcdaa1

refs #3164

Change-Id: I3e97a1f6adf3beedc4b5608cac75a276735891cb
2016-08-16 12:36:06 +00:00
Junxiao Shi b30863e0e2 table: simplify StrategyChoice iterator with Boost.Range
This commit also improves Doxygen in NameTree, Fib, and Pit enumeration.

refs #3738

Change-Id: Ibb56f958df4d1bc2564192d905cfc2e499a7875e
2016-08-15 21:32:01 +00:00
Junxiao Shi 13ad4b7a42 table: simplify FIB iterator with Boost.Range
refs #3738

Change-Id: I0bfe985c9dac86a67988f77a89f4d2694c4fd9f5
2016-08-15 04:51:21 +00:00
Junxiao Shi 9f6ca60f74 table: declare name_tree::Range type
Declare that NameTree enumeration returns name_tree::Range type
instead of an unspecified type usable with range-based for.

refs #3738

Change-Id: I132c583704d0c6164077abf70a694e833b448e85
2016-08-15 04:50:29 +00:00
Junxiao Shi dbef6dc8e2 table: Pit::erase accepts Entry* instead of shared_ptr
refs #3164

Change-Id: I9ff47c80865da42b09870c632707dffd78ed76b9
2016-08-15 02:58:36 +00:00
Junxiao Shi 3248205bb7 table: PIT iterator dereferences to const shared_ptr<pit::Entry>&
refs #3164

Change-Id: Id857e214a727917009f865c2cfac782077844799
2016-08-15 02:05:17 +00:00
Junxiao Shi 09cf13cd9f table: move PIT iterator to a separate file
This commit only moves code around and renames variables.
There's no functional change.

refs #3164

Change-Id: Icb6b249cc0c07fcfe42f7a6d6987de31285566e7
2016-08-15 02:05:00 +00:00
Junxiao Shi 340d5533ea table: make name_tree::Node the sole owner of name_tree::Entry
This commit also improves name_tree::Entry test coverage.

refs #3687

Change-Id: I92375f29fbebab82c67da7dff2ea7a2952ba2cca
2016-08-13 04:00:35 +00:00
Junxiao Shi e7258ffa88 table: cleanupOnFaceRemoval doesn't rely on shared_ptr<name_tree::Entry> anymore
refs #3687

Change-Id: I3901f053bf370ca5a19a0fea72aec8eb58fcfe10
2016-08-12 23:55:47 +00:00
Junxiao Shi dd8f66140b table: NameTree::findLongestPrefixMatch accepts all table entry types
This simplifies longest prefix match procedures in FIB and StrategyChoice.

refs #3687

Change-Id: I9aa93232124b91bae7890d065337ac9389e8398e
2016-08-12 15:42:52 +00:00
Junxiao Shi 759993b922 table: delete unnecessary name_tree::Iterator destructor
refs #3687

Change-Id: Iccb755c0b1234d31bea84797db348fd229b2fde9
2016-08-12 11:19:08 +00:00
Junxiao Shi 7f35843d58 table: NameTree::lookup return Entry& instead of shared_ptr
refs #3687

Change-Id: Ie86057337dd36ff2bc6ef3ea0c73fd4ffc4b13d0
2016-08-11 17:06:33 +00:00
Junxiao Shi f2420fc7a3 table: ensure NameTree::lookup(tableEntry) does not return nullptr
NameTree::lookup(tableEntry) is always equivalent to NameTree::lookup(Name).
NameTree::getEntry(tableEntry) should be used when inserting new name tree entry is undesired.

refs #3687

Change-Id: I0b17cd07dde83341976cfe66c85855dfb2fa6e89
2016-08-11 13:18:21 +00:00
Junxiao Shi 811c010098 table: NameTree findExactMatch, findLongestPrefixMatch return Entry*
refs #3687

Change-Id: I32752fd711b9641228fbb7f356e72144780cf9ec
2016-08-10 04:12:45 +00:00
Junxiao Shi e3cf285ee7 table: delete deprecated functions in NameTree
NameTree::eraseEntryIfEmpty is renamed to eraseIfEmpty;
the deprecated overload that accepts shared_ptr<name_tree::Entry> is deleted.
name_tree::Entry::getPrefix is deleted in favor of getName.

This commit also improves Doxygen in NameTree class.

refs #3687

Change-Id: Ia98ca676ce6d3bc7b2e97328adccac911c8167d7
2016-08-09 03:50:56 +00:00
Junxiao Shi b660b4c9c0 table: refactor NameTree hashtable
refs #3687

Change-Id: I908c1d7e67da861fc86a756fc0bc69b99ee696f7
2016-08-06 20:47:44 +00:00
Junxiao Shi 029401f6cc table: refactor NameTree iterator
refs #3687

Change-Id: Icf5be98d79cfaa27597f62832fcd0189df2731d1
2016-08-05 12:55:14 +00:00
Junxiao Shi 9f5b01dfd8 core: move common.hpp to core/
Headers in core/ are now included as `#include "core/*.hpp"`.
This allows NFD to rely less on include paths when used as a submodule in
another codebase, such as ndnSIM and NFD-Android.

refs #3127

Change-Id: Ia38f3c97427e17ff7b5401281f1fe875b5d5313e
2016-08-05 03:54:28 +00:00
Junxiao Shi 9cff779038 table: pit::FaceRecord stores Face& instead of shared_ptr
refs #3164

Change-Id: Ib23ab2341a37213fee791f2070f13b76da851d53
2016-08-01 21:45:11 +00:00
Junxiao Shi 02b73f5705 table: delete PIT in-record and out-record when face is destroyed
refs #3685

Change-Id: I3c20417c9a30db69c90c9d59a30af1529bc1f98e
2016-07-28 01:48:27 +00:00
Junxiao Shi 2570f3ec4f table: NameTree code style corrections
refs #3687

Change-Id: I25cfac1d8b11236c251c2ab717facb82b62dcb10
2016-07-27 02:48:29 +00:00
Junxiao Shi 80f9fcdaa1 table: don't use shared_ptr in Measurements
refs #3164

Change-Id: I7705d00ac155b15b5db69809610b68e96360a0ae
2016-07-24 22:52:28 -07:00
Junxiao Shi a49a1abf12 table: StrategyChoice uses unique_ptr instead of shared_ptr
refs #3164

Change-Id: Id3110f72aab83982b0768e596a04bad9f7336975
2016-07-15 18:24:36 +00:00
Junxiao Shi ff10da6575 table: attach unique_ptr<strategy_choice::Entry> onto NameTree
refs #3164

Change-Id: I5cce7e43dba77cdaaa07347ec7ffca13f242113c
2016-07-13 17:57:43 +00:00
Junxiao Shi a6de4290c8 table: don't use shared_ptr in FIB
refs #3164

Change-Id: I5b5eb47d60f6bf5b6389c32ac840f793767e4334
2016-07-12 02:08:10 +00:00
Junxiao Shi 8d843148d2 fw: eliminate fibEntry in Strategy API
Strategy::lookupFib can be used to obtain FIB entry.
FIB lookup is skipped when strategy does not need it.

refs #3205

Change-Id: Icba67229cbc261d9def44ffa91461ea4b09982b2
2016-07-11 22:42:42 +00:00
Junxiao Shi 05cc50ae37 fw: Forwarder::lookupFib
refs #3664

Change-Id: I0e0cc3de997653c93db9b7c89e81ea73b4fb12ac
2016-07-11 22:38:21 +00:00
Junxiao Shi 2879779804 table: fix Pit::find leak of NameTreeEntry
refs #3619

Change-Id: If1043a08c9f4f8bb53cad77d2b6f21991553e1cc
2016-05-26 18:10:18 +00:00
Junxiao Shi b184e5324d table: NameTree::getEntry
NameTree::get is renamed to NameTree::lookup.
NameTree::getEntry is introduced to return the NameTreeEntry on which a table entry is attached.
tableEntry::m_nameTreeEntry is changed to weak_ptr to avoid circular shared_ptr reference.

refs #3608, #3619

Change-Id: I425b6a2eb5fe3024bbaff4ff766eb6739be54b02
2016-05-26 18:09:57 +00:00
spirosmastorakis ff920303df table: fix Pit::erase crash when Interest name contains implicit digest
refs #3608

Change-Id: I41e0cd327b9dcc5f2d3a83f4cebff40c2d302fc1
2016-05-26 18:09:31 +00:00
Yumin Xia ab49745afe core: use Boost.Log for logging
This makes the logging backend asynchronous

Change-Id: Ib3417e2ae424c5ae7237c071dc4698ca9769a33c
Refs: #2513
2016-05-11 11:33:13 +08:00
Davide Pesavento b84bd3a8c4 common: remove DECL_FINAL/OVERRIDE macros; use C++11 keywords directly
Change-Id: I71a148b0df7c95387b2caa8e2b9fe93b03ca2399
Refs: #3599
2016-04-27 12:15:06 -07:00