X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsrv6%2Fsr.h;h=c2867eb7508b67e0e9a166e7223320b066e805cc;hb=e8ea6be8dfb626b5bb4ff3355ce8037724ce1d83;hp=41adef30818079d7a58b1c9ce66970ad195bd59b;hpb=8bf80a3ddae7733925a757cb1710e25776eea01c;p=vpp.git diff --git a/src/vnet/srv6/sr.h b/src/vnet/srv6/sr.h index 41adef30818..c2867eb7508 100644 --- a/src/vnet/srv6/sr.h +++ b/src/vnet/srv6/sr.h @@ -56,13 +56,11 @@ #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,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 */ @@ -87,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 */ @@ -98,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 */ @@ -108,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; @@ -125,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 { @@ -307,6 +311,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; @@ -339,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 @@ -360,6 +365,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); @@ -403,7 +409,6 @@ ip6_sr_compute_rewrite_string_insert (ip6_address_t * sl) return rs; } - #endif /* included_vnet_sr_h */ /*