|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
44 #define UDP_PG_EDIT_LENGTH (1 << 0)
45 #define UDP_PG_EDIT_CHECKSUM (1 << 1)
54 u32 ip_offset, udp_offset;
57 ip_offset = (g - 1)->start_byte_offset;
59 while (n_packets >= 1)
70 ip0 = (
void *) (p0->
data + ip_offset);
71 udp0 = (
void *) (p0->
data + udp_offset);
75 udp0->
length = clib_host_to_net_u16 (udp_len0);
77 udp_len0 = clib_host_to_net_u16 (udp0->
length);
87 (sum0, clib_host_to_net_u32 (udp_len0 + (ip0->
protocol << 16)));
99 sum0 = sum0 != 0 ? sum0 : 0xffff;
145 #define _(f) pg_edit_init (&p->f, udp_header_t, f);
168 if (!
unformat (input,
"UDP: %U -> %U",
181 else if (
unformat (input,
"checksum %U",
vnet_interface_main_t * im
static void udp_pg_edit_function(pg_main_t *pg, pg_stream_t *s, pg_edit_group_t *g, u32 *packets, u32 n_packets)
vl_api_ip_port_and_mask_t dst_port
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define UDP_PG_EDIT_CHECKSUM
static ip_csum_t ip_incremental_checksum_buffer(vlib_main_t *vm, vlib_buffer_t *first_buffer, u32 first_buffer_offset, u32 n_bytes_to_checksum, ip_csum_t sum)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
uword unformat_pg_number(unformat_input_t *input, va_list *args)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
unformat_function_t * unformat_pg_edit
uword edit_function_opaque
uword unformat_pg_udp_header(unformat_input_t *input, va_list *args)
#define UDP_PG_EDIT_LENGTH
static void * pg_get_edit_group(pg_stream_t *s, u32 group_index)
#define clib_mem_unaligned(pointer, type)
vl_api_ip_port_and_mask_t src_port
static u64 pg_edit_get_value(pg_edit_t *e, int hi_or_lo)
static pg_edit_group_t * pg_stream_get_group(pg_stream_t *s, u32 group_index)
static void pg_free_edit_group(pg_stream_t *s)
uword unformat_pg_edit(unformat_input_t *input, va_list *args)
static tcp_udp_port_info_t * ip_get_tcp_udp_port_info(ip_main_t *im, u32 port)
uword unformat_pg_payload(unformat_input_t *input, va_list *args)
static void udp_pg_edit_function_inline(pg_main_t *pg, pg_stream_t *s, pg_edit_group_t *g, u32 *packets, u32 n_packets, u32 flags)
static void pg_udp_header_init(pg_udp_header_t *p)
static void * pg_create_edit_group(pg_stream_t *s, int n_edit_bytes, int n_packet_bytes, u32 *group_index)
static ip_csum_t ip_csum_with_carry(ip_csum_t sum, ip_csum_t x)
static udp_dst_port_info_t * udp_get_dst_port_info(udp_main_t *um, udp_dst_port_t dst_port, u8 is_ip4)
static vlib_main_t * vlib_get_main(void)
unformat_function_t * unformat_pg_edit
void(* edit_function)(struct pg_main_t *pg, struct pg_stream_t *s, struct pg_edit_group_t *g, u32 *buffers, u32 n_buffers)
static u16 ip_csum_fold(ip_csum_t c)
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags