|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
52 clib_host_to_net_u16 (lcl_port));
55 clib_host_to_net_u16 (lcl_port));
118 uc->c_proto = TRANSPORT_PROTO_UDP;
177 lcl_port_ho = clib_net_to_host_u16 (lcl->port);
182 return SESSION_E_PORTINUSE;
196 ip_set (&lcl->ip, iface_ip, lcl->is_ip4);
200 listener->c_proto = TRANSPORT_PROTO_UDP;
201 listener->c_s_index = session_index;
202 listener->c_fib_index = lcl->fib_index;
204 listener->flags |= UDP_CONN_F_OWNS_PORT | UDP_CONN_F_LISTEN;
207 listener->flags |= UDP_CONN_F_CONNECTED;
257 b->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
290 uc->
flags |= UDP_CONN_F_CLOSING;
300 if (uc->
flags & UDP_CONN_F_MIGRATED)
329 ip46_address_t lcl_addr;
338 if (
rv != SESSION_E_PORTINUSE)
342 return SESSION_E_PORTINUSE;
346 lcl_port, rmt->port, TRANSPORT_PROTO_UDP,
348 return SESSION_E_PORTINUSE;
361 return SESSION_E_PORTINUSE;
369 return SESSION_E_PORTINUSE;
381 ip_copy (&uc->c_rmt_ip, &rmt->ip, rmt->is_ip4);
382 ip_copy (&uc->c_lcl_ip, &lcl_addr, rmt->is_ip4);
383 uc->c_rmt_port = rmt->port;
384 uc->c_lcl_port = clib_host_to_net_u16 (lcl_port);
385 uc->c_is_ip4 = rmt->is_ip4;
386 uc->c_proto = TRANSPORT_PROTO_UDP;
387 uc->c_fib_index = rmt->fib_index;
389 uc->
flags |= UDP_CONN_F_OWNS_PORT;
392 uc->
flags |= UDP_CONN_F_CONNECTED;
400 return uc->c_c_index;
420 u32 uci = va_arg (*args,
u32);
422 u32 verbose = va_arg (*args,
u32);
432 u32 __clib_unused tci = va_arg (*args,
u32);
441 u32 tci = va_arg (*args,
u32);
443 u32 verbose = va_arg (*args,
u32);
463 .transport_options = {
510 for (
i = 0;
i < num_threads;
i++)
528 .runs_after =
VLIB_INITS(
"ip_main_init",
"ip4_lookup_init",
static void clib_spinlock_init(clib_spinlock_t *p)
vlib_node_registration_t ip4_lookup_node
(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)
vnet_interface_main_t * im
int transport_alloc_local_endpoint(u8 proto, transport_endpoint_cfg_t *rmt_cfg, ip46_address_t *lcl_addr, u16 *lcl_port)
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
static udp_connection_t * udp_listener_get(u32 conn_index)
vlib_node_registration_t udp6_local_node
(constructor) VLIB_REGISTER_NODE (udp6_local_node)
static u32 udp_push_header(transport_connection_t *tc, vlib_buffer_t *b)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
static void * vlib_buffer_push_udp(vlib_buffer_t *b, u16 sp, u16 dp, u8 offload_csum)
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
static u8 * format_udp_listener_session(u8 *s, va_list *args)
void udp_add_dst_port(udp_main_t *um, udp_dst_port_t dst_port, char *dst_port_name, u8 is_ip4)
static u16 udp_default_mtu(udp_main_t *um, u8 is_ip4)
static transport_connection_t * udp_session_get(u32 connection_index, u32 thread_index)
void udp_connection_free(udp_connection_t *uc)
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 void udp_session_close(u32 connection_index, u32 thread_index)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
static ip_protocol_info_t * ip_get_protocol_info(ip_main_t *im, u32 protocol)
#define clib_error_return(e, args...)
format_function_t * format_header
static clib_error_t * udp_init(vlib_main_t *vm)
struct _transport_proto_vft transport_proto_vft_t
static void udp_connection_unregister_port(u16 lcl_port, u8 is_ip4)
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_node_registration_t udp4_input_node
(constructor) VLIB_REGISTER_NODE (udp4_input_node)
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.
u32 local_to_input_edge[N_UDP_AF]
static transport_connection_t * udp_session_get_listener(u32 listener_index)
struct _transport_connection transport_connection_t
static transport_connection_t * udp_session_get_half_open(u32 conn_index)
vlib_node_registration_t udp4_local_node
(constructor) VLIB_REGISTER_NODE (udp4_local_node)
vlib_node_registration_t ip6_lookup_node
(constructor) VLIB_REGISTER_NODE (ip6_lookup_node)
clib_spinlock_t * peekers_readers_locks
static u32 udp_session_bind(u32 session_index, transport_endpoint_t *lcl)
#define pool_get_aligned_will_expand(P, YESNO, A)
See if pool_get will expand the pool or not.
void udp_connection_share_port(u16 lcl_port, u8 is_ip4)
static void udp_connection_cleanup(udp_connection_t *uc)
@ TRANSPORT_CONNECTION_F_CLESS
Connection is "connection less".
void * ip_interface_get_first_ip(u32 sw_if_index, u8 is_ip4)
static udp_connection_t * udp_connection_get(u32 conn_index, u32 thread_index)
#define sparse_vec_validate(v, i)
#define ENDPOINT_INVALID_INDEX
udp_connection_t * listener_pool
static const transport_proto_vft_t udp_proto
static u32 transport_max_tx_dequeue(transport_connection_t *tc)
static u32 transport_cl_thread(void)
sll srl srl sll sra u16x4 i
static void clib_spinlock_free(clib_spinlock_t *p)
@ TRANSPORT_CFG_F_CONNECTED
void udp_unregister_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u8 is_ip4)
static int udp_session_send_params(transport_connection_t *tconn, transport_send_params_t *sp)
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 pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
u8 udp_is_valid_dst_port(udp_dst_port_t dst_port, u8 is_ip4)
transport_connection_t * session_lookup_connection(u32 fib_index, ip46_address_t *lcl, ip46_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto, u8 is_ip4)
static u8 * format_udp_half_open_session(u8 *s, va_list *args)
static u32 udp_session_unbind(u32 listener_index)
#define clib_atomic_fetch_add_rel(a, b)
#define CLIB_CACHE_LINE_BYTES
void session_transport_delete_notify(transport_connection_t *tc)
Notification from transport that connection is being deleted.
void udp_connection_delete(udp_connection_t *uc)
#define clib_atomic_sub_fetch(a, b)
void transport_share_local_endpoint(u8 proto, ip46_address_t *lcl_ip, u16 port)
format_function_t format_udp_connection
@ TRANSPORT_TX_DGRAM
datagram mode
description fragment has unexpected format
#define VLIB_INIT_FUNCTION(x)
void ip_copy(ip46_address_t *dst, ip46_address_t *src, u8 is_ip4)
vlib_node_registration_t udp6_input_node
(constructor) VLIB_REGISTER_NODE (udp6_input_node)
static void udp_connection_register_port(vlib_main_t *vm, u16 lcl_port, u8 is_ip4)
@ TRANSPORT_SERVICE_CL
connectionless service
void transport_endpoint_cleanup(u8 proto, ip46_address_t *lcl_ip, u16 port)
static udp_dst_port_info_t * udp_get_dst_port_info(udp_main_t *um, udp_dst_port_t dst_port, u8 is_ip4)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
udp_connection_t * udp_connection_alloc(u32 thread_index)
static void udp_session_cleanup(u32 connection_index, u32 thread_index)
static vlib_main_t * vlib_get_main(void)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static u8 udp_connection_port_used_extern(u16 lcl_port, u8 is_ip4)
clib_spinlock_t rx_lock
rx fifo lock
static int udp_open_connection(transport_endpoint_cfg_t *rmt)
transport_snd_flags_t flags
#define clib_warning(format, args...)
transport_connection_t connection
must be first
static void * vlib_buffer_push_ip4_custom(vlib_main_t *vm, vlib_buffer_t *b, ip4_address_t *src, ip4_address_t *dst, int proto, u8 csum_offload, u8 is_df)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
static vlib_thread_main_t * vlib_get_thread_main()
unformat_function_t * unformat_pg_edit
udp_connection_t ** connections
clib_spinlock_t * peekers_write_locks
static u8 * format_udp_session(u8 *s, va_list *args)
static udp_main_t * vnet_get_udp_main()
static udp_connection_t * udp_connection_from_transport(transport_connection_t *tc)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
u8 ip_is_zero(ip46_address_t *ip46_address, u8 is_ip4)