42 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 49 #define foreach_vpe_api_msg \ 50 _(LLDP_CONFIG, lldp_config) \ 51 _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) 56 vl_api_lldp_config_reply_t *rmp;
66 rv = VNET_API_ERROR_INVALID_VALUE;
75 vl_api_sw_interface_set_lldp_reply_t *rmp;
77 u8 *mgmt_oid = 0, *mgmt_ip4 = 0, *mgmt_ip6 = 0;
79 u8 no_data[128] = { 0 };
107 strncpy ((
char *) mgmt_oid, (
char *) mp->
mgmt_oid,
vec_len (mgmt_oid));
113 &mgmt_ip4, &mgmt_ip6, &mgmt_oid,
120 rv = VNET_API_ERROR_INVALID_VALUE;
136 #define vl_msg_name_crc_list 138 #undef vl_msg_name_crc_list 143 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 144 foreach_vl_msg_name_crc_lldp;
154 vl_msg_api_set_handlers(VL_API_##N, #n, \ 155 vl_api_##n##_t_handler, \ 157 vl_api_##n##_t_endian, \ 158 vl_api_##n##_t_print, \ 159 sizeof(vl_api_##n##_t), 1); #define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
lldp_cfg_err_t lldp_cfg_intf_set(u32 hw_if_index, u8 **port_desc, u8 **mgmt_ip4, u8 **mgmt_ip6, u8 **mgmt_oid, int enable)
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
#define clib_memcpy(d, s, n)
vl_api_ip6_address_t mgmt_ip6
vl_api_interface_index_t sw_if_index
#define foreach_vpe_api_msg
VLIB_API_INIT_FUNCTION(lldp_api_hookup)
u32 vl_api_string_len(vl_api_string_t *astr)
LLDP external definition.
API main structure, used by both vpp and binary API clients.
#define BAD_SW_IF_INDEX_LABEL
static void vl_api_lldp_config_t_handler(vl_api_lldp_config_t *mp)
vl_api_ip4_address_t mgmt_ip4
static uword ip6_address_is_zero(const ip6_address_t *a)
#define vec_free(V)
Free vector's memory (no header).
char * vl_api_from_api_to_new_c_string(vl_api_string_t *astr)
static void vl_api_sw_interface_set_lldp_t_handler(vl_api_sw_interface_set_lldp_t *mp)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void setup_message_id_table(api_main_t *am)
void ip4_address_decode(const vl_api_ip4_address_t in, ip4_address_t *out)
Interface set LLDP request.
bool enable[default=true]
static api_main_t * vlibapi_get_main(void)
configure global parameter for LLDP
lldp_cfg_err_t lldp_cfg_set(u8 **host, int hold_time, int tx_interval)
static clib_error_t * lldp_api_hookup(vlib_main_t *vm)
u8 * vl_api_from_api_to_new_vec(void *mp, vl_api_string_t *astr)
#define VALIDATE_SW_IF_INDEX(mp)