![]() |
FD.io VPP
v16.12-rc0-308-g931be3a
Vector Packet Processing
|
IPv4 Forwarding. More...
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_ARP, IP4_REWRITE_NEXT_ICMP_ERROR } |
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... | |
static char * | rx_feature_start_nodes [] |
static char * | tx_feature_start_nodes [] |
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... | |
vlib_node_registration_t | ip4_rewrite_local_node |
(constructor) VLIB_REGISTER_NODE (ip4_rewrite_local_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... | |
IPv4 Forwarding.
This file contains the source code for IPv4 forwarding.
Definition in file ip4_forward.c.
#define foreach_notrace_ip4_arp_error |
Definition at line 2081 of file ip4_forward.c.
enum ip4_rewrite_next_t |
Enumerator | |
---|---|
IP4_REWRITE_NEXT_DROP | |
IP4_REWRITE_NEXT_ARP | |
IP4_REWRITE_NEXT_ICMP_ERROR |
Definition at line 2169 of file ip4_forward.c.
|
static |
clib_error_t* arp_notrace_init | ( | vlib_main_t * | vm | ) |
Definition at line 1134 of file ip4_forward.c.
Definition at line 1146 of file ip4_forward.c.
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 847 of file ip4_forward.c.
|
static |
Definition at line 765 of file ip4_forward.c.
|
static |
Definition at line 611 of file ip4_forward.c.
|
static |
|
inlinestatic |
Definition at line 1841 of file ip4_forward.c.
|
static |
Definition at line 684 of file ip4_forward.c.
|
static |
Definition at line 1293 of file ip4_forward.c.
|
static |
Definition at line 1270 of file ip4_forward.c.
|
static |
Definition at line 967 of file ip4_forward.c.
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 1183 of file ip4_forward.c.
|
static |
ip4_address_t* ip4_interface_first_address | ( | ip4_main_t * | im, |
u32 | sw_if_index, | ||
ip_interface_address_t ** | result_ia | ||
) |
Definition at line 591 of file ip4_forward.c.
|
inlinestatic |
|
static |
|
static |
IPv4 lookup node.
ip4-lookup
This is the main IPv4 lookup dispatch node.
vm | vlib_main_t corresponding to the current thread |
node | vlib_node_runtime_t |
frame | vlib_frame_t whose contents should be dispatched |
Uses:
vnet_buffer(b)->sw_if_index[VLIB_RX]
sw_if_index
value of the interface that the packet was received on.vnet_buffer(b)->sw_if_index[VLIB_TX]
~0
then the node performs a longest prefix match (LPM) for the packet destination address in the FIB attached to the receive interface.[VLIB_TX]
is a FIB index value (0, 1, ...) and not a VRF id.Sets:
vnet_buffer(b)->ip.adj_index[VLIB_TX]
Next Index:
adj->lookup_next_index
(where adj
is the lookup result adjacency). Definition at line 474 of file ip4_forward.c.
clib_error_t* ip4_lookup_init | ( | vlib_main_t * | vm | ) |
Definition at line 1063 of file ip4_forward.c.
|
inlinestatic |
Definition at line 68 of file ip4_forward.c.
|
static |
int ip4_lookup_validate | ( | ip4_address_t * | a, |
u32 | fib_index0 | ||
) |
Definition at line 3015 of file ip4_forward.c.
|
static |
clib_error_t* ip4_probe_neighbor | ( | vlib_main_t * | vm, |
ip4_address_t * | dst, | ||
u32 | sw_if_index | ||
) |
Definition at line 2107 of file ip4_forward.c.
|
static |
Definition at line 1790 of file ip4_forward.c.
|
inlinestatic |
Definition at line 2176 of file ip4_forward.c.
|
static |
IPv4 local rewrite node.
ip4-rewrite-local
This is the IPv4 local rewrite node. Fetch the ip adjacency, check the outbound interface mtu, apply the adjacency rewrite, and send pkts to the adjacency rewrite header's rewrite_next_index. Deal with hemorrhoids of the form "some clown sends an icmp4 w/ src = dst = interface addr."
vm | vlib_main_t corresponding to the current thread |
node | vlib_node_runtime_t |
frame | vlib_frame_t whose contents should be dispatched |
Uses:
vnet_buffer(b)->ip.adj_index[VLIB_RX]
adj->lookup_next_index
adj->rewrite_header
Sets:
b->current_data, b->current_length
Next Indices:
adj->rewrite_header.next_index
or error-drop
Definition at line 2640 of file ip4_forward.c.
|
static |
IPv4 transit rewrite node.
ip4-rewrite-transit
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.
vm | vlib_main_t corresponding to the current thread |
node | vlib_node_runtime_t |
frame | vlib_frame_t whose contents should be dispatched |
Uses:
vnet_buffer(b)->ip.adj_index[VLIB_TX]
adj->lookup_next_index
adj->rewrite_header
Sets:
b->current_data, b->current_length
Next Indices:
adj->rewrite_header.next_index
or error-drop
Definition at line 2598 of file ip4_forward.c.
|
static |
Definition at line 709 of file ip4_forward.c.
u16 ip4_tcp_udp_compute_checksum | ( | vlib_main_t * | vm, |
vlib_buffer_t * | p0, | ||
ip4_header_t * | ip0 | ||
) |
Definition at line 1336 of file ip4_forward.c.
|
static |
Definition at line 1381 of file ip4_forward.c.
|
static |
|
static |
|
static |
|
static |
VNET_IP4_MULTICAST_FEATURE_INIT | ( | ip4_vpath_mc | , |
static | |||
) |
VNET_IP4_MULTICAST_FEATURE_INIT | ( | ip4_lookup_mc | , |
static | |||
) |
VNET_IP4_MULTICAST_FEATURE_INIT | ( | ip4_mc_drop | , |
static | |||
) |
VNET_IP4_TX_FEATURE_INIT | ( | ip4_source_and_port_range_check_tx | , |
static | |||
) |
VNET_IP4_TX_FEATURE_INIT | ( | interface_output | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_flow_classify | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_inacl | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_source_check_1 | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_source_check_2 | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_source_and_port_range_check_rx | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_policer_classify | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_ipsec | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_vpath | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_lookup | , |
static | |||
) |
VNET_IP4_UNICAST_FEATURE_INIT | ( | ip4_drop | , |
static | |||
) |
int vnet_set_ip4_classify_intfc | ( | vlib_main_t * | vm, |
u32 | sw_if_index, | ||
u32 | table_index | ||
) |
Definition at line 3263 of file ip4_forward.c.
Definition at line 3115 of file ip4_forward.c.
VNET_SW_INTERFACE_ADD_DEL_FUNCTION | ( | ip4_sw_interface_add_del | ) |
|
static |
Definition at line 2040 of file ip4_forward.c.
vlib_node_registration_t ip4_arp_node |
(constructor) VLIB_REGISTER_NODE (ip4_arp_node)
Definition at line 2049 of file ip4_forward.c.
|
static |
(constructor) VLIB_REGISTER_NODE (ip4_drop_node)
Definition at line 1304 of file ip4_forward.c.
vlib_node_registration_t ip4_glean_node |
(constructor) VLIB_REGISTER_NODE (ip4_glean_node)
Definition at line 2065 of file ip4_forward.c.
vlib_node_registration_t ip4_load_balance_node |
(constructor) VLIB_REGISTER_NODE (ip4_load_balance_node)
Definition at line 578 of file ip4_forward.c.
|
static |
(constructor) VLIB_REGISTER_NODE (ip4_local_node)
Definition at line 1772 of file ip4_forward.c.
|
static |
(constructor) VLIB_REGISTER_NODE (ip4_lookup_multicast_node)
Definition at line 2990 of file ip4_forward.c.
vlib_node_registration_t ip4_lookup_node |
(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)
Definition at line 485 of file ip4_forward.c.
ip4_main_t ip4_main |
Global ip4 main structure.
Definition at line 1060 of file ip4_forward.c.
vlib_node_registration_t ip4_midchain_node |
(constructor) VLIB_REGISTER_NODE (ip4_midchain_node)
Definition at line 2674 of file ip4_forward.c.
|
static |
(constructor) VLIB_REGISTER_NODE (ip4_multicast_node)
Definition at line 3002 of file ip4_forward.c.
|
static |
(constructor) VLIB_REGISTER_NODE (ip4_punt_node)
Definition at line 1319 of file ip4_forward.c.
vlib_node_registration_t ip4_rewrite_local_node |
(constructor) VLIB_REGISTER_NODE (ip4_rewrite_local_node)
Definition at line 2686 of file ip4_forward.c.
vlib_node_registration_t ip4_rewrite_node |
(constructor) VLIB_REGISTER_NODE (ip4_rewrite_node)
Definition at line 2657 of file ip4_forward.c.
|
static |
(constructor) VLIB_CLI_COMMAND (lookup_test_command)
Definition at line 3108 of file ip4_forward.c.
|
static |
Definition at line 941 of file ip4_forward.c.
|
static |
(constructor) VLIB_CLI_COMMAND (set_interface_ip_table_command)
Definition at line 2768 of file ip4_forward.c.
|
static |
(constructor) VLIB_CLI_COMMAND (set_ip_classify_command)
Definition at line 3377 of file ip4_forward.c.
|
static |
(constructor) VLIB_CLI_COMMAND (set_ip_flow_hash_command)
Definition at line 3255 of file ip4_forward.c.
|
static |
(constructor) VLIB_CLI_COMMAND (show_ip_local)
Definition at line 1833 of file ip4_forward.c.
|
static |
Definition at line 944 of file ip4_forward.c.