24 #include <vpp/app/version.h> 29 unsigned char def_str[] =
"Endpoint to SR-unaware appliance via masquerading";
30 unsigned char params_str[] =
"nh <next-hop> oif <iface-out> iif <iface-in>";
51 localsid->
nh_adj = nh_adj_index;
109 "\tOutgoing iface: %U\n" 110 "\tIncoming iface: %U",
126 void **plugin_mem_p = va_arg (*args,
void **);
131 ip46_address_t nh_addr;
135 if (
unformat (input,
"end.am nh %U oif %U iif %U",
144 memset (ls_mem, 0,
sizeof *ls_mem);
153 *plugin_mem_p = ls_mem;
167 return (
format (s,
"SR: dynamic_proxy_index:[%u]", index));
230 .arc_name =
"ip6-unicast",
231 .node_name =
"srv6-am-rewrite",
238 .version = VPP_BUILD_VER,
239 .description =
"Masquerading SRv6 proxy",
dpo_lock_fn_t dv_lock
A reference counting lock function.
u32 nh_adj
Next_adj for xconnect usage only.
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)
vnet_main_t * vnet_get_main(void)
vnet_interface_main_t interface_main
static const char *const srv6_am_ip6_nodes[]
u32 sw_if_index_out
Outgoing iface to proxied device.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static u8 * format_srv6_am_dpo(u8 *s, va_list *args)
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
memset(h->entries, 0, sizeof(h->entries[0])*entries)
#define VLIB_INIT_FUNCTION(x)
void srv6_am_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.
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
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 ...
static int srv6_am_localsid_creation_fn(ip6_sr_localsid_t *localsid)
dpo_type_t srv6_am_dpo_type
DPO type.
uword unformat_srv6_am_localsid(unformat_input_t *input, va_list *args)
vnet_main_t * vnet_main
[convenience] vnet main
static clib_error_t * srv6_am_init(vlib_main_t *vm)
u32 srv6_localsid_behavior_id
SRv6 LocalSID behavior number.
#define clib_memcpy(a, b, c)
u8 * format_srv6_am_localsid(u8 *s, va_list *args)
#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.
unsigned char keyword_str[]
static const char *const *const srv6_am_nodes[DPO_PROTO_NUM]
void * plugin_mem
Memory to be used by the plugin callback functions.
static void clib_mem_free(void *p)
ip46_address_t nh_addr
Proxied device address.
unsigned char function_name[]
VNET_FEATURE_INIT(srv6_am_rewrite, static)
void srv6_am_dpo_unlock(dpo_id_t *dpo)
vnet_sw_interface_t * sw_interfaces
srv6_am_main_t srv6_am_main
unsigned char params_str[]
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.
static int srv6_am_localsid_removal_fn(ip6_sr_localsid_t *localsid)
vlib_main_t * vlib_main
[convenience] vlib main
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 sw_if_index_in
Incoming iface from proxied device.