29 #include "../session/application_interface.h" 32 #define udp_error(n,s) s, 52 s =
format (s,
"UDP_INPUT: connection %d, disposition %d, thread %d",
57 #define foreach_udp_input_next \ 58 _ (DROP, "error-drop") 62 #define _(s, n) UDP_INPUT_NEXT_##s, 84 u32 n_left_from, *from, *to_next;
85 u32 next_index, errors;
92 while (n_left_from > 0)
98 while (n_left_from > 0 && n_left_to_next > 0)
102 u32 next0 = UDP_INPUT_NEXT_DROP;
103 u32 error0 = UDP_ERROR_ENQUEUED;
146 error0 = UDP_ERROR_NO_LISTENER;
162 ASSERT (s0->session_index == new_uc0->c_s_index);
169 s0->thread_index, &s0);
187 child0->c_lcl_port = udp0->
dst_port;
188 child0->c_rmt_port = udp0->
src_port;
189 child0->c_is_ip4 = is_ip4;
195 error0 = UDP_ERROR_CREATE_SESSION;
198 s0 =
session_get (child0->c_s_index, child0->c_thread_index);
202 error0 = UDP_ERROR_LISTENER;
206 error0 = UDP_ERROR_NOT_READY;
214 error0 = UDP_ERROR_FIFO_FULL;
222 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
233 to_next, n_left_to_next,
260 .name =
"udp4-input",
261 .vector_size =
sizeof (
u32),
268 #define _(s, n) [UDP_INPUT_NEXT_##s] = n, 286 .name =
"udp6-input",
287 .vector_size =
sizeof (
u32),
294 #define _(s, n) [UDP_INPUT_NEXT_##s] = n,
struct _transport_connection transport_connection_t
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
transport_connection_t * session_get_transport(stream_session_t *s)
static void session_pool_remove_peeker(u32 thread_index)
vlib_error_t * errors
Vector of errors for this node.
struct _stream_session_t stream_session_t
int session_dgram_connect_notify(transport_connection_t *tc, u32 old_thread_index, stream_session_t **new_session)
Move dgram session to the right thread.
udp_connection_t * udp_connection_alloc(u32 thread_index)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
stream_session_t * session_lookup_safe6(u32 fib_index, ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup session with ip6 and transport layer information.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
int stream_session_accept(transport_connection_t *tc, u32 listener_index, u8 notify)
Accept a stream session.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static stream_session_t * session_get(u32 si, u32 thread_index)
The fine-grained event logger allows lightweight, thread-safe event logging at minimum cost...
#define VLIB_REGISTER_NODE(x,...)
stream_session_t * session_lookup_safe4(u32 fib_index, ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Lookup session with ip4 and transport layer information.
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
int session_enqueue_dgram_connection(stream_session_t *s, vlib_buffer_t *b, u8 proto, u8 queue_event)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static udp_connection_t * udp_conenction_clone_safe(u32 connection_index, u32 thread_index)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
transport_connection_t connection
transport_connection_t * listen_session_get_transport(stream_session_t *s)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
int session_manager_flush_enqueue_events(u8 transport_proto, u32 thread_index)
Flushes queue of sessions that are to be notified of new data enqueued events.
u16 flags
Copy of main node flags.
#define VLIB_NODE_FLAG_TRACE
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.