68 u32 fib_table, ip46_address_t * nh_addr,
void *ls_plugin_mem)
92 .ip6 = *localsid_addr,
196 nh_addr, sw_if_index);
200 nh_addr, sw_if_index);
209 ls->
nh_adj = nh_adj_index;
273 ip46_address_t next_hop;
274 char address_set = 0;
276 void *ls_plugin_mem = 0;
287 else if (!address_set
291 else if (!address_set
295 else if (
unformat (input,
"fib-table %u", &fib_index));
296 else if (vlan_index == (
u32) ~ 0
297 &&
unformat (input,
"vlan %u", &vlan_index));
298 else if (!behavior &&
unformat (input,
"behavior"))
304 else if (
unformat (input,
"end.t %u", &sw_if_index))
306 else if (
unformat (input,
"end.dx6 %U %U",
310 else if (
unformat (input,
"end.dx4 %U %U",
314 else if (
unformat (input,
"end.dx2 %U",
317 else if (
unformat (input,
"end.dt6 %u", &sw_if_index))
319 else if (
unformat (input,
"end.dt4 %u", &sw_if_index))
331 vec_add1 (vec_plugins, plugin);
338 (input,
"%U", (*plugin_it)->ls_unformat, &ls_plugin_mem))
340 behavior = (*plugin_it)->sr_localsid_function_number;
354 else if (!end_psp &&
unformat (input,
"psp"))
360 if (!behavior && end_psp)
365 "Error: SRv6 LocalSID address is mandatory.");
366 if (!is_del && !behavior)
368 "Error: SRv6 LocalSID behavior is mandatory.");
369 if (vlan_index != (
u32) ~ 0)
371 "Error: SRv6 End.DX2 with rewrite VLAN tag not supported by now.");
374 "Error: SRv6 PSP only compatible with End and End.X");
377 sw_if_index, vlan_index, fib_index, &next_hop,
388 "Identical localsid already exists. Requested localsid not created.");
391 "The requested localsid could not be deleted. SR localsid not found");
396 "requested localsid non segment routing related");
399 "Could not create ARP/ND entry for such next_hop. Internal error.");
402 "Error on the plugin based localsid creation.");
411 .path =
"sr localsid",
412 .short_help =
"sr localsid (del) address XX:XX::YY:YY" 413 "(fib-table 8) behavior STRING",
415 "Create SR LocalSID and binds it to a particular behavior\n" 417 "\tlocalSID IPv6_addr(128b) LocalSID IPv6 address\n" 418 "\t(fib-table X) Optional. VRF where to install SRv6 localsid\n" 419 "\tbehavior STRING Specifies the behavior\n" 421 "\tEnd\t-> Endpoint.\n" 422 "\tEnd.X\t-> Endpoint with decapsulation and Layer-3 cross-connect.\n" 423 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 424 "\tEnd.DX2\t-> Endpoint with decapsulation and Layer-2 cross-connect.\n" 425 "\t\tParameters: '<iface>'\n" 426 "\tEnd.DX6\t-> Endpoint with decapsulation and IPv6 cross-connect.\n" 427 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 428 "\tEnd.DX4\t-> Endpoint with decapsulation and IPv4 cross-connect.\n" 429 "\t\tParameters: '<iface> <ip4_next_hop>'\n" 430 "\tEnd.DT6\t-> Endpoint with decapsulation and specific IPv6 table lookup.\n" 431 "\t\tParameters: '<ip6_fib_table>'\n" 432 "\tEnd.DT4\t-> Endpoint with decapsulation and specific IPv4 table lookup.\n" 433 "\t\tParameters: '<ip4_fib_table>'\n",
456 for (i = 0; i <
vec_len (localsid_list); i++)
458 ls = localsid_list[
i];
467 "\tAddress: \t%U\n\tBehavior: \tX (Endpoint with Layer-3 cross-connect)" 468 "\n\tIface: \t%U\n\tNext hop: \t%U",
475 "\tAddress: \t%U\n\tBehavior: \tT (Endpoint with specific IPv6 table lookup)" 483 "\tAddress: \t%U\n\tBehavior: \tDX4 (Endpoint with decapsulation and IPv4 cross-connect)" 484 "\n\tIface: \t%U\n\tNext hop: \t%U",
491 "\tAddress: \t%U\n\tBehavior: \tDX6 (Endpoint with decapsulation and IPv6 cross-connect)" 492 "\n\tIface: \t%U\n\tNext hop: \t%U",
500 "\tAddress: \t%U\n\tBehavior: \tDX2 (Endpoint with decapulation and Layer-2 cross-connect)" 506 "Unsupported yet. (DX2 with egress VLAN rewrite)");
510 "\tAddress: \t%U\n\tBehavior: \tDT6 (Endpoint with decapsulation and specific IPv6 table lookup)" 517 "\tAddress: \t%U\n\tBehavior: \tDT4 (Endpoint with decapsulation and specific IPv4 table lookup)" 531 "\tBehavior: \t%s (%s)\n\t%U",
559 .path =
"show sr localsids",
560 .short_help =
"show sr localsids",
583 .path =
"clear sr localsid-counters",
584 .short_help =
"clear sr localsid-counters",
602 #define foreach_sr_localsid_error \ 603 _(NO_INNER_HEADER, "(SR-Error) No inner IP header") \ 604 _(NO_MORE_SEGMENTS, "(SR-Error) No more segments") \ 605 _(NO_SRH, "(SR-Error) No SR header") \ 606 _(NO_PSP, "(SR-Error) PSP Not available (segments left > 0)") \ 607 _(NOT_LS, "(SR-Error) Decaps not available (segments left > 0)") \ 608 _(L2, "(SR-Error) SRv6 decapsulated a L2 frame without dest") 612 #define _(sym,str) SR_LOCALSID_ERROR_##sym, 619 #define _(sym,string) string, 624 #define foreach_sr_localsid_next \ 625 _(ERROR, "error-drop") \ 626 _(IP6_LOOKUP, "ip6-lookup") \ 627 _(IP4_LOOKUP, "ip4-lookup") \ 628 _(IP6_REWRITE, "ip6-rewrite") \ 629 _(IP4_REWRITE, "ip4-rewrite") \ 630 _(INTERFACE_OUTPUT, "interface-output") 634 #define _(s,n) SR_LOCALSID_NEXT_##s, 658 s =
format (s,
"\tBehavior: End\n");
661 s =
format (s,
"\tBehavior: Decapsulation with IPv6 L3 xconnect\n");
664 s =
format (s,
"\tBehavior: Decapsulation with IPv4 L3 xconnect\n");
667 s =
format (s,
"\tBehavior: IPv6 L3 xconnect\n");
670 s =
format (s,
"\tBehavior: IPv6 specific table lookup\n");
673 s =
format (s,
"\tBehavior: Decapsulation with IPv6 Table lookup\n");
676 s =
format (s,
"\tBehavior: Decapsulation with IPv4 Table lookup\n");
679 s =
format (s,
"\tBehavior: Decapsulation with L2 xconnect\n");
682 s =
format (s,
"\tBehavior: defined in plugin\n");
690 s =
format (s,
"\tSID list: [in ietf order]");
712 u32 * next0,
u8 psp, ip6_ext_header_t * prev0)
721 u64 *copy_dst0, *copy_src0;
722 u32 copy_len_u64s0 = 0;
737 copy_src0 = (
u64 *) ip0;
738 copy_dst0 = copy_src0 + (sr0->
length + 1);
746 copy_dst0[4 + copy_len_u64s0] = copy_src0[4 + copy_len_u64s0];
747 copy_dst0[3 + copy_len_u64s0] = copy_src0[3 + copy_len_u64s0];
748 copy_dst0[2 + copy_len_u64s0] = copy_src0[2 + copy_len_u64s0];
749 copy_dst0[1 + copy_len_u64s0] = copy_src0[1 + copy_len_u64s0];
750 copy_dst0[0 + copy_len_u64s0] = copy_src0[0 + copy_len_u64s0];
753 for (i = copy_len_u64s0 - 1; i >= 0; i--)
755 copy_dst0[
i] = copy_src0[
i];
761 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
779 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
788 *next0 = SR_LOCALSID_NEXT_ERROR;
789 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_MORE_SEGMENTS];
795 *next0 = SR_LOCALSID_NEXT_ERROR;
796 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_SRH];
812 ip6_ext_header_t *next_ext_header;
816 next_ext_header = (
void *) (ip0 + 1);
821 next_proto = next_ext_header->next_hdr;
828 *next0 = SR_LOCALSID_NEXT_ERROR;
829 b0->
error = node->
errors[SR_LOCALSID_ERROR_NOT_LS];
835 case IP_PROTOCOL_IPV6:
841 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
851 case IP_PROTOCOL_IP_IN_IP:
857 *next0 = SR_LOCALSID_NEXT_IP4_REWRITE;
864 *next0 = SR_LOCALSID_NEXT_IP4_LOOKUP;
868 case IP_PROTOCOL_IP6_NONXT:
874 *next0 = SR_LOCALSID_NEXT_INTERFACE_OUTPUT;
879 *next0 = SR_LOCALSID_NEXT_ERROR;
880 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_INNER_HEADER];
891 u32 n_left_from, next_index, *from, *to_next;
898 while (n_left_from > 0)
904 while (n_left_from >= 8 && n_left_to_next >= 4)
906 u32 bi0, bi1, bi2, bi3;
910 u32 next0, next1, next2, next3;
911 next0 = next1 = next2 = next3 = SR_LOCALSID_NEXT_IP6_LOOKUP;
935 to_next[0] = bi0 = from[0];
936 to_next[1] = bi1 = from[1];
937 to_next[2] = bi2 = from[2];
938 to_next[3] = bi3 = from[3];
991 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1014 if (ip1->
protocol == IP_PROTOCOL_IPV6_ROUTE
1037 if (ip2->
protocol == IP_PROTOCOL_IPV6_ROUTE
1060 if (ip3->
protocol == IP_PROTOCOL_IPV6_ROUTE
1098 n_left_to_next, bi0, bi1, bi2, bi3,
1099 next0, next1, next2, next3);
1103 while (n_left_from > 0 && n_left_to_next > 0)
1109 u32 next0 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1117 n_left_to_next -= 1;
1144 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1165 n_left_to_next, bi0, next0);
1175 .name =
"sr-localsid-d",
1176 .vector_size =
sizeof (
u32),
1183 #define _(s,n) [SR_LOCALSID_NEXT_##s] = n, 1197 u32 n_left_from, next_index, *from, *to_next;
1204 while (n_left_from > 0)
1210 while (n_left_from >= 8 && n_left_to_next >= 4)
1212 u32 bi0, bi1, bi2, bi3;
1216 ip6_ext_header_t *prev0, *prev1, *prev2, *prev3;
1217 u32 next0, next1, next2, next3;
1218 next0 = next1 = next2 = next3 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1242 to_next[0] = bi0 = from[0];
1243 to_next[1] = bi1 = from[1];
1244 to_next[2] = bi2 = from[2];
1245 to_next[3] = bi3 = from[3];
1249 n_left_to_next -= 4;
1302 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1325 if (ip1->
protocol == IP_PROTOCOL_IPV6_ROUTE
1348 if (ip2->
protocol == IP_PROTOCOL_IPV6_ROUTE
1371 if (ip3->
protocol == IP_PROTOCOL_IPV6_ROUTE
1409 n_left_to_next, bi0, bi1, bi2, bi3,
1410 next0, next1, next2, next3);
1414 while (n_left_from > 0 && n_left_to_next > 0)
1419 ip6_ext_header_t *prev0;
1421 u32 next0 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1429 n_left_to_next -= 1;
1455 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1475 n_left_to_next, bi0, next0);
1485 .name =
"sr-localsid",
1486 .vector_size =
sizeof (
u32),
1493 #define _(s,n) [SR_LOCALSID_NEXT_##s] = n, 1506 return (
format (s,
"SR: localsid_index:[%d]", index));
1597 "SR LocalSIDs behaviors:\n-----------------------\n\n");
1601 ({ vec_add1 (plugins_vec, plugin); }));
1606 "\tEnd\t-> Endpoint.\n" 1607 "\tEnd.X\t-> Endpoint with Layer-3 cross-connect.\n" 1608 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 1609 "\tEnd.T\t-> Endpoint with specific IPv6 table lookup.\n" 1610 "\t\tParameters: '<fib_table>'\n" 1611 "\tEnd.DX2\t-> Endpoint with decapsulation and Layer-2 cross-connect.\n" 1612 "\t\tParameters: '<iface>'\n" 1613 "\tEnd.DX6\t-> Endpoint with decapsulation and IPv6 cross-connect.\n" 1614 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 1615 "\tEnd.DX4\t-> Endpoint with decapsulation and IPv4 cross-connect.\n" 1616 "\t\tParameters: '<iface> <ip4_next_hop>'\n" 1617 "\tEnd.DT6\t-> Endpoint with decapsulation and specific IPv6 table lookup.\n" 1618 "\t\tParameters: '<ip6_fib_table>'\n" 1619 "\tEnd.DT4\t-> Endpoint with decapsulation and specific IPv4 table lookup.\n" 1620 "\t\tParameters: '<ip4_fib_table>'\n");
1622 for (i = 0; i <
vec_len (plugins_vec); i++)
1624 plugin = plugins_vec[
i];
1634 .path =
"show sr localsids behaviors",
1635 .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.
int sr_cli_localsid(char is_del, ip6_address_t *localsid_addr, 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.
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]
#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.
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.
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, 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.
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.
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.
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
static const char *const *const sr_loc_d_nodes[DPO_PROTO_NUM]
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)
#define ip46_address_reset(ip46)
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