44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define vl_api_version(n,v) static u32 api_version=(v); 54 #define REPLY_MSG_ID_BASE sm->msg_id_base 58 #define foreach_pot_plugin_api_msg \ 59 _(POT_PROFILE_ADD, pot_profile_add) \ 60 _(POT_PROFILE_ACTIVATE, pot_profile_activate) \ 61 _(POT_PROFILE_DEL, pot_profile_del) \ 62 _(POT_PROFILE_SHOW_CONFIG_DUMP, pot_profile_show_config_dump) \ 69 vl_api_pot_profile_add_reply_t * rmp;
82 clib_net_to_host_u64(mp->
prime),
84 clib_net_to_host_u64(mp->
lpc),
111 rmp->
prime=clib_host_to_net_u64(profile->
prime);
113 rmp->
lpc=clib_host_to_net_u64(profile->
lpc);
135 u8 dump_call_id = ~0;
136 if(dump_call_id==
id){
149 vl_api_pot_profile_add_reply_t * rmp;
172 vl_api_pot_profile_del_reply_t * rmp;
185 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 187 vl_api_##n##_t_handler, \ 189 vl_api_##n##_t_endian, \ 190 vl_api_##n##_t_print, \ 191 sizeof(vl_api_##n##_t), 1); 198 #define vl_msg_name_crc_list 200 #undef vl_msg_name_crc_list 205 #define _(id,n,crc) \ 206 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 207 foreach_vl_msg_name_crc_pot;
223 name =
format (0,
"ioam_pot_%08x%c", api_version, 0);
void clear_pot_profiles()
u16 vl_msg_api_get_msg_ids(const char *name, int n)
static clib_error_t * pot_plugin_api_hookup(vlib_main_t *vm)
pot_profile * pot_profile_find(u8 id)
vnet_main_t * vnet_get_main(void)
int pot_profile_create(pot_profile *profile, u64 prime, u64 poly2, u64 lpc, u64 secret_share)
Proof of Transit(POT): Set POT profile.
#define REPLY_MACRO2(t, body)
static clib_error_t * pot_init(vlib_main_t *vm)
static int pot_profile_set_active(u8 id)
#define VLIB_INIT_FUNCTION(x)
API main structure, used by both vpp and binary API clients.
static void vl_api_pot_profile_del_t_handler(vl_api_pot_profile_del_t *mp)
#define vec_free(V)
Free vector's memory (no header).
static void vl_api_pot_profile_show_config_dump_t_handler(vl_api_pot_profile_show_config_dump_t *mp)
#define foreach_pot_plugin_api_msg
int pot_set_validator(pot_profile *profile, u64 key)
static void vl_api_pot_profile_activate_t_handler(vl_api_pot_profile_activate_t *mp)
void pot_profile_list_init(u8 *profile_list_name)
int pot_profile_list_is_enabled(u8 *name)
Proof of Transit(POT): Activate POT profile in the list.
static void setup_message_id_table(pot_main_t *sm, api_main_t *am)
static void send_pot_profile_details(vl_api_pot_profile_show_config_dump_t *mp, u8 id)
int pot_profile_set_bit_mask(pot_profile *profile, u16 bits)
static void vl_api_pot_profile_add_t_handler(vl_api_pot_profile_add_t *mp)