FD.io VPP  v17.01-9-ge7dcee4
Vector Packet Processing
ip4_forward.c File Reference

IPv4 Forwarding. More...

+ Include dependency graph for ip4_forward.c:

Go to the source code of this file.

Data Structures

struct  ip4_forward_next_trace_t
 

Macros

#define foreach_notrace_ip4_arp_error
 

Enumerations

enum  ip4_rewrite_next_t { IP4_REWRITE_NEXT_DROP, IP4_REWRITE_NEXT_ICMP_ERROR }
 

Functions

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)
 
static uword ip4_lookup_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int lookup_for_responses_to_locally_received_packets)
 
static uword ip4_lookup (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 IPv4 lookup node. More...
 
static u8format_ip4_lookup_trace (u8 *s, va_list *args)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_lookup_node, ip4_lookup)
 
static uword ip4_load_balance (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_load_balance_node, ip4_load_balance)
 
ip4_address_tip4_interface_first_address (ip4_main_t *im, u32 sw_if_index, ip_interface_address_t **result_ia)
 
static void ip4_add_interface_routes (u32 sw_if_index, ip4_main_t *im, u32 fib_index, ip_interface_address_t *a)
 
static void ip4_del_interface_routes (ip4_main_t *im, u32 fib_index, ip4_address_t *address, u32 address_length)
 
void ip4_sw_interface_enable_disable (u32 sw_if_index, u32 is_enable)
 
static clib_error_tip4_add_del_interface_address_internal (vlib_main_t *vm, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 is_del)
 
clib_error_tip4_add_del_interface_address (vlib_main_t *vm, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 is_del)
 
 VNET_FEATURE_ARC_INIT (ip4_unicast, static)
 
 VNET_FEATURE_INIT (ip4_flow_classify, static)
 
 VNET_FEATURE_INIT (ip4_inacl, static)
 
 VNET_FEATURE_INIT (ip4_source_check_1, static)
 
 VNET_FEATURE_INIT (ip4_source_check_2, static)
 
 VNET_FEATURE_INIT (ip4_source_and_port_range_check_rx, static)
 
 VNET_FEATURE_INIT (ip4_policer_classify, static)
 
 VNET_FEATURE_INIT (ip4_ipsec, static)
 
 VNET_FEATURE_INIT (ip4_vpath, static)
 
 VNET_FEATURE_INIT (ip4_vxlan_bypass, static)
 
 VNET_FEATURE_INIT (ip4_lookup, static)
 
 VNET_FEATURE_INIT (ip4_drop, static)
 
 VNET_FEATURE_ARC_INIT (ip4_multicast, static)
 
 VNET_FEATURE_INIT (ip4_vpath_mc, static)
 
 VNET_FEATURE_INIT (ip4_lookup_mc, static)
 
 VNET_FEATURE_INIT (ip4_mc_drop, static)
 
 VNET_FEATURE_ARC_INIT (ip4_output, static)
 
 VNET_FEATURE_INIT (ip4_source_and_port_range_check_tx, static)
 
 VNET_FEATURE_INIT (ip4_ipsec_output, static)
 
 VNET_FEATURE_INIT (ip4_interface_output, static)
 
static clib_error_tip4_sw_interface_add_del (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (ip4_sw_interface_add_del)
 
clib_error_tip4_lookup_init (vlib_main_t *vm)
 
u8format_ip4_forward_next_trace (u8 *s, va_list *args)
 
static u8format_ip4_rewrite_trace (u8 *s, va_list *args)
 
static uword ip4_drop_or_punt (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, ip4_error_t error_code)
 
static uword ip4_drop (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword ip4_punt (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_drop_node, ip4_drop)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_punt_node, ip4_punt)
 
u16 ip4_tcp_udp_compute_checksum (vlib_main_t *vm, vlib_buffer_t *p0, ip4_header_t *ip0)
 
u32 ip4_tcp_udp_validate_checksum (vlib_main_t *vm, vlib_buffer_t *p0)
 
static uword ip4_local (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_local_node, ip4_local)
 
void ip4_register_protocol (u32 protocol, u32 node_index)
 
static clib_error_tshow_ip_local_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static uword ip4_arp_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_glean)
 
static uword ip4_arp (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword ip4_glean (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_tarp_notrace_init (vlib_main_t *vm)
 
clib_error_tip4_probe_neighbor (vlib_main_t *vm, ip4_address_t *dst, u32 sw_if_index)
 
static uword ip4_rewrite_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_midchain)
 
static uword ip4_rewrite (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 IPv4 rewrite node. More...
 
static uword ip4_midchain (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_rewrite_node, ip4_rewrite)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_midchain_node, ip4_midchain)
 
static clib_error_tadd_del_interface_table (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static uword ip4_lookup_multicast (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_lookup_multicast_node, ip4_lookup_multicast)
 
int ip4_lookup_validate (ip4_address_t *a, u32 fib_index0)
 
static clib_error_ttest_lookup_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
int vnet_set_ip4_flow_hash (u32 table_id, u32 flow_hash_config)
 
static clib_error_tset_ip_flow_hash_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
int vnet_set_ip4_classify_intfc (vlib_main_t *vm, u32 sw_if_index, u32 table_index)
 
static clib_error_tset_ip_classify_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

vlib_node_registration_t ip4_lookup_node
 (constructor) VLIB_REGISTER_NODE (ip4_lookup_node) More...
 
vlib_node_registration_t ip4_load_balance_node
 (constructor) VLIB_REGISTER_NODE (ip4_load_balance_node) More...
 
ip4_main_t ip4_main
 Global ip4 main structure. More...
 
static vlib_node_registration_t ip4_drop_node
 (constructor) VLIB_REGISTER_NODE (ip4_drop_node) More...
 
static vlib_node_registration_t ip4_punt_node
 (constructor) VLIB_REGISTER_NODE (ip4_punt_node) More...
 
static vlib_node_registration_t ip4_local_node
 (constructor) VLIB_REGISTER_NODE (ip4_local_node) More...
 
static vlib_cli_command_t show_ip_local
 (constructor) VLIB_CLI_COMMAND (show_ip_local) More...
 
static char * ip4_arp_error_strings []
 
vlib_node_registration_t ip4_arp_node
 (constructor) VLIB_REGISTER_NODE (ip4_arp_node) More...
 
vlib_node_registration_t ip4_glean_node
 (constructor) VLIB_REGISTER_NODE (ip4_glean_node) More...
 
vlib_node_registration_t ip4_rewrite_node
 (constructor) VLIB_REGISTER_NODE (ip4_rewrite_node) More...
 
vlib_node_registration_t ip4_midchain_node
 (constructor) VLIB_REGISTER_NODE (ip4_midchain_node) More...
 
static vlib_cli_command_t set_interface_ip_table_command
 (constructor) VLIB_CLI_COMMAND (set_interface_ip_table_command) More...
 
static vlib_node_registration_t ip4_lookup_multicast_node
 (constructor) VLIB_REGISTER_NODE (ip4_lookup_multicast_node) More...
 
static vlib_node_registration_t ip4_multicast_node
 (constructor) VLIB_REGISTER_NODE (ip4_multicast_node) More...
 
static vlib_cli_command_t lookup_test_command
 (constructor) VLIB_CLI_COMMAND (lookup_test_command) More...
 
static vlib_cli_command_t set_ip_flow_hash_command
 (constructor) VLIB_CLI_COMMAND (set_ip_flow_hash_command) More...
 
static vlib_cli_command_t set_ip_classify_command
 (constructor) VLIB_CLI_COMMAND (set_ip_classify_command) More...
 

Detailed Description

IPv4 Forwarding.

This file contains the source code for IPv4 forwarding.

Definition in file ip4_forward.c.

Macro Definition Documentation

#define foreach_notrace_ip4_arp_error
Value:
_(DROP) \
_(REQUEST_SENT) \
_(REPLICATE_DROP) \
_(REPLICATE_FAIL)
DROP
Definition: error.def:41

Definition at line 2144 of file ip4_forward.c.

Enumeration Type Documentation

Enumerator
IP4_REWRITE_NEXT_DROP 
IP4_REWRITE_NEXT_ICMP_ERROR 

Definition at line 2237 of file ip4_forward.c.

Function Documentation

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

Definition at line 2651 of file ip4_forward.c.

+ Here is the call graph for this function:

clib_error_t* arp_notrace_init ( vlib_main_t vm)

Definition at line 2151 of file ip4_forward.c.

+ Here is the call graph for this function:

u8* format_ip4_forward_next_trace ( u8 s,
va_list *  args 
)

Definition at line 1177 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 * format_ip4_lookup_trace ( u8 s,
va_list *  args 
)
static

Definition at line 1190 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ip4_rewrite_trace ( u8 s,
va_list *  args 
)
static

Definition at line 1206 of file ip4_forward.c.

+ Here is the call graph for this function:

clib_error_t* ip4_add_del_interface_address ( vlib_main_t vm,
u32  sw_if_index,
ip4_address_t address,
u32  address_length,
u32  is_del 
)

Definition at line 921 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ip4_add_del_interface_address_internal ( vlib_main_t vm,
u32  sw_if_index,
ip4_address_t address,
u32  address_length,
u32  is_del 
)
static

Definition at line 836 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_add_interface_routes ( u32  sw_if_index,
ip4_main_t im,
u32  fib_index,
ip_interface_address_t a 
)
static

Definition at line 733 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2104 of file ip4_forward.c.

+ Here is the call graph for this function:

static uword ip4_arp_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_glean 
)
inlinestatic

Definition at line 1908 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_del_interface_routes ( ip4_main_t im,
u32  fib_index,
ip4_address_t address,
u32  address_length 
)
static

Definition at line 787 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1333 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ip4_drop_or_punt ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
ip4_error_t  error_code 
)
static

Definition at line 1313 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 
)

Definition at line 1226 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2110 of file ip4_forward.c.

+ Here is the call graph for this function:

ip4_address_t* ip4_interface_first_address ( ip4_main_t im,
u32  sw_if_index,
ip_interface_address_t **  result_ia 
)

Definition at line 710 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ip4_load_balance ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
inlinestatic

Definition at line 520 of file ip4_forward.c.

+ Here is the call graph for this function:

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

Definition at line 1449 of file ip4_forward.c.

+ Here is the call graph for this function:

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

IPv4 lookup node.

Node Identifier:
ip4-lookup

This is the main IPv4 lookup dispatch node.

Parameters
vmvlib_main_t corresponding to the current thread
nodevlib_node_runtime_t
framevlib_frame_t whose contents should be dispatched
Graph mechanics: buffer metadata, next index usage

Uses:

  • vnet_buffer(b)->sw_if_index[VLIB_RX]
    • Indicates the sw_if_index value of the interface that the packet was received on.
  • vnet_buffer(b)->sw_if_index[VLIB_TX]
    • When the value is ~0 then the node performs a longest prefix match (LPM) for the packet destination address in the FIB attached to the receive interface.
    • Otherwise perform LPM for the packet destination address in the indicated FIB. In this case [VLIB_TX] is a FIB index value (0, 1, ...) and not a VRF id.

Sets:

  • vnet_buffer(b)->ip.adj_index[VLIB_TX]
    • The lookup result adjacency index.

Next Index:

  • Dispatches the packet to the node index found in ip_adjacency_t adj->lookup_next_index (where adj is the lookup result adjacency).

Definition at line 500 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* ip4_lookup_init ( vlib_main_t vm)

Definition at line 1102 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ip4_lookup_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  lookup_for_responses_to_locally_received_packets 
)
inlinestatic

Definition at line 68 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2727 of file ip4_forward.c.

+ Here is the call graph for this function:

int ip4_lookup_validate ( ip4_address_t a,
u32  fib_index0 
)

Definition at line 2963 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2623 of file ip4_forward.c.

+ Here is the call graph for this function:

clib_error_t* ip4_probe_neighbor ( vlib_main_t vm,
ip4_address_t dst,
u32  sw_if_index 
)

Definition at line 2170 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1339 of file ip4_forward.c.

+ Here is the call graph for this function:

void ip4_register_protocol ( u32  protocol,
u32  node_index 
)

Definition at line 1856 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

IPv4 rewrite node.

Node Identifier:
ip4-rewrite

This is the IPv4 transit-rewrite node: decrement TTL, fix the ipv4 header checksum, fetch the ip adjacency, check the outbound mtu, apply the adjacency rewrite, and send pkts to the adjacency rewrite header's rewrite_next_index.

Parameters
vmvlib_main_t corresponding to the current thread
nodevlib_node_runtime_t
framevlib_frame_t whose contents should be dispatched
Graph mechanics: buffer metadata, next index usage

Uses:

  • vnet_buffer(b)->ip.adj_index[VLIB_TX]
    • the rewrite adjacency index
  • adj->lookup_next_index
    • Must be IP_LOOKUP_NEXT_REWRITE or IP_LOOKUP_NEXT_ARP, otherwise the packet will be dropped.
  • adj->rewrite_header
    • Rewrite string length, rewrite string, next_index

Sets:

  • b->current_data, b->current_length
    • Updated net of applying the rewrite string

Next Indices:

  • adj->rewrite_header.next_index or error-drop

Definition at line 2616 of file ip4_forward.c.

+ Here is the call graph for this function:

static uword ip4_rewrite_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_midchain 
)
inlinestatic

Definition at line 2244 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1080 of file ip4_forward.c.

+ Here is the call graph for this function:

void ip4_sw_interface_enable_disable ( u32  sw_if_index,
u32  is_enable 
)

Definition at line 807 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u16 ip4_tcp_udp_compute_checksum ( vlib_main_t vm,
vlib_buffer_t p0,
ip4_header_t ip0 
)

Definition at line 1368 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 ip4_tcp_udp_validate_checksum ( vlib_main_t vm,
vlib_buffer_t p0 
)

Definition at line 1423 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 3277 of file ip4_forward.c.

+ Here is the call graph for this function:

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

Definition at line 3081 of file ip4_forward.c.

+ Here is the call graph for this function:

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

Definition at line 1868 of file ip4_forward.c.

+ Here is the call graph for this function:

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

Definition at line 2986 of file ip4_forward.c.

+ Here is the call graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( ip4_lookup_node  ,
ip4_lookup   
)
VLIB_NODE_FUNCTION_MULTIARCH ( ip4_load_balance_node  ,
ip4_load_balance   
)
VLIB_NODE_FUNCTION_MULTIARCH ( ip4_drop_node  ,
ip4_drop   
)
VLIB_NODE_FUNCTION_MULTIARCH ( ip4_punt_node  ,
ip4_punt   
)
VLIB_NODE_FUNCTION_MULTIARCH ( ip4_local_node  ,
ip4_local   
)
VLIB_NODE_FUNCTION_MULTIARCH ( ip4_rewrite_node  ,
ip4_rewrite   
)
VLIB_NODE_FUNCTION_MULTIARCH ( ip4_midchain_node  ,
ip4_midchain   
)
VLIB_NODE_FUNCTION_MULTIARCH ( ip4_lookup_multicast_node  ,
ip4_lookup_multicast   
)
VNET_FEATURE_ARC_INIT ( ip4_unicast  ,
static   
)

+ Here is the caller graph for this function:

VNET_FEATURE_ARC_INIT ( ip4_multicast  ,
static   
)
VNET_FEATURE_ARC_INIT ( ip4_output  ,
static   
)
VNET_FEATURE_INIT ( ip4_flow_classify  ,
static   
)

+ Here is the caller graph for this function:

VNET_FEATURE_INIT ( ip4_inacl  ,
static   
)
VNET_FEATURE_INIT ( ip4_source_check_1  ,
static   
)
VNET_FEATURE_INIT ( ip4_source_check_2  ,
static   
)
VNET_FEATURE_INIT ( ip4_source_and_port_range_check_rx  ,
static   
)
VNET_FEATURE_INIT ( ip4_policer_classify  ,
static   
)
VNET_FEATURE_INIT ( ip4_ipsec  ,
static   
)
VNET_FEATURE_INIT ( ip4_vpath  ,
static   
)
VNET_FEATURE_INIT ( ip4_vxlan_bypass  ,
static   
)
VNET_FEATURE_INIT ( ip4_lookup  ,
static   
)
VNET_FEATURE_INIT ( ip4_drop  ,
static   
)
VNET_FEATURE_INIT ( ip4_vpath_mc  ,
static   
)
VNET_FEATURE_INIT ( ip4_lookup_mc  ,
static   
)
VNET_FEATURE_INIT ( ip4_mc_drop  ,
static   
)
VNET_FEATURE_INIT ( ip4_source_and_port_range_check_tx  ,
static   
)
VNET_FEATURE_INIT ( ip4_ipsec_output  ,
static   
)
VNET_FEATURE_INIT ( ip4_interface_output  ,
static   
)
int vnet_set_ip4_classify_intfc ( vlib_main_t vm,
u32  sw_if_index,
u32  table_index 
)

Definition at line 3217 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vnet_set_ip4_flow_hash ( u32  table_id,
u32  flow_hash_config 
)

Definition at line 3065 of file ip4_forward.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( ip4_sw_interface_add_del  )

+ Here is the caller graph for this function:

Variable Documentation

char* ip4_arp_error_strings[]
static
Initial value:
= {
[IP4_ARP_ERROR_DROP] = "address overflow drops",
[IP4_ARP_ERROR_REQUEST_SENT] = "ARP requests sent",
[IP4_ARP_ERROR_NON_ARP_ADJ] = "ARPs to non-ARP adjacencies",
[IP4_ARP_ERROR_REPLICATE_DROP] = "ARP replication completed",
[IP4_ARP_ERROR_REPLICATE_FAIL] = "ARP replication failed",
[IP4_ARP_ERROR_NO_SOURCE_ADDRESS] = "no source address for ARP request",
}

Definition at line 2115 of file ip4_forward.c.

Initial value:
=
{
.function = ip4_arp,.name = "ip4-arp",.vector_size =
sizeof (u32),.format_trace = format_ip4_forward_next_trace,.n_errors =
ARRAY_LEN (ip4_arp_error_strings),.error_strings =
ip4_arp_error_strings,.n_next_nodes = IP4_ARP_N_NEXT,.next_nodes =
{
[IP4_ARP_NEXT_DROP] = "error-drop",}
,}
static uword ip4_arp(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:2104
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1177
static char * ip4_arp_error_strings[]
Definition: ip4_forward.c:2115

(constructor) VLIB_REGISTER_NODE (ip4_arp_node)

Definition at line 2124 of file ip4_forward.c.

vlib_node_registration_t ip4_drop_node
static
Initial value:
=
{
.function = ip4_drop,.name = "ip4-drop",.vector_size =
sizeof (u32),.format_trace = format_ip4_forward_next_trace,.n_next_nodes =
1,.next_nodes =
{
[0] = "error-drop",}
,}
static uword ip4_drop(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:1333
unsigned int u32
Definition: types.h:88
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1177

(constructor) VLIB_REGISTER_NODE (ip4_drop_node)

Definition at line 1344 of file ip4_forward.c.

vlib_node_registration_t ip4_glean_node
Initial value:
=
{
.function = ip4_glean,.name = "ip4-glean",.vector_size =
sizeof (u32),.format_trace = format_ip4_forward_next_trace,.n_errors =
ARRAY_LEN (ip4_arp_error_strings),.error_strings =
ip4_arp_error_strings,.n_next_nodes = IP4_ARP_N_NEXT,.next_nodes =
{
[IP4_ARP_NEXT_DROP] = "error-drop",}
,}
static uword ip4_glean(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:2110
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1177
static char * ip4_arp_error_strings[]
Definition: ip4_forward.c:2115

(constructor) VLIB_REGISTER_NODE (ip4_glean_node)

Definition at line 2134 of file ip4_forward.c.

vlib_node_registration_t ip4_load_balance_node
Initial value:
=
{
.function = ip4_load_balance,.name = "ip4-load-balance",.vector_size =
sizeof (u32),.sibling_of = "ip4-lookup",.format_trace =
static uword ip4_load_balance(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:520
static u8 * format_ip4_lookup_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1190
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (ip4_load_balance_node)

Definition at line 700 of file ip4_forward.c.

vlib_node_registration_t ip4_local_node
static
Initial value:
=
{
.function = ip4_local,.name = "ip4-local",.vector_size =
sizeof (u32),.format_trace = format_ip4_forward_next_trace,.n_next_nodes =
IP_LOCAL_N_NEXT,.next_nodes =
{
[IP_LOCAL_NEXT_DROP] = "error-drop",
[IP_LOCAL_NEXT_PUNT] = "error-punt",
[IP_LOCAL_NEXT_UDP_LOOKUP] = "ip4-udp-lookup",
[IP_LOCAL_NEXT_ICMP] = "ip4-icmp-input",}
,}
unsigned int u32
Definition: types.h:88
static uword ip4_local(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:1449
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1177

(constructor) VLIB_REGISTER_NODE (ip4_local_node)

Definition at line 1841 of file ip4_forward.c.

vlib_node_registration_t ip4_lookup_multicast_node
static
Initial value:
=
{
.function = ip4_lookup_multicast,.name =
"ip4-lookup-multicast",.vector_size = sizeof (u32),.sibling_of =
"ip4-lookup",.format_trace = format_ip4_lookup_trace,.n_next_nodes = 0,}
static u8 * format_ip4_lookup_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1190
unsigned int u32
Definition: types.h:88
static uword ip4_lookup_multicast(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:2727

(constructor) VLIB_REGISTER_NODE (ip4_lookup_multicast_node)

Definition at line 2944 of file ip4_forward.c.

vlib_node_registration_t ip4_lookup_node
Initial value:
=
{
.function = ip4_lookup,.name = "ip4-lookup",.vector_size =
sizeof (u32),.format_trace = format_ip4_lookup_trace,.n_next_nodes =
#define IP4_LOOKUP_NEXT_NODES
Definition: lookup.h:111
static u8 * format_ip4_lookup_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1190
unsigned int u32
Definition: types.h:88
static uword ip4_lookup(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
IPv4 lookup node.
Definition: ip4_forward.c:500

(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)

Definition at line 511 of file ip4_forward.c.

ip4_main_t ip4_main

Global ip4 main structure.

Definition at line 1099 of file ip4_forward.c.

vlib_node_registration_t ip4_midchain_node
Initial value:
=
{
.function = ip4_midchain,.name = "ip4-midchain",.vector_size =
sizeof (u32),.format_trace = format_ip4_forward_next_trace,.sibling_of =
"ip4-rewrite",}
static uword ip4_midchain(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:2623
unsigned int u32
Definition: types.h:88
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1177

(constructor) VLIB_REGISTER_NODE (ip4_midchain_node)

Definition at line 2642 of file ip4_forward.c.

vlib_node_registration_t ip4_multicast_node
static
Initial value:
=
{
.function = ip4_drop,.name = "ip4-multicast",.vector_size =
sizeof (u32),.format_trace = format_ip4_forward_next_trace,.n_next_nodes =
1,.next_nodes =
{
[0] = "error-drop",}
,}
static uword ip4_drop(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:1333
unsigned int u32
Definition: types.h:88
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1177

(constructor) VLIB_REGISTER_NODE (ip4_multicast_node)

Definition at line 2953 of file ip4_forward.c.

vlib_node_registration_t ip4_punt_node
static
Initial value:
=
{
.function = ip4_punt,.name = "ip4-punt",.vector_size =
sizeof (u32),.format_trace = format_ip4_forward_next_trace,.n_next_nodes =
1,.next_nodes =
{
[0] = "error-punt",}
,}
static uword ip4_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ip4_forward.c:1339
unsigned int u32
Definition: types.h:88
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1177

(constructor) VLIB_REGISTER_NODE (ip4_punt_node)

Definition at line 1355 of file ip4_forward.c.

vlib_node_registration_t ip4_rewrite_node
Initial value:
=
{
.function = ip4_rewrite,.name = "ip4-rewrite",.vector_size =
sizeof (u32),.format_trace = format_ip4_rewrite_trace,.n_next_nodes =
2,.next_nodes =
{
[IP4_REWRITE_NEXT_DROP] = "error-drop",
[IP4_REWRITE_NEXT_ICMP_ERROR] = "ip4-icmp-error",}
,}
static u8 * format_ip4_rewrite_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1206
unsigned int u32
Definition: types.h:88
static uword ip4_rewrite(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
IPv4 rewrite node.
Definition: ip4_forward.c:2616

(constructor) VLIB_REGISTER_NODE (ip4_rewrite_node)

Definition at line 2630 of file ip4_forward.c.

vlib_cli_command_t lookup_test_command
static
Initial value:
=
{
.path = "test lookup",
.short_help = "test lookup <ipv4-addr> [table <fib-id>] [count <nn>]",
}
static clib_error_t * test_lookup_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip4_forward.c:2986

(constructor) VLIB_CLI_COMMAND (lookup_test_command)

Definition at line 3056 of file ip4_forward.c.

vlib_cli_command_t set_interface_ip_table_command
static
Initial value:
=
{
.path = "set interface ip table",
.short_help = "set interface ip table <interface> <table-id>",
}
static clib_error_t * add_del_interface_table(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip4_forward.c:2651

(constructor) VLIB_CLI_COMMAND (set_interface_ip_table_command)

Definition at line 2717 of file ip4_forward.c.

vlib_cli_command_t set_ip_classify_command
static
Initial value:
=
{
.path = "set ip classify",
.short_help =
"set ip classify intfc <interface> table-index <classify-idx>",
}
static clib_error_t * set_ip_classify_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip4_forward.c:3277

(constructor) VLIB_CLI_COMMAND (set_ip_classify_command)

Definition at line 3330 of file ip4_forward.c.

vlib_cli_command_t set_ip_flow_hash_command
static
Initial value:
=
{
.path = "set ip flow-hash",
.short_help =
"set ip flow-hash table <table-id> [src] [dst] [sport] [dport] [proto] [reverse]",
}
static clib_error_t * set_ip_flow_hash_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip4_forward.c:3081

(constructor) VLIB_CLI_COMMAND (set_ip_flow_hash_command)

Definition at line 3207 of file ip4_forward.c.

vlib_cli_command_t show_ip_local
static
Initial value:
=
{
.path = "show ip local",
.short_help = "show ip local",
}
static clib_error_t * show_ip_local_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip4_forward.c:1868

(constructor) VLIB_CLI_COMMAND (show_ip_local)

Definition at line 1899 of file ip4_forward.c.