summaryrefslogtreecommitdiffstats
path: root/src/vnet/dpo/interface_dpo.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/dpo/interface_dpo.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/dpo/interface_dpo.c')
-rw-r--r--src/vnet/dpo/interface_dpo.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/vnet/dpo/interface_dpo.c b/src/vnet/dpo/interface_dpo.c
index 8d700c23e46..780bfa2a293 100644
--- a/src/vnet/dpo/interface_dpo.c
+++ b/src/vnet/dpo/interface_dpo.c
@@ -195,11 +195,17 @@ const static char* const interface_dpo_ip6_nodes[] =
"interface-dpo-ip4",
NULL,
};
+const static char* const interface_dpo_l2_nodes[] =
+{
+ "interface-dpo-l2",
+ NULL,
+};
const static char* const * const interface_dpo_nodes[DPO_PROTO_NUM] =
{
[DPO_PROTO_IP4] = interface_dpo_ip4_nodes,
[DPO_PROTO_IP6] = interface_dpo_ip6_nodes,
+ [DPO_PROTO_ETHERNET] = interface_dpo_l2_nodes,
[DPO_PROTO_MPLS] = NULL,
};
@@ -382,6 +388,14 @@ interface_dpo_ip6 (vlib_main_t * vm,
return (interface_dpo_inline(vm, node, from_frame));
}
+static uword
+interface_dpo_l2 (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
+{
+ return (interface_dpo_inline(vm, node, from_frame));
+}
+
VLIB_REGISTER_NODE (interface_dpo_ip4_node) = {
.function = interface_dpo_ip4,
.name = "interface-dpo-ip4",
@@ -414,3 +428,19 @@ VLIB_REGISTER_NODE (interface_dpo_ip6_node) = {
VLIB_NODE_FUNCTION_MULTIARCH (interface_dpo_ip6_node,
interface_dpo_ip6)
+VLIB_REGISTER_NODE (interface_dpo_l2_node) = {
+ .function = interface_dpo_l2,
+ .name = "interface-dpo-l2",
+ .vector_size = sizeof (u32),
+ .format_trace = format_interface_dpo_trace,
+
+ .n_next_nodes = 2,
+ .next_nodes = {
+ [INTERFACE_DPO_DROP] = "error-drop",
+ [INTERFACE_DPO_INPUT] = "l2-input",
+ },
+};
+
+VLIB_NODE_FUNCTION_MULTIARCH (interface_dpo_l2_node,
+ interface_dpo_l2)
+