68 u32 fib_table, ip46_address_t *
nh_addr,
void *ls_plugin_mem)
98 pref_length = prefixlen;
104 .fp_len = pref_length,
106 .ip6 = *localsid_addr,
149 .fp_len = pref_length,
220 nh_addr, sw_if_index);
224 nh_addr, sw_if_index);
233 ls->
nh_adj = nh_adj_index;
298 ip46_address_t next_hop;
299 char address_set = 0;
301 void *ls_plugin_mem = 0;
312 else if (!address_set
316 else if (!address_set
318 &resulting_address, &prefix_len))
320 else if (!address_set
324 else if (
unformat (input,
"fib-table %u", &fib_index));
325 else if (vlan_index == (
u32) ~ 0
326 &&
unformat (input,
"vlan %u", &vlan_index));
327 else if (!behavior &&
unformat (input,
"behavior"))
333 else if (
unformat (input,
"end.t %u", &sw_if_index))
335 else if (
unformat (input,
"end.dx6 %U %U",
339 else if (
unformat (input,
"end.dx4 %U %U",
343 else if (
unformat (input,
"end.dx2 %U",
346 else if (
unformat (input,
"end.dt6 %u", &sw_if_index))
348 else if (
unformat (input,
"end.dt4 %u", &sw_if_index))
360 vec_add1 (vec_plugins, plugin);
367 (input,
"%U", (*plugin_it)->ls_unformat, &ls_plugin_mem))
369 behavior = (*plugin_it)->sr_localsid_function_number;
383 else if (!end_psp &&
unformat (input,
"psp"))
389 if (!behavior && end_psp)
394 "Error: SRv6 LocalSID address is mandatory.");
395 if (!is_del && !behavior)
397 "Error: SRv6 LocalSID behavior is mandatory.");
398 if (vlan_index != (
u32) ~ 0)
400 "Error: SRv6 End.DX2 with rewrite VLAN tag not supported by now.");
403 "Error: SRv6 PSP only compatible with End and End.X");
407 behavior, sw_if_index, vlan_index, fib_index, &next_hop,
418 "Identical localsid already exists. Requested localsid not created.");
421 "The requested localsid could not be deleted. SR localsid not found");
426 "requested localsid non segment routing related");
429 "Could not create ARP/ND entry for such next_hop. Internal error.");
432 "Error on the plugin based localsid creation.");
441 .path =
"sr localsid",
442 .short_help =
"sr localsid (del) address XX:XX::YY:YY" 443 "(fib-table 8) behavior STRING",
445 "Create SR LocalSID and binds it to a particular behavior\n" 447 "\tlocalSID IPv6_addr(128b) LocalSID IPv6 address\n" 448 "\t(fib-table X) Optional. VRF where to install SRv6 localsid\n" 449 "\tbehavior STRING Specifies the behavior\n" 451 "\tEnd\t-> Endpoint.\n" 452 "\tEnd.X\t-> Endpoint with decapsulation and Layer-3 cross-connect.\n" 453 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 454 "\tEnd.DX2\t-> Endpoint with decapsulation and Layer-2 cross-connect.\n" 455 "\t\tParameters: '<iface>'\n" 456 "\tEnd.DX6\t-> Endpoint with decapsulation and IPv6 cross-connect.\n" 457 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 458 "\tEnd.DX4\t-> Endpoint with decapsulation and IPv4 cross-connect.\n" 459 "\t\tParameters: '<iface> <ip4_next_hop>'\n" 460 "\tEnd.DT6\t-> Endpoint with decapsulation and specific IPv6 table lookup.\n" 461 "\t\tParameters: '<ip6_fib_table>'\n" 462 "\tEnd.DT4\t-> Endpoint with decapsulation and specific IPv4 table lookup.\n" 463 "\t\tParameters: '<ip4_fib_table>'\n",
486 for (i = 0; i <
vec_len (localsid_list); i++)
488 ls = localsid_list[
i];
497 "\tAddress: \t%U\n\tBehavior: \tX (Endpoint with Layer-3 cross-connect)" 498 "\n\tIface: \t%U\n\tNext hop: \t%U",
505 "\tAddress: \t%U\n\tBehavior: \tT (Endpoint with specific IPv6 table lookup)" 511 "\tAddress: \t%U\n\tBehavior: \tDX4 (Endpoint with decapsulation and IPv4 cross-connect)" 512 "\n\tIface: \t%U\n\tNext hop: \t%U",
519 "\tAddress: \t%U\n\tBehavior: \tDX6 (Endpoint with decapsulation and IPv6 cross-connect)" 520 "\n\tIface: \t%U\n\tNext hop: \t%U",
528 "\tAddress: \t%U\n\tBehavior: \tDX2 (Endpoint with decapulation and Layer-2 cross-connect)" 534 "Unsupported yet. (DX2 with egress VLAN rewrite)");
538 "\tAddress: \t%U\n\tBehavior: \tDT6 (Endpoint with decapsulation and specific IPv6 table lookup)" 544 "\tAddress: \t%U\n\tBehavior: \tDT4 (Endpoint with decapsulation and specific IPv4 table lookup)" 556 "\tBehavior: \t%s (%s)\n\t%U",
584 .path =
"show sr localsids",
585 .short_help =
"show sr localsids",
608 .path =
"clear sr localsid-counters",
609 .short_help =
"clear sr localsid-counters",
627 #define foreach_sr_localsid_error \ 628 _(NO_INNER_HEADER, "(SR-Error) No inner IP header") \ 629 _(NO_MORE_SEGMENTS, "(SR-Error) No more segments") \ 630 _(NO_SRH, "(SR-Error) No SR header") \ 631 _(NO_PSP, "(SR-Error) PSP Not available (segments left > 0)") \ 632 _(NOT_LS, "(SR-Error) Decaps not available (segments left > 0)") \ 633 _(L2, "(SR-Error) SRv6 decapsulated a L2 frame without dest") 637 #define _(sym,str) SR_LOCALSID_ERROR_##sym, 644 #define _(sym,string) string, 649 #define foreach_sr_localsid_next \ 650 _(ERROR, "error-drop") \ 651 _(IP6_LOOKUP, "ip6-lookup") \ 652 _(IP4_LOOKUP, "ip4-lookup") \ 653 _(IP6_REWRITE, "ip6-rewrite") \ 654 _(IP4_REWRITE, "ip4-rewrite") \ 655 _(INTERFACE_OUTPUT, "interface-output") 659 #define _(s,n) SR_LOCALSID_NEXT_##s, 683 s =
format (s,
"\tBehavior: End\n");
686 s =
format (s,
"\tBehavior: Decapsulation with IPv6 L3 xconnect\n");
689 s =
format (s,
"\tBehavior: Decapsulation with IPv4 L3 xconnect\n");
692 s =
format (s,
"\tBehavior: IPv6 L3 xconnect\n");
695 s =
format (s,
"\tBehavior: IPv6 specific table lookup\n");
698 s =
format (s,
"\tBehavior: Decapsulation with IPv6 Table lookup\n");
701 s =
format (s,
"\tBehavior: Decapsulation with IPv4 Table lookup\n");
704 s =
format (s,
"\tBehavior: Decapsulation with L2 xconnect\n");
707 s =
format (s,
"\tBehavior: defined in plugin\n");
715 s =
format (s,
"\tSID list: [in ietf order]");
737 u32 * next0,
u8 psp, ip6_ext_header_t * prev0)
746 u64 *copy_dst0, *copy_src0;
747 u32 copy_len_u64s0 = 0;
762 copy_src0 = (
u64 *) ip0;
763 copy_dst0 = copy_src0 + (sr0->
length + 1);
771 copy_dst0[4 + copy_len_u64s0] = copy_src0[4 + copy_len_u64s0];
772 copy_dst0[3 + copy_len_u64s0] = copy_src0[3 + copy_len_u64s0];
773 copy_dst0[2 + copy_len_u64s0] = copy_src0[2 + copy_len_u64s0];
774 copy_dst0[1 + copy_len_u64s0] = copy_src0[1 + copy_len_u64s0];
775 copy_dst0[0 + copy_len_u64s0] = copy_src0[0 + copy_len_u64s0];
778 for (i = copy_len_u64s0 - 1; i >= 0; i--)
780 copy_dst0[
i] = copy_src0[
i];
786 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
804 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
813 *next0 = SR_LOCALSID_NEXT_ERROR;
814 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_MORE_SEGMENTS];
820 *next0 = SR_LOCALSID_NEXT_ERROR;
821 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_SRH];
837 ip6_ext_header_t *next_ext_header;
841 next_ext_header = (
void *) (ip0 + 1);
846 next_proto = next_ext_header->next_hdr;
853 *next0 = SR_LOCALSID_NEXT_ERROR;
854 b0->
error = node->
errors[SR_LOCALSID_ERROR_NOT_LS];
860 case IP_PROTOCOL_IPV6:
866 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
876 case IP_PROTOCOL_IP_IN_IP:
882 *next0 = SR_LOCALSID_NEXT_IP4_REWRITE;
889 *next0 = SR_LOCALSID_NEXT_IP4_LOOKUP;
893 case IP_PROTOCOL_IP6_NONXT:
899 *next0 = SR_LOCALSID_NEXT_INTERFACE_OUTPUT;
904 *next0 = SR_LOCALSID_NEXT_ERROR;
905 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_INNER_HEADER];
916 u32 n_left_from, next_index, *from, *to_next;
923 while (n_left_from > 0)
929 while (n_left_from >= 8 && n_left_to_next >= 4)
931 u32 bi0, bi1, bi2, bi3;
935 u32 next0, next1, next2, next3;
936 next0 = next1 = next2 = next3 = SR_LOCALSID_NEXT_IP6_LOOKUP;
960 to_next[0] = bi0 = from[0];
961 to_next[1] = bi1 = from[1];
962 to_next[2] = bi2 = from[2];
963 to_next[3] = bi3 = from[3];
1016 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1039 if (ip1->
protocol == IP_PROTOCOL_IPV6_ROUTE
1062 if (ip2->
protocol == IP_PROTOCOL_IPV6_ROUTE
1085 if (ip3->
protocol == IP_PROTOCOL_IPV6_ROUTE
1123 n_left_to_next, bi0, bi1, bi2, bi3,
1124 next0, next1, next2, next3);
1128 while (n_left_from > 0 && n_left_to_next > 0)
1134 u32 next0 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1142 n_left_to_next -= 1;
1169 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1190 n_left_to_next, bi0, next0);
1200 .name =
"sr-localsid-d",
1201 .vector_size =
sizeof (
u32),
1208 #define _(s,n) [SR_LOCALSID_NEXT_##s] = n, 1222 u32 n_left_from, next_index, *from, *to_next;
1229 while (n_left_from > 0)
1235 while (n_left_from >= 8 && n_left_to_next >= 4)
1237 u32 bi0, bi1, bi2, bi3;
1241 ip6_ext_header_t *prev0, *prev1, *prev2, *prev3;
1242 u32 next0, next1, next2, next3;
1243 next0 = next1 = next2 = next3 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1267 to_next[0] = bi0 = from[0];
1268 to_next[1] = bi1 = from[1];
1269 to_next[2] = bi2 = from[2];
1270 to_next[3] = bi3 = from[3];
1274 n_left_to_next -= 4;
1327 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1350 if (ip1->
protocol == IP_PROTOCOL_IPV6_ROUTE
1373 if (ip2->
protocol == IP_PROTOCOL_IPV6_ROUTE
1396 if (ip3->
protocol == IP_PROTOCOL_IPV6_ROUTE
1434 n_left_to_next, bi0, bi1, bi2, bi3,
1435 next0, next1, next2, next3);
1439 while (n_left_from > 0 && n_left_to_next > 0)
1444 ip6_ext_header_t *prev0;
1446 u32 next0 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1454 n_left_to_next -= 1;
1480 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1500 n_left_to_next, bi0, next0);
1510 .name =
"sr-localsid",
1511 .vector_size =
sizeof (
u32),
1518 #define _(s,n) [SR_LOCALSID_NEXT_##s] = n, 1531 return (
format (s,
"SR: localsid_index:[%d]", index));
1624 "SR LocalSIDs behaviors:\n-----------------------\n\n");
1628 ({ vec_add1 (plugins_vec, plugin); }));
1633 "\tEnd\t-> Endpoint.\n" 1634 "\tEnd.X\t-> Endpoint with Layer-3 cross-connect.\n" 1635 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 1636 "\tEnd.T\t-> Endpoint with specific IPv6 table lookup.\n" 1637 "\t\tParameters: '<fib_table>'\n" 1638 "\tEnd.DX2\t-> Endpoint with decapsulation and Layer-2 cross-connect.\n" 1639 "\t\tParameters: '<iface>'\n" 1640 "\tEnd.DX6\t-> Endpoint with decapsulation and IPv6 cross-connect.\n" 1641 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 1642 "\tEnd.DX4\t-> Endpoint with decapsulation and IPv4 cross-connect.\n" 1643 "\t\tParameters: '<iface> <ip4_next_hop>'\n" 1644 "\tEnd.DT6\t-> Endpoint with decapsulation and specific IPv6 table lookup.\n" 1645 "\t\tParameters: '<ip6_fib_table>'\n" 1646 "\tEnd.DT4\t-> Endpoint with decapsulation and specific IPv4 table lookup.\n" 1647 "\t\tParameters: '<ip4_fib_table>'\n");
1649 for (i = 0; i <
vec_len (plugins_vec); i++)
1651 plugin = plugins_vec[
i];
1661 .path =
"show sr localsids behaviors",
1662 .short_help =
"show sr localsids behaviors",
u8 * function_name
Function name.
#define SR_BEHAVIOR_D_FIRST
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
fib_protocol_t fp_proto
protocol type
dpo_lock_fn_t dv_lock
A reference counting lock function.
u32 vlan_index
VLAN tag (not an index)
u32 nh_adj
Next_adj for xconnect usage only.
A virtual function table regisitered for a DPO type.
static const char *const sr_loc_ip6_nodes[]
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
fib_node_index_t fib_table_lookup_exact_match(u32 fib_index, const fib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
vnet_main_t * vnet_get_main(void)
void sr_dpo_unlock(dpo_id_t *dpo)
no-op unlock function.
unsigned char params_str[32]
uword mhash_unset(mhash_t *h, void *key, uword *old_value)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
format_function_t * ls_format
LocalSID format function.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static_always_inline void end_decaps_srh_processing(vlib_node_runtime_t *node, vlib_buffer_t *b0, ip6_header_t *ip0, ip6_sr_header_t *sr0, ip6_sr_localsid_t *ls0, u32 *next0)
#define vlib_validate_buffer_enqueue_x4(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, bi2, bi3, next0, next1, next2, next3)
Finish enqueueing four buffers forward in the graph.
Combined counter to hold both packets and byte differences.
static void * ip6_ext_next_header(ip6_ext_header_t *ext_hdr)
#define hash_set_mem(h, key, value)
u16 behavior
Behavior associated to this localsid.
unformat_function_t unformat_vnet_sw_interface
#define ROUTING_HEADER_TYPE_SR
unsigned char keyword_str[32]
vlib_error_t * errors
Vector of errors for this node.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
vlib_combined_counter_main_t sr_ls_invalid_counters
vlib_combined_counter_main_t sr_ls_valid_counters
static char * sr_localsid_error_strings[]
static clib_error_t * show_sr_localsid_behaviors_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI function to 'show' all available SR LocalSID behaviors.
format_function_t format_vnet_sw_if_index_name
static const char *const sr_loc_d_ip6_nodes[]
#define clib_memcpy(d, s, n)
static const char *const *const sr_loc_nodes[DPO_PROTO_NUM]
static void ip46_address_reset(ip46_address_t *ip46)
#define static_always_inline
static clib_error_t * sr_cli_localsid_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
SR LocalSID CLI function.
void vlib_clear_combined_counters(vlib_combined_counter_main_t *cm)
Clear a collection of combined counters.
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type() ...
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Aggregate type for a prefix.
#define clib_error_return(e, args...)
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
u16 fp_len
The mask length.
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
static void * ip6_ext_header_find(vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6_header, u8 header_type, ip6_ext_header_t **prev_ext_header)
#define hash_create_string(elts, value_bytes)
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
counter_t packets
packet counter
vlib_node_registration_t sr_localsid_d_node
(constructor) VLIB_REGISTER_NODE (sr_localsid_d_node)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
u8 * format_sr_localsid_trace(u8 *s, va_list *args)
SR LocalSID graph node trace function.
SR LocalSID behavior registration.
unsigned char def_str[64]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define pool_put(P, E)
Free an object E in pool P.
char end_psp
Combined with End.PSP?
static dpo_type_t sr_localsid_d_dpo_type
void sr_dpo_lock(dpo_id_t *dpo)
no-op lock function.
static u8 * format_sr_dpo(u8 *s, va_list *args)
static_always_inline void end_srh_processing(vlib_node_runtime_t *node, vlib_buffer_t *b0, ip6_header_t *ip0, ip6_sr_header_t *sr0, ip6_sr_localsid_t *ls0, u32 *next0, u8 psp, ip6_ext_header_t *prev0)
Function doing End processing.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
static uword mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
static uword sr_localsid_d_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
SR LocalSID graph node.
#define ip6_ext_header_len(p)
ip6_sr_localsid_t * localsids
The fine-grained event logger allows lightweight, thread-safe event logging at minimum cost...
#define VLIB_REGISTER_NODE(x,...)
void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
static clib_error_t * show_sr_localsid_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI function to 'show' all SR LocalSIDs on console.
int() sr_plugin_callback_t(ip6_sr_localsid_t *localsid)
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
#define CLIB_PREFETCH(addr, size, type)
static clib_error_t * clear_sr_localsid_counters_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Function to 'clear' ALL SR localsid counters.
void fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
u32 fib_node_index_t
A typedef of a node index.
unformat_function_t * ls_unformat
LocalSID unformat function.
u32 adj_index_t
An index for adjacencies.
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
vlib_main_t vlib_node_runtime_t * node
static u8 ip6_ext_hdr(u8 nexthdr)
#define VLIB_CLI_COMMAND(x,...)
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
dpo_type_t dpo
DPO type registration.
u8 * def_str
Behavior definition (i.e.
static uword * mhash_get(mhash_t *h, const void *key)
void * plugin_mem
Memory to be used by the plugin callback functions.
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 localsid add/del.
static const char *const *const sr_loc_d_nodes[DPO_PROTO_NUM]
int sr_localsid_register_function(vlib_main_t *vm, u8 *fn_name, u8 *keyword_str, u8 *def_str, 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, sr_plugin_callback_t *removal_fn)
SR LocalSID plugin registry.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
u32 fib_table
FIB table where localsid is registered.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u16 sr_localsid_function_number
SR LocalSID plugin function (>SR_BEHAVIOR_LAST)
counter_t bytes
byte counter
#define FIB_NODE_INDEX_INVALID
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
sr_plugin_callback_t * creation
Function within plugin that will be called after localsid creation.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
clib_error_t * sr_localsids_init(vlib_main_t *vm)
SR LocalSID initialization.
#define hash_get_mem(h, key)
vlib_node_registration_t sr_localsid_node
(constructor) VLIB_REGISTER_NODE (sr_localsid_node)
Segment Routing data structures definitions.
Segment Routing main datastructure.
adj_index_t adj_nbr_add_or_lock(fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index)
Neighbour Adjacency sub-type.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_foreach(var, vec)
Vector iterator.
static uword sr_localsid_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
SR LocalSID graph node.
#define foreach_sr_localsid_next
ip46_address_t next_hop
Next_hop for xconnect usage only.
mhash_t sr_localsids_index_hash
u8 * params_str
Behavior parameters (i.e.
#define foreach_sr_localsid_error
u32 sw_if_index
xconnect only
#define CLIB_CACHE_LINE_BYTES
sr_plugin_callback_t * removal
Function within plugin that will be called before localsid removal.
ip6_address_t localsid
LocalSID IPv6 address.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static dpo_type_t sr_localsid_dpo_type
Dynamically added SR localsid DPO type.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
u8 * keyword_str
Behavior keyword (i.e.
sr_localsid_fn_registration_t * plugin_functions
uword * plugin_functions_by_key