24 lldp_chassis_id_tlv_t *t = (lldp_chassis_id_tlv_t *) * t0p;
29 const size_t addr_len = 6;
40 lldp_port_id_tlv_t *t = (lldp_port_id_tlv_t *) * t0p;
47 const size_t len =
STRUCT_SIZE_OF (lldp_port_id_tlv_t, subtype) + name_len;
55 lldp_ttl_tlv_t *t = (lldp_ttl_tlv_t *) * t0p;
65 t->ttl = htons ((1 << 16) - 1);
83 lldp_tlv_t *t = (lldp_tlv_t *) * t0p;
94 lldp_tlv_t *t = (lldp_tlv_t *) * t0p;
138 u8 *data = ((
u8 *) h0) +
sizeof (*h0);
183 memset (&h, 0,
sizeof (h));
198 h.
type = htons (ETHERNET_TYPE_802_1_LLDP);
#define LLDP_CHASS_ID_SUBTYPE_NAME(t)
#define hash_unset(h, key)
static f64 vlib_time_now(vlib_main_t *vm)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
static void lldp_add_tlvs(lldp_main_t *lm, vnet_hw_interface_t *hw, u8 **t0p, int shutdown)
void vlib_packet_template_init(vlib_main_t *vm, vlib_packet_template_t *t, void *packet_data, uword n_packet_data_bytes, uword min_n_buffers_each_physmem_alloc, char *fmt,...)
#define VLIB_INIT_FUNCTION(x)
static void lldp_add_ttl(const lldp_main_t *lm, u8 **t0p, int shutdown)
void lldp_send_ethernet(lldp_main_t *lm, lldp_intf_t *n, int shutdown)
static void lldp_add_sys_name(const lldp_main_t *lm, u8 **t0p)
u16 current_length
Nbytes between current data and the end of this buffer.
uword * intf_by_hw_if_index
#define pool_put(P, E)
Free an object E in pool P.
static void lldp_add_chassis_id(const vnet_hw_interface_t *hw, u8 **t0p)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define LLDP_PORT_ID_SUBTYPE_NAME(t)
void lldp_delete_intf(lldp_main_t *lm, lldp_intf_t *n)
#define vec_free(V)
Free vector's memory (no header).
#define clib_memcpy(a, b, c)
static void lldp_add_pdu_end(u8 **t0p)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
void lldp_unschedule_intf(lldp_main_t *lm, lldp_intf_t *n)
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
LLDP global declarations.
#define STRUCT_SIZE_OF(t, f)
vlib_packet_template_t packet_template
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static clib_error_t * lldp_template_init(vlib_main_t *vm)
static void lldp_add_port_id(const vnet_hw_interface_t *hw, u8 **t0p)