VPP-76:APIs for Proof of transit feature added to iOAM
[vpp.git] / vnet / vnet / ip / ip6_hop_by_hop.h
index 50a14a9..0ee24b3 100644 (file)
@@ -45,8 +45,8 @@ typedef struct {
   u32 node_id;
   u32 app_data;
 
-  /* PoW option */
-  u8 has_pow_option;
+  /* Pot option */
+  u8 has_pot_option;
 
 #define PPC_NONE  0
 #define PPC_ENCAP 1
@@ -59,7 +59,12 @@ typedef struct {
 #define TSP_NANOSECONDS          3
   /* Time stamp precision. This is enumerated to above four options */
   u32 trace_tsp;
-
+  
+  /* Array of function pointers to ADD and POP HBH option handling routines */
+  u8 options_size[256];
+  int (*add_options[256])(u8 *rewrite_string, u8 rewrite_size);
+  int (*pop_options[256])(ip6_header_t *ip, ip6_hop_by_hop_option_t *opt);
+  
   /* convenience */
   vlib_main_t * vlib_main;
   vnet_main_t * vnet_main;
@@ -70,7 +75,7 @@ extern ip6_hop_by_hop_ioam_main_t ip6_hop_by_hop_ioam_main;
 extern u8 * format_path_map(u8 * s, va_list * args);
 extern clib_error_t *
 ip6_ioam_trace_profile_set(u32 trace_option_elts, u32 trace_type, u32 node_id,
-                           u32 app_data, int has_pow_option, u32 trace_tsp,
+                           u32 app_data, int has_pot_option, u32 trace_tsp,
                            int has_e2e_option);
 extern int ip6_ioam_set_destination (ip6_address_t *addr, u32 mask_width,
                   u32 vrf_id, int is_add, int is_pop, int is_none);
@@ -103,5 +108,14 @@ static inline u8 is_zero_ip6_address (ip6_address_t *a)
   return ((a->as_u64[0] == 0) && (a->as_u64[1] == 0));
 }
 
-extern ip6_hop_by_hop_ioam_main_t * hm;
+int ip6_hbh_add_register_option (u8 option,
+                                u8 size,
+                                int rewrite_options(u8 *rewrite_string, u8 size));
+int ip6_hbh_add_unregister_option (u8 option);
+
+int ip6_hbh_pop_register_option (u8 option,
+                                int options(ip6_header_t *ip, ip6_hop_by_hop_option_t *opt));
+int ip6_hbh_pop_unregister_option (u8 option);
+
+
 #endif /* __included_ip6_hop_by_hop_ioam_h__ */