|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
70 int *result = va_arg (*args,
int *);
85 am->opcode_by_name, &
i))
98 int *result = va_arg (*args,
int *);
103 *result = clib_host_to_net_u16 ((
u16) * result);
132 return (
am->ethernet_arp_by_sw_if_index[
sw_if_index].enabled);
165 u32 input_sw_if_index,
u32 conn_sw_if_index)
190 const ethernet_arp_ip4_over_ethernet_address_t *
addr)
205 return (ETHERNET_ARP_ERROR_l3_src_address_learned);
241 pi0 = to_next[0] =
from[0];
250 error0 = ETHERNET_ARP_ERROR_replies_sent;
255 clib_net_to_host_u16 (ETHERNET_ARP_HARDWARE_TYPE_ethernet) ?
256 ETHERNET_ARP_ERROR_l2_type_not_ethernet : error0);
259 clib_net_to_host_u16 (ETHERNET_TYPE_IP4) ?
260 ETHERNET_ARP_ERROR_l3_type_not_ip4 : error0);
263 ETHERNET_ARP_ERROR_l3_dst_address_unset : error0);
265 if (ETHERNET_ARP_ERROR_replies_sent == error0)
276 n_left_to_next, pi0, next0);
282 return frame->n_vectors;
291 #define foreach_arp_disabled_error \
292 _ (DISABLED, "ARP Disabled on this interface") \
296 #define _(sym,string) ARP_DISABLED_ERROR_##sym,
303 #define _(sym,string) string,
334 error0 = ARP_DISABLED_ERROR_DISABLED;
336 pi0 = to_next[0] =
from[0];
346 n_left_to_next, pi0, next0);
352 return frame->n_vectors;
392 u32 n_replies_sent = 0;
415 u32 pi0, error0, next0, sw_if_index0, conn_sw_if_index0, fib_index0;
416 u8 dst_is_local0, is_vrrp_reply0;
434 error0 = ETHERNET_ARP_ERROR_replies_sent;
439 if (~0 == fib_index0)
441 error0 = ETHERNET_ARP_ERROR_interface_no_table;
469 ip4_over_ethernet[0].ip4,
487 error0 = ETHERNET_ARP_ERROR_l3_src_address_is_local;
542 error0 = ETHERNET_ARP_ERROR_l3_src_address_not_local;
563 if (conn_sw_if_index0 != sw_if_index0)
564 error0 = ETHERNET_ARP_ERROR_l3_dst_address_not_local;
575 error0 = ETHERNET_ARP_ERROR_l3_dst_address_not_local;
585 clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_reply))
598 error0 = ETHERNET_ARP_ERROR_l2_address_mismatch;
605 clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_reply))
614 error0 = ETHERNET_ARP_ERROR_l3_dst_address_not_local;
619 clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_request) &&
620 (dst_is_local0 == 0))
626 if (sw_if_index0 != conn_sw_if_index0 ||
636 error0 = ETHERNET_ARP_ERROR_unnumbered_mismatch;
643 error0 = ETHERNET_ARP_ERROR_gratuitous_arp;
648 if_addr0, arp0, eth_rx);
667 n_left_to_next, pi0, next0);
674 ETHERNET_ARP_ERROR_replies_sent, n_replies_sent);
676 return frame->n_vectors;
681 #define _(sym,string) string,
692 .vector_size =
sizeof (
u32),
707 .name =
"arp-disabled",
708 .vector_size =
sizeof (
u32),
723 .vector_size =
sizeof (
u32),
740 .last_in_arc =
"error-drop",
747 .node_name =
"arp-reply",
754 .node_name =
"arp-proxy",
762 .node_name =
"arp-disabled",
769 .node_name =
"error-drop",
784 } ip4_over_ethernet[2];
791 #define _(f) pg_edit_init (&p->f, ethernet_arp_header_t, f);
794 _(n_l2_address_bytes);
795 _(n_l3_address_bytes);
797 _(ip4_over_ethernet[0].
mac);
798 _(ip4_over_ethernet[0].
ip4);
799 _(ip4_over_ethernet[1].
mac);
800 _(ip4_over_ethernet[1].
ip4);
821 if (!
unformat (input,
"%U: %U/%U -> %U/%U",
889 #define _(o) hash_set_mem (am->opcode_by_name, #o, ETHERNET_ARP_OPCODE_##o);
899 vnet_pcap_drop_trace_filter_add_del \
900 (rt->errors[ETHERNET_ARP_ERROR_##a], \
910 vec_add1 (
im->enable_disable_interface_callbacks, cb);
static vlib_node_registration_t arp_reply_node
(constructor) VLIB_REGISTER_NODE (arp_reply_node)
vnet_interface_main_t * im
static void pg_edit_set_fixed(pg_edit_t *e, u64 value)
int arp_proxy_add(u32 fib_index, const ip4_address_t *lo_addr, const ip4_address_t *hi_addr)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
int arp_proxy_del(u32 fib_index, const ip4_address_t *lo_addr, const ip4_address_t *hi_addr)
Virtual function Table for neighbor protocol implementations to register.
nat44_ei_hairpin_src_next_t next_index
ip4_main_t ip4_main
Global ip4 main structure.
Per-interface ARP configuration and state.
ip4_neighbor_proxy_addr_t inv_proxy4_add
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
enum arp_input_next_t_ arp_input_next_t
VNET_FEATURE_ARC_INIT(arp_feat, static)
VNET_FEATURE_INIT(arp_reply_feat_node, static)
void vlib_trace_frame_buffers_only(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, uword n_buffers, uword next_buffer_stride, uword n_buffer_data_bytes_in_trace)
vlib_main_t vlib_node_runtime_t * node
static void arp_disable(ethernet_arp_main_t *am, u32 sw_if_index)
@ FIB_ENTRY_FLAG_ATTACHED
static ethernet_arp_main_t ethernet_arp_main
Information related to the source of a FIB entry.
static uword arp_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
u16 fp_len
The mask length.
uword unformat_pg_arp_header(unformat_input_t *input, va_list *args)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define hash_create_string(elts, value_bytes)
static enum arp_dst_fib_type arp_dst_fib_check(const fib_node_index_t fei, fib_entry_flag_t *flags)
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
#define foreach_ethernet_arp_error
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(vnet_arp_add_del_sw_interface)
vnet_sw_interface_flags_t flags
static int ethernet_mac_address_equal(const u8 *a, const u8 *b)
static uword unformat_ethernet_arp_opcode_host_byte_order(unformat_input_t *input, va_list *args)
@ FIB_SOURCE_ADJ
Adjacency source.
const static ip_neighbor_vft_t arp_vft
enum fib_entry_flag_t_ fib_entry_flag_t
#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 vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
unformat_function_t * unformat_edit
vnet_main_t * vnet_get_main(void)
#define VLIB_NODE_FLAG_TRACE
int arp_proxy_disable(u32 sw_if_index)
void ip_neighbor_register(ip_address_family_t af, const ip_neighbor_vft_t *vft)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
ethernet_arp_interface_t * ethernet_arp_by_sw_if_index
Per interface state.
u32 fib_node_index_t
A typedef of a node index.
static pg_node_t * pg_get_node(uword node_index)
static char * arp_disabled_error_strings[]
static uword arp_disabled(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static clib_error_t * ethernet_arp_init(vlib_main_t *vm)
fib_node_index_t ip4_fib_table_lookup(const ip4_fib_t *fib, const ip4_address_t *addr, u32 len)
sll srl srl sll sra u16x4 i
static u8 * format_ethernet_arp_input_trace(u8 *s, va_list *va)
static ip4_fib_t * ip4_fib_get(u32 index)
Get the FIB at the given index.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
fib_entry_flag_t fib_entry_get_flags_for_source(fib_node_index_t fib_entry_index, fib_source_t source)
@ VNET_SW_INTERFACE_FLAG_UNNUMBERED
u32 fib_entry_get_resolving_interface(fib_node_index_t entry_index)
static void pg_free_edit_group(pg_stream_t *s)
struct _vlib_node_registration vlib_node_registration_t
vnet_sw_interface_t * sw_interfaces
uword unformat_pg_edit(unformat_input_t *input, va_list *args)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
@ ARP_REPLY_NEXT_REPLY_TX
static void pg_ethernet_arp_header_init(pg_ethernet_arp_header_t *p)
static uword arp_reply(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 unnumbered_sw_if_index
static char * ethernet_arp_error_strings[]
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
static int arp_unnumbered(vlib_buffer_t *p0, u32 input_sw_if_index, u32 conn_sw_if_index)
ip4_enable_disable_interface_function_t * function
#define foreach_ethernet_arp_opcode
fib_entry_t * fib_entry_get(fib_node_index_t index)
@ FIB_ENTRY_FLAG_CONNECTED
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
description fragment has unexpected format
static void * pg_create_edit_group(pg_stream_t *s, int n_edit_bytes, int n_packet_bytes, u32 *group_index)
@ FIB_SOURCE_DEFAULT_ROUTE
The default route source.
uword unformat_mac_address_t(unformat_input_t *input, va_list *args)
u32 fib_entry_get_any_resolving_interface(fib_node_index_t entry_index)
vlib_put_next_frame(vm, node, next_index, 0)
void ip_neighbor_learn_dp(const ip_neighbor_learn_t *l)
APIs invoked by neighbor implementation (i.s.
u32 enabled
Is ARP enabled on this interface.
#define VLIB_INIT_FUNCTION(x)
#define FOR_EACH_SRC_ADDED(_entry, _src, _source, action)
enum arp_disabled_next_t_ arp_disabled_next_t
static int arp_is_enabled(ethernet_arp_main_t *am, u32 sw_if_index)
static vlib_node_registration_t arp_input_node
(constructor) VLIB_REGISTER_NODE (arp_input_node)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
static_always_inline u32 arp_mk_reply(vnet_main_t *vnm, vlib_buffer_t *p0, u32 sw_if_index0, const ip4_address_t *if_addr0, ethernet_arp_header_t *arp0, ethernet_header_t *eth_rx)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
static uword unformat_ethernet_arp_opcode_net_byte_order(unformat_input_t *input, va_list *args)
static vlib_node_registration_t arp_disabled_node
(constructor) VLIB_REGISTER_NODE (arp_disabled_node)
#define VNET_FEATURES(...)
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)
static ethernet_header_t * ethernet_buffer_get_header(vlib_buffer_t *b)
@ ARP_INPUT_NEXT_DISABLED
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
static const u8 vrrp_prefix[]
enum fib_source_t_ fib_source_t
The different sources that can create a route.
struct ethernet_arp_interface_t_ ethernet_arp_interface_t
Per-interface ARP configuration and state.
static clib_error_t * vnet_arp_add_del_sw_interface(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
static u32 arp_learn(u32 sw_if_index, const ethernet_arp_ip4_over_ethernet_address_t *addr)
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).
u8 * format_ethernet_arp_header(u8 *s, va_list *va)
Aggregate type for a prefix.
void ethernet_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
vnet_interface_main_t interface_main
static void arp_enable(ethernet_arp_main_t *am, u32 sw_if_index)
#define foreach_arp_disabled_error
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
static void arp_enable_disable_interface(ip4_main_t *im, uword opaque, u32 sw_if_index, u32 is_enable)
vl_api_wireguard_peer_flags_t flags