FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
ip4.h File Reference
+ Include dependency graph for ip4.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ip4_mfib_t
 
struct  ip4_add_del_interface_address_callback_t
 
struct  ip4_enable_disable_interface_callback_t
 
struct  ip4_table_bind_callback_t
 
struct  ip4_main_t
 IPv4 main type. More...
 

Macros

#define ARP_THROTTLE_BITS   (512)
 
#define IP_DF   0x4000 /* don't fragment */
 

Typedefs

typedef struct ip4_mfib_t ip4_mfib_t
 
typedef void() ip4_add_del_interface_address_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_del)
 
typedef void() ip4_enable_disable_interface_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, u32 is_enable)
 
typedef void() ip4_table_bind_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
typedef struct ip4_main_t ip4_main_t
 IPv4 main type. More...
 

Functions

static uword ip4_destination_matches_route (const ip4_main_t *im, const ip4_address_t *key, const ip4_address_t *dest, uword dest_length)
 
static uword ip4_destination_matches_interface (ip4_main_t *im, ip4_address_t *key, ip_interface_address_t *ia)
 
static int ip4_src_address_for_packet (ip_lookup_main_t *lm, u32 sw_if_index, ip4_address_t *src)
 
static ip4_address_tip4_interface_address_matching_destination (ip4_main_t *im, const ip4_address_t *dst, u32 sw_if_index, ip_interface_address_t **result_ia)
 
ip4_address_tip4_interface_first_address (ip4_main_t *im, u32 sw_if_index, ip_interface_address_t **result_ia)
 
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)
 
void ip4_directed_broadcast (u32 sw_if_index, u8 enable)
 
void ip4_sw_interface_enable_disable (u32 sw_if_index, u32 is_enable)
 
int ip4_address_compare (ip4_address_t *a1, ip4_address_t *a2)
 
uword ip4_udp_register_listener (vlib_main_t *vm, u16 dst_port, u32 next_node_index)
 
u16 ip4_tcp_udp_compute_checksum (vlib_main_t *vm, vlib_buffer_t *p0, ip4_header_t *ip0)
 
void ip4_register_protocol (u32 protocol, u32 node_index)
 
void ip4_unregister_protocol (u32 protocolx)
 
int vnet_set_ip4_flow_hash (u32 table_id, flow_hash_config_t flow_hash_config)
 
int vnet_set_ip4_classify_intfc (vlib_main_t *vm, u32 sw_if_index, u32 table_index)
 
void ip4_punt_policer_add_del (u8 is_add, u32 policer_index)
 
void ip4_punt_redirect_add (u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t *nh)
 
void ip4_punt_redirect_add_paths (u32 rx_sw_if_index, fib_route_path_t *paths)
 
void ip4_punt_redirect_del (u32 rx_sw_if_index)
 
static u32 ip4_compute_flow_hash (const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
 
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)
 
u8format_ip4_forward_next_trace (u8 *s, va_list *args)
 
u32 ip4_tcp_udp_validate_checksum (vlib_main_t *vm, vlib_buffer_t *p0)
 
static void * vlib_buffer_push_ip4_custom (vlib_main_t *vm, vlib_buffer_t *b, ip4_address_t *src, ip4_address_t *dst, int proto, u8 csum_offload, u8 is_df)
 
static void * vlib_buffer_push_ip4 (vlib_main_t *vm, vlib_buffer_t *b, ip4_address_t *src, ip4_address_t *dst, int proto, u8 csum_offload)
 Push IPv4 header to buffer. More...
 
static u32 vlib_buffer_get_ip4_fib_index (vlib_buffer_t *b)
 

Variables

ip4_main_t ip4_main
 Global ip4 main structure. More...
 
char * ip4_error_strings []
 
vlib_node_registration_t ip4_input_node
 Global ip4 input node. More...
 
vlib_node_registration_t ip4_lookup_node
 (constructor) VLIB_REGISTER_NODE (ip4_lookup_node) More...
 
vlib_node_registration_t ip4_local_node
 (constructor) VLIB_REGISTER_NODE (ip4_local_node) More...
 
vlib_node_registration_t ip4_rewrite_node
 (constructor) VLIB_REGISTER_NODE (ip4_rewrite_node) More...
 
vlib_node_registration_t ip4_rewrite_mcast_node
 (constructor) VLIB_REGISTER_NODE (ip4_rewrite_mcast_node) More...
 
vlib_node_registration_t ip4_rewrite_local_node
 
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_midchain_node
 (constructor) VLIB_REGISTER_NODE (ip4_midchain_node) More...
 
vlib_node_registration_t ip4_punt_node
 (constructor) VLIB_REGISTER_NODE (ip4_punt_node) More...
 
serialize_function_t serialize_vnet_ip4_main
 
serialize_function_t unserialize_vnet_ip4_main
 

Macro Definition Documentation

◆ ARP_THROTTLE_BITS

#define ARP_THROTTLE_BITS   (512)

Definition at line 181 of file ip4.h.

◆ IP_DF

#define IP_DF   0x4000 /* don't fragment */

Definition at line 368 of file ip4.h.

Typedef Documentation

◆ ip4_add_del_interface_address_function_t

typedef void() ip4_add_del_interface_address_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_del)

Definition at line 66 of file ip4.h.

◆ ip4_enable_disable_interface_function_t

typedef void() ip4_enable_disable_interface_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, u32 is_enable)

Definition at line 79 of file ip4.h.

◆ ip4_main_t

typedef struct ip4_main_t ip4_main_t

IPv4 main type.

State of IPv4 VPP processing including:

  • FIBs
  • Feature indices used in feature topological sort
  • Feature node run time references

◆ ip4_mfib_t

typedef struct ip4_mfib_t ip4_mfib_t

◆ ip4_table_bind_function_t

typedef void() ip4_table_bind_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)

Definition at line 88 of file ip4.h.

Function Documentation

◆ format_ip4_forward_next_trace()

u8* format_ip4_forward_next_trace ( u8 s,
va_list *  args 
)

Definition at line 1229 of file ip4_forward.c.

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

◆ ip4_add_del_interface_address()

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 872 of file ip4_forward.c.

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

◆ ip4_address_compare()

int ip4_address_compare ( ip4_address_t a1,
ip4_address_t a2 
)

Definition at line 53 of file ip46_cli.c.

+ Here is the caller graph for this function:

◆ ip4_compute_flow_hash()

static u32 ip4_compute_flow_hash ( const ip4_header_t ip,
flow_hash_config_t  flow_hash_config 
)
inlinestatic

Definition at line 310 of file ip4.h.

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

◆ ip4_destination_matches_interface()

static uword ip4_destination_matches_interface ( ip4_main_t im,
ip4_address_t key,
ip_interface_address_t ia 
)
inlinestatic

Definition at line 208 of file ip4.h.

+ Here is the call graph for this function:

◆ ip4_destination_matches_route()

static uword ip4_destination_matches_route ( const ip4_main_t im,
const ip4_address_t key,
const ip4_address_t dest,
uword  dest_length 
)
inlinestatic

Definition at line 200 of file ip4.h.

+ Here is the caller graph for this function:

◆ ip4_directed_broadcast()

void ip4_directed_broadcast ( u32  sw_if_index,
u8  enable 
)

Definition at line 882 of file ip4_forward.c.

+ Here is the caller graph for this function:

◆ ip4_forward_next_trace()

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 1279 of file ip4_forward.c.

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

◆ ip4_interface_address_matching_destination()

static ip4_address_t* ip4_interface_address_matching_destination ( ip4_main_t im,
const ip4_address_t dst,
u32  sw_if_index,
ip_interface_address_t **  result_ia 
)
inlinestatic

Definition at line 238 of file ip4.h.

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

◆ ip4_interface_first_address()

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

Definition at line 281 of file ip4_forward.c.

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

◆ ip4_punt_policer_add_del()

void ip4_punt_policer_add_del ( u8  is_add,
u32  policer_index 
)

Definition at line 220 of file ip4_punt_drop.c.

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

◆ ip4_punt_redirect_add()

void ip4_punt_redirect_add ( u32  rx_sw_if_index,
u32  tx_sw_if_index,
ip46_address_t *  nh 
)

Definition at line 292 of file ip4_punt_drop.c.

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

◆ ip4_punt_redirect_add_paths()

void ip4_punt_redirect_add_paths ( u32  rx_sw_if_index,
fib_route_path_t paths 
)

Definition at line 313 of file ip4_punt_drop.c.

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

◆ ip4_punt_redirect_del()

void ip4_punt_redirect_del ( u32  rx_sw_if_index)

Definition at line 323 of file ip4_punt_drop.c.

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

◆ ip4_register_protocol()

void ip4_register_protocol ( u32  protocol,
u32  node_index 
)

Definition at line 1933 of file ip4_forward.c.

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

◆ ip4_src_address_for_packet()

static int ip4_src_address_for_packet ( ip_lookup_main_t lm,
u32  sw_if_index,
ip4_address_t src 
)
inlinestatic

Definition at line 217 of file ip4.h.

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

◆ ip4_sw_interface_enable_disable()

void ip4_sw_interface_enable_disable ( u32  sw_if_index,
u32  is_enable 
)

Definition at line 640 of file ip4_forward.c.

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

◆ ip4_tcp_udp_compute_checksum()

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

Definition at line 1367 of file ip4_forward.c.

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

◆ ip4_tcp_udp_validate_checksum()

u32 ip4_tcp_udp_validate_checksum ( vlib_main_t vm,
vlib_buffer_t p0 
)

Definition at line 1400 of file ip4_forward.c.

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

◆ ip4_udp_register_listener()

uword ip4_udp_register_listener ( vlib_main_t vm,
u16  dst_port,
u32  next_node_index 
)
+ Here is the caller graph for this function:

◆ ip4_unregister_protocol()

void ip4_unregister_protocol ( u32  protocolx)

Definition at line 1945 of file ip4_forward.c.

+ Here is the caller graph for this function:

◆ vlib_buffer_get_ip4_fib_index()

static u32 vlib_buffer_get_ip4_fib_index ( vlib_buffer_t b)
inlinestatic

Definition at line 429 of file ip4.h.

◆ vlib_buffer_push_ip4()

static void* vlib_buffer_push_ip4 ( vlib_main_t vm,
vlib_buffer_t b,
ip4_address_t src,
ip4_address_t dst,
int  proto,
u8  csum_offload 
)
inlinestatic

Push IPv4 header to buffer.

This does not support fragmentation.

Parameters
vm- vlib_main
b- buffer to write the header to
src- source IP
dst- destination IP
prot- payload proto
Returns
- pointer to start of IP header

Definition at line 420 of file ip4.h.

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

◆ vlib_buffer_push_ip4_custom()

static void* vlib_buffer_push_ip4_custom ( vlib_main_t vm,
vlib_buffer_t b,
ip4_address_t src,
ip4_address_t dst,
int  proto,
u8  csum_offload,
u8  is_df 
)
inlinestatic

Definition at line 371 of file ip4.h.

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

◆ vnet_set_ip4_classify_intfc()

int vnet_set_ip4_classify_intfc ( vlib_main_t vm,
u32  sw_if_index,
u32  table_index 
)

Definition at line 2967 of file ip4_forward.c.

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

◆ vnet_set_ip4_flow_hash()

int vnet_set_ip4_flow_hash ( u32  table_id,
flow_hash_config_t  flow_hash_config 
)

Definition at line 2813 of file ip4_forward.c.

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

Variable Documentation

◆ ip4_arp_node

(constructor) VLIB_REGISTER_NODE (ip4_arp_node)

Definition at line 261 of file ip4_neighbor.c.

◆ ip4_error_strings

char* ip4_error_strings[]

Definition at line 377 of file ip4_input.c.

◆ ip4_glean_node

vlib_node_registration_t ip4_glean_node

(constructor) VLIB_REGISTER_NODE (ip4_glean_node)

Definition at line 274 of file ip4_neighbor.c.

◆ ip4_input_node

vlib_node_registration_t ip4_input_node

Global ip4 input node.

Errors get attached to ip4 input node.

Global ip4 input node.

Definition at line 385 of file ip4_input.c.

◆ ip4_local_node

vlib_node_registration_t ip4_local_node

(constructor) VLIB_REGISTER_NODE (ip4_local_node)

Definition at line 1888 of file ip4_forward.c.

◆ ip4_lookup_node

vlib_node_registration_t ip4_lookup_node

(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)

Definition at line 104 of file ip4_forward.c.

◆ ip4_main

ip4_main_t ip4_main

Global ip4 main structure.

Definition at line 1144 of file ip4_forward.c.

◆ ip4_midchain_node

vlib_node_registration_t ip4_midchain_node

(constructor) VLIB_REGISTER_NODE (ip4_midchain_node)

Definition at line 2706 of file ip4_forward.c.

◆ ip4_punt_node

vlib_node_registration_t ip4_punt_node

(constructor) VLIB_REGISTER_NODE (ip4_punt_node)

Definition at line 193 of file ip4_punt_drop.c.

◆ ip4_rewrite_local_node

vlib_node_registration_t ip4_rewrite_local_node

◆ ip4_rewrite_mcast_node

vlib_node_registration_t ip4_rewrite_mcast_node

(constructor) VLIB_REGISTER_NODE (ip4_rewrite_mcast_node)

Definition at line 2690 of file ip4_forward.c.

◆ ip4_rewrite_node

vlib_node_registration_t ip4_rewrite_node

(constructor) VLIB_REGISTER_NODE (ip4_rewrite_node)

Definition at line 2668 of file ip4_forward.c.

◆ serialize_vnet_ip4_main

serialize_function_t serialize_vnet_ip4_main

Definition at line 290 of file ip4.h.

◆ unserialize_vnet_ip4_main

serialize_function_t unserialize_vnet_ip4_main

Definition at line 290 of file ip4.h.