|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
23 u32 if_index,
u8 oid_len,
u8 * oid)
25 lldp_tlv_t *t = (lldp_tlv_t *) * t0p;
28 t->v[0] = addr_len + 1;
31 t->v[addr_len + 2] = 2;
32 t->v[addr_len + 3] = (if_index >> 24) & 0xFF;
33 t->v[addr_len + 4] = (if_index >> 16) & 0xFF;
34 t->v[addr_len + 5] = (if_index >> 8) & 0xFF;
35 t->v[addr_len + 6] = (if_index >> 0) & 0xFF;
36 t->v[addr_len + 7] = oid_len;
42 *t0p +=
STRUCT_SIZE_OF (lldp_tlv_t, head) + addr_len + oid_len + 8;
48 lldp_chassis_id_tlv_t *t = (lldp_chassis_id_tlv_t *) * t0p;
53 const size_t addr_len = 6;
64 lldp_port_id_tlv_t *t = (lldp_port_id_tlv_t *) * t0p;
79 lldp_ttl_tlv_t *t = (lldp_ttl_tlv_t *) * t0p;
89 t->ttl = htons ((1 << 16) - 1);
107 lldp_tlv_t *t = (lldp_tlv_t *) * t0p;
121 lldp_tlv_t *t = (lldp_tlv_t *) * t0p;
136 if (!(len_ip4 | len_ip6))
176 lldp_tlv_t *t = (lldp_tlv_t *) * t0p;
226 u8 *
data = ((
u8 *) h0) +
sizeof (*h0);
291 h.type = htons (ETHERNET_TYPE_802_1_LLDP);
static void lldp_add_tlvs(lldp_main_t *lm, vnet_hw_interface_t *hw, u8 **t0p, int shutdown, lldp_intf_t *n)
uword * intf_by_hw_if_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static void lldp_build_mgmt_addr_tlv(u8 **t0p, u8 subtype, u8 addr_len, u8 *addr, u32 if_index, u8 oid_len, u8 *oid)
static void lldp_add_pdu_end(u8 **t0p)
#define LLDP_CHASS_ID_SUBTYPE_NAME(t)
void lldp_unschedule_intf(lldp_main_t *lm, lldp_intf_t *n)
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void lldp_add_port_desc(const lldp_main_t *lm, lldp_intf_t *n, u8 **t0p)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
static void lldp_add_port_id(const vnet_hw_interface_t *hw, u8 **t0p)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
const u8 lldp_mac_addr[6]
static clib_error_t * lldp_template_init(vlib_main_t *vm)
u16 current_length
Nbytes between current data and the end of this buffer.
vl_api_mac_address_t mac_addr
#define vec_free(V)
Free vector's memory (no header).
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
static void lldp_add_mgmt_addr(const lldp_intf_t *n, const vnet_hw_interface_t *hw, u8 **t0p)
#define VLIB_INIT_FUNCTION(x)
#define LLDP_PORT_ID_SUBTYPE_NAME(t)
LLDP global declarations.
static void lldp_add_ttl(const lldp_main_t *lm, u8 **t0p, int shutdown)
#define hash_unset(h, key)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static void lldp_add_sys_name(const lldp_main_t *lm, u8 **t0p)
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_alloc, char *fmt,...)
static f64 vlib_time_now(vlib_main_t *vm)
static void lldp_add_chassis_id(const vnet_hw_interface_t *hw, u8 **t0p)
void lldp_send_ethernet(lldp_main_t *lm, lldp_intf_t *n, int shutdown)
#define STRUCT_SIZE_OF(t, f)
void lldp_delete_intf(lldp_main_t *lm, lldp_intf_t *n)
vlib_packet_template_t packet_template
VLIB buffer representation.