aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/mpls/mpls.c
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/vnet/mpls/mpls.c
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/vnet/mpls/mpls.c')
-rw-r--r--src/vnet/mpls/mpls.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/vnet/mpls/mpls.c b/src/vnet/mpls/mpls.c
index 068d31f4c8e..266ba42c94f 100644
--- a/src/vnet/mpls/mpls.c
+++ b/src/vnet/mpls/mpls.c
@@ -261,7 +261,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
&rpath.frp_sw_if_index,
&rpath.frp_weight))
{
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
}
@@ -272,7 +272,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
&rpath.frp_sw_if_index,
&rpath.frp_weight))
{
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
vec_add1(rpaths, rpath);
}
@@ -283,7 +283,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
&rpath.frp_sw_if_index))
{
rpath.frp_weight = 1;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "rx-ip4 %U",
@@ -291,7 +291,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
&rpath.frp_sw_if_index))
{
rpath.frp_weight = 1;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
rpath.frp_flags = FIB_ROUTE_PATH_INTF_RX;
vec_add1(rpaths, rpath);
}
@@ -302,7 +302,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
&rpath.frp_sw_if_index))
{
rpath.frp_weight = 1;
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "via %U next-hop-table %d",
@@ -312,7 +312,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
{
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "via %U next-hop-table %d",
@@ -322,7 +322,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
{
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "via %U",
@@ -336,7 +336,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
rpath.frp_fib_index = table_id;
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "via %U",
@@ -346,7 +346,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
rpath.frp_fib_index = table_id;
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "%d", &local_label))
@@ -355,7 +355,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
"ip4-lookup-in-table %d",
&rpath.frp_fib_index))
{
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
rpath.frp_sw_if_index = FIB_NODE_INDEX_INVALID;
pfx.fp_payload_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
@@ -364,7 +364,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
"ip6-lookup-in-table %d",
&rpath.frp_fib_index))
{
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
rpath.frp_sw_if_index = FIB_NODE_INDEX_INVALID;
vec_add1(rpaths, rpath);
pfx.fp_payload_proto = DPO_PROTO_IP6;
@@ -373,11 +373,21 @@ vnet_mpls_local_label (vlib_main_t * vm,
"mpls-lookup-in-table %d",
&rpath.frp_fib_index))
{
- rpath.frp_proto = FIB_PROTOCOL_MPLS;
+ rpath.frp_proto = DPO_PROTO_MPLS;
rpath.frp_sw_if_index = FIB_NODE_INDEX_INVALID;
pfx.fp_payload_proto = DPO_PROTO_MPLS;
vec_add1(rpaths, rpath);
}
+ else if (unformat (line_input,
+ "l2-input-on %U",
+ unformat_vnet_sw_interface, vnm,
+ &rpath.frp_sw_if_index))
+ {
+ rpath.frp_proto = DPO_PROTO_ETHERNET;
+ pfx.fp_payload_proto = DPO_PROTO_ETHERNET;
+ rpath.frp_flags = FIB_ROUTE_PATH_INTF_RX;
+ vec_add1(rpaths, rpath);
+ }
else if (unformat (line_input, "out-label %U",
unformat_mpls_unicast_label,
&out_label))
@@ -440,7 +450,7 @@ vnet_mpls_local_label (vlib_main_t * vm,
pfx.fp_proto = FIB_PROTOCOL_MPLS;
pfx.fp_len = 21;
pfx.fp_label = local_label;
- pfx.fp_payload_proto = fib_proto_to_dpo(rpaths[0].frp_proto);
+ pfx.fp_payload_proto = rpaths[0].frp_proto;
/*
* the CLI parsing stored table Ids, swap to FIB indicies