|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
91 u32 fib_index,
int is_del)
95 u32 found_at_index = ~0;
102 found_at_index = pa -
am->proxy_arps;
107 if (found_at_index != ~0)
116 return VNET_API_ERROR_NO_SUCH_ENTRY;
149 cb (enabled -
am->enabled_by_sw_if_index,
data);
247 .path =
"set interface proxy-arp",
249 "set interface proxy-arp <intfc> [enable|disable]",
256 .path =
"set arp proxy",
257 .short_help =
"set arp proxy [del] table-ID <table-ID> start <start-address> end <end-addres>",
287 u32 n_arp_replies_sent = 0;
310 u32 pi0, error0, next0, sw_if_index0, fib_index0;
326 is_request0 = arp0->
opcode
327 == clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_request);
329 error0 = ETHERNET_ARP_ERROR_replies_sent;
334 if (~0 == fib_index0)
336 error0 = ETHERNET_ARP_ERROR_interface_no_table;
339 if (0 == error0 && is_request0)
341 u32 this_addr = clib_net_to_host_u32
350 if ((this_addr >= lo_addr && this_addr <= hi_addr) &&
359 n_arp_replies_sent++;
373 n_left_to_next, pi0, next0);
380 ETHERNET_ARP_ERROR_replies_sent, n_arp_replies_sent);
382 return frame->n_vectors;
386 #define _(sym,string) string,
393 .function =
arp_proxy,.name =
"arp-proxy",.vector_size =
440 .path =
"show arp proxy",
442 .short_help =
"show ip arp",
struct arp_proxy_main_t_ arp_proxy_main_t
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static vlib_node_registration_t arp_proxy_node
(constructor) VLIB_REGISTER_NODE (arp_proxy_node)
static vlib_cli_command_t set_int_proxy_enable_command
(constructor) VLIB_CLI_COMMAND (set_int_proxy_enable_command)
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
walk_rc_t() proxy_arp_intf_walk_t(u32 sw_if_index, void *data)
call back function when walking the DB of proxy ARP interface
static uword arp_proxy(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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
#define clib_error_return(e, args...)
static int vnet_proxy_arp_add_del(const ip4_address_t *lo_addr, const ip4_address_t *hi_addr, u32 fib_index, int is_del)
static clib_error_t * set_arp_proxy(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
int arp_proxy_add(u32 fib_index, const ip4_address_t *lo, const ip4_address_t *hi)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define vec_delete(V, N, M)
Delete N elements starting at element M.
static char * ethernet_arp_error_strings[]
int arp_proxy_del(u32 fib_index, const ip4_address_t *lo, const ip4_address_t *hi)
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
#define foreach_ethernet_arp_error
void proxy_arp_intfc_walk(proxy_arp_intf_walk_t cb, void *data)
#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_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
vnet_main_t * vnet_get_main(void)
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
f64 end
end of the time range
static vlib_cli_command_t set_arp_proxy_command
(constructor) VLIB_CLI_COMMAND (set_arp_proxy_command)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
ethernet_proxy_arp_t * proxy_arps
void proxy_arp_walk(proxy_arp_walk_t cb, void *data)
walk_rc_t() proxy_arp_walk_t(const ip4_address_t *lo_addr, const ip4_address_t *hi_addr, u32 fib_index, void *dat)
call back function when walking the DB of proxy ARPs
struct _vlib_node_registration vlib_node_registration_t
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
int arp_proxy_disable(u32 sw_if_index)
@ ARP_REPLY_NEXT_REPLY_TX
static vlib_cli_command_t show_ip4_arp_command
(constructor) VLIB_CLI_COMMAND (show_ip4_arp_command)
#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.
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
bool * enabled_by_sw_if_index
Per interface state.
int arp_proxy_enable(u32 sw_if_index)
#define vec_foreach(var, vec)
Vector iterator.
static clib_error_t * set_int_proxy_arp_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
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 clib_error_t * show_ip4_arp(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static ethernet_header_t * ethernet_buffer_get_header(vlib_buffer_t *b)
arp_proxy_main_t arp_proxy_main
static u8 * format_ethernet_arp_input_trace(u8 *s, va_list *va)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
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)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)