67 char end_psp,
u8 behavior,
u32 sw_if_index,
u32 vlan_index,
68 u32 fib_table, ip46_address_t * nh_addr,
void *ls_plugin_mem)
92 .ip6 = *localsid_addr,
149 memset (ls, 0,
sizeof (*ls));
196 nh_addr, sw_if_index);
200 nh_addr, sw_if_index);
209 ls->
nh_adj = nh_adj_index;
268 u32 sw_if_index = (
u32) ~ 0, vlan_index = (
u32) ~ 0, fib_index = 0;
272 ip46_address_t next_hop;
273 char address_set = 0;
275 void *ls_plugin_mem = 0;
286 else if (!address_set
290 else if (!address_set
294 else if (
unformat (input,
"fib-table %u", &fib_index));
295 else if (vlan_index == (
u32) ~ 0
296 &&
unformat (input,
"vlan %u", &vlan_index));
297 else if (!behavior &&
unformat (input,
"behavior"))
303 else if (
unformat (input,
"end.t %u", &sw_if_index))
305 else if (
unformat (input,
"end.dx6 %U %U",
309 else if (
unformat (input,
"end.dx4 %U %U",
313 else if (
unformat (input,
"end.dx2 %U",
316 else if (
unformat (input,
"end.dt6 %u", &sw_if_index))
318 else if (
unformat (input,
"end.dt4 %u", &sw_if_index))
330 vec_add1 (vec_plugins, plugin);
337 (input,
"%U", (*plugin_it)->ls_unformat, &ls_plugin_mem))
339 behavior = (*plugin_it)->sr_localsid_function_number;
353 else if (!end_psp &&
unformat (input,
"psp"))
359 if (!behavior && end_psp)
364 "Error: SRv6 LocalSID address is mandatory.");
365 if (!is_del && !behavior)
367 "Error: SRv6 LocalSID behavior is mandatory.");
368 if (vlan_index != (
u32) ~ 0)
370 "Error: SRv6 End.DX2 with rewrite VLAN tag not supported by now.");
373 "Error: SRv6 PSP only compatible with End and End.X");
376 sw_if_index, vlan_index, fib_index, &next_hop,
387 "Identical localsid already exists. Requested localsid not created.");
390 "The requested localsid could not be deleted. SR localsid not found");
395 "requested localsid non segment routing related");
398 "Could not create ARP/ND entry for such next_hop. Internal error.");
401 "Error on the plugin based localsid creation.");
410 .path =
"sr localsid",
411 .short_help =
"sr localsid (del) address XX:XX::YY:YY" 412 "(fib-table 8) behavior STRING",
414 "Create SR LocalSID and binds it to a particular behavior\n" 416 "\tlocalSID IPv6_addr(128b) LocalSID IPv6 address\n" 417 "\t(fib-table X) Optional. VRF where to install SRv6 localsid\n" 418 "\tbehavior STRING Specifies the behavior\n" 420 "\tEnd\t-> Endpoint.\n" 421 "\tEnd.X\t-> Endpoint with decapsulation and Layer-3 cross-connect.\n" 422 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 423 "\tEnd.DX2\t-> Endpoint with decapsulation and Layer-2 cross-connect.\n" 424 "\t\tParameters: '<iface>'\n" 425 "\tEnd.DX6\t-> Endpoint with decapsulation and IPv6 cross-connect.\n" 426 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 427 "\tEnd.DX4\t-> Endpoint with decapsulation and IPv4 cross-connect.\n" 428 "\t\tParameters: '<iface> <ip4_next_hop>'\n" 429 "\tEnd.DT6\t-> Endpoint with decapsulation and specific IPv6 table lookup.\n" 430 "\t\tParameters: '<ip6_fib_table>'\n" 431 "\tEnd.DT4\t-> Endpoint with decapsulation and specific IPv4 table lookup.\n" 432 "\t\tParameters: '<ip4_fib_table>'\n",
455 for (i = 0; i <
vec_len (localsid_list); i++)
457 ls = localsid_list[
i];
466 "\tAddress: \t%U\n\tBehavior: \tX (Endpoint with Layer-3 cross-connect)" 467 "\n\tIface: \t%U\n\tNext hop: \t%U",
474 "\tAddress: \t%U\n\tBehavior: \tT (Endpoint with specific IPv6 table lookup)" 481 "\tAddress: \t%U\n\tBehavior: \tDX4 (Endpoint with decapsulation and IPv4 cross-connect)" 482 "\n\tIface: \t%U\n\tNext hop: \t%U",
489 "\tAddress: \t%U\n\tBehavior: \tDX6 (Endpoint with decapsulation and IPv6 cross-connect)" 490 "\n\tIface: \t%U\n\tNext hop: \t%U",
498 "\tAddress: \t%U\n\tBehavior: \tDX2 (Endpoint with decapulation and Layer-2 cross-connect)" 504 "Unsupported yet. (DX2 with egress VLAN rewrite)");
508 "\tAddress: \t%U\n\tBehavior: \tDT6 (Endpoint with decapsulation and specific IPv6 table lookup)" 514 "\tAddress: \t%U\n\tBehavior: \tDT4 (Endpoint with decapsulation and specific IPv4 table lookup)" 526 "\tBehavior: \t%s (%s)\n\t%U",
554 .path =
"show sr localsids",
555 .short_help =
"show sr localsids",
578 .path =
"clear sr localsid counters",
579 .short_help =
"clear sr localsid counters",
597 #define foreach_sr_localsid_error \ 598 _(NO_INNER_HEADER, "(SR-Error) No inner IP header") \ 599 _(NO_MORE_SEGMENTS, "(SR-Error) No more segments") \ 600 _(NO_SRH, "(SR-Error) No SR header") \ 601 _(NO_PSP, "(SR-Error) PSP Not available (segments left > 0)") \ 602 _(NOT_LS, "(SR-Error) Decaps not available (segments left > 0)") \ 603 _(L2, "(SR-Error) SRv6 decapsulated a L2 frame without dest") 607 #define _(sym,str) SR_LOCALSID_ERROR_##sym, 614 #define _(sym,string) string, 619 #define foreach_sr_localsid_next \ 620 _(ERROR, "error-drop") \ 621 _(IP6_LOOKUP, "ip6-lookup") \ 622 _(IP4_LOOKUP, "ip4-lookup") \ 623 _(IP6_REWRITE, "ip6-rewrite") \ 624 _(IP4_REWRITE, "ip4-rewrite") \ 625 _(INTERFACE_OUTPUT, "interface-output") 629 #define _(s,n) SR_LOCALSID_NEXT_##s, 653 s =
format (s,
"\tBehavior: End\n");
656 s =
format (s,
"\tBehavior: Decapsulation with IPv6 L3 xconnect\n");
659 s =
format (s,
"\tBehavior: Decapsulation with IPv4 L3 xconnect\n");
662 s =
format (s,
"\tBehavior: IPv6 L3 xconnect\n");
665 s =
format (s,
"\tBehavior: IPv6 specific table lookup\n");
668 s =
format (s,
"\tBehavior: Decapsulation with IPv6 Table lookup\n");
671 s =
format (s,
"\tBehavior: Decapsulation with IPv4 Table lookup\n");
674 s =
format (s,
"\tBehavior: Decapsulation with L2 xconnect\n");
677 s =
format (s,
"\tBehavior: defined in plugin\n");
685 s =
format (s,
"\tSID list: [in ietf order]");
707 u32 * next0,
u8 psp, ip6_ext_header_t * prev0)
716 u64 *copy_dst0, *copy_src0;
717 u32 copy_len_u64s0 = 0;
732 copy_src0 = (
u64 *) ip0;
733 copy_dst0 = copy_src0 + (sr0->
length + 1);
741 copy_dst0[4 + copy_len_u64s0] = copy_src0[4 + copy_len_u64s0];
742 copy_dst0[3 + copy_len_u64s0] = copy_src0[3 + copy_len_u64s0];
743 copy_dst0[2 + copy_len_u64s0] = copy_src0[2 + copy_len_u64s0];
744 copy_dst0[1 + copy_len_u64s0] = copy_src0[1 + copy_len_u64s0];
745 copy_dst0[0 + copy_len_u64s0] = copy_src0[0 + copy_len_u64s0];
748 for (i = copy_len_u64s0 - 1; i >= 0; i--)
750 copy_dst0[
i] = copy_src0[
i];
756 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
774 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
783 *next0 = SR_LOCALSID_NEXT_ERROR;
784 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_MORE_SEGMENTS];
790 *next0 = SR_LOCALSID_NEXT_ERROR;
791 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_SRH];
807 ip6_ext_header_t *next_ext_header;
811 next_ext_header = (
void *) (ip0 + 1);
816 next_proto = next_ext_header->next_hdr;
823 *next0 = SR_LOCALSID_NEXT_ERROR;
824 b0->
error = node->
errors[SR_LOCALSID_ERROR_NOT_LS];
830 case IP_PROTOCOL_IPV6:
836 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
846 case IP_PROTOCOL_IP_IN_IP:
852 *next0 = SR_LOCALSID_NEXT_IP4_REWRITE;
859 *next0 = SR_LOCALSID_NEXT_IP4_LOOKUP;
863 case IP_PROTOCOL_IP6_NONXT:
869 *next0 = SR_LOCALSID_NEXT_INTERFACE_OUTPUT;
874 *next0 = SR_LOCALSID_NEXT_ERROR;
875 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_INNER_HEADER];
886 u32 n_left_from, next_index, *from, *to_next;
893 while (n_left_from > 0)
899 while (n_left_from >= 8 && n_left_to_next >= 4)
901 u32 bi0, bi1, bi2, bi3;
904 ip6_ext_header_t *prev0, *prev1, *prev2, *prev3;
906 u32 next0, next1, next2, next3;
907 next0 = next1 = next2 = next3 = SR_LOCALSID_NEXT_IP6_LOOKUP;
931 to_next[0] = bi0 = from[0];
932 to_next[1] = bi1 = from[1];
933 to_next[2] = bi2 = from[2];
934 to_next[3] = bi3 = from[3];
983 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1006 if (ip1->
protocol == IP_PROTOCOL_IPV6_ROUTE
1029 if (ip2->
protocol == IP_PROTOCOL_IPV6_ROUTE
1052 if (ip3->
protocol == IP_PROTOCOL_IPV6_ROUTE
1090 n_left_to_next, bi0, bi1, bi2, bi3,
1091 next0, next1, next2, next3);
1095 while (n_left_from > 0 && n_left_to_next > 0)
1100 ip6_ext_header_t *prev0;
1102 u32 next0 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1110 n_left_to_next -= 1;
1136 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1157 n_left_to_next, bi0, next0);
1167 .name =
"sr-localsid-d",
1168 .vector_size =
sizeof (
u32),
1175 #define _(s,n) [SR_LOCALSID_NEXT_##s] = n, 1189 u32 n_left_from, next_index, *from, *to_next;
1196 while (n_left_from > 0)
1202 while (n_left_from >= 8 && n_left_to_next >= 4)
1204 u32 bi0, bi1, bi2, bi3;
1208 ip6_ext_header_t *prev0, *prev1, *prev2, *prev3;
1209 u32 next0, next1, next2, next3;
1210 next0 = next1 = next2 = next3 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1234 to_next[0] = bi0 = from[0];
1235 to_next[1] = bi1 = from[1];
1236 to_next[2] = bi2 = from[2];
1237 to_next[3] = bi3 = from[3];
1241 n_left_to_next -= 4;
1290 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1313 if (ip1->
protocol == IP_PROTOCOL_IPV6_ROUTE
1336 if (ip2->
protocol == IP_PROTOCOL_IPV6_ROUTE
1359 if (ip3->
protocol == IP_PROTOCOL_IPV6_ROUTE
1397 n_left_to_next, bi0, bi1, bi2, bi3,
1398 next0, next1, next2, next3);
1402 while (n_left_from > 0 && n_left_to_next > 0)
1407 ip6_ext_header_t *prev0;
1409 u32 next0 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1417 n_left_to_next -= 1;
1442 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1462 n_left_to_next, bi0, next0);
1472 .name =
"sr-localsid",
1473 .vector_size =
sizeof (
u32),
1480 #define _(s,n) [SR_LOCALSID_NEXT_##s] = n, 1493 return (
format (s,
"SR: localsid_index:[%d]", index));
1553 memset (plugin, 0,
sizeof (*plugin));
1584 "SR LocalSIDs behaviors:\n-----------------------\n\n");
1588 ({ vec_add1 (plugins_vec, plugin); }));
1593 "\tEnd\t-> Endpoint.\n" 1594 "\tEnd.X\t-> Endpoint with Layer-3 cross-connect.\n" 1595 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 1596 "\tEnd.T\t-> Endpoint with specific IPv6 table lookup.\n" 1597 "\t\tParameters: '<fib_table>'\n" 1598 "\tEnd.DX2\t-> Endpoint with decapsulation and Layer-2 cross-connect.\n" 1599 "\t\tParameters: '<iface>'\n" 1600 "\tEnd.DX6\t-> Endpoint with decapsulation and IPv6 cross-connect.\n" 1601 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 1602 "\tEnd.DX4\t-> Endpoint with decapsulation and IPv4 cross-connect.\n" 1603 "\t\tParameters: '<iface> <ip4_next_hop>'\n" 1604 "\tEnd.DT6\t-> Endpoint with decapsulation and specific IPv6 table lookup.\n" 1605 "\t\tParameters: '<ip6_fib_table>'\n" 1606 "\tEnd.DT4\t-> Endpoint with decapsulation and specific IPv4 table lookup.\n" 1607 "\t\tParameters: '<ip4_fib_table>'\n");
1609 for (i = 0; i <
vec_len (plugins_vec); i++)
1611 plugin = plugins_vec[
i];
1621 .path =
"show sr localsids behaviors",
1622 .short_help =
"show sr localsids behaviors",
u8 * function_name
Function name.
#define SR_BEHAVIOR_D_FIRST
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.
sll srl srl sll sra u16x4 i
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)
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[]
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.
#define VLIB_INIT_FUNCTION(x)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Aggregrate 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.
#define hash_create_string(elts, value_bytes)
int( sr_plugin_callback_t)(ip6_sr_localsid_t *localsid)
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).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
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...
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.
static_always_inline uword vlib_get_thread_index(void)
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.
#define VLIB_BUFFER_IS_TRACED
#define clib_memcpy(a, b, c)
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.
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.
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.
#define VLIB_REGISTER_NODE(x,...)
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 ip6_ext_header_find_t(i, p, m, t)
#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.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
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