aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/core
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light/src/hicn/core')
-rw-r--r--hicn-light/src/hicn/core/nexthops.c6
-rw-r--r--hicn-light/src/hicn/core/nexthops.h1
-rw-r--r--hicn-light/src/hicn/core/strategy_vft.c2
3 files changed, 9 insertions, 0 deletions
diff --git a/hicn-light/src/hicn/core/nexthops.c b/hicn-light/src/hicn/core/nexthops.c
index 70089399d..1a6096777 100644
--- a/hicn-light/src/hicn/core/nexthops.c
+++ b/hicn-light/src/hicn/core/nexthops.c
@@ -29,6 +29,12 @@ int nexthops_disable(nexthops_t *nexthops, off_t offset) {
return 0;
}
+int nexthops_disable_all(nexthops_t *nexthops) {
+ nexthops->flags = ~0;
+ nexthops->cur_elts = 0;
+ return 0;
+}
+
void nexthops_reset(nexthops_t *nexthops) {
nexthops->flags = 0;
nexthops->cur_elts = nexthops->num_elts;
diff --git a/hicn-light/src/hicn/core/nexthops.h b/hicn-light/src/hicn/core/nexthops.h
index ff83199a6..232c74388 100644
--- a/hicn-light/src/hicn/core/nexthops.h
+++ b/hicn-light/src/hicn/core/nexthops.h
@@ -94,6 +94,7 @@ typedef struct nexthops_s {
} while (0)
int nexthops_disable(nexthops_t *nexthops, off_t offset);
+int nexthops_disable_all(nexthops_t *nexthops);
#define nexthops_disable_if(NH, i, condition) \
do { \
diff --git a/hicn-light/src/hicn/core/strategy_vft.c b/hicn-light/src/hicn/core/strategy_vft.c
index dcfda5c78..0af035c88 100644
--- a/hicn-light/src/hicn/core/strategy_vft.c
+++ b/hicn-light/src/hicn/core/strategy_vft.c
@@ -25,12 +25,14 @@ extern const strategy_ops_t strategy_random;
extern const strategy_ops_t strategy_replication;
extern const strategy_ops_t strategy_bestpath;
extern const strategy_ops_t strategy_low_latency;
+extern const strategy_ops_t strategy_local_remote;
const strategy_ops_t *const strategy_vft[] = {
[STRATEGY_TYPE_LOADBALANCER] = &strategy_load_balancer,
[STRATEGY_TYPE_RANDOM] = &strategy_random,
[STRATEGY_TYPE_REPLICATION] = &strategy_replication,
[STRATEGY_TYPE_BESTPATH] = &strategy_bestpath,
+ [STRATEGY_TYPE_LOCAL_REMOTE] = &strategy_local_remote,
#if 0
[STRATEGY_TYPE_LOW_LATENCY] = &strategy_low_latency,
#endif