FD.io VPP  v18.07-rc0-415-g6c78436
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_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, ip4_address_t *address, u32 fib_index)
 
static uword ip4_address_netmask_length (ip4_address_t *a)
 
static int ip4_get_fragment_offset (ip4_header_t *i)
 
static int ip4_get_fragment_more (ip4_header_t *i)
 
static int ip4_is_fragment (ip4_header_t *i)
 
static int ip4_is_first_fragment (ip4_header_t *i)
 
static int ip4_get_fragment_offset_bytes (ip4_header_t *i)
 
static int ip4_header_bytes (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 (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, 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

#define IP4_HEADER_FLAG_CONGESTION   (1 << 15)

Definition at line 153 of file ip4_packet.h.

#define IP4_HEADER_FLAG_DONT_FRAGMENT   (1 << 14)

Definition at line 152 of file ip4_packet.h.

#define IP4_HEADER_FLAG_MORE_FRAGMENTS   (1 << 13)

Definition at line 151 of file ip4_packet.h.

#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:90
static ip_csum_t ip_csum_with_carry(ip_csum_t sum, ip_csum_t x)
Definition: ip_packet.h:93
#define BITS(x)
Definition: clib.h:58

Definition at line 270 of file ip4_packet.h.

#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:90
static ip_csum_t ip_csum_with_carry(ip_csum_t sum, ip_csum_t x)
Definition: ip_packet.h:93
#define BITS(x)
Definition: clib.h:58

Definition at line 288 of file ip4_packet.h.

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

Definition at line 193 of file ip4_packet.h.

Function Documentation

static void ip4_addr_fib_init ( ip4_address_fib_t addr_fib,
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:

static uword ip4_address_is_multicast ( ip4_address_t a)
inlinestatic

Definition at line 315 of file ip4_packet.h.

+ Here is the caller graph for this function:

static uword ip4_address_netmask_length ( ip4_address_t a)
inlinestatic

Definition at line 87 of file ip4_packet.h.

static int ip4_get_fragment_more ( ip4_header_t i)
inlinestatic

Definition at line 203 of file ip4_packet.h.

+ Here is the caller graph for this function:

static int ip4_get_fragment_offset ( ip4_header_t i)
inlinestatic

Definition at line 197 of file ip4_packet.h.

+ Here is the caller graph for this function:

static int ip4_get_fragment_offset_bytes ( ip4_header_t i)
inlinestatic

Definition at line 226 of file ip4_packet.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ip4_header_bytes ( ip4_header_t i)
inlinestatic

Definition at line 232 of file ip4_packet.h.

+ Here is the caller graph for this function:

static u16 ip4_header_checksum ( ip4_header_t i)
inlinestatic

Definition at line 244 of file ip4_packet.h.

+ Here is the call graph for this function:

static uword ip4_header_checksum_is_valid ( ip4_header_t i)
inlinestatic

Definition at line 265 of file ip4_packet.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ip4_is_first_fragment ( ip4_header_t i)
inlinestatic

Definition at line 217 of file ip4_packet.h.

+ Here is the caller graph for this function:

static int ip4_is_fragment ( ip4_header_t i)
inlinestatic

Definition at line 210 of file ip4_packet.h.

+ Here is the caller graph for this function:

static void ip4_multicast_address_set_for_group ( ip4_address_t a,
ip_multicast_group_t  g 
)
inlinestatic

Definition at line 321 of file ip4_packet.h.

static void ip4_multicast_ethernet_address ( u8 ethernet_address,
ip4_address_t a 
)
inlinestatic

Definition at line 329 of file ip4_packet.h.

static void* ip4_next_header ( ip4_header_t i)
inlinestatic

Definition at line 238 of file ip4_packet.h.

+ Here is the call graph for this function:

static void ip4_tcp_reply_x1 ( ip4_header_t ip0,
tcp_header_t tcp0 
)
inlinestatic

Definition at line 342 of file ip4_packet.h.

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 358 of file ip4_packet.h.