44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define vl_api_version(n,v) static u32 api_version=(v); 62 #define REPLY_MACRO(t) \ 64 unix_shared_memory_queue_t * q = \ 65 vl_api_client_index_to_input_queue (mp->client_index); \ 69 rmp = vl_msg_api_alloc (sizeof (*rmp)); \ 70 rmp->_vl_msg_id = ntohs((t)+sm->msg_id_base); \ 71 rmp->context = mp->context; \ 72 rmp->retval = ntohl(rv); \ 74 vl_msg_api_send_shmem (q, (u8 *)&rmp); \ 77 #define REPLY_MACRO2(t, body) \ 79 unix_shared_memory_queue_t * q; \ 80 rv = vl_msg_api_pd_handler (mp, rv); \ 81 q = vl_api_client_index_to_input_queue (mp->client_index); \ 85 rmp = vl_msg_api_alloc (sizeof (*rmp)); \ 86 rmp->_vl_msg_id = ntohs((t)); \ 87 rmp->context = mp->context; \ 88 rmp->retval = ntohl(rv); \ 89 do {body;} while (0); \ 90 vl_msg_api_send_shmem (q, (u8 *)&rmp); \ 95 #define foreach_pot_plugin_api_msg \ 96 _(POT_PROFILE_ADD, pot_profile_add) \ 97 _(POT_PROFILE_ACTIVATE, pot_profile_activate) \ 98 _(POT_PROFILE_DEL, pot_profile_del) \ 118 clib_net_to_host_u64(mp->
prime),
120 clib_net_to_host_u64(mp->
lpc),
196 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 198 vl_api_##n##_t_handler, \ 200 vl_api_##n##_t_endian, \ 201 vl_api_##n##_t_print, \ 202 sizeof(vl_api_##n##_t), 1); 217 name =
format (0,
"pot_%08x%c", api_version, 0);
void clear_pot_profiles()
clib_error_t * vlib_plugin_register(vlib_main_t *vm, vnet_plugin_handoff_t *h, int from_early_init)
static clib_error_t * pot_plugin_api_hookup(vlib_main_t *vm)
pot_profile * pot_profile_find(u8 id)
int pot_profile_create(pot_profile *profile, u64 prime, u64 poly2, u64 lpc, u64 secret_share)
Proof of Transit(POT): Set POT profile.
Proof of Transit profile add / del response.
static clib_error_t * pot_init(vlib_main_t *vm)
static int pot_profile_set_active(u8 id)
#define VLIB_INIT_FUNCTION(x)
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).
#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 profile add / del response.
Proof of Transit(POT): Activate POT profile in the list.
u16 vl_msg_api_get_msg_ids(char *name, int n)
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)