#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)
*/
{
ip6_address_t localsid; /**< LocalSID IPv6 address */
+ u16 localsid_len;
+
char end_psp; /**< Combined with End.PSP? */
u16 behavior; /**< Behavior associated to this localsid */
u8 *params_str; /**< Behavior parameters (i.e. <oif> <IP46next_hop>) */
+ u8 prefix_length;
+
dpo_type_t dpo; /**< DPO type registration */
format_function_t *ls_format; /**< LocalSID format function */
extern int
sr_localsid_register_function (vlib_main_t * vm, u8 * fn_name,
u8 * keyword_str, u8 * def_str,
- u8 * params_str, dpo_type_t * dpo,
+ u8 * params_str, u8 prefix_length,
+ dpo_type_t * dpo,
format_function_t * ls_format,
unformat_function_t * ls_unformat,
sr_plugin_callback_t * creation_fn,
extern int
sr_policy_add (ip6_address_t * bsid, ip6_address_t * segments,
u32 weight, u8 behavior, u32 fib_table, u8 is_encap);
-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_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,
+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);
extern void sr_set_source (ip6_address_t * address);
+extern void sr_set_hop_limit (u8 hop_limit);
+extern u8 sr_get_hop_limit (void);
+
/**
* @brief SR rewrite string computation for SRH insertion (inline)
*
srh = (ip6_sr_header_t *) rs;
srh->type = ROUTING_HEADER_TYPE_SR;
srh->segments_left = vec_len (sl);
- srh->first_segment = vec_len (sl);
+ srh->last_entry = vec_len (sl);
srh->length = ((sizeof (ip6_sr_header_t) +
((vec_len (sl) + 1) * sizeof (ip6_address_t))) / 8) - 1;
srh->flags = 0x00;
- srh->reserved = 0x0000;
+ srh->tag = 0x0000;
addrp = srh->segments + vec_len (sl);
vec_foreach (this_address, sl)
{