33 pool_get (um->udp_listeners, listener);
35 listener->c_lcl_port = lcl->port;
36 listener->c_lcl_ip4.as_u32 = lcl->ip.ip4.as_u32;
49 pool_get (um->udp_listeners, listener);
50 listener->c_lcl_port = lcl->port;
142 clib_host_to_net_u32 (0x6 << 28);
148 payload_length -=
sizeof (*ip);
181 pool_put_index (um->udp_sessions[my_thread_index], connection_index);
187 u32 uci = va_arg (*args,
u32);
188 u32 thread_index = va_arg (*args,
u32);
194 &u4->c_lcl_ip4, clib_net_to_host_u16 (u4->c_lcl_port),
196 clib_net_to_host_u16 (u4->c_rmt_port));
203 u32 uci = va_arg (*args,
u32);
204 u32 thread_index = va_arg (*args,
u32);
207 &tc->c_lcl_ip6, clib_net_to_host_u16 (tc->c_lcl_port),
209 clib_net_to_host_u16 (tc->c_rmt_port));
216 u32 tci = va_arg (*args,
u32);
219 &tc->c_lcl_ip4, clib_net_to_host_u16 (tc->c_lcl_port),
221 clib_net_to_host_u16 (tc->c_rmt_port));
228 u32 tci = va_arg (*args,
u32);
231 &tc->c_lcl_ip6, clib_net_to_host_u16 (tc->c_lcl_port),
233 clib_net_to_host_u16 (tc->c_rmt_port));
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
int udp_open_connection(transport_endpoint_t *tep)
void session_register_transport(transport_proto_t transport_proto, u8 is_ip4, const transport_proto_vft_t *vft)
Register transport virtual function table.
static udp_connection_t * udp_listener_get(u32 conn_index)
vnet_main_t * vnet_get_main(void)
struct _transport_connection transport_connection_t
static clib_error_t * udp_init(vlib_main_t *vm)
struct _transport_proto_vft transport_proto_vft_t
static const transport_proto_vft_t udp6_proto
transport_connection_t * udp_session_get_listener(u32 listener_index)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
u32 udp_send_space_uri(transport_connection_t *t)
unformat_function_t * unformat_pg_edit
u8 * format_udp_listener_session_ip4(u8 *s, va_list *args)
#define VLIB_INIT_FUNCTION(x)
u16 udp_send_mss_uri(transport_connection_t *t)
#define clib_error_return(e, args...)
u32 udp_session_bind_ip6(u32 session_index, transport_endpoint_t *lcl)
void udp_session_close(u32 connection_index, u32 my_thread_index)
#define vlib_call_init_function(vm, x)
struct _udp_uri_main udp_uri_main_t
u8 * format_udp_session_ip6(u8 *s, va_list *args)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static ip_protocol_info_t * ip_get_protocol_info(ip_main_t *im, u32 protocol)
u16 current_length
Nbytes between current data and the end of this buffer.
format_function_t * format_header
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
clib_error_t * ip_main_init(vlib_main_t *vm)
void udp_unregister_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u8 is_ip4)
#define clib_warning(format, args...)
#define clib_memcpy(a, b, c)
static udp_connection_t * udp_connection_get(u32 conn_index, u32 thread_index)
u32 udp_push_header(transport_connection_t *tconn, vlib_buffer_t *b)
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
#define pool_put_index(p, i)
Free pool element with given index.
u32 udp_session_bind_ip4(u32 session_index, transport_endpoint_t *lcl)
u8 * format_udp_listener_session_ip6(u8 *s, va_list *args)
vlib_node_registration_t udp4_uri_input_node
(constructor) VLIB_REGISTER_NODE (udp4_uri_input_node)
u8 * format_udp_session_ip4(u8 *s, va_list *args)
clib_error_t * ip4_lookup_init(vlib_main_t *vm)
static vlib_main_t * vlib_get_main(void)
udp_uri_main_t udp_uri_main
static const transport_proto_vft_t udp4_proto
transport_connection_t connection
struct _transport_endpoint transport_endpoint_t
static vlib_thread_main_t * vlib_get_thread_main()
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
static clib_error_t * ip6_lookup_init(vlib_main_t *vm)
static udp_uri_main_t * vnet_get_udp_main()
static u16 ip4_header_checksum(ip4_header_t *i)
transport_connection_t * udp_session_get(u32 connection_index, u32 my_thread_index)
u32 udp_session_unbind_ip6(u32 listener_index)
u32 udp_session_unbind_ip4(u32 listener_index)