aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin')
-rw-r--r--hicn-plugin/src/cli.c92
-rw-r--r--hicn-plugin/src/hicn.api72
-rw-r--r--hicn-plugin/src/hicn_api.c71
-rw-r--r--hicn-plugin/src/hicn_api_test.c161
-rw-r--r--hicn-plugin/src/route.c232
-rw-r--r--hicn-plugin/src/route.h19
6 files changed, 26 insertions, 621 deletions
diff --git a/hicn-plugin/src/cli.c b/hicn-plugin/src/cli.c
index b3d03294d..5d613c535 100644
--- a/hicn-plugin/src/cli.c
+++ b/hicn-plugin/src/cli.c
@@ -364,17 +364,16 @@ done:
* cli handler for 'fib'
*/
static clib_error_t *
-hicn_cli_fib_set_command_fn (vlib_main_t * vm, unformat_input_t * main_input,
- vlib_cli_command_t * cmd)
+hicn_cli_strategy_set_command_fn (vlib_main_t * vm, unformat_input_t * main_input,
+ vlib_cli_command_t * cmd)
{
clib_error_t *cl_err = 0;
int rv = HICN_ERROR_NONE;
int addpfx = -1;
ip46_address_t address;
- hicn_face_id_t faceid = HICN_FACE_NULL;
u32 strategy_id;
- u8 plen = 0;
+ u32 plen = 0;
fib_prefix_t prefix;
/* Get a line of input. */
@@ -385,15 +384,7 @@ hicn_cli_fib_set_command_fn (vlib_main_t * vm, unformat_input_t * main_input,
}
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
- if (addpfx == -1 && unformat (line_input, "add"))
- {
- addpfx = 1;
- }
- else if (addpfx == -1 && unformat (line_input, "delete"))
- {
- addpfx = 0;
- }
- else if (unformat (line_input, "set strategy %d", &strategy_id))
+ if (unformat (line_input, "set %d", &strategy_id))
{
addpfx = 2;
}
@@ -402,9 +393,6 @@ hicn_cli_fib_set_command_fn (vlib_main_t * vm, unformat_input_t * main_input,
&address, IP46_TYPE_ANY, &plen))
{;
}
- else if (addpfx <= 1 && unformat (line_input, "face %u", &faceid))
- {;
- }
else
{
cl_err = clib_error_return (0, "%s '%U'",
@@ -417,63 +405,18 @@ hicn_cli_fib_set_command_fn (vlib_main_t * vm, unformat_input_t * main_input,
fib_prefix_from_ip46_addr (&address, &prefix);
prefix.fp_len = plen;
/* Check parse */
- if (addpfx <= 1
- && ((ip46_address_is_zero (&prefix.fp_addr))
- || faceid == HICN_FACE_NULL))
- {
- cl_err =
- clib_error_return (0, "Please specify prefix and a valid faceid...");
- goto done;
- }
- /* Check parse */
- if ((ip46_address_is_zero (&prefix.fp_addr))
- || (addpfx == 2 && hicn_dpo_strategy_id_is_valid (strategy_id)))
+ if (hicn_dpo_strategy_id_is_valid (strategy_id) == HICN_ERROR_DPO_MGR_ID_NOT_VALID)
{
cl_err = clib_error_return (0,
- "Please specify prefix and strategy_id...");
+ "Please specify a valid strategy...");
goto done;
}
- if (addpfx == 0)
- {
- if (ip46_address_is_zero (&prefix.fp_addr))
- {
- cl_err = clib_error_return (0, "Please specify prefix");
- goto done;
- }
- if (faceid == HICN_FACE_NULL)
- {
- rv = hicn_route_del (&prefix);
- }
- else
- {
- rv = hicn_route_del_nhop (&prefix, faceid);
- }
- cl_err =
- (rv == HICN_ERROR_NONE) ? NULL : clib_error_return (0,
- get_error_string
- (rv));
- }
- else if (addpfx == 1)
- {
- rv = hicn_route_add (&faceid, 1, &prefix);
- if (rv == HICN_ERROR_ROUTE_ALREADY_EXISTS)
- {
- rv = hicn_route_add_nhops (&faceid, 1, &prefix);
- }
- cl_err =
- (rv == HICN_ERROR_NONE) ? NULL : clib_error_return (0,
- get_error_string
- (rv));
- }
- else if (addpfx == 2)
- {
- rv = hicn_route_set_strategy (&prefix, strategy_id);
- cl_err =
- (rv == HICN_ERROR_NONE) ? NULL : clib_error_return (0,
- get_error_string
- (rv));
- }
+ rv = hicn_route_set_strategy (&prefix, strategy_id);
+ cl_err =
+ (rv == HICN_ERROR_NONE) ? NULL : clib_error_return (0,
+ get_error_string
+ (rv));
done:
return (cl_err);
@@ -886,13 +829,12 @@ VLIB_CLI_COMMAND(hicn_cli_node_ctl_command, static)=
};
/* cli declaration for 'fib' */
-VLIB_CLI_COMMAND(hicn_cli_fib_set_command, static)=
-{
- .path = "hicn fib",
- .short_help = "hicn fib {{add | delete } prefix <prefix> face <facei_d> }"
- " | set strategy <strategy_id> prefix <prefix>",
- .function = hicn_cli_fib_set_command_fn,
-};
+VLIB_CLI_COMMAND(hicn_cli_strategy_set_command, static)=
+ {
+ .path = "hicn strategy",
+ .short_help = "hicn strategy set <strategy_id> prefix <prefix>",
+ .function = hicn_cli_strategy_set_command_fn,
+ };
/* cli declaration for 'show' */
VLIB_CLI_COMMAND(hicn_cli_show_command, static)=
diff --git a/hicn-plugin/src/hicn.api b/hicn-plugin/src/hicn.api
index 753491c5f..9643f2098 100644
--- a/hicn-plugin/src/hicn.api
+++ b/hicn-plugin/src/hicn.api
@@ -294,78 +294,6 @@ define hicn_api_face_get_reply
vl_api_hicn_face_t face;
};
-define hicn_api_route_nhops_add
-{
- /* Client identifier, set from api_main.my_client_index */
- u32 client_index;
-
- /* Arbitrary context, so client can match reply to request */
- u32 context;
-
- /* Prefix to be added to the FIB */
- vl_api_prefix_t prefix;
-
- /* A Face ID to the next hop forwarder for the specified prefix */
- u32 face_ids[10];
-
- /* Number of face to add */
- u8 n_faces;
-};
-
-define hicn_api_route_nhops_add_reply
-{
- /* From the request */
- u32 context;
-
- /* Return value, zero means all OK */
- i32 retval;
-};
-
-define hicn_api_route_del
-{
- /* Client identifier, set from api_main.my_client_index */
- u32 client_index;
-
- /* Arbitrary context, so client can match reply to request */
- u32 context;
-
- /* Prefix to be added to the FIB */
- vl_api_prefix_t prefix;
-};
-
-define hicn_api_route_del_reply
-{
- /* From the request */
- u32 context;
-
- /* Return value, zero means all OK */
- i32 retval;
-};
-
-define hicn_api_route_nhop_del
-{
- /* Client identifier, set from api_main.my_client_index */
- u32 client_index;
-
- /* Arbitrary context, so client can match reply to request */
- u32 context;
-
- /* Prefix to be added to the FIB */
- vl_api_prefix_t prefix;
-
- /* Specific next-hop to be removed */
- u32 faceid;
-};
-
-define hicn_api_route_nhop_del_reply
-{
- /* From the request */
- u32 context;
-
- /* Return value, zero means all OK */
- i32 retval;
-};
-
define hicn_api_route_get
{
/* Client identifier, set from api_main.my_client_index */
diff --git a/hicn-plugin/src/hicn_api.c b/hicn-plugin/src/hicn_api.c
index 1aa6178a7..f5d2cee74 100644
--- a/hicn-plugin/src/hicn_api.c
+++ b/hicn-plugin/src/hicn_api.c
@@ -304,77 +304,6 @@ static void
/****** ROUTE *******/
-static void
-vl_api_hicn_api_route_nhops_add_t_handler (vl_api_hicn_api_route_nhops_add_t
- * mp)
-{
- vl_api_hicn_api_route_nhops_add_reply_t *rmp;
- int rv = HICN_ERROR_NONE;
- hicn_face_id_t face_ids[HICN_PARAM_FIB_ENTRY_NHOPS_MAX];
-
- hicn_main_t *sm = &hicn_main;
-
- fib_prefix_t prefix;
- ip_prefix_decode (&mp->prefix, &prefix);
-
- u8 n_faces = mp->n_faces;
-
- for (int i = 0; i < HICN_PARAM_FIB_ENTRY_NHOPS_MAX; i++)
- {
- face_ids[i] = clib_net_to_host_u32 (mp->face_ids[i]);
- }
-
- if ((face_ids == NULL) || (n_faces > HICN_PARAM_FIB_ENTRY_NHOPS_MAX))
- {
- rv = VNET_API_ERROR_INVALID_ARGUMENT;
- }
- if (rv == HICN_ERROR_NONE)
- {
- rv = hicn_route_add (face_ids, n_faces, &prefix);
-
- if (rv == HICN_ERROR_ROUTE_ALREADY_EXISTS)
- {
- rv = hicn_route_add_nhops (face_ids, n_faces, &prefix);
- }
- }
- REPLY_MACRO (VL_API_HICN_API_ROUTE_NHOPS_ADD_REPLY /* , rmp, mp, rv */ );
-}
-
-
-static void vl_api_hicn_api_route_del_t_handler
- (vl_api_hicn_api_route_del_t * mp)
-{
- vl_api_hicn_api_route_del_reply_t *rmp;
- int rv = HICN_ERROR_NONE;
-
- hicn_main_t *sm = &hicn_main;
-
- fib_prefix_t prefix;
- ip_prefix_decode (&mp->prefix, &prefix);
-
- rv = hicn_route_del (&prefix);
-
- REPLY_MACRO (VL_API_HICN_API_ROUTE_DEL_REPLY /* , rmp, mp, rv */ );
-}
-
-static void vl_api_hicn_api_route_nhop_del_t_handler
- (vl_api_hicn_api_route_nhop_del_t * mp)
-{
- vl_api_hicn_api_route_nhop_del_reply_t *rmp;
- int rv = HICN_ERROR_NONE;
-
- hicn_main_t *sm = &hicn_main;
-
- fib_prefix_t prefix;
- ip_prefix_decode (&mp->prefix, &prefix);
- hicn_face_id_t faceid = clib_net_to_host_u32 (mp->faceid);
-
-
- rv = hicn_route_del_nhop (&prefix, faceid);
-
- REPLY_MACRO (VL_API_HICN_API_ROUTE_NHOP_DEL_REPLY /* , rmp, mp, rv */ );
-}
-
static void vl_api_hicn_api_route_get_t_handler
(vl_api_hicn_api_route_get_t * mp)
{
diff --git a/hicn-plugin/src/hicn_api_test.c b/hicn-plugin/src/hicn_api_test.c
index a09e62c58..e4704e8ea 100644
--- a/hicn-plugin/src/hicn_api_test.c
+++ b/hicn-plugin/src/hicn_api_test.c
@@ -222,9 +222,6 @@ hicn_test_main_t hicn_test_main;
#define foreach_standard_reply_retval_handler \
_(hicn_api_node_params_set_reply) \
-_(hicn_api_route_nhops_add_reply) \
-_(hicn_api_route_del_reply) \
-_(hicn_api_route_nhop_del_reply) \
_(hicn_api_enable_disable_reply)
#define _(n) \
@@ -255,12 +252,9 @@ _(HICN_API_NODE_STATS_GET_REPLY, hicn_api_node_stats_get_reply) \
_(HICN_API_FACE_GET_REPLY, hicn_api_face_get_reply) \
_(HICN_API_FACES_DETAILS, hicn_api_faces_details) \
_(HICN_API_FACE_STATS_DETAILS, hicn_api_face_stats_details) \
-_(HICN_API_ROUTE_NHOPS_ADD_REPLY, hicn_api_route_nhops_add_reply) \
_(HICN_API_FACE_PARAMS_GET_REPLY, hicn_api_face_params_get_reply) \
_(HICN_API_ROUTE_GET_REPLY, hicn_api_route_get_reply) \
_(HICN_API_ROUTES_DETAILS, hicn_api_routes_details) \
-_(HICN_API_ROUTE_DEL_REPLY, hicn_api_route_del_reply) \
-_(HICN_API_ROUTE_NHOP_DEL_REPLY, hicn_api_route_nhop_del_reply) \
_(HICN_API_STRATEGIES_GET_REPLY, hicn_api_strategies_get_reply) \
_(HICN_API_STRATEGY_GET_REPLY, hicn_api_strategy_get_reply) \
_(HICN_API_ENABLE_DISABLE_REPLY, hicn_api_enable_disable_reply) \
@@ -552,6 +546,9 @@ api_hicn_api_faces_dump (vat_main_t * vam)
M (HICN_API_FACES_DUMP, mp);
S (mp);
+ if (!hm->ping_id)
+ hm->ping_id = vl_msg_api_get_msg_index ((u8 *) (VL_API_CONTROL_PING_CRC));
+
/* Use a control ping for synchronization */
mp_ping = vl_msg_api_alloc_as_if_client (sizeof (*mp_ping));
mp_ping->_vl_msg_id = htons (hm->ping_id);
@@ -655,6 +652,9 @@ api_hicn_api_face_stats_dump (vat_main_t * vam)
M (HICN_API_FACE_STATS_DUMP, mp);
S (mp);
+ if (!hm->ping_id)
+ hm->ping_id = vl_msg_api_get_msg_index ((u8 *) (VL_API_CONTROL_PING_CRC));
+
/* Use a control ping for synchronization */
mp_ping = vl_msg_api_alloc_as_if_client (sizeof (*mp_ping));
mp_ping->_vl_msg_id = htons (hm->ping_id);
@@ -757,6 +757,9 @@ api_hicn_api_routes_dump (vat_main_t * vam)
M (HICN_API_ROUTES_DUMP, mp);
S (mp);
+ if (!hm->ping_id)
+ hm->ping_id = vl_msg_api_get_msg_index ((u8 *) (VL_API_CONTROL_PING_CRC));
+
/* Use a control ping for synchronization */
mp_ping = vl_msg_api_alloc_as_if_client (sizeof (*mp_ping));
mp_ping->_vl_msg_id = htons (hm->ping_id);
@@ -847,152 +850,6 @@ static void
}
static int
-api_hicn_api_route_nhops_add (vat_main_t * vam)
-{
- unformat_input_t *input = vam->input;
- vl_api_hicn_api_route_nhops_add_t *mp;
-
- fib_prefix_t prefix;
- u32 faceid = 0;
- int ret;
-
-
- while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (input, "add prefix %U/%d", unformat_ip46_address,
- &prefix.fp_addr, IP46_TYPE_ANY, &prefix.fp_len))
- {;
- }
- else if (unformat (input, "face %d", &faceid))
- {;
- }
- else
- {
- break;
- }
- }
-
- /* Check parse */
- if (((prefix.fp_addr.as_u64[0] == 0) && (prefix.fp_addr.as_u64[1] == 0))
- || (prefix.fp_len == 0) || (faceid == 0))
- {
- clib_warning ("Please specify prefix and faceid...");
- return 1;
- }
- /* Construct the API message */
- M (HICN_API_ROUTE_NHOPS_ADD, mp);
- ip_prefix_encode (&prefix, &mp->prefix);
-
- if (!ip46_address_is_ip4 (&(prefix.fp_addr)))
- prefix.fp_proto = fib_proto_from_ip46 (IP46_TYPE_IP6);
-
- mp->face_ids[0] = clib_host_to_net_u32 (faceid);
- mp->n_faces = 1;
-
- /* send it... */
- S (mp);
-
- /* Wait for a reply... */
- W (ret);
-
- return ret;
-}
-
-static int
-api_hicn_api_route_del (vat_main_t * vam)
-{
- unformat_input_t *input = vam->input;
- vl_api_hicn_api_route_del_t *mp;
-
- fib_prefix_t prefix;
- int ret;
-
- while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (input, "prefix %U/%d", unformat_ip46_address,
- &prefix.fp_addr, IP46_TYPE_ANY, &prefix.fp_len))
- {;
- }
- else
- {
- break;
- }
- }
-
- /* Check parse */
- if (((prefix.fp_addr.as_u64[0] == 0) && (prefix.fp_addr.as_u64[1] == 0))
- || (prefix.fp_len == 0))
- {
- clib_warning ("Please specify prefix...");
- return 1;
- }
- /* Construct the API message */
- M (HICN_API_ROUTE_DEL, mp);
- ip_prefix_encode (&prefix, &mp->prefix);
-
- if (!ip46_address_is_ip4 (&(prefix.fp_addr)))
- prefix.fp_proto = fib_proto_from_ip46 (IP46_TYPE_IP6);
-
- /* send it... */
- S (mp);
-
- /* Wait for a reply... */
- W (ret);
-
- return ret;
-
-}
-
-static int
-api_hicn_api_route_nhop_del (vat_main_t * vam)
-{
- unformat_input_t *input = vam->input;
- vl_api_hicn_api_route_nhop_del_t *mp;
-
- fib_prefix_t prefix;
- int faceid = 0, ret;
-
- while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (input, "del prefix %U/%d", unformat_ip46_address,
- &prefix.fp_addr, IP46_TYPE_ANY, &prefix.fp_len))
- {;
- }
- else if (unformat (input, "face %d", &faceid))
- {;
- }
- else
- {
- break;
- }
- }
-
- /* Check parse */
- if (((prefix.fp_addr.as_u64[0] == 0) && (prefix.fp_addr.as_u64[1] == 0))
- || (prefix.fp_len == 0) || (faceid == HICN_FACE_NULL))
- {
- clib_warning ("Please specify prefix and faceid...");
- return 1;
- }
- /* Construct the API message */
- M (HICN_API_ROUTE_NHOP_DEL, mp);
- ip_prefix_encode (&prefix, &mp->prefix);
-
- if (!ip46_address_is_ip4 (&(prefix.fp_addr)))
- prefix.fp_proto = fib_proto_from_ip46 (IP46_TYPE_IP6);
-
- mp->faceid = clib_host_to_net_u32 (faceid);
-
- /* send it... */
- S (mp);
-
- /* Wait for a reply... */
- W (ret);
-
- return ret;
-}
-
-static int
api_hicn_api_strategies_get (vat_main_t * vam)
{
vl_api_hicn_api_strategies_get_t *mp;
diff --git a/hicn-plugin/src/route.c b/hicn-plugin/src/route.c
index 0096edb2b..b569d431e 100644
--- a/hicn-plugin/src/route.c
+++ b/hicn-plugin/src/route.c
@@ -103,238 +103,6 @@ hicn_route_get_dpo (const fib_prefix_t * prefix,
}
int
-hicn_route_add_nhops (hicn_face_id_t * face_id, u32 len,
- const fib_prefix_t * prefix)
-{
- const dpo_id_t *hicn_dpo_id;
- int ret = HICN_ERROR_NONE;
- hicn_face_id_t faces_id_tmp[HICN_PARAM_FIB_ENTRY_NHOPS_MAX];
- int n_face_id = 0;
- const hicn_dpo_vft_t *dpo_vft;
- u32 fib_index;
- vlib_main_t *vm = vlib_get_main ();
-
- if (face_id == NULL)
- {
- return HICN_ERROR_ROUTE_INVAL;
- }
- /*
- * Check is the faces are available, otherwise skip the face
- * id_adjacency existance is not checked. It should be checked before
- * sending a packet out
- */
- for (int i = 0; i < clib_min (HICN_PARAM_FIB_ENTRY_NHOPS_MAX, len); i++)
- {
- hicn_face_t *face = hicn_dpoi_get_from_idx_safe (face_id[i]);
-
- if (face == NULL)
- {
- vlib_cli_output (vm, "Face %d not found, skip...\n", face_id[i]);
- return ret;
- }
- else
- {
- faces_id_tmp[n_face_id++] = face_id[i];
- }
- }
-
- ret = hicn_route_get_dpo (prefix, &hicn_dpo_id, &fib_index);
-
- if (ret == HICN_ERROR_NONE)
- {
- for (int i = 0; i < n_face_id && (ret == HICN_ERROR_NONE); i++)
- {
- u32 vft_id = hicn_dpo_get_vft_id (hicn_dpo_id);
- dpo_vft = hicn_dpo_get_vft (vft_id);
-
- hicn_face_t *face =
- hicn_dpoi_get_from_idx (faces_id_tmp[i]);
- //Disable feature on the interface
- if (prefix->fp_proto == FIB_PROTOCOL_IP4)
- vnet_feature_enable_disable ("ip4-local", "hicn-data-input-ip4",
- face->sw_if, 1, 0, 0);
- else if (prefix->fp_proto == FIB_PROTOCOL_IP6)
- vnet_feature_enable_disable ("ip6-local", "hicn-data-input-ip6",
- face->sw_if, 1, 0, 0);
-
- ret = dpo_vft->hicn_dpo_add_update_nh (faces_id_tmp[i],
- hicn_dpo_id->dpoi_index);
- }
- }
- return ret;
-}
-
-/* Add a new route for a name prefix */
-int
-hicn_route_add (hicn_face_id_t * face_id, u32 len,
- const fib_prefix_t * prefix)
-{
- dpo_id_t dpo = DPO_INVALID;
- const dpo_id_t *hicn_dpo_id;
- int ret = HICN_ERROR_NONE;
- hicn_face_id_t face_id_tmp[HICN_PARAM_FIB_ENTRY_NHOPS_MAX];
- int n_face_id = 0;
- index_t dpo_idx;
- u32 fib_index;
- vlib_main_t *vm = vlib_get_main ();
-
- if (face_id == NULL || !hicn_dpoi_idx_is_valid (*face_id))
- {
- return HICN_ERROR_ROUTE_INVAL;
- }
- /*
- * Check is the faces are available, otherwise skip the face
- * id_adjacency existance is not checked. It should be checked before
- * sending a packet out
- */
- for (int i = 0; i < clib_min (HICN_PARAM_FIB_ENTRY_NHOPS_MAX, len); i++)
- {
- hicn_face_t *face = hicn_dpoi_get_from_idx (face_id[i]);
-
- if (face == NULL)
- {
- vlib_cli_output (vm, "Face %d not found, skip...\n", face_id[i]);
- return ret;
- }
- else
- {
- face_id_tmp[n_face_id++] = face_id[i];
- }
- }
-
- ret = hicn_route_get_dpo (prefix, &hicn_dpo_id, &fib_index);
-
- if (ret == HICN_ERROR_ROUTE_NOT_FOUND)
- {
- hicn_face_id_t nhops[HICN_PARAM_FIB_ENTRY_NHOPS_MAX];
- for (int i = 0; i < n_face_id; i++)
- {
- nhops[i] = face_id_tmp[i];
- hicn_face_t *face =
- hicn_dpoi_get_from_idx (face_id_tmp[i]);
- //Disable feature on the interface
- if (prefix->fp_proto == FIB_PROTOCOL_IP4)
- vnet_feature_enable_disable ("ip4-local", "hicn-data-input-ip4",
- face->sw_if, 1, 0, 0);
- else if (prefix->fp_proto == FIB_PROTOCOL_IP6)
- vnet_feature_enable_disable ("ip6-local", "hicn-data-input-ip6",
- face->sw_if, 1, 0, 0);
- }
-
- default_dpo.hicn_dpo_create (prefix->fp_proto, nhops, n_face_id,
- &dpo_idx);
-
- /* the value we got when we registered */
- /*
- * This should be taken from the name?!? the index of the
- * object
- */
- dpo_set (&dpo,
- default_dpo.hicn_dpo_get_type (),
- (ip46_address_is_ip4 (&prefix->fp_addr) ? DPO_PROTO_IP4 :
- DPO_PROTO_IP6), dpo_idx);
-
- /* Here is where we create the "via" like route */
- /*
- * For the moment we use the global one the prefix you want
- * to match Neale suggested -- FIB_SOURCE_HICN the client
- * that is adding them -- no easy explanation at this timeā€¦
- */
- fib_node_index_t new_fib_node_index =
- fib_table_entry_special_dpo_add (fib_index,
- prefix,
- hicn_fib_src,
- (FIB_ENTRY_FLAG_EXCLUSIVE |
- FIB_ENTRY_FLAG_LOOSE_URPF_EXEMPT),
- &dpo);
-
- /* We added a route, therefore add one lock to the table */
- fib_table_lock (fib_index, prefix->fp_proto, hicn_fib_src);
-
- dpo_unlock (&dpo);
- ret =
- (new_fib_node_index !=
- FIB_NODE_INDEX_INVALID) ? HICN_ERROR_NONE :
- HICN_ERROR_ROUTE_NO_INSERT;
-
- /*
- * TODO: we might want to store the fib index in the face.
- * This will help to update the fib entries when a face is
- * deleted. Fib_index_t is returned from
- * fib_table_entry_special_dpo_add.
- */
- }
- else if (ret == HICN_ERROR_NONE)
- {
- ret = hicn_route_add_nhops (face_id, len, prefix);
- }
- return ret;
-}
-
-int
-hicn_route_del (fib_prefix_t * prefix)
-{
- const dpo_id_t *hicn_dpo_id;
- int ret = HICN_ERROR_NONE;
- u32 fib_index;
-
- /* Remove the fib entry only if the dpo is of type hicn */
- ret = hicn_route_get_dpo (prefix, &hicn_dpo_id, &fib_index);
-
- if (ret == HICN_ERROR_NONE)
- {
- fib_table_entry_special_remove (HICN_FIB_TABLE, prefix, hicn_fib_src);
-
- /*
- * Remove the lock from the table. We keep one lock per route
- */
- fib_table_unlock (fib_index, prefix->fp_proto, hicn_fib_src);
- }
- //Remember to remove the lock from the table when removing the entry
- return ret;
-}
-
-int
-hicn_route_del_nhop (fib_prefix_t * prefix, hicn_face_id_t face_id)
-{
- const dpo_id_t *hicn_dpo_id;
- int ret;
- u32 vft_id;
- const hicn_dpo_vft_t *dpo_vft;
- u32 fib_index;
-
-
- ret = hicn_route_get_dpo (prefix, &hicn_dpo_id, &fib_index);
-
- /* Check if the dpo is an hicn_dpo_t */
- if (ret == HICN_ERROR_NONE)
- {
- vft_id = hicn_dpo_get_vft_id (hicn_dpo_id);
- dpo_vft = hicn_dpo_get_vft (vft_id);
-
- hicn_face_t *face = hicn_dpoi_get_from_idx (face_id);
- //Disable feature on the interface
- if (prefix->fp_proto == FIB_PROTOCOL_IP4)
- vnet_feature_enable_disable ("ip4-local", "hicn-data-input-ip4",
- face->sw_if, 0, 0, 0);
- else if (prefix->fp_proto == FIB_PROTOCOL_IP6)
- vnet_feature_enable_disable ("ip6-local", "hicn-data-input-ip6",
- face->sw_if, 0, 0, 0);
-
- ret = dpo_vft->hicn_dpo_del_nh (face_id, hicn_dpo_id->dpoi_index);
-
- hicn_dpo_ctx_t *dpo_ctx =
- hicn_strategy_dpo_ctx_get (hicn_dpo_id->dpoi_index);
-
-
- if (ret == HICN_ERROR_NONE && !dpo_ctx->entry_count)
- ret = hicn_route_del (prefix);
- }
- //Remember to remove the lock from the table when removing the entry
- return ret;
-}
-
-int
hicn_route_set_strategy (fib_prefix_t * prefix, u8 strategy_id)
{
const dpo_id_t *hicn_dpo_id;
diff --git a/hicn-plugin/src/route.h b/hicn-plugin/src/route.h
index 4ff514740..4918f275b 100644
--- a/hicn-plugin/src/route.h
+++ b/hicn-plugin/src/route.h
@@ -32,25 +32,6 @@ int
hicn_route_get_dpo (const fib_prefix_t * prefix,
const dpo_id_t ** hicn_dpo, u32 * fib_index);
-/*
- * Add a new route for a name prefix
- */
-int
-hicn_route_add (hicn_face_id_t * face_id, u32 len,
- const fib_prefix_t * prefix);
-
-/*
- * Add new next hops for a prefix route
- */
-int
-hicn_route_add_nhops (hicn_face_id_t * face_id, u32 len,
- const fib_prefix_t * prefix);
-
-/* Remove a route for a name prefix */
-int hicn_route_del (fib_prefix_t * prefix);
-
-/* Remove a next hop route for a name prefix */
-int hicn_route_del_nhop (fib_prefix_t * prefix, u32 face_id);
/* Remove a next hop route for a name prefix */
int