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, 61 u32 n_left_from, *from;
67 while (n_left_from > 0)
83 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
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 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define vec_foreach_index(var, v)
Iterate over vector indices.
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...
vl_api_wireguard_peer_flags_t flags
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
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)
#define clib_memcpy_fast(a, b, c)
static f64 vlib_time_now(vlib_main_t *vm)
static clib_error_t * lldp_sw_interface_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(lldp_sw_interface_up_down)
void lldp_schedule_intf(lldp_main_t *lm, lldp_intf_t *n)
static clib_error_t * lldp_hw_interface_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
u16 current_length
Nbytes between current data and the end of this buffer.
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(lldp_hw_interface_up_down)
vlib_error_t * errors
Vector of errors for this node.
void lldp_send_ethernet(lldp_main_t *lm, lldp_intf_t *n, int shutdown)
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...
u8 * lldp_input_format_trace(u8 *s, va_list *args)
static vlib_node_registration_t lldp_input_node
(constructor) VLIB_REGISTER_NODE (lldp_input_node)
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define vec_insert(V, N, M)
Insert N vector elements starting at element M, initialize new elements to zero (no header...
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static vlib_node_registration_t lldp_process_node
(constructor) VLIB_REGISTER_NODE (lldp_process_node)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define VLIB_REGISTER_NODE(x,...)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
#define clib_warning(format, args...)
vlib_main_t vlib_node_runtime_t * node
static uword lldp_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vec_delete(V, N, M)
Delete N elements starting at element M.
u32 lldp_process_node_index
static uword lldp_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
void ethernet_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
struct _vlib_node_registration vlib_node_registration_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static char * lldp_error_strings[]
void lldp_unschedule_intf(lldp_main_t *lm, lldp_intf_t *n)
LLDP global declarations.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vl_api_interface_index_t sw_if_index