23 #include <srv6-localsid/srv6_localsid_sample.h> 30 unsigned char def_str[64] =
"This is a definition of a sample new_srv6_localsid";
88 void **plugin_mem = va_arg (*args,
void **);
91 if (
unformat (input,
"new_srv6_localsid %u", &table_id))
104 *plugin_mem = ls_mem;
118 return (
format (s,
"SR: localsid_sample_index:[%u]", index));
138 "srv6-localsid-sample",
dpo_lock_fn_t dv_lock
A reference counting lock function.
uword unformat_srv6_localsid_sample(unformat_input_t *input, va_list *args)
A virtual function table regisitered for a DPO type.
unsigned char srv6_localsid_name[32]
static void * clib_mem_alloc_aligned_at_offset(uword size, uword align, uword align_offset, int os_out_of_memory_on_failure)
void srv6_localsid_sample_dpo_unlock(dpo_id_t *dpo)
static int srv6_localsid_removal_fn(ip6_sr_localsid_t *localsid)
unsigned char params_str[32]
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static int srv6_localsid_creation_fn(ip6_sr_localsid_t *localsid)
unsigned char keyword_str[32]
static const char *const srv6_localsid_sample_ip6_nodes[]
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.
#define VLIB_INIT_FUNCTION(x)
description fragment has unexpected format
#define clib_error_return(e, args...)
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
static u8 * format_srv6_localsid_sample_dpo(u8 *s, va_list *args)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static clib_error_t * srv6_localsid_sample_init(vlib_main_t *vm)
unsigned char def_str[64]
static const char *const *const srv6_localsid_sample_nodes[DPO_PROTO_NUM]
void srv6_localsid_sample_dpo_lock(dpo_id_t *dpo)
void * plugin_mem
Memory to be used by the plugin callback functions.
static void clib_mem_free(void *p)
srv6_localsid_sample_main_t srv6_localsid_sample_main
dpo_type_t srv6_localsid_sample_dpo_type
u32 srv6_localsid_behavior_id
u8 * format_srv6_localsid_sample(u8 *s, va_list *args)