24 #include <vpp/app/version.h> 40 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 46 #define vl_api_version(n,v) static u32 api_version=(v); 58 #define REPLY_MACRO(t) \ 60 unix_shared_memory_queue_t * q = \ 61 vl_api_client_index_to_input_queue (mp->client_index); \ 65 rmp = vl_msg_api_alloc (sizeof (*rmp)); \ 66 rmp->_vl_msg_id = ntohs((t)+cm->msg_id_base); \ 67 rmp->context = mp->context; \ 68 rmp->retval = ntohl(rv); \ 70 vl_msg_api_send_shmem (q, (u8 *)&rmp); \ 76 #define foreach_cdp_plugin_api_msg \ 77 _(CDP_ENABLE_DISABLE, cdp_enable_disable) 102 int enable_disable = 1;
110 else if (
unformat (input,
"enable"))
133 .short_help =
"cdp enable | disable",
142 vl_api_cdp_enable_disable_reply_t *rmp;
157 vl_msg_api_set_handlers((VL_API_##N + cm->msg_id_base), \ 159 vl_api_##n##_t_handler, \ 161 vl_api_##n##_t_endian, \ 162 vl_api_##n##_t_print, \ 163 sizeof(vl_api_##n##_t), 1); 170 #define vl_msg_name_crc_list 172 #undef vl_msg_name_crc_list 177 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n #crc, id + cm->msg_id_base); 178 foreach_vl_msg_name_crc_cdp;
191 name =
format (0,
"cdp_%08x%c", api_version, 0);
212 .version = VPP_BUILD_VER,
#define foreach_cdp_plugin_api_msg
static void setup_message_id_table(cdp_main_t *cm, api_main_t *am)
static clib_error_t * cdp_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
static void vl_api_cdp_enable_disable_t_handler(vl_api_cdp_enable_disable_t *mp)
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
API main structure, used by both vpp and binary API clients.
#define vec_free(V)
Free vector's memory (no header).
#define VLIB_CLI_COMMAND(x,...)
vlib_node_registration_t cdp_process_node
(constructor) VLIB_REGISTER_NODE (cdp_process_node)
static clib_error_t * cdp_plugin_api_hookup(vlib_main_t *vm)
int cdp_enable_disable(cdp_main_t *cm, int enable_disable)
u16 vl_msg_api_get_msg_ids(const char *name, int n)
static clib_error_t * cdp_init(vlib_main_t *vm)