ipsec: Support MPLS over IPSec[46] interface
[vpp.git] / src / vnet / ipsec / ipsec_handoff.c
index 4446f1e..87eb801 100644 (file)
@@ -220,6 +220,15 @@ VLIB_NODE_FN (esp6_encrypt_tun_handoff) (vlib_main_t * vm,
                        true);
 }
 
+VLIB_NODE_FN (esp_mpls_encrypt_tun_handoff)
+(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
+{
+  ipsec_main_t *im = &ipsec_main;
+
+  return ipsec_handoff (vm, node, from_frame, im->esp_mpls_enc_tun_fq_index,
+                       true);
+}
+
 VLIB_NODE_FN (esp4_decrypt_handoff) (vlib_main_t * vm,
                                     vlib_node_runtime_t * node,
                                     vlib_frame_t * from_frame)
@@ -343,6 +352,18 @@ VLIB_REGISTER_NODE (esp6_encrypt_tun_handoff) = {
     [0] = "error-drop",
   },
 };
+VLIB_REGISTER_NODE (esp_mpls_encrypt_tun_handoff) = {
+  .name = "esp-mpls-encrypt-tun-handoff",
+  .vector_size = sizeof (u32),
+  .format_trace = format_ipsec_handoff_trace,
+  .type = VLIB_NODE_TYPE_INTERNAL,
+  .n_errors = ARRAY_LEN(ipsec_handoff_error_strings),
+  .error_strings = ipsec_handoff_error_strings,
+  .n_next_nodes = 1,
+  .next_nodes = {
+    [0] = "error-drop",
+  },
+};
 VLIB_REGISTER_NODE (esp4_decrypt_handoff) = {
   .name = "esp4-decrypt-handoff",
   .vector_size = sizeof (u32),