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;
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)" 480 "\tAddress: \t%U\n\tBehavior: \tDX4 (Endpoint with decapsulation and IPv4 cross-connect)" 481 "\n\tIface: \t%U\n\tNext hop: \t%U",
488 "\tAddress: \t%U\n\tBehavior: \tDX6 (Endpoint with decapsulation and IPv6 cross-connect)" 489 "\n\tIface: \t%U\n\tNext hop: \t%U",
497 "\tAddress: \t%U\n\tBehavior: \tDX2 (Endpoint with decapulation and Layer-2 cross-connect)" 503 "Unsupported yet. (DX2 with egress VLAN rewrite)");
507 "\tAddress: \t%U\n\tBehavior: \tDT6 (Endpoint with decapsulation and specific IPv6 table lookup)" 513 "\tAddress: \t%U\n\tBehavior: \tDT4 (Endpoint with decapsulation and specific IPv4 table lookup)" 525 "\tBehavior: \t%s (%s)\n\t%U",
553 .path =
"show sr localsids",
554 .short_help =
"show sr localsids",
577 .path =
"clear sr localsid-counters",
578 .short_help =
"clear sr localsid-counters",
596 #define foreach_sr_localsid_error \ 597 _(NO_INNER_HEADER, "(SR-Error) No inner IP header") \ 598 _(NO_MORE_SEGMENTS, "(SR-Error) No more segments") \ 599 _(NO_SRH, "(SR-Error) No SR header") \ 600 _(NO_PSP, "(SR-Error) PSP Not available (segments left > 0)") \ 601 _(NOT_LS, "(SR-Error) Decaps not available (segments left > 0)") \ 602 _(L2, "(SR-Error) SRv6 decapsulated a L2 frame without dest") 606 #define _(sym,str) SR_LOCALSID_ERROR_##sym, 613 #define _(sym,string) string, 618 #define foreach_sr_localsid_next \ 619 _(ERROR, "error-drop") \ 620 _(IP6_LOOKUP, "ip6-lookup") \ 621 _(IP4_LOOKUP, "ip4-lookup") \ 622 _(IP6_REWRITE, "ip6-rewrite") \ 623 _(IP4_REWRITE, "ip4-rewrite") \ 624 _(INTERFACE_OUTPUT, "interface-output") 628 #define _(s,n) SR_LOCALSID_NEXT_##s, 652 s =
format (s,
"\tBehavior: End\n");
655 s =
format (s,
"\tBehavior: Decapsulation with IPv6 L3 xconnect\n");
658 s =
format (s,
"\tBehavior: Decapsulation with IPv4 L3 xconnect\n");
661 s =
format (s,
"\tBehavior: IPv6 L3 xconnect\n");
664 s =
format (s,
"\tBehavior: IPv6 specific table lookup\n");
667 s =
format (s,
"\tBehavior: Decapsulation with IPv6 Table lookup\n");
670 s =
format (s,
"\tBehavior: Decapsulation with IPv4 Table lookup\n");
673 s =
format (s,
"\tBehavior: Decapsulation with L2 xconnect\n");
676 s =
format (s,
"\tBehavior: defined in plugin\n");
684 s =
format (s,
"\tSID list: [in ietf order]");
706 u32 * next0,
u8 psp, ip6_ext_header_t * prev0)
715 u64 *copy_dst0, *copy_src0;
716 u32 copy_len_u64s0 = 0;
731 copy_src0 = (
u64 *) ip0;
732 copy_dst0 = copy_src0 + (sr0->
length + 1);
740 copy_dst0[4 + copy_len_u64s0] = copy_src0[4 + copy_len_u64s0];
741 copy_dst0[3 + copy_len_u64s0] = copy_src0[3 + copy_len_u64s0];
742 copy_dst0[2 + copy_len_u64s0] = copy_src0[2 + copy_len_u64s0];
743 copy_dst0[1 + copy_len_u64s0] = copy_src0[1 + copy_len_u64s0];
744 copy_dst0[0 + copy_len_u64s0] = copy_src0[0 + copy_len_u64s0];
747 for (i = copy_len_u64s0 - 1; i >= 0; i--)
749 copy_dst0[
i] = copy_src0[
i];
755 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
773 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
782 *next0 = SR_LOCALSID_NEXT_ERROR;
783 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_MORE_SEGMENTS];
789 *next0 = SR_LOCALSID_NEXT_ERROR;
790 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_SRH];
806 ip6_ext_header_t *next_ext_header;
810 next_ext_header = (
void *) (ip0 + 1);
815 next_proto = next_ext_header->next_hdr;
822 *next0 = SR_LOCALSID_NEXT_ERROR;
823 b0->
error = node->
errors[SR_LOCALSID_ERROR_NOT_LS];
829 case IP_PROTOCOL_IPV6:
835 *next0 = SR_LOCALSID_NEXT_IP6_REWRITE;
845 case IP_PROTOCOL_IP_IN_IP:
851 *next0 = SR_LOCALSID_NEXT_IP4_REWRITE;
858 *next0 = SR_LOCALSID_NEXT_IP4_LOOKUP;
862 case IP_PROTOCOL_IP6_NONXT:
868 *next0 = SR_LOCALSID_NEXT_INTERFACE_OUTPUT;
873 *next0 = SR_LOCALSID_NEXT_ERROR;
874 b0->
error = node->
errors[SR_LOCALSID_ERROR_NO_INNER_HEADER];
885 u32 n_left_from, next_index, *from, *to_next;
892 while (n_left_from > 0)
898 while (n_left_from >= 8 && n_left_to_next >= 4)
900 u32 bi0, bi1, bi2, bi3;
903 ip6_ext_header_t *prev0, *prev1, *prev2, *prev3;
905 u32 next0, next1, next2, next3;
906 next0 = next1 = next2 = next3 = SR_LOCALSID_NEXT_IP6_LOOKUP;
930 to_next[0] = bi0 = from[0];
931 to_next[1] = bi1 = from[1];
932 to_next[2] = bi2 = from[2];
933 to_next[3] = bi3 = from[3];
982 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1005 if (ip1->
protocol == IP_PROTOCOL_IPV6_ROUTE
1028 if (ip2->
protocol == IP_PROTOCOL_IPV6_ROUTE
1051 if (ip3->
protocol == IP_PROTOCOL_IPV6_ROUTE
1089 n_left_to_next, bi0, bi1, bi2, bi3,
1090 next0, next1, next2, next3);
1094 while (n_left_from > 0 && n_left_to_next > 0)
1099 ip6_ext_header_t *prev0;
1101 u32 next0 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1109 n_left_to_next -= 1;
1135 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1156 n_left_to_next, bi0, next0);
1166 .name =
"sr-localsid-d",
1167 .vector_size =
sizeof (
u32),
1174 #define _(s,n) [SR_LOCALSID_NEXT_##s] = n, 1188 u32 n_left_from, next_index, *from, *to_next;
1195 while (n_left_from > 0)
1201 while (n_left_from >= 8 && n_left_to_next >= 4)
1203 u32 bi0, bi1, bi2, bi3;
1207 ip6_ext_header_t *prev0, *prev1, *prev2, *prev3;
1208 u32 next0, next1, next2, next3;
1209 next0 = next1 = next2 = next3 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1233 to_next[0] = bi0 = from[0];
1234 to_next[1] = bi1 = from[1];
1235 to_next[2] = bi2 = from[2];
1236 to_next[3] = bi3 = from[3];
1240 n_left_to_next -= 4;
1289 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1312 if (ip1->
protocol == IP_PROTOCOL_IPV6_ROUTE
1335 if (ip2->
protocol == IP_PROTOCOL_IPV6_ROUTE
1358 if (ip3->
protocol == IP_PROTOCOL_IPV6_ROUTE
1396 n_left_to_next, bi0, bi1, bi2, bi3,
1397 next0, next1, next2, next3);
1401 while (n_left_from > 0 && n_left_to_next > 0)
1406 ip6_ext_header_t *prev0;
1408 u32 next0 = SR_LOCALSID_NEXT_IP6_LOOKUP;
1416 n_left_to_next -= 1;
1441 if (ip0->
protocol == IP_PROTOCOL_IPV6_ROUTE
1461 n_left_to_next, bi0, next0);
1471 .name =
"sr-localsid",
1472 .vector_size =
sizeof (
u32),
1479 #define _(s,n) [SR_LOCALSID_NEXT_##s] = n, 1492 return (
format (s,
"SR: localsid_index:[%d]", index));
1583 "SR LocalSIDs behaviors:\n-----------------------\n\n");
1587 ({ vec_add1 (plugins_vec, plugin); }));
1592 "\tEnd\t-> Endpoint.\n" 1593 "\tEnd.X\t-> Endpoint with Layer-3 cross-connect.\n" 1594 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 1595 "\tEnd.T\t-> Endpoint with specific IPv6 table lookup.\n" 1596 "\t\tParameters: '<fib_table>'\n" 1597 "\tEnd.DX2\t-> Endpoint with decapsulation and Layer-2 cross-connect.\n" 1598 "\t\tParameters: '<iface>'\n" 1599 "\tEnd.DX6\t-> Endpoint with decapsulation and IPv6 cross-connect.\n" 1600 "\t\tParameters: '<iface> <ip6_next_hop>'\n" 1601 "\tEnd.DX4\t-> Endpoint with decapsulation and IPv4 cross-connect.\n" 1602 "\t\tParameters: '<iface> <ip4_next_hop>'\n" 1603 "\tEnd.DT6\t-> Endpoint with decapsulation and specific IPv6 table lookup.\n" 1604 "\t\tParameters: '<ip6_fib_table>'\n" 1605 "\tEnd.DT4\t-> Endpoint with decapsulation and specific IPv4 table lookup.\n" 1606 "\t\tParameters: '<ip4_fib_table>'\n");
1608 for (i = 0; i <
vec_len (plugins_vec); i++)
1610 plugin = plugins_vec[
i];
1620 .path =
"show sr localsids behaviors",
1621 .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)
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)
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
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.
#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)
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.
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.
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 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.
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