|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
24 #include <vpp/app/version.h>
27 #define SID_CREATE_IFACE_FEATURE_ERROR -1
28 #define SID_CREATE_INVALID_IFACE_TYPE -3
29 #define SID_CREATE_INVALID_IFACE_INDEX -4
30 #define SID_CREATE_INVALID_ADJ_INDEX -5
35 "Endpoint with dynamic proxy to SR-unaware appliance";
36 unsigned char params_str[] =
"nh <next-hop> oif <iface-out> iif <iface-in>";
71 ls_mem->
nh_adj = nh_adj_index;
287 s =
format (s,
"\tGood rewrite traffic: \t[%Ld packets : %Ld bytes]\n",
289 s =
format (s,
"\tBad rewrite traffic: \t[%Ld packets : %Ld bytes]\n",
305 void **plugin_mem_p = va_arg (*args,
void **);
316 #define PARAM_AD_NH (1 << 0)
317 #define PARAM_AD_OIF (1 << 1)
318 #define PARAM_AD_IIF (1 << 2)
341 vnm, &sw_if_index_out))
347 vnm, &sw_if_index_in))
359 if ((params & params_chk) != params_chk)
367 *plugin_mem_p = ls_mem;
389 return (
format (s,
"SR: dynamic_proxy_index:[%u]",
index));
453 .arc_name =
"device-input",
454 .node_name =
"srv6-ad2-rewrite",
460 .arc_name =
"ip4-unicast",
461 .node_name =
"srv6-ad4-rewrite",
467 .arc_name =
"ip6-unicast",
468 .node_name =
"srv6-ad6-rewrite",
475 .version = VPP_BUILD_VER,
476 .description =
"Dynamic Segment Routing for IPv6 (SRv6) Proxy",
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
u32 * sw_iface_localsid4
Retrieve local SID from iface.
vnet_sw_interface_type_t type
static u8 * format_srv6_ad_dpo(u8 *s, va_list *args)
#define SID_CREATE_IFACE_FEATURE_ERROR
srv6_ad_localsid_t ** sids
Pool of AD SID pointers.
u32 srv6_localsid_behavior_id
SRv6 LocalSID behavior number.
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.
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
#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.
#define SID_CREATE_INVALID_ADJ_INDEX
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 clib_mem_free(void *p)
void * plugin_mem
Memory to be used by the plugin callback functions.
#define clib_error_return(e, args...)
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
#define pool_put(P, E)
Free an object E in pool P.
u32 nh_adj
Adjacency index for out.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static int srv6_ad_localsid_creation_fn(ip6_sr_localsid_t *localsid)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
srv6_ad_main_t srv6_ad_main
vlib_combined_counter_main_t invalid_counters
Invalid rewrite counters.
static int srv6_ad_localsid_removal_fn(ip6_sr_localsid_t *localsid)
VNET_FEATURE_INIT(srv6_ad2_rewrite, static)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
dpo_type_t srv6_ad_dpo_type
DPO type.
unsigned char keyword_str[]
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unsigned char params_str[]
vnet_main_t * vnet_get_main(void)
Combined counter to hold both packets and byte differences.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
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.
void srv6_ad_dpo_lock(dpo_id_t *dpo)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
u8 * rewrite
Headers to be rewritten.
dpo_lock_fn_t dv_lock
A reference counting lock function.
uword unformat_srv6_ad_localsid(unformat_input_t *input, va_list *args)
counter_t packets
packet counter
#define SID_CREATE_INVALID_IFACE_INDEX
static clib_error_t * srv6_ad_init(vlib_main_t *vm)
vnet_sw_interface_t * sw_interfaces
vlib_combined_counter_main_t valid_counters
Valid rewrite counters.
ip6_sr_localsid_t * localsids
u8 * format_srv6_ad_localsid(u8 *s, va_list *args)
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...
Segment Routing main datastructure.
#define vec_free(V)
Free vector's memory (no header).
#define pool_len(p)
Number of elements in pool vector.
format_function_t format_vnet_sw_if_index_name
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
void srv6_ad_dpo_unlock(dpo_id_t *dpo)
u32 * sw_iface_localsid6
Retrieve local SID from iface.
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
vlib_main_t * vlib_main
[convenience] vlib main
counter_t bytes
byte counter
vnet_main_t * vnet_main
[convenience] vnet main
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V,...
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
u32 adj_index_t
An index for adjacencies.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
A virtual function table regisitered for a DPO type.
#define VNET_FEATURES(...)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
const static char *const *const srv6_ad_nodes[DPO_PROTO_NUM]
ip46_address_t nh_addr
Proxied device address.
static void * clib_mem_alloc_aligned_at_offset(uword size, uword align, uword align_offset, int os_out_of_memory_on_failure)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
@ VNET_SW_INTERFACE_TYPE_HARDWARE
u32 * sw_iface_localsid2
Retrieve local SID from iface.
u32 rw_len
Number of bits to be rewritten.
const static dpo_vft_t srv6_ad_vft
#define SID_CREATE_INVALID_IFACE_TYPE
unsigned char function_name[]
vnet_interface_main_t interface_main
u32 sw_if_index_in
Incoming iface from proxied dev.
u32 sw_if_index_out
Outgoing iface to proxied dev.
const static char *const srv6_ad_ip6_nodes[]