|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
40 #ifndef included_ip_ip4_inlines_h
41 #define included_ip_ip4_inlines_h
56 uword is_tcp_udp = (
ip->protocol == IP_PROTOCOL_TCP
57 ||
ip->protocol == IP_PROTOCOL_UDP);
59 t1 = (flow_hash_config & IP_FLOW_HASH_SRC_ADDR)
60 ?
ip->src_address.data_u32 : 0;
61 t2 = (flow_hash_config & IP_FLOW_HASH_DST_ADDR)
62 ?
ip->dst_address.data_u32 : 0;
64 a = (flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ? t2 : t1;
65 b = (flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ? t1 : t2;
67 t1 = is_tcp_udp ? tcp->src : 0;
68 t2 = is_tcp_udp ? tcp->dst : 0;
70 t1 = (flow_hash_config & IP_FLOW_HASH_SRC_PORT) ? t1 : 0;
71 t2 = (flow_hash_config & IP_FLOW_HASH_DST_PORT) ? t2 : 0;
73 if (flow_hash_config & IP_FLOW_HASH_SYMMETRIC)
89 b ^= (flow_hash_config & IP_FLOW_HASH_PROTO) ?
ip->protocol : 0;
90 c = (flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ?
91 (t1 << 16) | t2 : (t2 << 16) | t1;
122 b->
flags |= VNET_BUFFER_F_IS_IP4 | VNET_BUFFER_F_L3_HDR_OFFSET_VALID;
struct _tcp_header tcp_header_t
static_always_inline void vnet_buffer_offload_flags_set(vlib_buffer_t *b, vnet_buffer_oflags_t oflags)
static void * vlib_buffer_push_ip4(vlib_main_t *vm, vlib_buffer_t *b, ip4_address_t *src, ip4_address_t *dst, int proto, u8 csum_offload)
Push IPv4 header to buffer.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 ip_flow_hash_router_id
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
enum flow_hash_config_t_ flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
#define hash_v3_finalize32(a, b, c)
static void * vlib_buffer_push_uninit(vlib_buffer_t *b, u8 size)
Prepend uninitialized data to buffer.
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
static u16 ip4_header_checksum(ip4_header_t *i)
static void * vlib_buffer_push_ip4_custom(vlib_main_t *vm, vlib_buffer_t *b, ip4_address_t *src, ip4_address_t *dst, int proto, u8 csum_offload, u8 is_df)
#define hash_v3_mix32(a, b, c)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.