29 ip46_address_t * ip,
u16 port_number_host_byte_order)
34 pool_get (um->udp_listeners, listener);
36 listener->c_lcl_port = clib_host_to_net_u16 (port_number_host_byte_order);
37 listener->c_lcl_ip4.as_u32 = ip->ip4.as_u32;
38 listener->c_proto = SESSION_TYPE_IP4_UDP;
46 ip46_address_t * ip,
u16 port_number_host_byte_order)
51 pool_get (um->udp_listeners, listener);
52 listener->c_lcl_port = clib_host_to_net_u16 (port_number_host_byte_order);
54 listener->c_proto = SESSION_TYPE_IP6_UDP;
144 clib_host_to_net_u32 (0x6 << 28);
150 payload_length -=
sizeof (*ip);
183 pool_put_index (um->udp_sessions[my_thread_index], connection_index);
189 u32 uci = va_arg (*args,
u32);
190 u32 thread_index = va_arg (*args,
u32);
196 &u4->c_lcl_ip4, clib_net_to_host_u16 (u4->c_lcl_port),
198 clib_net_to_host_u16 (u4->c_rmt_port));
205 u32 uci = va_arg (*args,
u32);
206 u32 thread_index = va_arg (*args,
u32);
209 &tc->c_lcl_ip6, clib_net_to_host_u16 (tc->c_lcl_port),
211 clib_net_to_host_u16 (tc->c_rmt_port));
218 u32 tci = va_arg (*args,
u32);
221 &tc->c_lcl_ip4, clib_net_to_host_u16 (tc->c_lcl_port),
223 clib_net_to_host_u16 (tc->c_rmt_port));
230 u32 tci = va_arg (*args,
u32);
233 &tc->c_lcl_ip6, clib_net_to_host_u16 (tc->c_lcl_port),
235 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) ...
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)
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)
u32 udp_session_bind_ip4(u32 session_index, ip46_address_t *ip, u16 port_number_host_byte_order)
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...)
void udp_session_close(u32 connection_index, u32 my_thread_index)
#define vlib_call_init_function(vm, x)
struct _transport_proto_vft transport_proto_vft_t
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.
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)
void session_register_transport(u8 type, const transport_proto_vft_t *vft)
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
static vlib_thread_main_t * vlib_get_thread_main()
int udp_open_connection(ip46_address_t *addr, u16 port)
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)
u32 udp_session_bind_ip6(u32 session_index, ip46_address_t *ip, u16 port_number_host_byte_order)
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)