aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-05-24 09:15:43 -0700
committerFlorin Coras <florin.coras@gmail.com>2017-08-08 17:25:00 +0000
commitda78f957e46c686434149d332a477d7ea055d76a (patch)
tree4499475fa0904c4b7660dd29576857def77a29ba /src/vat
parentb60f4965bf6f51eb746e18fa0307af8e3444bf96 (diff)
L2 over MPLS
[support for VPWS/VPLS] - switch to using dpo_proto_t rather than fib_protocol_t in fib_paths so that we can describe L2 paths - VLIB nodes to handle pop/push of MPLS labels to L2 Change-Id: Id050d06a11fd2c9c1c81ce5a0654e6c5ae6afa6e Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/api_format.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index f97cdeef417..009cf173064 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -7498,7 +7498,7 @@ api_mpls_route_add_del (vat_main_t * vam)
mpls_label_t *next_hop_out_label_stack = NULL;
mpls_label_t local_label = MPLS_LABEL_INVALID;
u8 is_eos = 0;
- u8 next_hop_proto_is_ip4 = 1;
+ dpo_proto_t next_hop_proto = DPO_PROTO_IP4;
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
@@ -7517,13 +7517,13 @@ api_mpls_route_add_del (vat_main_t * vam)
&v4_next_hop_address))
{
next_hop_set = 1;
- next_hop_proto_is_ip4 = 1;
+ next_hop_proto = DPO_PROTO_IP4;
}
else if (unformat (i, "via %U", unformat_ip6_address,
&v6_next_hop_address))
{
next_hop_set = 1;
- next_hop_proto_is_ip4 = 0;
+ next_hop_proto = DPO_PROTO_IP6;
}
else if (unformat (i, "weight %d", &next_hop_weight))
;
@@ -7548,12 +7548,12 @@ api_mpls_route_add_del (vat_main_t * vam)
else if (unformat (i, "lookup-in-ip4-table %d", &next_hop_table_id))
{
next_hop_set = 1;
- next_hop_proto_is_ip4 = 1;
+ next_hop_proto = DPO_PROTO_IP4;
}
else if (unformat (i, "lookup-in-ip6-table %d", &next_hop_table_id))
{
next_hop_set = 1;
- next_hop_proto_is_ip4 = 0;
+ next_hop_proto = DPO_PROTO_IP6;
}
else if (unformat (i, "next-hop-table %d", &next_hop_table_id))
;
@@ -7599,7 +7599,7 @@ api_mpls_route_add_del (vat_main_t * vam)
mp->mr_create_table_if_needed = create_table_if_needed;
mp->mr_is_add = is_add;
- mp->mr_next_hop_proto_is_ip4 = next_hop_proto_is_ip4;
+ mp->mr_next_hop_proto = next_hop_proto;
mp->mr_is_classify = is_classify;
mp->mr_is_multipath = is_multipath;
mp->mr_is_resolve_host = resolve_host;
@@ -7622,13 +7622,14 @@ api_mpls_route_add_del (vat_main_t * vam)
if (next_hop_set)
{
- if (next_hop_proto_is_ip4)
+ if (DPO_PROTO_IP4 == next_hop_proto)
{
clib_memcpy (mp->mr_next_hop,
&v4_next_hop_address,
sizeof (v4_next_hop_address));
}
- else
+ else if (DPO_PROTO_IP6 == next_hop_proto)
+
{
clib_memcpy (mp->mr_next_hop,
&v6_next_hop_address,