FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
buffer.h File Reference
+ Include dependency graph for buffer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vnet_buffer_opaque_t
 
struct  vnet_buffer_opaque2_t
 

Macros

#define foreach_vnet_buffer_flag
 Flags that are set in the high order bits of ((vlib_buffer*)b)->flags. More...
 
#define VNET_BUFFER_FLAGS_ALL_AVAIL
 
#define VNET_BUFFER_FLAGS_VLAN_BITS   (VNET_BUFFER_F_VLAN_1_DEEP | VNET_BUFFER_F_VLAN_2_DEEP)
 
#define foreach_vnet_buffer_offload_flag
 
#define foreach_buffer_opaque_union_subtype
 
#define VNET_REWRITE_TOTAL_BYTES   (VLIB_BUFFER_PRE_DATA_SIZE)
 
#define vnet_buffer(b)   ((vnet_buffer_opaque_t *) (b)->opaque)
 
#define vnet_buffer2(b)   ((vnet_buffer_opaque2_t *) (b)->opaque2)
 
#define gso_mtu_sz(b)
 

Enumerations

enum  { foreach_vnet_buffer_flag }
 
enum  { foreach_vnet_buffer_flag }
 
enum  vnet_buffer_oflags_t { foreach_vnet_buffer_offload_flag }
 

Functions

 STATIC_ASSERT (((VNET_BUFFER_FLAGS_ALL_AVAIL &VLIB_BUFFER_FLAGS_ALL)==0), "VLIB / VNET buffer flags overlap")
 
 STATIC_ASSERT (sizeof(vnet_buffer_opaque_t)<=STRUCT_SIZE_OF(vlib_buffer_t, opaque), "VNET buffer meta-data too large for vlib_buffer")
 
 STATIC_ASSERT (sizeof(vnet_buffer_opaque2_t)<=STRUCT_SIZE_OF(vlib_buffer_t, opaque2), "VNET buffer opaque2 meta-data too large for vlib_buffer")
 
static_always_inline void vnet_buffer_offload_flags_set (vlib_buffer_t *b, vnet_buffer_oflags_t oflags)
 
static_always_inline void vnet_buffer_offload_flags_clear (vlib_buffer_t *b, vnet_buffer_oflags_t oflags)
 

Variables

save_rewrite_length must be aligned so that reass doesn t overwrite it
 
format_function_t format_vnet_buffer
 
format_function_t format_vnet_buffer_offload
 
format_function_t format_vnet_buffer_flags
 
format_function_t format_vnet_buffer_opaque
 
format_function_t format_vnet_buffer_opaque2
 

Macro Definition Documentation

◆ foreach_buffer_opaque_union_subtype

#define foreach_buffer_opaque_union_subtype
Value:
_(ip) \
_(l2) \
_(l2t) \
_(l2_classify) \
_(policer) \
_(ipsec) \
_(map) \
_(map_t) \
_(ip_frag) \
_(mpls) \
_(tcp)

Definition at line 125 of file buffer.h.

◆ foreach_vnet_buffer_flag

foreach_vnet_buffer_flag
Value:
_ (1, L4_CHECKSUM_COMPUTED, "l4-cksum-computed", 1) \
_ (2, L4_CHECKSUM_CORRECT, "l4-cksum-correct", 1) \
_ (3, VLAN_2_DEEP, "vlan-2-deep", 1) \
_ (4, VLAN_1_DEEP, "vlan-1-deep", 1) \
_ (5, SPAN_CLONE, "span-clone", 1) \
_ (6, LOOP_COUNTER_VALID, "loop-counter-valid", 0) \
_ (7, LOCALLY_ORIGINATED, "local", 1) \
_ (8, IS_IP4, "ip4", 1) \
_ (9, IS_IP6, "ip6", 1) \
_ (10, OFFLOAD, "offload", 0) \
_ (11, IS_NATED, "natted", 1) \
_ (12, L2_HDR_OFFSET_VALID, "l2_hdr_offset_valid", 0) \
_ (13, L3_HDR_OFFSET_VALID, "l3_hdr_offset_valid", 0) \
_ (14, L4_HDR_OFFSET_VALID, "l4_hdr_offset_valid", 0) \
_ (15, FLOW_REPORT, "flow-report", 1) \
_ (16, IS_DVR, "dvr", 1) \
_ (17, QOS_DATA_VALID, "qos-data-valid", 0) \
_ (18, GSO, "gso", 0) \
_ (19, AVAIL1, "avail1", 1) \
_ (20, AVAIL2, "avail2", 1) \
_ (21, AVAIL3, "avail3", 1) \
_ (22, AVAIL4, "avail4", 1) \
_ (23, AVAIL5, "avail5", 1) \
_ (24, AVAIL6, "avail6", 1) \
_ (25, AVAIL7, "avail7", 1) \
_ (26, AVAIL8, "avail8", 1) \
_ (27, AVAIL9, "avail9", 1)

Flags that are set in the high order bits of ((vlib_buffer*)b)->flags.

Definition at line 49 of file buffer.h.

◆ foreach_vnet_buffer_offload_flag

#define foreach_vnet_buffer_offload_flag
Value:
_ (0, IP_CKSUM, "offload-ip-cksum", 1) \
_ (1, TCP_CKSUM, "offload-tcp-cksum", 1) \
_ (2, UDP_CKSUM, "offload-udp-cksum", 1) \
_ (3, OUTER_IP_CKSUM, "offload-outer-ip-cksum", 1) \
_ (4, OUTER_TCP_CKSUM, "offload-outer-tcp-cksum", 1) \
_ (5, OUTER_UDP_CKSUM, "offload-outer-udp-cksum", 1)

Definition at line 110 of file buffer.h.

◆ gso_mtu_sz

#define gso_mtu_sz (   b)
Value:
(vnet_buffer2(b)->gso_size + \
vnet_buffer2(b)->gso_l4_hdr_sz + \
vnet_buffer(b)->l4_hdr_offset - \
vnet_buffer (b)->l3_hdr_offset)

Definition at line 509 of file buffer.h.

◆ vnet_buffer

#define vnet_buffer (   b)    ((vnet_buffer_opaque_t *) (b)->opaque)

Definition at line 437 of file buffer.h.

◆ vnet_buffer2

#define vnet_buffer2 (   b)    ((vnet_buffer_opaque2_t *) (b)->opaque2)

Definition at line 499 of file buffer.h.

◆ VNET_BUFFER_FLAGS_ALL_AVAIL

#define VNET_BUFFER_FLAGS_ALL_AVAIL
Value:
(VNET_BUFFER_F_AVAIL1 | VNET_BUFFER_F_AVAIL2 | VNET_BUFFER_F_AVAIL3 | \
VNET_BUFFER_F_AVAIL4 | VNET_BUFFER_F_AVAIL5 | VNET_BUFFER_F_AVAIL6 | \
VNET_BUFFER_F_AVAIL7 | VNET_BUFFER_F_AVAIL8 | VNET_BUFFER_F_AVAIL9)

Definition at line 84 of file buffer.h.

◆ VNET_BUFFER_FLAGS_VLAN_BITS

#define VNET_BUFFER_FLAGS_VLAN_BITS   (VNET_BUFFER_F_VLAN_1_DEEP | VNET_BUFFER_F_VLAN_2_DEEP)

Definition at line 89 of file buffer.h.

◆ VNET_REWRITE_TOTAL_BYTES

#define VNET_REWRITE_TOTAL_BYTES   (VLIB_BUFFER_PRE_DATA_SIZE)

Definition at line 407 of file buffer.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
foreach_vnet_buffer_flag 

Definition at line 92 of file buffer.h.

◆ anonymous enum

anonymous enum
Enumerator
foreach_vnet_buffer_flag 

Definition at line 99 of file buffer.h.

◆ vnet_buffer_oflags_t

Enumerator
foreach_vnet_buffer_offload_flag 

Definition at line 118 of file buffer.h.

Function Documentation

◆ STATIC_ASSERT() [1/3]

STATIC_ASSERT ( ((VNET_BUFFER_FLAGS_ALL_AVAIL &VLIB_BUFFER_FLAGS_ALL)==0)  ,
"VLIB / VNET buffer flags overlap"   
)

◆ STATIC_ASSERT() [2/3]

STATIC_ASSERT ( sizeof(vnet_buffer_opaque2_t)<=STRUCT_SIZE_OF(vlib_buffer_t, opaque2)  ,
"VNET buffer opaque2 meta-data too large for vlib_buffer"   
)

◆ STATIC_ASSERT() [3/3]

STATIC_ASSERT ( sizeof(vnet_buffer_opaque_t)<=STRUCT_SIZE_OF(vlib_buffer_t, opaque)  ,
"VNET buffer meta-data too large for vlib_buffer"   
)

◆ vnet_buffer_offload_flags_clear()

static_always_inline void vnet_buffer_offload_flags_clear ( vlib_buffer_t b,
vnet_buffer_oflags_t  oflags 
)

Definition at line 538 of file buffer.h.

+ Here is the caller graph for this function:

◆ vnet_buffer_offload_flags_set()

static_always_inline void vnet_buffer_offload_flags_set ( vlib_buffer_t b,
vnet_buffer_oflags_t  oflags 
)

Definition at line 522 of file buffer.h.

+ Here is the caller graph for this function:

Variable Documentation

◆ format_vnet_buffer

format_function_t format_vnet_buffer

Definition at line 515 of file buffer.h.

◆ format_vnet_buffer_flags

format_function_t format_vnet_buffer_flags

Definition at line 517 of file buffer.h.

◆ format_vnet_buffer_offload

format_function_t format_vnet_buffer_offload

Definition at line 516 of file buffer.h.

◆ format_vnet_buffer_opaque

format_function_t format_vnet_buffer_opaque

Definition at line 518 of file buffer.h.

◆ format_vnet_buffer_opaque2

format_function_t format_vnet_buffer_opaque2

Definition at line 519 of file buffer.h.

◆ it

save_rewrite_length must be aligned so that reass doesn t overwrite it

Definition at line 421 of file buffer.h.

vnet_buffer2
#define vnet_buffer2(b)
Definition: buffer.h:499
map
counters map
Definition: map.api:356
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
ip
vl_api_address_t ip
Definition: l2.api:558