69 u8 *rewrite, rewrite_len;
80 clib_warning (
"Sending GARP for IP4 address %U on sw_if_idex %d",
103 rewrite_len =
vec_len (rewrite);
126 u32 *from, *to_next_drop;
127 uword n_left_from, n_left_to_next_drop, next_index;
142 while (n_left_from > 0)
145 to_next_drop, n_left_to_next_drop);
147 while (n_left_from > 0 && n_left_to_next_drop > 0)
149 u32 pi0, adj_index0, sw_if_index0;
160 to_next_drop[0] = pi0;
162 n_left_to_next_drop -= 1;
166 sw_if_index0 = adj0->rewrite_header.sw_if_index;
267 .vector_size =
sizeof (
u32),
280 .vector_size =
sizeof (
u32),
291 #define foreach_notrace_ip4_arp_error \ 306 vnet_pcap_drop_trace_filter_add_del \ 307 (rt->errors[IP4_ARP_ERROR_##a], \
#define VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
vnet_main_t * vnet_get_main(void)
#define VLIB_MAIN_LOOP_ENTER_FUNCTION(x)
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 throttle_t arp_throttle
ARP throttling.
This packet is to be rewritten and forwarded to the next processing node.
void throttle_init(throttle_t *t, u32 n_threads, f64 time)
adj_index_t adj_glean_get(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh)
Get an existing glean.
#define VLIB_NODE_FN(node)
vlib_error_t * errors
Vector of errors for this node.
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
struct ip_adjacency_t_::@161::@162 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
#define VLIB_INIT_FUNCTION(x)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
static_always_inline void mac_address_from_bytes(mac_address_t *mac, const u8 *bytes)
void ip4_neighbor_probe_dst(u32 sw_if_index, const ip4_address_t *dst)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static clib_error_t * arp_notrace_init(vlib_main_t *vm)
static u64 throttle_seed(throttle_t *t, u32 thread_index, f64 time_now)
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
#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).
A throttle Used in the data plane to decide if a given hash should be throttled, i.e.
vlib_thread_main_t vlib_thread_main
static uword ip4_arp_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_glean)
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
#define VLIB_REGISTER_NODE(x,...)
static clib_error_t * ip4_neighbor_main_loop_enter(vlib_main_t *vm)
#define vec_free(V)
Free vector's memory (no header).
#define clib_warning(format, args...)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
void ip4_neighbor_advertise(vlib_main_t *vm, vnet_main_t *vnm, u32 sw_if_index, const ip4_address_t *addr)
u32 adj_index_t
An index for adjacencies.
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
vlib_main_t vlib_node_runtime_t * node
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)
vlib_packet_template_t ip4_arp_request_packet_template
Template used to generate IP4 ARP packets.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
struct ip_adjacency_t_::@161::@164 glean
IP_LOOKUP_NEXT_GLEAN.
static vlib_main_t * vlib_get_main(void)
union ip_adjacency_t_::@161 sub_type
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
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_node_registration_t ip4_arp_node
(constructor) VLIB_REGISTER_NODE (ip4_arp_node)
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)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
#define foreach_notrace_ip4_arp_error
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
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' ...
ip4_main_t ip4_main
Global ip4 main structure.
u16 flags
Copy of main node flags.
vlib_node_registration_t ip4_glean_node
(constructor) VLIB_REGISTER_NODE (ip4_glean_node)
static char * ip4_arp_error_strings[]
#define VLIB_NODE_FLAG_TRACE
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
static int throttle_check(throttle_t *t, u32 thread_index, u64 hash, u64 seed)