linux-cp: fix setting mtu on hardware interfaces
[vpp.git] / src / vnet / srv6 / sr.h
old mode 100755 (executable)
new mode 100644 (file)
index 6a228c8..507f8df
@@ -43,7 +43,9 @@
 #define SR_BEHAVIOR_DX4 7
 #define SR_BEHAVIOR_DT6 8
 #define SR_BEHAVIOR_DT4 9
-#define SR_BEHAVIOR_LAST 10    /* Must always be the last one */
+#define SR_BEHAVIOR_END_UN_PERF 10
+#define SR_BEHAVIOR_END_UN 11
+#define SR_BEHAVIOR_LAST 12    /* Must always be the last one */
 
 #define SR_STEER_L2 2
 #define SR_STEER_IPV4 4
@@ -73,6 +75,9 @@ typedef struct
 
   u8 *rewrite;                                 /**< Precomputed rewrite header */
   u8 *rewrite_bsid;                            /**< Precomputed rewrite header for bindingSID */
+  u8 policy_type;
+
+  u32 egress_fib_table; /**< Egress FIB table for encap packet */
 
   dpo_id_t bsid_dpo;                           /**< DPO for Encaps/Insert for BSID */
   dpo_id_t ip6_dpo;                            /**< DPO for Encaps/Insert IPv6 */
@@ -96,7 +101,7 @@ typedef struct
 
   u8 type;                                     /**< Type (default is 0) */
   /* SR Policy specific DPO                                       */
-  /* IF Type = DEFAULT Then Load Balancer DPO among SID lists     */
+  /* IF Type = DEFAULT Then Load-Balancer DPO among SID lists     */
   /* IF Type = SPRAY then Spray DPO with all SID lists            */
   dpo_id_t bsid_dpo;                   /**< SR Policy specific DPO - BSID */
   dpo_id_t ip4_dpo;                    /**< SR Policy specific DPO - IPv6 */
@@ -119,11 +124,11 @@ typedef struct
 {
   ip6_address_t localsid;              /**< LocalSID IPv6 address */
 
-  u16 localsid_len;
+  u16 localsid_prefix_len;
 
   char end_psp;                                        /**< Combined with End.PSP? */
 
-  u16 behavior;                                        /**< Behavior associated to this localsid */
+  u8 behavior; /**< Behavior associated to this localsid */
 
   union
   {
@@ -139,6 +144,15 @@ typedef struct
 
   u32 nh_adj;                                          /**< Next_adj for xconnect usage only */
 
+  ip6_address_t usid_block;
+  ip6_address_t usid_block_mask;
+
+  u8 usid_index;
+  u8 usid_len;
+
+  u8 usid_next_index;
+  u8 usid_next_len;
+
   void *plugin_mem;                            /**< Memory to be used by the plugin callback functions */
 } ip6_sr_localsid_t;
 
@@ -231,6 +245,13 @@ typedef struct
   u32 sr_policy;                                       /**< SR Policy index */
 } ip6_sr_steering_policy_t;
 
+typedef struct
+{
+  ip6_address_t address;
+  u16 pref_len;
+  u8 padding[2];
+} sr_localsid_key_t;
+
 /**
  * @brief Segment Routing main datastructure
  */
@@ -289,6 +310,7 @@ typedef struct
   /* convenience */
   vlib_main_t *vlib_main;
   vnet_main_t *vnet_main;
+  u16 msg_id_base;
 } ip6_sr_main_t;
 
 extern ip6_sr_main_t sr_main;
@@ -321,20 +343,19 @@ sr_policy_register_function (vlib_main_t * vm, u8 * fn_name,
                             sr_p_plugin_callback_t * creation_fn,
                             sr_p_plugin_callback_t * removal_fn);
 
-extern int
-sr_policy_add (ip6_address_t * bsid, ip6_address_t * segments,
-              u32 weight, u8 behavior, u32 fib_table, u8 is_encap,
-              u16 plugin, void *plugin_mem);
+extern int sr_policy_add (ip6_address_t *bsid, ip6_address_t *segments,
+                         u32 weight, u8 type, u32 fib_table, u8 is_encap,
+                         u16 plugin, void *plugin_mem);
 extern int sr_policy_mod (ip6_address_t * bsid, u32 index, u32 fib_table,
                          u8 operation, ip6_address_t * segments,
                          u32 sl_index, u32 weight);
 extern int sr_policy_del (ip6_address_t * bsid, u32 index);
 
 extern int
-sr_cli_localsid (char is_del, ip6_address_t * localsid_addr, u16 prefixlen,
-                char end_psp, u8 behavior, u32 sw_if_index,
-                u32 vlan_index, u32 fib_table, ip46_address_t * nh_addr,
-                void *ls_plugin_mem);
+sr_cli_localsid (char is_del, ip6_address_t * localsid_addr,
+                u16 localsid_prefix_len, char end_psp, u8 behavior,
+                u32 sw_if_index, u32 vlan_index, u32 fib_table,
+                ip46_address_t * nh_addr, int usid_len, void *ls_plugin_mem);
 
 extern int
 sr_steering_policy (int is_del, ip6_address_t * bsid, u32 sr_policy_index,
@@ -342,6 +363,7 @@ sr_steering_policy (int is_del, ip6_address_t * bsid, u32 sr_policy_index,
                    u32 sw_if_index, u8 traffic_type);
 
 extern void sr_set_source (ip6_address_t * address);
+extern ip6_address_t *sr_get_encaps_source ();
 
 extern void sr_set_hop_limit (u8 hop_limit);
 extern u8 sr_get_hop_limit (void);
@@ -385,7 +407,6 @@ ip6_sr_compute_rewrite_string_insert (ip6_address_t * sl)
   return rs;
 }
 
-
 #endif /* included_vnet_sr_h */
 
 /*