FD.io VPP  v20.05.1-6-gf53edbc3b
Vector Packet Processing
ip_packet.h File Reference
+ Include dependency graph for ip_packet.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ip_protocol(n, s)   IP_PROTOCOL_##s = n,
 
#define ip_port(s, n)   IP_PORT_##s = n,
 
#define foreach_ip_builtin_multicast_group
 
#define foreach_ip_dscp
 The set of RFC defined DSCP values. More...
 
#define IP_PACKET_TC_FIELD_DSCP_BIT_SHIFT   2
 IP DSCP bit shift The ECN occupies the 2 least significant bits of the TC field. More...
 
#define IP_PACKET_TC_FIELD_ECN_MASK   0x03
 
#define foreach_ip_ecn
 The set of RFC defined DSCP values. More...
 
#define ip_csum_update(sum, old, new, type, field)
 

Typedefs

typedef enum ip_protocol ip_protocol_t
 
typedef enum ip_dscp_t_ ip_dscp_t
 
typedef enum ip_ecn_t_ ip_ecn_t
 
typedef uword ip_csum_t
 

Enumerations

enum  ip_protocol { ip_protocol, ip_protocol }
 
enum  ip_port_t { ip_port, ip_port }
 
enum  ip_builtin_protocol_t { IP_BUILTIN_PROTOCOL_UDP, IP_BUILTIN_PROTOCOL_ICMP, IP_BUILTIN_PROTOCOL_UNKNOWN }
 
enum  ip_multicast_group_t { foreach_ip_builtin_multicast_group }
 
enum  ip_dscp_t_ { foreach_ip_dscp }
 
enum  ip_ecn_t_ { foreach_ip_ecn }
 

Functions

u8format_ip_dscp (u8 *s, va_list *va)
 
 STATIC_ASSERT_SIZEOF (ip_ecn_t, 1)
 
u8format_ip_ecn (u8 *s, va_list *va)
 
static_always_inline u16 ip_csum (void *data, u16 n_left)
 
static ip_csum_t ip_csum_with_carry (ip_csum_t sum, ip_csum_t x)
 
static ip_csum_t ip_csum_add_even (ip_csum_t c, ip_csum_t x)
 
static ip_csum_t ip_csum_sub_even (ip_csum_t c, ip_csum_t x)
 
static ip_csum_t ip_csum_update_inline (ip_csum_t sum, ip_csum_t old, ip_csum_t new, u32 field_byte_offset, u32 field_n_bytes)
 
static u16 ip_csum_fold (ip_csum_t c)
 
static ip_csum_t ip_incremental_checksum (ip_csum_t sum, void *_data, uword n_bytes)
 
static u16 ip_csum_and_memcpy_fold (ip_csum_t sum, void *dst)
 

Variables

ip_csum_t(* vnet_incremental_checksum_fp )(ip_csum_t, void *, uword)
 

Macro Definition Documentation

◆ foreach_ip_builtin_multicast_group

#define foreach_ip_builtin_multicast_group
Value:
_ (1, all_hosts_on_subnet) \
_ (2, all_routers_on_subnet) \
_ (4, dvmrp) \
_ (5, ospf_all_routers) \
_ (6, ospf_designated_routers) \
_ (13, pim) \
_ (18, vrrp) \
_ (102, hsrp) \
_ (22, igmp_v3)

Definition at line 69 of file ip_packet.h.

◆ foreach_ip_dscp

#define foreach_ip_dscp
Value:
_(0, CS0) \
_(8, CS1) \
_(10, AF11) \
_(12, AF12) \
_(14, AF13) \
_(16, CS2) \
_(18, AF21) \
_(20, AF22) \
_(22, AF23) \
_(24, CS3) \
_(26, AF31) \
_(28, AF32) \
_(30, AF33) \
_(32, CS4) \
_(34, AF41) \
_(36, AF42) \
_(38, AF43) \
_(40, CS5) \
_(46, EF) \
_(48, CS6) \
_(50, CS7)

The set of RFC defined DSCP values.

Definition at line 91 of file ip_packet.h.

◆ foreach_ip_ecn

#define foreach_ip_ecn
Value:
_(0, NON_ECN) \
_(1, ECT_0) \
_(2, ECT_1) \
_(3, CE)

The set of RFC defined DSCP values.

Definition at line 133 of file ip_packet.h.

◆ ip_csum_update

#define ip_csum_update (   sum,
  old,
  new,
  type,
  field 
)
Value:
ip_csum_update_inline ((sum), (old), (new), \
STRUCT_OFFSET_OF (type, field), \
STRUCT_SIZE_OF (type, field))
#define STRUCT_OFFSET_OF(t, f)
Definition: clib.h:69
static ip_csum_t ip_csum_update_inline(ip_csum_t sum, ip_csum_t old, ip_csum_t new, u32 field_byte_offset, u32 field_n_bytes)
Definition: ip_packet.h:278
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define STRUCT_SIZE_OF(t, f)
Definition: clib.h:71

Definition at line 294 of file ip_packet.h.

◆ IP_PACKET_TC_FIELD_DSCP_BIT_SHIFT

#define IP_PACKET_TC_FIELD_DSCP_BIT_SHIFT   2

IP DSCP bit shift The ECN occupies the 2 least significant bits of the TC field.

Definition at line 127 of file ip_packet.h.

◆ IP_PACKET_TC_FIELD_ECN_MASK

#define IP_PACKET_TC_FIELD_ECN_MASK   0x03

Definition at line 128 of file ip_packet.h.

◆ ip_port

#define ip_port (   s,
 
)    IP_PORT_##s = n,

Definition at line 56 of file ip_packet.h.

◆ ip_protocol

#define ip_protocol (   n,
 
)    IP_PROTOCOL_##s = n,

Definition at line 48 of file ip_packet.h.

Typedef Documentation

◆ ip_csum_t

typedef uword ip_csum_t

Definition at line 244 of file ip_packet.h.

◆ ip_dscp_t

typedef enum ip_dscp_t_ ip_dscp_t

◆ ip_ecn_t

typedef enum ip_ecn_t_ ip_ecn_t

◆ ip_protocol_t

typedef enum ip_protocol ip_protocol_t

Enumeration Type Documentation

◆ ip_builtin_protocol_t

Enumerator
IP_BUILTIN_PROTOCOL_UDP 
IP_BUILTIN_PROTOCOL_ICMP 
IP_BUILTIN_PROTOCOL_UNKNOWN 

Definition at line 62 of file ip_packet.h.

◆ ip_dscp_t_

enum ip_dscp_t_
Enumerator
foreach_ip_dscp 

Definition at line 114 of file ip_packet.h.

◆ ip_ecn_t_

enum ip_ecn_t_
Enumerator
foreach_ip_ecn 

Definition at line 139 of file ip_packet.h.

◆ ip_multicast_group_t

Enumerator
foreach_ip_builtin_multicast_group 

Definition at line 80 of file ip_packet.h.

◆ ip_port_t

enum ip_port_t
Enumerator
ip_port 
ip_port 

Definition at line 54 of file ip_packet.h.

◆ ip_protocol

Enumerator
ip_protocol 
ip_protocol 

Definition at line 46 of file ip_packet.h.

Function Documentation

◆ format_ip_dscp()

u8* format_ip_dscp ( u8 s,
va_list *  va 
)

Definition at line 136 of file ip.c.

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

◆ format_ip_ecn()

u8* format_ip_ecn ( u8 s,
va_list *  va 
)

Definition at line 153 of file ip.c.

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

◆ ip_csum()

static_always_inline u16 ip_csum ( void *  data,
u16  n_left 
)

Definition at line 153 of file ip_packet.h.

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

◆ ip_csum_add_even()

static ip_csum_t ip_csum_add_even ( ip_csum_t  c,
ip_csum_t  x 
)
inlinestatic

Definition at line 255 of file ip_packet.h.

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

◆ ip_csum_and_memcpy_fold()

static u16 ip_csum_and_memcpy_fold ( ip_csum_t  sum,
void *  dst 
)
inlinestatic

Definition at line 324 of file ip_packet.h.

+ Here is the call graph for this function:

◆ ip_csum_fold()

static u16 ip_csum_fold ( ip_csum_t  c)
inlinestatic

Definition at line 300 of file ip_packet.h.

◆ ip_csum_sub_even()

static ip_csum_t ip_csum_sub_even ( ip_csum_t  c,
ip_csum_t  x 
)
inlinestatic

Definition at line 272 of file ip_packet.h.

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

◆ ip_csum_update_inline()

static ip_csum_t ip_csum_update_inline ( ip_csum_t  sum,
ip_csum_t  old,
ip_csum_t  new,
u32  field_byte_offset,
u32  field_n_bytes 
)
inlinestatic

Definition at line 278 of file ip_packet.h.

+ Here is the call graph for this function:

◆ ip_csum_with_carry()

static ip_csum_t ip_csum_with_carry ( ip_csum_t  sum,
ip_csum_t  x 
)
inlinestatic

Definition at line 247 of file ip_packet.h.

+ Here is the caller graph for this function:

◆ ip_incremental_checksum()

static ip_csum_t ip_incremental_checksum ( ip_csum_t  sum,
void *  _data,
uword  n_bytes 
)
inlinestatic

Definition at line 318 of file ip_packet.h.

+ Here is the caller graph for this function:

◆ STATIC_ASSERT_SIZEOF()

STATIC_ASSERT_SIZEOF ( ip_ecn_t  ,
 
)

Variable Documentation

◆ vnet_incremental_checksum_fp

ip_csum_t(* vnet_incremental_checksum_fp) (ip_csum_t, void *, uword)

Definition at line 124 of file ip_checksum.c.