15 #ifndef __included_udp_h__ 16 #define __included_udp_h__ 30 #define udp_error(n,s) UDP_ERROR_##n, 36 #define foreach_udp_connection_flag \ 37 _(CONNECTED, "CONNECTED") \ 38 _(OWNS_PORT, "OWNS_PORT") \ 39 _(CLOSING, "CLOSING") \ 41 _(MIGRATED, "MIGRATED") \ 45 #define _(sym, str) UDP_CONN_F_BIT_##sym, 53 #define _(sym, str) UDP_CONN_F_##sym = 1 << UDP_CONN_F_BIT_##sym, 106 u16 *next_by_dst_port4;
133 char *dst_port_name,
u8 is_ip4);
164 return (uc - udp_main.
connections[uc->c_thread_index]);
214 old_c = udp_main.
connections[thread_index] + connection_index;
216 old_c->
flags |= UDP_CONN_F_MIGRATED;
218 new_c->c_thread_index = current_thread_index;
220 new_c->c_fib_index = old_c->c_fib_index;
static udp_connection_t * udp_connection_from_transport(transport_connection_t *tc)
static udp_connection_t * udp_listener_get(u32 conn_index)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
unformat_function_t unformat_udp_header
vl_api_wireguard_peer_flags_t flags
vl_api_ip_port_and_mask_t dst_port
uword * dst_port_info_by_dst_port[N_UDP_AF]
unformat_function_t unformat_udp_port
#define clib_memcpy_fast(a, b, c)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
uword unformat_pg_edit(unformat_input_t *input, va_list *args)
static udp_dst_port_info_t * udp_get_dst_port_info(udp_main_t *um, udp_dst_port_t dst_port, u8 is_ip4)
vlib_node_registration_t udp4_local_node
(constructor) VLIB_REGISTER_NODE (udp4_local_node)
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.
void udp_add_dst_port(udp_main_t *um, udp_dst_port_t dst_port, char *dst_port_name, u8 is_ip4)
void udp_connection_share_port(u16 lcl_port, u8 is_ip4)
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.
static u32 udp_connection_index(udp_connection_t *uc)
format_function_t format_udp_connection
udp_dst_port_info_t * dst_port_infos[N_UDP_AF]
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 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)
format_function_t format_udp_rx_trace
static_always_inline uword vlib_get_thread_index(void)
static udp_connection_t * udp_connection_get(u32 conn_index, u32 thread_index)
struct _transport_connection transport_connection_t
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
clib_spinlock_t * peekers_write_locks
#define foreach_udp_connection_flag
cloned to another thread
enum udp_conn_flags_ udp_conn_flags_t
struct _vlib_node_registration vlib_node_registration_t
vlib_node_registration_t udp6_local_node
(constructor) VLIB_REGISTER_NODE (udp6_local_node)
void udp_connection_free(udp_connection_t *uc)
static udp_connection_t * udp_connection_clone_safe(u32 connection_index, u32 thread_index)
udp_connection_t ** connections
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
format_function_t format_udp_header