15 #ifndef __included_udp_h__ 16 #define __included_udp_h__ 31 #define udp_error(n,s) UDP_ERROR_##n, 46 #define foreach_udp4_dst_port \ 48 _ (67, dhcp_to_server) \ 49 _ (68, dhcp_to_client) \ 65 #define foreach_udp6_dst_port \ 67 _ (547, dhcpv6_to_server) \ 68 _ (546, dhcpv6_to_client) \ 74 _ (4790, VXLAN6_GPE) \ 82 #define _(n,f) UDP_DST_PORT_##f = n, 89 #define _(n,f) UDP6_DST_PORT_##f = n, 175 return (uc - udp_main.
connections[uc->c_thread_index]);
224 old_c = udp_main.
connections[thread_index] + connection_index;
227 new_c->c_thread_index = current_thread_index;
246 u32 node_index,
u8 is_ip4);
264 b->
flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
359 ASSERT (_vec_len (ec0) == _vec_len (ec1));
368 u16 old_l0 = 0, old_l1 = 0;
static udp_connection_t * udp_listener_get(u32 conn_index)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
unformat_function_t unformat_udp_header
struct _transport_connection transport_connection_t
uword * dst_port_info_by_dst_port[N_UDP_AF]
static udp_connection_t * udp_get_connection_from_transport(transport_connection_t *tc)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
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 void * vlib_buffer_push_udp(vlib_buffer_t *b, u16 sp, u16 dp, u8 offload_csum)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static udp_main_t * vnet_get_udp_main()
udp_connection_t * udp_connection_alloc(u32 thread_index)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define foreach_udp6_dst_port
static void udp_pool_remove_peeker(u32 thread_index)
vlib_node_registration_t udp4_input_node
(constructor) VLIB_REGISTER_NODE (udp4_input_node)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u16 current_length
Nbytes between current data and the end of this buffer.
static u32 udp_connection_index(udp_connection_t *uc)
udp_dst_port_info_t * dst_port_infos[N_UDP_AF]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
clib_spinlock_t * peekers_readers_locks
vlib_node_registration_t udp6_input_node
(constructor) VLIB_REGISTER_NODE (udp6_input_node)
udp_connection_t * listener_pool
static void ip_udp_encap_one(vlib_main_t *vm, vlib_buffer_t *b0, u8 *ec0, word ec_len, u8 is_ip4)
static void udp_pool_add_peeker(u32 thread_index)
Acquires a lock that blocks a connection pool from expanding.
void udp_punt_unknown(vlib_main_t *vm, u8 is_ip4, u8 is_add)
static void ip_udp_fixup_one(vlib_main_t *vm, vlib_buffer_t *b0, u8 is_ip4)
format_function_t format_udp_rx_trace
static void ip_udp_encap_two(vlib_main_t *vm, vlib_buffer_t *b0, vlib_buffer_t *b1, u8 *ec0, u8 *ec1, word ec_len, u8 is_v4)
static_always_inline uword vlib_get_thread_index(void)
void udp_unregister_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u8 is_ip4)
#define clib_memcpy(a, b, c)
static udp_connection_t * udp_connection_get(u32 conn_index, u32 thread_index)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
#define foreach_udp4_dst_port
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static udp_connection_t * udp_conenction_clone_safe(u32 connection_index, u32 thread_index)
clib_spinlock_t * peekers_write_locks
struct _vlib_node_registration vlib_node_registration_t
static void * vlib_buffer_push_uninit(vlib_buffer_t *b, u8 size)
Prepend uninitialized data to buffer.
transport_connection_t connection
#define ip_csum_update(sum, old, new, type, field)
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
udp_connection_t ** connections
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
static u16 ip_csum_fold(ip_csum_t c)
format_function_t format_udp_header