FD.io VPP  v18.04-17-g3a0d853
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
 
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 148 of file ip4_packet.h.

#define IP4_HEADER_FLAG_DONT_FRAGMENT   (1 << 14)

Definition at line 147 of file ip4_packet.h.

#define IP4_HEADER_FLAG_MORE_FRAGMENTS   (1 << 13)

Definition at line 146 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 265 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 283 of file ip4_packet.h.

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

Definition at line 188 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 310 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 82 of file ip4_packet.h.

static int ip4_get_fragment_more ( ip4_header_t i)
inlinestatic

Definition at line 198 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 192 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 221 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 227 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 239 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 260 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 212 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 205 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 316 of file ip4_packet.h.

static void ip4_multicast_ethernet_address ( u8 ethernet_address,
ip4_address_t a 
)
inlinestatic

Definition at line 324 of file ip4_packet.h.

static void* ip4_next_header ( ip4_header_t i)
inlinestatic

Definition at line 233 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 337 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 353 of file ip4_packet.h.