tcp: avoid fr segments less than mss if possible
[vpp.git] / src / vnet / srv6 / sr.h
index d47c213..c2867eb 100644 (file)
 
 #define SR_SEGMENT_LIST_WEIGHT_DEFAULT 1
 
-/* *INDENT-OFF* */
 typedef struct
 {
   ip6_header_t ip;
   ip6_sr_header_t sr;
 } __attribute__ ((packed)) ip6srv_combo_header_t;
-/* *INDENT-ON* */
 
 /**
  * @brief SR Segment List (SID list)
@@ -75,6 +73,7 @@ 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 */
 
@@ -89,6 +88,7 @@ typedef struct
 /* SR policy types */
 #define SR_POLICY_TYPE_DEFAULT 0
 #define SR_POLICY_TYPE_SPRAY 1
+#define SR_POLICY_TYPE_TEF     2
 /**
  * @brief SR Policy
  */
@@ -100,7 +100,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 */
@@ -110,6 +110,8 @@ typedef struct
 
   u8 is_encap;                         /**< Mode (0 is SRH insert, 1 Encaps) */
 
+  ip6_address_t encap_src;
+
   u16 plugin;
   void *plugin_mem;
 } ip6_sr_policy_t;
@@ -127,7 +129,7 @@ typedef struct
 
   char end_psp;                                        /**< Combined with End.PSP? */
 
-  u16 behavior;                                        /**< Behavior associated to this localsid */
+  u8 behavior; /**< Behavior associated to this localsid */
 
   union
   {
@@ -342,13 +344,13 @@ 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_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_add (ip6_address_t *bsid, ip6_address_t *segments,
+                         ip6_address_t *encap_src, 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,
+                         ip6_address_t *encap_src, u32 sl_index, u32 weight);
 extern int sr_policy_del (ip6_address_t * bsid, u32 index);
 
 extern int