aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-10-21 10:53:20 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-09 15:16:52 +0000
commitd792d9c01e60656cbfe1b0f1fd6a9b125f5dab0c (patch)
treedb88d99dd8102389fb92e8ed44bc7d6a55dc3080 /src/vnet/ip/ip_api.c
parenta2ff7b8cfc829ffbb6d5de7534efb51f7cba9cf3 (diff)
BIER
- see draft-ietf-bier-mpls-encapsulation-10 - midpoint, head and tail functions - supported payload protocols; IPv4 and IPv6 only. Change-Id: I59d7363bb6fdfdce8e4016a68a9c8f5a5e5791cb Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip_api.c')
-rw-r--r--src/vnet/ip/ip_api.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 20e19205756..0fdb167312e 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -464,7 +464,7 @@ send_ip_mfib_details (unix_shared_memory_queue_t * q,
if (!mp)
return;
memset (mp, 0, sizeof (*mp));
- mp->_vl_msg_id = ntohs (VL_API_IP_FIB_DETAILS);
+ mp->_vl_msg_id = ntohs (VL_API_IP_MFIB_DETAILS);
mp->context = context;
mp->rpf_id = mfib_entry->mfe_rpf_id;
@@ -563,7 +563,7 @@ send_ip6_mfib_details (vpe_api_main_t * am,
if (!mp)
return;
memset (mp, 0, sizeof (*mp));
- mp->_vl_msg_id = ntohs (VL_API_IP6_FIB_DETAILS);
+ mp->_vl_msg_id = ntohs (VL_API_IP6_MFIB_DETAILS);
mp->context = context;
mp->table_id = htonl (table_id);
@@ -1283,40 +1283,45 @@ mroute_add_del_handler (u8 is_add,
u8 is_local,
u32 fib_index,
const mfib_prefix_t * prefix,
+ dpo_proto_t nh_proto,
u32 entry_flags,
fib_rpf_id_t rpf_id,
- u32 next_hop_sw_if_index, u32 itf_flags)
+ u32 next_hop_sw_if_index, u32 itf_flags, u32 bier_imp)
{
stats_dslock_with_hint (1 /* release hint */ , 2 /* tag */ );
fib_route_path_t path = {
.frp_sw_if_index = next_hop_sw_if_index,
- .frp_proto = fib_proto_to_dpo (prefix->fp_proto),
+ .frp_proto = nh_proto,
};
if (is_local)
path.frp_flags |= FIB_ROUTE_PATH_LOCAL;
-
- if (!is_local && ~0 == next_hop_sw_if_index)
+ if (DPO_PROTO_BIER == nh_proto)
+ {
+ path.frp_bier_imp = bier_imp;
+ path.frp_flags = FIB_ROUTE_PATH_BIER_IMP;
+ }
+ else if (!is_local && ~0 == next_hop_sw_if_index)
{
mfib_table_entry_update (fib_index, prefix,
MFIB_SOURCE_API, rpf_id, entry_flags);
+ goto done;
+ }
+
+ if (is_add)
+ {
+ mfib_table_entry_path_update (fib_index, prefix,
+ MFIB_SOURCE_API, &path, itf_flags);
}
else
{
- if (is_add)
- {
- mfib_table_entry_path_update (fib_index, prefix,
- MFIB_SOURCE_API, &path, itf_flags);
- }
- else
- {
- mfib_table_entry_path_remove (fib_index, prefix,
- MFIB_SOURCE_API, &path);
- }
+ mfib_table_entry_path_remove (fib_index, prefix,
+ MFIB_SOURCE_API, &path);
}
+done:
stats_dsunlock ();
return (0);
}
@@ -1325,9 +1330,11 @@ static int
api_mroute_add_del_t_handler (vl_api_ip_mroute_add_del_t * mp)
{
fib_protocol_t fproto;
+ dpo_proto_t nh_proto;
u32 fib_index;
int rv;
+ nh_proto = mp->next_hop_afi;
fproto = (mp->is_ipv6 ? FIB_PROTOCOL_IP6 : FIB_PROTOCOL_IP4);
rv = add_del_mroute_check (fproto,
mp->table_id,
@@ -1360,10 +1367,12 @@ api_mroute_add_del_t_handler (vl_api_ip_mroute_add_del_t * mp)
return (mroute_add_del_handler (mp->is_add,
mp->is_local,
fib_index, &pfx,
+ nh_proto,
ntohl (mp->entry_flags),
ntohl (mp->rpf_id),
ntohl (mp->next_hop_sw_if_index),
- ntohl (mp->itf_flags)));
+ ntohl (mp->itf_flags),
+ ntohl (mp->bier_imp)));
}
void