|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
40 #ifndef included_ip_ip6_inlines_h
41 #define included_ip_ip6_inlines_h
59 ((
ip->protocol == IP_PROTOCOL_TCP)
60 || (
ip->protocol == IP_PROTOCOL_UDP)))
63 tcp = (
void *) (
ip + 1);
65 else if (
ip->protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS)
68 if ((hbh->
protocol == IP_PROTOCOL_TCP) ||
77 t1 = (
ip->src_address.as_u64[0] ^
ip->src_address.as_u64[1]);
78 t1 = (flow_hash_config & IP_FLOW_HASH_SRC_ADDR) ? t1 : 0;
80 t2 = (
ip->dst_address.as_u64[0] ^
ip->dst_address.as_u64[1]);
81 t2 = (flow_hash_config & IP_FLOW_HASH_DST_ADDR) ? t2 : 0;
83 a = (flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ? t2 : t1;
84 b = (flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ? t1 : t2;
86 t1 = is_tcp_udp ? tcp->src : 0;
87 t2 = is_tcp_udp ? tcp->dst : 0;
89 t1 = (flow_hash_config & IP_FLOW_HASH_SRC_PORT) ? t1 : 0;
90 t2 = (flow_hash_config & IP_FLOW_HASH_DST_PORT) ? t2 : 0;
92 if (flow_hash_config & IP_FLOW_HASH_SYMMETRIC)
108 b ^= (flow_hash_config & IP_FLOW_HASH_PROTO) ?
protocol : 0;
109 c = ((flow_hash_config & IP_FLOW_HASH_REVERSE_SRC_DST) ? ((t1 << 16) | t2) :
163 if (find_hdr_type < 0)
167 if (
next_proto == IP_PROTOCOL_IPV6_FRAGMENTATION)
169 ip6_frag_hdr_t *frag_hdr = (ip6_frag_hdr_t *) next_header;
174 exthdr_len =
sizeof (ip6_frag_hdr_t);
175 temp_nxthdr = next_header + exthdr_len;
181 temp_nxthdr = next_header + exthdr_len;
187 temp_nxthdr = next_header + exthdr_len;
189 next_proto = ((ip6_ext_header_t *) next_header)->next_hdr;
190 next_header = temp_nxthdr;
191 cur_offset += exthdr_len;
213 ip6_address_t *
src, ip6_address_t *
dst,
221 ASSERT (flow_label < 1 << 20);
223 clib_host_to_net_u32 ((0x6 << 28) | flow_label);
227 payload_length -=
sizeof (*ip6h);
238 b->
flags |= VNET_BUFFER_F_IS_IP6 | VNET_BUFFER_F_L3_HDR_OFFSET_VALID;
256 ip6_address_t *
src, ip6_address_t *
dst,
int proto)
static_always_inline u32 ip6_flow_label_network_order(const ip6_header_t *ip6)
struct _tcp_header tcp_header_t
static void * vlib_buffer_push_ip6(vlib_main_t *vm, vlib_buffer_t *b, ip6_address_t *src, ip6_address_t *dst, int proto)
Push IPv6 header to buffer.
#define ip6_ext_header_len(p)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 ip_flow_hash_router_id
static void * ip6_next_header(ip6_header_t *i)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
enum flow_hash_config_t_ flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
#define ip6_frag_hdr_offset(hdr)
static int ip6_locate_header(vlib_buffer_t *p0, ip6_header_t *ip0, int find_hdr_type, u32 *offset)
#define ip6_ext_authhdr_len(p)
u16 current_length
Nbytes between current data and the end of this buffer.
static void * vlib_buffer_push_uninit(vlib_buffer_t *b, u8 size)
Prepend uninitialized data to buffer.
template key/value backing page structure
static u8 ip6_ext_hdr(u8 nexthdr)
vl_api_ip_proto_t protocol
vl_api_udp_decap_next_proto_t next_proto
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define hash_mix64(a0, b0, c0)
static void * vlib_buffer_push_ip6_custom(vlib_main_t *vm, vlib_buffer_t *b, ip6_address_t *src, ip6_address_t *dst, int proto, u32 flow_label)
Push IPv6 header to buffer.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.