summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-02-23 05:29:09 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-09 11:59:58 +0000
commit31ed74407643595fdce206e9d7487108fb8b33ab (patch)
treec22c3703c30b7d457b858fe899f56e57613cbb52 /src/vnet/ip/ip_api.c
parent8f931a47b0fa58d5d33a792062650a42ff8bef70 (diff)
MPLS Unifom mode
- support both pipe and uniform modes for all MPLS LSP - all API programming for output-labels requires that the mode (and associated data) is specificed - API changes in MPLS, BIER and IP are involved - new DPO [sub] types for MPLS labels to handle the two modes. Change-Id: I87b76401e996f10dfbdbe4552ff6b19af958783c 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.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 60fa2faf926..726d24ca5a8 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -867,7 +867,7 @@ add_del_route_t_handler (u8 is_multipath,
u16 next_hop_weight,
u16 next_hop_preference,
mpls_label_t next_hop_via_label,
- mpls_label_t * next_hop_out_label_stack)
+ fib_mpls_label_t * next_hop_out_label_stack)
{
vnet_classify_main_t *cm = &vnet_classify_main;
fib_route_path_flags_t path_flags = FIB_ROUTE_PATH_FLAG_NONE;
@@ -1071,7 +1071,7 @@ static int
ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t * mp)
{
u32 fib_index, next_hop_fib_index;
- mpls_label_t *label_stack = NULL;
+ fib_mpls_label_t *label_stack = NULL;
int rv, ii, n_labels;;
rv = add_del_route_check (FIB_PROTOCOL_IP4,
@@ -1097,13 +1097,19 @@ ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t * mp)
n_labels = mp->next_hop_n_out_labels;
if (n_labels == 0)
;
- else if (1 == n_labels)
- vec_add1 (label_stack, ntohl (mp->next_hop_out_label_stack[0]));
else
{
vec_validate (label_stack, n_labels - 1);
for (ii = 0; ii < n_labels; ii++)
- label_stack[ii] = ntohl (mp->next_hop_out_label_stack[ii]);
+ {
+ label_stack[ii].fml_value =
+ ntohl (mp->next_hop_out_label_stack[ii].label);
+ label_stack[ii].fml_ttl = mp->next_hop_out_label_stack[ii].ttl;
+ label_stack[ii].fml_exp = mp->next_hop_out_label_stack[ii].exp;
+ label_stack[ii].fml_mode =
+ (mp->next_hop_out_label_stack[ii].is_uniform ?
+ FIB_MPLS_LSP_MODE_UNIFORM : FIB_MPLS_LSP_MODE_PIPE);
+ }
}
return (add_del_route_t_handler (mp->is_multipath,
@@ -1133,8 +1139,8 @@ ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t * mp)
static int
ip6_add_del_route_t_handler (vl_api_ip_add_del_route_t * mp)
{
+ fib_mpls_label_t *label_stack = NULL;
u32 fib_index, next_hop_fib_index;
- mpls_label_t *label_stack = NULL;
int rv, ii, n_labels;;
rv = add_del_route_check (FIB_PROTOCOL_IP6,
@@ -1160,13 +1166,19 @@ ip6_add_del_route_t_handler (vl_api_ip_add_del_route_t * mp)
n_labels = mp->next_hop_n_out_labels;
if (n_labels == 0)
;
- else if (1 == n_labels)
- vec_add1 (label_stack, ntohl (mp->next_hop_out_label_stack[0]));
else
{
vec_validate (label_stack, n_labels - 1);
for (ii = 0; ii < n_labels; ii++)
- label_stack[ii] = ntohl (mp->next_hop_out_label_stack[ii]);
+ {
+ label_stack[ii].fml_value =
+ ntohl (mp->next_hop_out_label_stack[ii].label);
+ label_stack[ii].fml_ttl = mp->next_hop_out_label_stack[ii].ttl;
+ label_stack[ii].fml_exp = mp->next_hop_out_label_stack[ii].exp;
+ label_stack[ii].fml_mode =
+ (mp->next_hop_out_label_stack[ii].is_uniform ?
+ FIB_MPLS_LSP_MODE_UNIFORM : FIB_MPLS_LSP_MODE_PIPE);
+ }
}
return (add_del_route_t_handler (mp->is_multipath,