64 sw_if_index, 0, NULL, 0);
81 sw_if_index, 1, NULL, 0);
91 u32 fib_index,
int is_del)
95 u32 found_at_index = ~0;
107 if (found_at_index != ~0)
116 return VNET_API_ERROR_NO_SUCH_ENTRY;
177 if (~0 == sw_if_index)
201 if (
unformat (input,
"table-id %d", &table_id))
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>",
286 u32 n_left_from, next_index, *from, *to_next;
287 u32 n_arp_replies_sent = 0;
298 while (n_left_from > 0)
304 while (n_left_from > 0 && n_left_to_next > 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);
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",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define foreach_ethernet_arp_error
arp_proxy_main_t arp_proxy_main
vnet_main_t * vnet_get_main(void)
int arp_proxy_add(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)
bool * enabled_by_sw_if_index
Per interface state.
static u8 * format_ethernet_arp_input_trace(u8 *s, va_list *va)
static clib_error_t * set_arp_proxy(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * show_ip4_arp(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
ethernet_proxy_arp_t * proxy_arps
void proxy_arp_intfc_walk(proxy_arp_intf_walk_t cb, void *data)
unformat_function_t unformat_vnet_sw_interface
static vlib_node_registration_t arp_proxy_node
(constructor) VLIB_REGISTER_NODE (arp_proxy_node)
vlib_error_t * errors
Vector of errors for this node.
static char * ethernet_arp_error_strings[]
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
description fragment has unexpected format
#define clib_error_return(e, args...)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
void proxy_arp_walk(proxy_arp_walk_t cb, void *data)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static ethernet_header_t * ethernet_buffer_get_header(vlib_buffer_t *b)
static clib_error_t * set_int_proxy_arp_command_fn(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.
int arp_proxy_enable(u32 sw_if_index)
u32 node_index
Node index.
#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_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)
#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_REGISTER_NODE(x,...)
int arp_proxy_disable(u32 sw_if_index)
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
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
#define VLIB_CLI_COMMAND(x,...)
int arp_proxy_del(u32 fib_index, const ip4_address_t *lo, const ip4_address_t *hi)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define vec_delete(V, N, M)
Delete N elements starting at element M.
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
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)
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)
struct arp_proxy_main_t_ arp_proxy_main_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static uword arp_proxy(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u8 * format_ethernet_arp_header(u8 *s, va_list *va)
#define vec_foreach(var, vec)
Vector iterator.
f64 end
end of the time range
u16 flags
Copy of main node flags.
#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
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)