FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
arp.c File Reference

IPv4 ARP. More...

+ Include dependency graph for arp.c:

Go to the source code of this file.

Data Structures

struct  ethernet_arp_interface_t_
 Per-interface ARP configuration and state. More...
 
struct  ethernet_proxy_arp_t
 
struct  pending_resolution_t
 
struct  ethernet_arp_main_t
 
struct  vnet_arp_set_ip4_over_ethernet_rpc_args_t
 
struct  ethernet_arp_input_trace_t
 
struct  pg_ethernet_arp_header_t
 

Macros

#define ETHERNET_ARP_ARGS_REMOVE   (1<<0)
 
#define ETHERNET_ARP_ARGS_FLUSH   (1<<1)
 
#define ETHERNET_ARP_ARGS_POPULATE   (1<<2)
 
#define ETHERNET_ARP_ARGS_WC_PUB   (1<<3)
 
#define foreach_ethernet_arp_error
 
#define foreach_arp_disabled_error   _ (DISABLED, "ARP Disabled on this interface") \
 

Typedefs

typedef struct ethernet_arp_interface_t_ ethernet_arp_interface_t
 Per-interface ARP configuration and state. More...
 
typedef enum arp_input_next_t_ arp_input_next_t
 
typedef enum arp_disabled_next_t_ arp_disabled_next_t
 

Enumerations

enum  arp_reply_next_t { ARP_REPLY_NEXT_DROP, ARP_REPLY_NEXT_REPLY_TX, ARP_REPLY_N_NEXT }
 
enum  ethernet_arp_reply_error_t { ETHERNET_ARP_N_ERROR }
 
enum  arp_input_next_t_ { ARP_INPUT_NEXT_DROP, ARP_INPUT_NEXT_DISABLED, ARP_INPUT_N_NEXT }
 
enum  arp_disabled_next_t_ { ARP_DISABLED_NEXT_DROP, ARP_DISABLED_N_NEXT }
 
enum  arp_disabled_error_t { ARP_DISABLED_N_ERROR }
 
enum  arp_dst_fib_type { ARP_DST_FIB_NONE, ARP_DST_FIB_ADJ, ARP_DST_FIB_CONN }
 
enum  arp_term_next_t { ARP_TERM_NEXT_L2_OUTPUT, ARP_TERM_NEXT_DROP, ARP_TERM_N_NEXT }
 

Functions

static void set_ip4_over_ethernet_rpc_callback (vnet_arp_set_ip4_over_ethernet_rpc_args_t *a)
 
static u8format_ethernet_arp_hardware_type (u8 *s, va_list *va)
 
static u8format_ethernet_arp_opcode (u8 *s, va_list *va)
 
static uword unformat_ethernet_arp_opcode_host_byte_order (unformat_input_t *input, va_list *args)
 
static uword unformat_ethernet_arp_opcode_net_byte_order (unformat_input_t *input, va_list *args)
 
static u8format_ethernet_arp_header (u8 *s, va_list *va)
 
u8format_ethernet_arp_ip4_entry (u8 *s, va_list *va)
 
static u8format_ethernet_arp_input_trace (u8 *s, va_list *va)
 
static u8format_arp_term_input_trace (u8 *s, va_list *va)
 
static void arp_nbr_probe (ip_adjacency_t *adj)
 
static void arp_mk_complete (adj_index_t ai, ethernet_arp_ip4_entry_t *e)
 
static void arp_mk_incomplete (adj_index_t ai)
 
static ethernet_arp_ip4_entry_tarp_entry_find (ethernet_arp_interface_t *eai, const ip4_address_t *addr)
 
static adj_walk_rc_t arp_mk_complete_walk (adj_index_t ai, void *ctx)
 
static adj_walk_rc_t arp_mk_incomplete_walk (adj_index_t ai, void *ctx)
 
static int arp_is_enabled (ethernet_arp_main_t *am, u32 sw_if_index)
 
static void arp_enable (ethernet_arp_main_t *am, u32 sw_if_index)
 
static int vnet_arp_flush_ip4_over_ethernet_internal (vnet_main_t *vnm, vnet_arp_set_ip4_over_ethernet_rpc_args_t *args)
 
static void arp_disable (ethernet_arp_main_t *am, u32 sw_if_index)
 
void arp_update_adjacency (vnet_main_t *vnm, u32 sw_if_index, u32 ai)
 
static void arp_adj_fib_add (ethernet_arp_ip4_entry_t *e, u32 fib_index)
 
static void arp_adj_fib_remove (ethernet_arp_ip4_entry_t *e, u32 fib_index)
 
static ethernet_arp_ip4_entry_tforce_reuse_arp_entry (void)
 
static int vnet_arp_set_ip4_over_ethernet_internal (vnet_main_t *vnm, vnet_arp_set_ip4_over_ethernet_rpc_args_t *args)
 
void vnet_register_ip4_arp_resolution_event (vnet_main_t *vnm, void *address_arg, uword node_index, uword type_opaque, uword data)
 
int vnet_add_del_ip4_arp_change_event (vnet_main_t *vnm, arp_change_event_cb_t data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
 
static int arp_unnumbered (vlib_buffer_t *p0, u32 input_sw_if_index, u32 conn_sw_if_index)
 
static u32 arp_learn (vnet_main_t *vnm, ethernet_arp_main_t *am, u32 sw_if_index, const ethernet_arp_ip4_over_ethernet_address_t *addr)
 
static uword arp_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword arp_disabled (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
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)
 
static enum arp_dst_fib_type arp_dst_fib_check (const fib_node_index_t fei, fib_entry_flag_t *flags)
 
static uword arp_reply (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword arp_proxy (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_ARC_INIT (arp_feat, static)
 
 VNET_FEATURE_INIT (arp_reply_feat_node, static)
 
 VNET_FEATURE_INIT (arp_proxy_feat_node, static)
 
 VNET_FEATURE_INIT (arp_disabled_feat_node, static)
 
 VNET_FEATURE_INIT (arp_drop_feat_node, static)
 
static int ip4_arp_entry_sort (void *a1, void *a2)
 
ethernet_arp_ip4_entry_tip4_neighbors_pool (void)
 
ethernet_arp_ip4_entry_tip4_neighbor_entries (u32 sw_if_index)
 
static clib_error_tshow_ip4_arp (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static void pg_ethernet_arp_header_init (pg_ethernet_arp_header_t *p)
 
uword unformat_pg_arp_header (unformat_input_t *input, va_list *args)
 
clib_error_tip4_set_arp_limit (u32 arp_limit)
 
int vnet_arp_unset_ip4_over_ethernet (vnet_main_t *vnm, u32 sw_if_index, const ethernet_arp_ip4_over_ethernet_address_t *a)
 Control Plane hook to remove an ARP entry. More...
 
static int vnet_arp_wc_publish (u32 sw_if_index, const ethernet_arp_ip4_over_ethernet_address_t *a)
 publish wildcard arp event More...
 
static void vnet_arp_wc_publish_internal (vnet_main_t *vnm, vnet_arp_set_ip4_over_ethernet_rpc_args_t *args)
 
void wc_arp_set_publisher_node (uword node_index, uword event_type)
 
static void arp_entry_free (ethernet_arp_interface_t *eai, ethernet_arp_ip4_entry_t *e)
 
static void arp_enable_disable_interface (ip4_main_t *im, uword opaque, u32 sw_if_index, u32 is_enable)
 
static void arp_add_del_interface_address (ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_del)
 
static void arp_table_bind (ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
static clib_error_tethernet_arp_init (vlib_main_t *vm)
 
static int vnet_arp_unset_ip4_over_ethernet_internal (vnet_main_t *vnm, vnet_arp_set_ip4_over_ethernet_rpc_args_t *args)
 
static int vnet_arp_populate_ip4_over_ethernet_internal (vnet_main_t *vnm, vnet_arp_set_ip4_over_ethernet_rpc_args_t *args)
 
static clib_error_tethernet_arp_sw_interface_up_down (vnet_main_t *vnm, u32 sw_if_index, u32 flags)
 Invoked when the interface's admin state changes. More...
 
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (ethernet_arp_sw_interface_up_down)
 
static void increment_ip4_and_mac_address (ethernet_arp_ip4_over_ethernet_address_t *a)
 
int vnet_arp_set_ip4_over_ethernet (vnet_main_t *vnm, u32 sw_if_index, const ethernet_arp_ip4_over_ethernet_address_t *a, ip_neighbor_flags_t flags)
 
void proxy_arp_walk (proxy_arp_walk_t cb, void *data)
 
int vnet_proxy_arp_enable_disable (vnet_main_t *vnm, u32 sw_if_index, u8 enable)
 
int vnet_proxy_arp_add_del (ip4_address_t *lo_addr, ip4_address_t *hi_addr, u32 fib_index, int is_del)
 
void proxy_arp_intfc_walk (proxy_arp_intf_walk_t cb, void *data)
 
int vnet_proxy_arp_fib_reset (u32 fib_id)
 
static clib_error_tip_arp_add_del_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tset_int_proxy_arp_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static uword arp_term_l2bd (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tarp_term_init (vlib_main_t *vm)
 
void change_arp_mac (u32 sw_if_index, ethernet_arp_ip4_entry_t *e)
 
void ethernet_arp_change_mac (u32 sw_if_index)
 
void send_ip4_garp (vlib_main_t *vm, u32 sw_if_index)
 
void send_ip4_garp_w_addr (vlib_main_t *vm, const ip4_address_t *ip4_addr, u32 sw_if_index)
 
static clib_error_tvnet_arp_delete_sw_interface (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (vnet_arp_delete_sw_interface)
 

Variables

static ethernet_arp_main_t ethernet_arp_main
 
static const u8 vrrp_prefix [] = { 0x00, 0x00, 0x5E, 0x00, 0x01 }
 
u32 send_garp_na_process_node_index
 
static char * arp_disabled_error_strings []
 
static char * ethernet_arp_error_strings []
 
static vlib_node_registration_t arp_input_node
 (constructor) VLIB_REGISTER_NODE (arp_input_node) More...
 
static vlib_node_registration_t arp_disabled_node
 (constructor) VLIB_REGISTER_NODE (arp_disabled_node) More...
 
static vlib_node_registration_t arp_reply_node
 (constructor) VLIB_REGISTER_NODE (arp_reply_node) More...
 
static vlib_node_registration_t arp_proxy_node
 (constructor) VLIB_REGISTER_NODE (arp_proxy_node) More...
 
static vlib_cli_command_t show_ip4_arp_command
 (constructor) VLIB_CLI_COMMAND (show_ip4_arp_command) More...
 
static vlib_cli_command_t ip_arp_add_del_command
 (constructor) VLIB_CLI_COMMAND (ip_arp_add_del_command) More...
 
static vlib_cli_command_t set_int_proxy_enable_command
 (constructor) VLIB_CLI_COMMAND (set_int_proxy_enable_command) More...
 
u32 arp_term_next_node_index [32]
 
static vlib_node_registration_t arp_term_l2bd_node
 (constructor) VLIB_REGISTER_NODE (arp_term_l2bd_node) More...
 

Detailed Description

IPv4 ARP.

This file contains code to manage the IPv4 ARP tables (IP Address to MAC Address lookup).

Definition in file arp.c.

Macro Definition Documentation

◆ ETHERNET_ARP_ARGS_FLUSH

#define ETHERNET_ARP_ARGS_FLUSH   (1<<1)

Definition at line 123 of file arp.c.

◆ ETHERNET_ARP_ARGS_POPULATE

#define ETHERNET_ARP_ARGS_POPULATE   (1<<2)

Definition at line 124 of file arp.c.

◆ ETHERNET_ARP_ARGS_REMOVE

#define ETHERNET_ARP_ARGS_REMOVE   (1<<0)

Definition at line 122 of file arp.c.

◆ ETHERNET_ARP_ARGS_WC_PUB

#define ETHERNET_ARP_ARGS_WC_PUB   (1<<3)

Definition at line 125 of file arp.c.

◆ foreach_arp_disabled_error

#define foreach_arp_disabled_error   _ (DISABLED, "ARP Disabled on this interface") \

Definition at line 1109 of file arp.c.

◆ foreach_ethernet_arp_error

#define foreach_ethernet_arp_error
Value:
_ (replies_sent, "ARP replies sent") \
_ (l2_type_not_ethernet, "L2 type not ethernet") \
_ (l3_type_not_ip4, "L3 type not IP4") \
_ (l3_src_address_not_local, "IP4 source address not local to subnet") \
_ (l3_dst_address_not_local, "IP4 destination address not local to subnet") \
_ (l3_dst_address_unset, "IP4 destination address is unset") \
_ (l3_src_address_is_local, "IP4 source address matches local interface") \
_ (l3_src_address_learned, "ARP request IP4 source address learned") \
_ (replies_received, "ARP replies received") \
_ (opcode_not_request, "ARP opcode not request") \
_ (proxy_arp_replies_sent, "Proxy ARP replies sent") \
_ (l2_address_mismatch, "ARP hw addr does not match L2 frame src addr") \
_ (gratuitous_arp, "ARP probe or announcement dropped") \
_ (interface_no_table, "Interface is not mapped to an IP table") \
_ (interface_not_ip_enabled, "Interface is not IP enabled") \
_ (unnumbered_mismatch, "RX interface is unnumbered to different subnet") \

Definition at line 966 of file arp.c.

Typedef Documentation

◆ arp_disabled_next_t

◆ arp_input_next_t

◆ ethernet_arp_interface_t

Per-interface ARP configuration and state.

Enumeration Type Documentation

◆ arp_disabled_error_t

Enumerator
ARP_DISABLED_N_ERROR 

Definition at line 1112 of file arp.c.

◆ arp_disabled_next_t_

Enumerator
ARP_DISABLED_NEXT_DROP 
ARP_DISABLED_N_NEXT 

Definition at line 1103 of file arp.c.

◆ arp_dst_fib_type

Enumerator
ARP_DST_FIB_NONE 
ARP_DST_FIB_ADJ 
ARP_DST_FIB_CONN 

Definition at line 1225 of file arp.c.

◆ arp_input_next_t_

Enumerator
ARP_INPUT_NEXT_DROP 
ARP_INPUT_NEXT_DISABLED 
ARP_INPUT_N_NEXT 

Definition at line 1026 of file arp.c.

◆ arp_reply_next_t

Enumerator
ARP_REPLY_NEXT_DROP 
ARP_REPLY_NEXT_REPLY_TX 
ARP_REPLY_N_NEXT 

Definition at line 959 of file arp.c.

◆ arp_term_next_t

Enumerator
ARP_TERM_NEXT_L2_OUTPUT 
ARP_TERM_NEXT_DROP 
ARP_TERM_N_NEXT 

Definition at line 2730 of file arp.c.

◆ ethernet_arp_reply_error_t

Enumerator
ETHERNET_ARP_N_ERROR 

Definition at line 984 of file arp.c.

Function Documentation

◆ arp_add_del_interface_address()

static void arp_add_del_interface_address ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
ip4_address_t address,
u32  address_length,
u32  if_address_index,
u32  is_del 
)
static

Definition at line 2076 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_adj_fib_add()

static void arp_adj_fib_add ( ethernet_arp_ip4_entry_t e,
u32  fib_index 
)
static

Definition at line 630 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_adj_fib_remove()

static void arp_adj_fib_remove ( ethernet_arp_ip4_entry_t e,
u32  fib_index 
)
static

Definition at line 648 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_disable()

static void arp_disable ( ethernet_arp_main_t am,
u32  sw_if_index 
)
static

Definition at line 473 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_disabled()

static uword arp_disabled ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1127 of file arp.c.

+ Here is the call graph for this function:

◆ arp_dst_fib_check()

static enum arp_dst_fib_type arp_dst_fib_check ( const fib_node_index_t  fei,
fib_entry_flag_t flags 
)
static

Definition at line 1238 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_enable()

static void arp_enable ( ethernet_arp_main_t am,
u32  sw_if_index 
)
static

Definition at line 453 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_enable_disable_interface()

static void arp_enable_disable_interface ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
u32  is_enable 
)
static

Definition at line 2059 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_entry_find()

static ethernet_arp_ip4_entry_t* arp_entry_find ( ethernet_arp_interface_t eai,
const ip4_address_t addr 
)
static

Definition at line 407 of file arp.c.

+ Here is the caller graph for this function:

◆ arp_entry_free()

static void arp_entry_free ( ethernet_arp_interface_t eai,
ethernet_arp_ip4_entry_t e 
)
static

Definition at line 2230 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_input()

static uword arp_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1034 of file arp.c.

+ Here is the call graph for this function:

◆ arp_is_enabled()

static int arp_is_enabled ( ethernet_arp_main_t am,
u32  sw_if_index 
)
static

Definition at line 444 of file arp.c.

+ Here is the caller graph for this function:

◆ arp_learn()

static u32 arp_learn ( vnet_main_t vnm,
ethernet_arp_main_t am,
u32  sw_if_index,
const ethernet_arp_ip4_over_ethernet_address_t *  addr 
)
static

Definition at line 1018 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_mk_complete()

static void arp_mk_complete ( adj_index_t  ai,
ethernet_arp_ip4_entry_t e 
)
static

Definition at line 383 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_mk_complete_walk()

static adj_walk_rc_t arp_mk_complete_walk ( adj_index_t  ai,
void *  ctx 
)
static

Definition at line 426 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_mk_incomplete()

static void arp_mk_incomplete ( adj_index_t  ai)
static

Definition at line 393 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_mk_incomplete_walk()

static adj_walk_rc_t arp_mk_incomplete_walk ( adj_index_t  ai,
void *  ctx 
)
static

Definition at line 436 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_mk_reply()

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 
)

Definition at line 1174 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_nbr_probe()

static void arp_nbr_probe ( ip_adjacency_t adj)
static

Definition at line 319 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_proxy()

static uword arp_proxy ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1549 of file arp.c.

+ Here is the call graph for this function:

◆ arp_reply()

static uword arp_reply ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1258 of file arp.c.

+ Here is the call graph for this function:

◆ arp_table_bind()

static void arp_table_bind ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
u32  new_fib_index,
u32  old_fib_index 
)
static

Definition at line 2134 of file arp.c.

+ Here is the caller graph for this function:

◆ arp_term_init()

clib_error_t* arp_term_init ( vlib_main_t vm)

Definition at line 2967 of file arp.c.

+ Here is the call graph for this function:

◆ arp_term_l2bd()

static uword arp_term_l2bd ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 2740 of file arp.c.

+ Here is the call graph for this function:

◆ arp_unnumbered()

static int arp_unnumbered ( vlib_buffer_t p0,
u32  input_sw_if_index,
u32  conn_sw_if_index 
)
static

Definition at line 993 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arp_update_adjacency()

void arp_update_adjacency ( vnet_main_t vnm,
u32  sw_if_index,
u32  ai 
)

Definition at line 519 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ change_arp_mac()

void change_arp_mac ( u32  sw_if_index,
ethernet_arp_ip4_entry_t e 
)

Definition at line 2981 of file arp.c.

+ Here is the call graph for this function:

◆ ethernet_arp_change_mac()

void ethernet_arp_change_mac ( u32  sw_if_index)

Definition at line 2991 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ethernet_arp_init()

static clib_error_t* ethernet_arp_init ( vlib_main_t vm)
static

Definition at line 2169 of file arp.c.

+ Here is the call graph for this function:

◆ ethernet_arp_sw_interface_up_down()

static clib_error_t* ethernet_arp_sw_interface_up_down ( vnet_main_t vnm,
u32  sw_if_index,
u32  flags 
)
static

Invoked when the interface's admin state changes.

Definition at line 2312 of file arp.c.

+ Here is the call graph for this function:

◆ force_reuse_arp_entry()

static ethernet_arp_ip4_entry_t* force_reuse_arp_entry ( void  )
static

Definition at line 672 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_arp_term_input_trace()

static u8* format_arp_term_input_trace ( u8 s,
va_list *  va 
)
static

Definition at line 302 of file arp.c.

+ Here is the call graph for this function:

◆ format_ethernet_arp_hardware_type()

static u8* format_ethernet_arp_hardware_type ( u8 s,
va_list *  va 
)
static

Definition at line 138 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_ethernet_arp_header()

static u8* format_ethernet_arp_header ( u8 s,
va_list *  va 
)
static

Definition at line 215 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_ethernet_arp_input_trace()

static u8* format_ethernet_arp_input_trace ( u8 s,
va_list *  va 
)
static

Definition at line 288 of file arp.c.

+ Here is the call graph for this function:

◆ format_ethernet_arp_ip4_entry()

u8* format_ethernet_arp_ip4_entry ( u8 s,
va_list *  va 
)

Definition at line 262 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_ethernet_arp_opcode()

static u8* format_ethernet_arp_opcode ( u8 s,
va_list *  va 
)
static

Definition at line 156 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ increment_ip4_and_mac_address()

static void increment_ip4_and_mac_address ( ethernet_arp_ip4_over_ethernet_address_t *  a)
static

Definition at line 2357 of file arp.c.

+ Here is the caller graph for this function:

◆ ip4_arp_entry_sort()

static int ip4_arp_entry_sort ( void *  a1,
void *  a2 
)
static

Definition at line 1764 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip4_neighbor_entries()

ethernet_arp_ip4_entry_t* ip4_neighbor_entries ( u32  sw_if_index)

Definition at line 1786 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip4_neighbors_pool()

ethernet_arp_ip4_entry_t* ip4_neighbors_pool ( void  )

Definition at line 1779 of file arp.c.

+ Here is the caller graph for this function:

◆ ip4_set_arp_limit()

clib_error_t* ip4_set_arp_limit ( u32  arp_limit)

Definition at line 1933 of file arp.c.

+ Here is the caller graph for this function:

◆ ip_arp_add_del_command_fn()

static clib_error_t* ip_arp_add_del_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 2529 of file arp.c.

+ Here is the call graph for this function:

◆ pg_ethernet_arp_header_init()

static void pg_ethernet_arp_header_init ( pg_ethernet_arp_header_t p)
inlinestatic

Definition at line 1880 of file arp.c.

+ Here is the caller graph for this function:

◆ proxy_arp_intfc_walk()

void proxy_arp_intfc_walk ( proxy_arp_intf_walk_t  cb,
void *  data 
)

Definition at line 2481 of file arp.c.

+ Here is the caller graph for this function:

◆ proxy_arp_walk()

void proxy_arp_walk ( proxy_arp_walk_t  cb,
void *  data 
)

Definition at line 2399 of file arp.c.

+ Here is the caller graph for this function:

◆ send_ip4_garp()

void send_ip4_garp ( vlib_main_t vm,
u32  sw_if_index 
)

Definition at line 3011 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_ip4_garp_w_addr()

void send_ip4_garp_w_addr ( vlib_main_t vm,
const ip4_address_t ip4_addr,
u32  sw_if_index 
)

Definition at line 3020 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_int_proxy_arp_command_fn()

static clib_error_t* set_int_proxy_arp_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 2665 of file arp.c.

+ Here is the call graph for this function:

◆ set_ip4_over_ethernet_rpc_callback()

static void set_ip4_over_ethernet_rpc_callback ( vnet_arp_set_ip4_over_ethernet_rpc_args_t a)
static

Definition at line 2290 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_ip4_arp()

static clib_error_t* show_ip4_arp ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1805 of file arp.c.

+ Here is the call graph for this function:

◆ unformat_ethernet_arp_opcode_host_byte_order()

static uword unformat_ethernet_arp_opcode_host_byte_order ( unformat_input_t input,
va_list *  args 
)
static

Definition at line 174 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unformat_ethernet_arp_opcode_net_byte_order()

static uword unformat_ethernet_arp_opcode_net_byte_order ( unformat_input_t input,
va_list *  args 
)
static

Definition at line 202 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unformat_pg_arp_header()

uword unformat_pg_arp_header ( unformat_input_t input,
va_list *  args 
)

Definition at line 1897 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_add_del_ip4_arp_change_event()

int vnet_add_del_ip4_arp_change_event ( vnet_main_t vnm,
arp_change_event_cb_t  data_callback,
u32  pid,
void *  address_arg,
uword  node_index,
uword  type_opaque,
uword  data,
int  is_add 
)

Definition at line 888 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_arp_delete_sw_interface()

static clib_error_t* vnet_arp_delete_sw_interface ( vnet_main_t vnm,
u32  sw_if_index,
u32  is_add 
)
static

Definition at line 3074 of file arp.c.

+ Here is the call graph for this function:

◆ vnet_arp_flush_ip4_over_ethernet_internal()

static int vnet_arp_flush_ip4_over_ethernet_internal ( vnet_main_t vnm,
vnet_arp_set_ip4_over_ethernet_rpc_args_t args 
)
static

Definition at line 2014 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_arp_populate_ip4_over_ethernet_internal()

static int vnet_arp_populate_ip4_over_ethernet_internal ( vnet_main_t vnm,
vnet_arp_set_ip4_over_ethernet_rpc_args_t args 
)
static

Definition at line 2268 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_arp_set_ip4_over_ethernet()

int vnet_arp_set_ip4_over_ethernet ( vnet_main_t vnm,
u32  sw_if_index,
const ethernet_arp_ip4_over_ethernet_address_t *  a,
ip_neighbor_flags_t  flags 
)

Definition at line 2380 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_arp_set_ip4_over_ethernet_internal()

static int vnet_arp_set_ip4_over_ethernet_internal ( vnet_main_t vnm,
vnet_arp_set_ip4_over_ethernet_rpc_args_t args 
)
static

Definition at line 704 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_arp_unset_ip4_over_ethernet()

int vnet_arp_unset_ip4_over_ethernet ( vnet_main_t vnm,
u32  sw_if_index,
const ethernet_arp_ip4_over_ethernet_address_t *  a 
)

Control Plane hook to remove an ARP entry.

Definition at line 1945 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_arp_unset_ip4_over_ethernet_internal()

static int vnet_arp_unset_ip4_over_ethernet_internal ( vnet_main_t vnm,
vnet_arp_set_ip4_over_ethernet_rpc_args_t args 
)
inlinestatic

Definition at line 2241 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_arp_wc_publish()

static int vnet_arp_wc_publish ( u32  sw_if_index,
const ethernet_arp_ip4_over_ethernet_address_t *  a 
)
static

publish wildcard arp event

Parameters
sw_if_indexThe interface on which the ARP entries are acted

Definition at line 1968 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_arp_wc_publish_internal()

static void vnet_arp_wc_publish_internal ( vnet_main_t vnm,
vnet_arp_set_ip4_over_ethernet_rpc_args_t args 
)
static

Definition at line 1984 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VNET_FEATURE_ARC_INIT()

VNET_FEATURE_ARC_INIT ( arp_feat  ,
static   
)

◆ VNET_FEATURE_INIT() [1/4]

VNET_FEATURE_INIT ( arp_reply_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [2/4]

VNET_FEATURE_INIT ( arp_proxy_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [3/4]

VNET_FEATURE_INIT ( arp_disabled_feat_node  ,
static   
)

◆ VNET_FEATURE_INIT() [4/4]

VNET_FEATURE_INIT ( arp_drop_feat_node  ,
static   
)

◆ vnet_proxy_arp_add_del()

int vnet_proxy_arp_add_del ( ip4_address_t lo_addr,
ip4_address_t hi_addr,
u32  fib_index,
int  is_del 
)

Definition at line 2444 of file arp.c.

+ Here is the caller graph for this function:

◆ vnet_proxy_arp_enable_disable()

int vnet_proxy_arp_enable_disable ( vnet_main_t vnm,
u32  sw_if_index,
u8  enable 
)

Definition at line 2412 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_proxy_arp_fib_reset()

int vnet_proxy_arp_fib_reset ( u32  fib_id)

Definition at line 2498 of file arp.c.

+ Here is the call graph for this function:

◆ vnet_register_ip4_arp_resolution_event()

void vnet_register_ip4_arp_resolution_event ( vnet_main_t vnm,
void *  address_arg,
uword  node_index,
uword  type_opaque,
uword  data 
)

Definition at line 857 of file arp.c.

+ Here is the caller graph for this function:

◆ VNET_SW_INTERFACE_ADD_DEL_FUNCTION()

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( vnet_arp_delete_sw_interface  )
+ Here is the caller graph for this function:

◆ VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION()

VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION ( ethernet_arp_sw_interface_up_down  )
+ Here is the caller graph for this function:

◆ wc_arp_set_publisher_node()

void wc_arp_set_publisher_node ( uword  node_index,
uword  event_type 
)

Definition at line 2003 of file arp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ arp_disabled_error_strings

char* arp_disabled_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_arp_disabled_error
Definition: arp.c:1109

Definition at line 1120 of file arp.c.

◆ arp_disabled_node

vlib_node_registration_t arp_disabled_node
static
Initial value:
=
{
.function = arp_disabled,
.name = "arp-disabled",
.vector_size = sizeof (u32),
.n_errors = ARP_DISABLED_N_ERROR,
.error_strings = arp_disabled_error_strings,
.n_next_nodes = ARP_DISABLED_N_NEXT,
.next_nodes = {
[ARP_INPUT_NEXT_DROP] = "error-drop",
},
.format_buffer = format_ethernet_arp_header,
}
static uword arp_disabled(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: arp.c:1127
static u8 * format_ethernet_arp_header(u8 *s, va_list *va)
Definition: arp.c:215
static u8 * format_ethernet_arp_input_trace(u8 *s, va_list *va)
Definition: arp.c:288
unsigned int u32
Definition: types.h:88
static char * arp_disabled_error_strings[]
Definition: arp.c:1120

(constructor) VLIB_REGISTER_NODE (arp_disabled_node)

Definition at line 1676 of file arp.c.

◆ arp_input_node

vlib_node_registration_t arp_input_node
static
Initial value:
=
{
.function = arp_input,
.name = "arp-input",
.vector_size = sizeof (u32),
.n_errors = ETHERNET_ARP_N_ERROR,
.error_strings = ethernet_arp_error_strings,
.n_next_nodes = ARP_INPUT_N_NEXT,
.next_nodes = {
[ARP_INPUT_NEXT_DROP] = "error-drop",
[ARP_INPUT_NEXT_DISABLED] = "arp-disabled",
},
.format_buffer = format_ethernet_arp_header,
}
static u8 * format_ethernet_arp_header(u8 *s, va_list *va)
Definition: arp.c:215
static uword arp_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: arp.c:1034
static u8 * format_ethernet_arp_input_trace(u8 *s, va_list *va)
Definition: arp.c:288
unsigned int u32
Definition: types.h:88
static char * ethernet_arp_error_strings[]
Definition: arp.c:1652

(constructor) VLIB_REGISTER_NODE (arp_input_node)

Definition at line 1660 of file arp.c.

◆ arp_proxy_node

vlib_node_registration_t arp_proxy_node
static
Initial value:
=
{
.function = arp_proxy,
.name = "arp-proxy",
.vector_size = sizeof (u32),
.n_errors = ETHERNET_ARP_N_ERROR,
.error_strings = ethernet_arp_error_strings,
.n_next_nodes = ARP_REPLY_N_NEXT,
.next_nodes = {
[ARP_REPLY_NEXT_DROP] = "error-drop",
[ARP_REPLY_NEXT_REPLY_TX] = "interface-output",
},
.format_buffer = format_ethernet_arp_header,
}
static u8 * format_ethernet_arp_header(u8 *s, va_list *va)
Definition: arp.c:215
static u8 * format_ethernet_arp_input_trace(u8 *s, va_list *va)
Definition: arp.c:288
unsigned int u32
Definition: types.h:88
static char * ethernet_arp_error_strings[]
Definition: arp.c:1652
static uword arp_proxy(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: arp.c:1549

(constructor) VLIB_REGISTER_NODE (arp_proxy_node)

Definition at line 1707 of file arp.c.

◆ arp_reply_node

vlib_node_registration_t arp_reply_node
static
Initial value:
=
{
.function = arp_reply,
.name = "arp-reply",
.vector_size = sizeof (u32),
.n_errors = ETHERNET_ARP_N_ERROR,
.error_strings = ethernet_arp_error_strings,
.n_next_nodes = ARP_REPLY_N_NEXT,
.next_nodes = {
[ARP_REPLY_NEXT_DROP] = "error-drop",
[ARP_REPLY_NEXT_REPLY_TX] = "interface-output",
},
.format_buffer = format_ethernet_arp_header,
}
static uword arp_reply(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: arp.c:1258
static u8 * format_ethernet_arp_header(u8 *s, va_list *va)
Definition: arp.c:215
static u8 * format_ethernet_arp_input_trace(u8 *s, va_list *va)
Definition: arp.c:288
unsigned int u32
Definition: types.h:88
static char * ethernet_arp_error_strings[]
Definition: arp.c:1652

(constructor) VLIB_REGISTER_NODE (arp_reply_node)

Definition at line 1691 of file arp.c.

◆ arp_term_l2bd_node

vlib_node_registration_t arp_term_l2bd_node
static
Initial value:
= {
.function = arp_term_l2bd,
.name = "arp-term-l2bd",
.vector_size = sizeof (u32),
.n_errors = ETHERNET_ARP_N_ERROR,
.error_strings = ethernet_arp_error_strings,
.n_next_nodes = ARP_TERM_N_NEXT,
.next_nodes = {
[ARP_TERM_NEXT_L2_OUTPUT] = "l2-output",
[ARP_TERM_NEXT_DROP] = "error-drop",
},
.format_buffer = format_ethernet_arp_header,
.format_trace = format_arp_term_input_trace,
}
static uword arp_term_l2bd(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: arp.c:2740
static u8 * format_ethernet_arp_header(u8 *s, va_list *va)
Definition: arp.c:215
unsigned int u32
Definition: types.h:88
static char * ethernet_arp_error_strings[]
Definition: arp.c:1652
static u8 * format_arp_term_input_trace(u8 *s, va_list *va)
Definition: arp.c:302

(constructor) VLIB_REGISTER_NODE (arp_term_l2bd_node)

Definition at line 2950 of file arp.c.

◆ arp_term_next_node_index

u32 arp_term_next_node_index[32]

Definition at line 2737 of file arp.c.

◆ ethernet_arp_error_strings

char* ethernet_arp_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_ethernet_arp_error
Definition: arp.c:966

Definition at line 1652 of file arp.c.

◆ ethernet_arp_main

ethernet_arp_main_t ethernet_arp_main
static

Definition at line 113 of file arp.c.

◆ ip_arp_add_del_command

vlib_cli_command_t ip_arp_add_del_command
static
Initial value:
= {
.path = "set ip arp",
.short_help =
"set ip arp [del] <intfc> <ip-address> <mac-address> [static] [no-fib-entry] [count <count>] [fib-id <fib-id>] [proxy <lo-addr> - <hi-addr>]",
}
static clib_error_t * ip_arp_add_del_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: arp.c:2529

(constructor) VLIB_CLI_COMMAND (ip_arp_add_del_command)

Definition at line 2656 of file arp.c.

◆ send_garp_na_process_node_index

u32 send_garp_na_process_node_index

Definition at line 131 of file arp.c.

◆ set_int_proxy_enable_command

vlib_cli_command_t set_int_proxy_enable_command
static
Initial value:
= {
.path = "set interface proxy-arp",
.short_help =
"set interface proxy-arp <intfc> [enable|disable]",
}
static clib_error_t * set_int_proxy_arp_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: arp.c:2665

(constructor) VLIB_CLI_COMMAND (set_int_proxy_enable_command)

Definition at line 2717 of file arp.c.

◆ show_ip4_arp_command

vlib_cli_command_t show_ip4_arp_command
static
Initial value:
= {
.path = "show ip arp",
.function = show_ip4_arp,
.short_help = "show ip arp",
}
static clib_error_t * show_ip4_arp(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: arp.c:1805

(constructor) VLIB_CLI_COMMAND (show_ip4_arp_command)

Definition at line 1860 of file arp.c.

◆ vrrp_prefix

const u8 vrrp_prefix[] = { 0x00, 0x00, 0x5E, 0x00, 0x01 }
static

Definition at line 128 of file arp.c.