52 uc->c_thread_index = thread_index;
83 listener->c_lcl_port = lcl->port;
91 ip_set (&lcl->ip, iface_ip, lcl->is_ip4);
93 ip_copy (&listener->c_lcl_ip, &lcl->ip, lcl->is_ip4);
94 listener->c_is_ip4 = lcl->is_ip4;
96 listener->c_s_index = session_index;
97 listener->c_fib_index = lcl->fib_index;
103 return listener->c_c_index;
148 b->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
194 s =
format (s,
"[#%d][%s] %U:%d->%U:%d", uc->c_thread_index,
"U",
197 &uc->c_rmt_ip4, clib_net_to_host_u16 (uc->c_rmt_port));
199 s =
format (s,
"[#%d][%s] %U:%d->%U:%d", uc->c_thread_index,
"U",
202 &uc->c_rmt_ip6, clib_net_to_host_u16 (uc->c_rmt_port));
210 u32 verbose = va_arg (*args,
u32);
217 s =
format (s,
"%-15s\n",
"-");
227 u32 uci = va_arg (*args,
u32);
228 u32 thread_index = va_arg (*args,
u32);
229 u32 verbose = va_arg (*args,
u32);
246 u32 tci = va_arg (*args,
u32);
272 ip46_address_t lcl_addr;
298 ip_copy (&uc->c_rmt_ip, &rmt->ip, rmt->is_ip4);
299 ip_copy (&uc->c_lcl_ip, &lcl_addr, rmt->is_ip4);
300 uc->c_rmt_port = rmt->port;
301 uc->c_lcl_port = clib_host_to_net_u16 (lcl_port);
302 uc->c_is_ip4 = rmt->is_ip4;
304 uc->c_fib_index = rmt->fib_index;
306 return uc->c_c_index;
436 for (i = 0; i < num_threads; i++)
500 .path =
"show udp punt",
501 .short_help =
"show udp punt [ipv4|ipv6]",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static clib_error_t * show_udp_punt_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
void udp_session_cleanup(u32 connection_index, u32 thread_index)
#define ENDPOINT_INVALID_INDEX
static udp_connection_t * udp_listener_get(u32 conn_index)
u8 * format_udp_session(u8 *s, va_list *args)
void ip_copy(ip46_address_t *dst, ip46_address_t *src, u8 is_ip4)
static clib_error_t * ip4_lookup_init(vlib_main_t *vm)
static udp_connection_t * udp_get_connection_from_transport(transport_connection_t *tc)
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
void session_transport_delete_notify(transport_connection_t *tc)
Notification from transport that connection is being deleted.
static clib_error_t * udp_init(vlib_main_t *vm)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
transport_connection_t * udp_session_get_half_open(u32 conn_index)
#define pool_get_aligned_will_expand(P, YESNO, A)
See if pool_get will expand the pool or not.
static udp_dst_port_info_t * udp_get_dst_port_info(udp_main_t *um, udp_dst_port_t dst_port, u8 is_ip4)
int udp_open_connection(transport_endpoint_cfg_t *rmt)
transport_connection_t * udp_session_get_listener(u32 listener_index)
void * ip_interface_get_first_ip(u32 sw_if_index, u8 is_ip4)
u32 udp_push_header(transport_connection_t *tc, vlib_buffer_t *b)
static void * vlib_buffer_push_udp(vlib_buffer_t *b, u16 sp, u16 dp, u8 offload_csum)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static udp_main_t * vnet_get_udp_main()
vlib_node_registration_t ip4_lookup_node
(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)
unformat_function_t * unformat_pg_edit
void udp_connection_free(udp_connection_t *uc)
int udpc_connection_open(transport_endpoint_cfg_t *rmt)
#define VLIB_INIT_FUNCTION(x)
u32 udp_session_bind(u32 session_index, transport_endpoint_t *lcl)
#define clib_error_return(e, args...)
int transport_alloc_local_endpoint(u8 proto, transport_endpoint_cfg_t *rmt_cfg, ip46_address_t *lcl_addr, u16 *lcl_port)
static const transport_proto_vft_t udpc_proto
#define vlib_call_init_function(vm, x)
struct _transport_proto_vft transport_proto_vft_t
static void clib_spinlock_init(clib_spinlock_t *p)
vlib_node_registration_t udp4_input_node
(constructor) VLIB_REGISTER_NODE (udp4_input_node)
static ip_protocol_info_t * ip_get_protocol_info(ip_main_t *im, u32 protocol)
format_function_t * format_header
u32 udp_session_unbind(u32 listener_index)
udp_dst_port_info_t * dst_port_infos[N_UDP_AF]
udp_connection_t * udp_connection_alloc(u32 thread_index)
clib_spinlock_t * peekers_readers_locks
#define pool_put(P, E)
Free an object E in pool P.
vlib_node_registration_t udp6_input_node
(constructor) VLIB_REGISTER_NODE (udp6_input_node)
udp_connection_t * listener_pool
u16 udp_send_mss(transport_connection_t *t)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
clib_error_t * ip_main_init(vlib_main_t *vm)
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_warning(format, args...)
static udp_connection_t * udp_connection_get(u32 conn_index, u32 thread_index)
struct _transport_connection transport_connection_t
void transport_register_protocol(transport_proto_t transport_proto, const transport_proto_vft_t *vft, fib_protocol_t fib_proto, u32 output_node)
Register transport virtual function table.
#define VLIB_CLI_COMMAND(x,...)
vlib_node_registration_t ip6_lookup_node
(constructor) VLIB_REGISTER_NODE (ip6_lookup_node)
clib_spinlock_t * peekers_write_locks
static vlib_main_t * vlib_get_main(void)
u8 * format_udp_connection(u8 *s, va_list *args)
u8 ip_is_zero(ip46_address_t *ip46_address, u8 is_ip4)
u32 udpc_connection_listen(u32 session_index, transport_endpoint_t *lcl)
static const transport_proto_vft_t udp_proto
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.
transport_connection_t connection
must be first
clib_spinlock_t rx_lock
rx fifo lock
bool udp_is_valid_dst_port(udp_dst_port_t dst_port, u8 is_ip4)
void udp_session_close(u32 connection_index, u32 thread_index)
VLIB buffer representation.
u8 * format_udp_half_open_session(u8 *s, va_list *args)
u8 * format_udp_connection_id(u8 *s, va_list *args)
unreliable transport protos
transport_connection_t * udp_session_get(u32 connection_index, u32 thread_index)
static vlib_thread_main_t * vlib_get_thread_main()
static u32 vlib_num_workers()
#define vec_foreach(var, vec)
Vector iterator.
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
int transport_alloc_local_port(u8 proto, ip46_address_t *ip)
Allocate local port and add if successful add entry to local endpoint table to mark the pair as used...
static clib_error_t * ip6_lookup_init(vlib_main_t *vm)
#define CLIB_CACHE_LINE_BYTES
u32 udp_send_space(transport_connection_t *t)
udp_connection_t ** connections
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
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.
u8 is_connected
connected mode
u8 * format_udp_listener_session(u8 *s, va_list *args)