|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
24 #define LLDP_DEBUG (0)
28 #define F(sym, string) static char LLDP_ERR_##sym##_STR[] = string;
37 #define F(sym, string) LLDP_ERR_##sym##_STR,
83 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
99 return frame->n_vectors;
108 .name =
"lldp-input",
109 .vector_size =
sizeof(
u32),
112 .n_errors = LLDP_N_ERROR,
133 uword event_type, *event_data = 0;
147 clib_warning (
"DEBUG: wait for event with timeout %f", timeout);
223 _vec_len (event_data) = 0;
237 .name =
"lldp-process",
244 const int idx = n - lm->
intfs;
274 clib_warning (
"DEBUG: unschedule interface %p, if idx %d", n,
277 const int idx = n - lm->
intfs;
u32 lldp_process_node_index
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
void lldp_send_ethernet(lldp_main_t *lm, lldp_intf_t *n, int shutdown)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
void lldp_unschedule_intf(lldp_main_t *lm, lldp_intf_t *n)
static vlib_node_registration_t lldp_process_node
(constructor) VLIB_REGISTER_NODE (lldp_process_node)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define vec_delete(V, N, M)
Delete N elements starting at element M.
@ VNET_HW_INTERFACE_FLAG_LINK_UP
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type,...
static clib_error_t * lldp_hw_interface_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static clib_error_t * lldp_sw_interface_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(lldp_sw_interface_up_down)
#define vec_foreach_index(var, v)
Iterate over vector indices.
sll srl srl sll sra u16x4 i
struct _vlib_node_registration vlib_node_registration_t
u16 current_length
Nbytes between current data and the end of this buffer.
#define vec_free(V)
Free vector's memory (no header).
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(lldp_hw_interface_up_down)
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
description fragment has unexpected format
void lldp_schedule_intf(lldp_main_t *lm, lldp_intf_t *n)
static void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
u8 * lldp_input_format_trace(u8 *s, va_list *args)
LLDP global declarations.
static vlib_node_registration_t lldp_input_node
(constructor) VLIB_REGISTER_NODE (lldp_input_node)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vnet_interface_output_runtime_t * rt
#define clib_warning(format, args...)
static f64 vlib_time_now(vlib_main_t *vm)
static uword lldp_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
vl_api_interface_index_t sw_if_index
static uword lldp_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vec_insert(V, N, M)
Insert N vector elements starting at element M, initialize new elements to zero (no header,...
vl_api_fib_path_type_t type
void ethernet_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
static char * lldp_error_strings[]
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
vl_api_wireguard_peer_flags_t flags