FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
ip4_packet.h File Reference
+ Include dependency graph for ip4_packet.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  ip4_address_t
 
struct  ip4_address_fib_t
 
struct  ip4_address_pair_t
 
struct  ip4_address_and_mask_t
 
union  ip4_header_t
 

Macros

#define IP4_HEADER_FLAG_MORE_FRAGMENTS   (1 << 13)
 
#define IP4_HEADER_FLAG_DONT_FRAGMENT   (1 << 14)
 
#define IP4_HEADER_FLAG_CONGESTION   (1 << 15)
 
#define IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS   ((4 << 4) | (sizeof (ip4_header_t) / sizeof (u32)))
 
#define IP4_ROUTER_ALERT_OPTION   20
 
#define ip4_partial_header_checksum_x1(ip0, sum0)
 
#define ip4_partial_header_checksum_x2(ip0, ip1, sum0, sum1)
 

Functions

static void ip4_addr_fib_init (ip4_address_fib_t *addr_fib, const ip4_address_t *address, u32 fib_index)
 
static uword ip4_address_netmask_length (const ip4_address_t *a)
 
static int ip4_get_fragment_offset (const ip4_header_t *i)
 
static int ip4_get_fragment_more (const ip4_header_t *i)
 
static int ip4_is_fragment (const ip4_header_t *i)
 
static int ip4_is_first_fragment (const ip4_header_t *i)
 
static int ip4_get_fragment_offset_bytes (const ip4_header_t *i)
 
static int ip4_header_bytes (const ip4_header_t *i)
 
static void * ip4_next_header (ip4_header_t *i)
 
static u16 ip4_header_checksum (ip4_header_t *i)
 
static uword ip4_header_checksum_is_valid (ip4_header_t *i)
 
static uword ip4_address_is_multicast (const ip4_address_t *a)
 
static void ip4_multicast_address_set_for_group (ip4_address_t *a, ip_multicast_group_t g)
 
static void ip4_multicast_ethernet_address (u8 *ethernet_address, const ip4_address_t *a)
 
static void ip4_tcp_reply_x1 (ip4_header_t *ip0, tcp_header_t *tcp0)
 
static void ip4_tcp_reply_x2 (ip4_header_t *ip0, ip4_header_t *ip1, tcp_header_t *tcp0, tcp_header_t *tcp1)
 

Macro Definition Documentation

◆ IP4_HEADER_FLAG_CONGESTION

#define IP4_HEADER_FLAG_CONGESTION   (1 << 15)

Definition at line 154 of file ip4_packet.h.

◆ IP4_HEADER_FLAG_DONT_FRAGMENT

#define IP4_HEADER_FLAG_DONT_FRAGMENT   (1 << 14)

Definition at line 153 of file ip4_packet.h.

◆ IP4_HEADER_FLAG_MORE_FRAGMENTS

#define IP4_HEADER_FLAG_MORE_FRAGMENTS   (1 << 13)

Definition at line 152 of file ip4_packet.h.

◆ ip4_partial_header_checksum_x1

#define ip4_partial_header_checksum_x1 (   ip0,
  sum0 
)
Value:
do { \
if (BITS (ip_csum_t) > 32) \
{ \
sum0 = ip0->checksum_data_64[0]; \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_64[1]); \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_64_32[0]); \
} \
else \
{ \
sum0 = ip0->checksum_data_32[0]; \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[1]); \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[2]); \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[3]); \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[4]); \
} \
} while (0)
uword ip_csum_t
Definition: ip_packet.h:219
static ip_csum_t ip_csum_with_carry(ip_csum_t sum, ip_csum_t x)
Definition: ip_packet.h:222
#define BITS(x)
Definition: clib.h:62

Definition at line 273 of file ip4_packet.h.

◆ ip4_partial_header_checksum_x2

#define ip4_partial_header_checksum_x2 (   ip0,
  ip1,
  sum0,
  sum1 
)
Value:
do { \
if (BITS (ip_csum_t) > 32) \
{ \
sum0 = ip0->checksum_data_64[0]; \
sum1 = ip1->checksum_data_64[0]; \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_64[1]); \
sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_64[1]); \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_64_32[0]); \
sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_64_32[0]); \
} \
else \
{ \
sum0 = ip0->checksum_data_32[0]; \
sum1 = ip1->checksum_data_32[0]; \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[1]); \
sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_32[1]); \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[2]); \
sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_32[2]); \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[3]); \
sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_32[3]); \
sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[4]); \
sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_32[4]); \
} \
} while (0)
uword ip_csum_t
Definition: ip_packet.h:219
static ip_csum_t ip_csum_with_carry(ip_csum_t sum, ip_csum_t x)
Definition: ip_packet.h:222
#define BITS(x)
Definition: clib.h:62

Definition at line 291 of file ip4_packet.h.

◆ IP4_ROUTER_ALERT_OPTION

#define IP4_ROUTER_ALERT_OPTION   20

Definition at line 197 of file ip4_packet.h.

◆ IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS

#define IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS   ((4 << 4) | (sizeof (ip4_header_t) / sizeof (u32)))

Definition at line 194 of file ip4_packet.h.

Function Documentation

◆ ip4_addr_fib_init()

static void ip4_addr_fib_init ( ip4_address_fib_t addr_fib,
const ip4_address_t address,
u32  fib_index 
)
inlinestatic

Definition at line 67 of file ip4_packet.h.

+ Here is the caller graph for this function:

◆ ip4_address_is_multicast()

static uword ip4_address_is_multicast ( const ip4_address_t a)
inlinestatic

Definition at line 318 of file ip4_packet.h.

+ Here is the caller graph for this function:

◆ ip4_address_netmask_length()

static uword ip4_address_netmask_length ( const ip4_address_t a)
inlinestatic

Definition at line 88 of file ip4_packet.h.

◆ ip4_get_fragment_more()

static int ip4_get_fragment_more ( const ip4_header_t i)
inlinestatic

Definition at line 206 of file ip4_packet.h.

+ Here is the caller graph for this function:

◆ ip4_get_fragment_offset()

static int ip4_get_fragment_offset ( const ip4_header_t i)
inlinestatic

Definition at line 200 of file ip4_packet.h.

+ Here is the caller graph for this function:

◆ ip4_get_fragment_offset_bytes()

static int ip4_get_fragment_offset_bytes ( const ip4_header_t i)
inlinestatic

Definition at line 229 of file ip4_packet.h.

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

◆ ip4_header_bytes()

static int ip4_header_bytes ( const ip4_header_t i)
inlinestatic

Definition at line 235 of file ip4_packet.h.

+ Here is the caller graph for this function:

◆ ip4_header_checksum()

static u16 ip4_header_checksum ( ip4_header_t i)
inlinestatic

Definition at line 247 of file ip4_packet.h.

+ Here is the call graph for this function:

◆ ip4_header_checksum_is_valid()

static uword ip4_header_checksum_is_valid ( ip4_header_t i)
inlinestatic

Definition at line 268 of file ip4_packet.h.

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

◆ ip4_is_first_fragment()

static int ip4_is_first_fragment ( const ip4_header_t i)
inlinestatic

Definition at line 220 of file ip4_packet.h.

+ Here is the caller graph for this function:

◆ ip4_is_fragment()

static int ip4_is_fragment ( const ip4_header_t i)
inlinestatic

Definition at line 213 of file ip4_packet.h.

+ Here is the caller graph for this function:

◆ ip4_multicast_address_set_for_group()

static void ip4_multicast_address_set_for_group ( ip4_address_t a,
ip_multicast_group_t  g 
)
inlinestatic

Definition at line 324 of file ip4_packet.h.

◆ ip4_multicast_ethernet_address()

static void ip4_multicast_ethernet_address ( u8 ethernet_address,
const ip4_address_t a 
)
inlinestatic

Definition at line 332 of file ip4_packet.h.

◆ ip4_next_header()

static void* ip4_next_header ( ip4_header_t i)
inlinestatic

Definition at line 241 of file ip4_packet.h.

+ Here is the call graph for this function:

◆ ip4_tcp_reply_x1()

static void ip4_tcp_reply_x1 ( ip4_header_t ip0,
tcp_header_t tcp0 
)
inlinestatic

Definition at line 346 of file ip4_packet.h.

◆ ip4_tcp_reply_x2()

static void ip4_tcp_reply_x2 ( ip4_header_t ip0,
ip4_header_t ip1,
tcp_header_t tcp0,
tcp_header_t tcp1 
)
inlinestatic

Definition at line 362 of file ip4_packet.h.