BFD-FIB interactions
[vpp.git] / src / vnet / bfd / bfd_udp.h
index 5080ec9..8786810 100644 (file)
 /* *INDENT-OFF* */
 /** identifier of BFD session based on UDP transport only */
 typedef CLIB_PACKED (struct {
-  /** interface to which the session is tied */
-  u32 sw_if_index;
+  union {
+    /** interface to which the session is tied - single-hop */
+    u32 sw_if_index;
+    /** the FIB index the peer is in - multi-hop*/
+    u32 fib_index;
+  };
   /** local address */
   ip46_address_t local_addr;
   /** peer address */
@@ -57,11 +61,12 @@ struct bfd_session_s;
 /**
  * @brief add the necessary transport layer by prepending it to existing data
  *
+ *
  * @param is_echo 1 if this is echo packet, 0 if control frame
  *
  * @return 1 on success, 0 on failure
  */
-int bfd_add_udp4_transport (vlib_main_t * vm, vlib_buffer_t * b,
+int bfd_add_udp4_transport (vlib_main_t * vm, u32 bi,
                            const struct bfd_session_s *bs, int is_echo);
 
 /**
@@ -71,9 +76,29 @@ int bfd_add_udp4_transport (vlib_main_t * vm, vlib_buffer_t * b,
  *
  * @return 1 on success, 0 on failure
  */
-int bfd_add_udp6_transport (vlib_main_t * vm, vlib_buffer_t * b,
+int bfd_add_udp6_transport (vlib_main_t * vm, u32 bi,
                            const struct bfd_session_s *bs, int is_echo);
 
+/**
+ * @brief transport packet over udpv4
+ *
+ * @param is_echo 1 if this is echo packet, 0 if control frame
+ *
+ * @return 1 on success, 0 on failure
+ */
+int bfd_transport_udp4 (vlib_main_t * vm, u32 bi,
+                       const struct bfd_session_s *bs);
+
+/**
+ * @brief transport packet over udpv6
+ *
+ * @param is_echo 1 if this is echo packet, 0 if control frame
+ *
+ * @return 1 on success, 0 on failure
+ */
+int bfd_transport_udp6 (vlib_main_t * vm, u32 bi,
+                       const struct bfd_session_s *bs);
+
 /**
  * @brief check if the bfd udp layer is echo-capable at this time
  *