|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
50 .subclass_name =
"neighbor",
53 #define log_debug(fmt, ...) \
54 vlib_log_debug (ip4_neighbor_log.class, fmt, __VA_ARGS__)
88 log_debug (
"Sending GARP for IP4 address %U on sw_if_idex %d",
103 h->ip4_over_ethernet[0].ip4 =
addr[0];
104 h->ip4_over_ethernet[1].ip4 =
addr[0];
153 to_next_drop, n_left_to_next_drop);
157 u32 pi0, adj_index0, sw_if_index0;
168 to_next_drop[0] = pi0;
170 n_left_to_next_drop -= 1;
174 sw_if_index0 = adj0->rewrite_header.sw_if_index;
247 return frame->n_vectors;
275 .vector_size =
sizeof (
u32),
288 .vector_size =
sizeof (
u32),
299 #define foreach_notrace_ip4_arp_error \
314 vnet_pcap_drop_trace_filter_add_del \
315 (rt->errors[IP4_ARP_ERROR_##a], \
void throttle_init(throttle_t *t, u32 n_threads, f64 time)
@ IP_LOOKUP_NEXT_ARP
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
#define VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
u8 * ethernet_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
build a rewrite string to use for sending packets of type 'link_type' to 'dst_address'
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
void ip4_forward_next_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t which_adj_index)
nat44_ei_hairpin_src_next_t next_index
static throttle_t arp_throttle
ARP throttling.
ip4_main_t ip4_main
Global ip4 main structure.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
vlib_main_t vlib_node_runtime_t * node
@ IP_LOOKUP_NEXT_GLEAN
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
adj_index_t adj_glean_get(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh)
Get an existing glean.
@ IP4_ARP_ERROR_NON_ARP_ADJ
vlib_packet_template_t ip4_arp_request_packet_template
Template used to generate IP4 ARP packets.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
@ IP4_ARP_ERROR_THROTTLED
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)
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#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.
#define VLIB_NODE_FN(node)
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
vnet_main_t * vnet_get_main(void)
#define VLIB_NODE_FLAG_TRACE
@ IP4_ARP_ERROR_REQUEST_SENT
VLIB_REGISTER_LOG_CLASS(ip4_neighbor_log, static)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static uword ip4_arp_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_glean)
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
vlib_thread_main_t vlib_thread_main
@ IP_LOOKUP_NEXT_REWRITE
This packet is to be rewritten and forwarded to the next processing node.
void ip4_neighbor_probe_dst(u32 sw_if_index, const ip4_address_t *dst)
static clib_error_t * arp_notrace_init(vlib_main_t *vm)
static u64 throttle_seed(throttle_t *t, u32 thread_index, f64 time_now)
A throttle Used in the data plane to decide if a given hash should be throttled, i....
static clib_error_t * ip4_neighbor_main_loop_enter(vlib_main_t *vm)
void ip4_neighbor_advertise(vlib_main_t *vm, vnet_main_t *vnm, u32 sw_if_index, const ip4_address_t *addr)
struct _vlib_node_registration vlib_node_registration_t
static vlib_buffer_t * ip4_neighbor_probe(vlib_main_t *vm, vnet_main_t *vnm, const ip_adjacency_t *adj0, const ip4_address_t *src, const ip4_address_t *dst)
#define log_debug(fmt,...)
struct ip_adjacency_t_::@144::@147 glean
IP_LOOKUP_NEXT_GLEAN.
#define vec_free(V)
Free vector's memory (no header).
union ip_adjacency_t_::@144 sub_type
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
bool fib_sas4_get(u32 sw_if_index, const ip4_address_t *dst, ip4_address_t *src)
Get an IPv4 Source address to use in a packet being sent out an interface.
vlib_put_next_frame(vm, node, next_index, 0)
static int throttle_check(throttle_t *t, u32 thread_index, u64 hash, u64 seed)
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
@ IP4_ARP_ERROR_NO_BUFFERS
u32 adj_index_t
An index for adjacencies.
#define foreach_notrace_ip4_arp_error
static vlib_main_t * vlib_get_main(void)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vnet_interface_output_runtime_t * rt
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
struct ip_adjacency_t_::@144::@145 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
vlib_node_registration_t ip4_arp_node
(constructor) VLIB_REGISTER_NODE (ip4_arp_node)
static char * ip4_arp_error_strings[]
static f64 vlib_time_now(vlib_main_t *vm)
vlib_node_registration_t ip4_glean_node
(constructor) VLIB_REGISTER_NODE (ip4_glean_node)
vl_api_interface_index_t sw_if_index
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
#define VLIB_MAIN_LOOP_ENTER_FUNCTION(x)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
@ IP4_ARP_ERROR_NO_SOURCE_ADDRESS
static_always_inline void mac_address_from_bytes(mac_address_t *mac, const u8 *bytes)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)