|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
44 sum = (sum & 0xFFFF) + (sum >> 16);
59 sum += clib_host_to_net_u16 (IP_PROTOCOL_UDP);
60 sum += clib_host_to_net_u16 (
length);
64 sum = (sum & 0xFFFF) + (sum >> 16);
67 return ((
u16) (~sum));
74 register const u16 *sp;
91 phu.ph.ph_src =
ip6->src_address;
92 phu.ph.ph_dst =
ip6->dst_address;
93 phu.ph.ph_len = clib_host_to_net_u32 (
len);
94 phu.ph.ph_nxt = IP_PROTOCOL_UDP;
97 for (
i = 0;
i <
sizeof (phu.pa) /
sizeof (phu.pa[0]);
i++)
100 sp = (
const u16 *) up;
102 for (
i = 0;
i < (
len & ~1);
i += 2)
106 sum += clib_host_to_net_u16 ((*(
const u8 *) sp) << 8);
109 sum = (sum & 0xffff) + (sum >> 16);
139 uh->
src_port = clib_host_to_net_u16 (sp);
140 uh->
dst_port = clib_host_to_net_u16 (dp);
141 uh->
length = clib_host_to_net_u16 (udp_len);
152 clib_warning (
"src %U and dst %U IP have different AFI! Discarding!",
195 if (udpsum == (
u16) ~ 0)
201 b->
flags &= ~(VNET_BUFFER_F_IS_IP4 | VNET_BUFFER_F_IS_IP6);
u16 udp_ip4_checksum(const void *b, u32 len, u8 *src, u8 *dst)
void * pkt_push_udp(vlib_main_t *vm, vlib_buffer_t *b, u16 sp, u16 dp)
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.
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.
u16 udp_ip6_checksum(ip6_header_t *ip6, udp_header_t *up, u32 len)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
pool_header_t * ph(void *p)
GDB callable function: ph - call pool_header - get pool header.
void * pkt_push_ip(vlib_main_t *vm, vlib_buffer_t *b, ip_address_t *src, ip_address_t *dst, u32 proto, u8 csum_offload)
#define ip_addr_version(_a)
u8 * format_ip_address(u8 *s, va_list *args)
sll srl srl sll sra u16x4 i
static void * vlib_buffer_push_uninit(vlib_buffer_t *b, u8 size)
Prepend uninitialized data to buffer.
void * pkt_push_udp_and_ip(vlib_main_t *vm, vlib_buffer_t *b, u16 sp, u16 dp, ip_address_t *sip, ip_address_t *dip, u8 csum_offload)
@ LISP_ENCAP_CONTROL_TYPE
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define clib_warning(format, args...)
void * pkt_push_ecm_hdr(vlib_buffer_t *b)
u16 udp_checksum(udp_header_t *uh, u32 udp_len, void *ih, u8 version)
vl_api_address_union_t src_address
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.