24 #include <vpp/app/version.h> 30 "Endpoint with dynamic proxy to SR-unaware appliance";
31 unsigned char params_str[] =
"nh <next-hop> oif <iface-out> iif <iface-in>";
59 ls_mem->
nh_adj = nh_adj_index;
177 "\tOutgoing iface: %U\n" 178 "\tIncoming iface: %U",
188 "\tOutgoing iface: %U\n" 189 "\tIncoming iface: %U",
207 void **plugin_mem_p = va_arg (*args,
void **);
212 ip46_address_t nh_addr;
216 if (
unformat (input,
"end.ad nh %U oif %U iif %U",
225 memset (ls_mem, 0,
sizeof *ls_mem);
235 *plugin_mem_p = ls_mem;
238 else if (
unformat (input,
"end.ad nh %U oif %U iif %U",
247 memset (ls_mem, 0,
sizeof *ls_mem);
257 *plugin_mem_p = ls_mem;
271 return (
format (s,
"SR: dynamic_proxy_index:[%u]", index));
334 .arc_name =
"ip4-unicast",
335 .node_name =
"srv6-ad4-rewrite",
341 .arc_name =
"ip6-unicast",
342 .node_name =
"srv6-ad6-rewrite",
349 .version = VPP_BUILD_VER,
350 .description =
"Dynamic SRv6 proxy",
dpo_lock_fn_t dv_lock
A reference counting lock function.
u8 * format_srv6_ad_localsid(u8 *s, va_list *args)
vnet_main_t * vnet_main
[convenience] vnet main
A virtual function table regisitered for a DPO type.
static void * clib_mem_alloc_aligned_at_offset(uword size, uword align, uword align_offset, int os_out_of_memory_on_failure)
static int srv6_ad_localsid_creation_fn(ip6_sr_localsid_t *localsid)
vnet_main_t * vnet_get_main(void)
static const char *const *const srv6_ad_nodes[DPO_PROTO_NUM]
vnet_interface_main_t interface_main
static int srv6_ad_localsid_removal_fn(ip6_sr_localsid_t *localsid)
uword unformat_srv6_ad_localsid(unformat_input_t *input, va_list *args)
static clib_error_t * srv6_ad_init(vlib_main_t *vm)
u32 * sw_iface_localsid4
Retrieve local SID from iface.
void srv6_ad_dpo_unlock(dpo_id_t *dpo)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
unformat_function_t unformat_vnet_sw_interface
format_function_t format_vnet_sw_if_index_name
#define pool_len(p)
Number of elements in pool vector.
u32 srv6_localsid_behavior_id
SRv6 LocalSID behavior number.
#define VLIB_INIT_FUNCTION(x)
void srv6_ad_dpo_lock(dpo_id_t *dpo)
#define clib_error_return(e, args...)
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
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 nh_adj
Adjacency index for out.
ip46_address_t nh_addr
Proxied device address.
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 ...
u32 sw_if_index_out
Outgoing iface to proxied dev.
u32 rw_len
Number of bits to be rewritten.
static u8 * format_srv6_ad_dpo(u8 *s, va_list *args)
vlib_main_t * vlib_main
[convenience] vlib main
ip6_sr_localsid_t * localsids
#define clib_memcpy(a, b, c)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
u32 adj_index_t
An index for adjacencies.
static const char *const srv6_ad_ip6_nodes[]
void * plugin_mem
Memory to be used by the plugin callback functions.
VNET_FEATURE_INIT(srv6_ad4_rewrite, static)
static void clib_mem_free(void *p)
dpo_type_t srv6_ad_dpo_type
DPO type.
unsigned char function_name[]
u32 * sw_iface_localsid6
Retrieve local SID from iface.
u32 sw_if_index_in
Incoming iface from proxied dev.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unsigned char params_str[]
srv6_ad_main_t srv6_ad_main
vnet_sw_interface_t * sw_interfaces
unsigned char keyword_str[]
Segment Routing main datastructure.
vnet_sw_interface_type_t type
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.
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.
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)