FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
session.c File Reference

Session and session manager. More...

+ Include dependency graph for session.c:

Go to the source code of this file.

Typedefs

typedef struct _session_switch_pool_args session_switch_pool_args_t
 
typedef int(* session_open_service_fn) (session_endpoint_cfg_t *, session_handle_t *)
 

Functions

static int session_send_evt_to_thread (void *data, void *args, u32 thread_index, session_evt_type_t evt_type)
 
int session_send_io_evt_to_thread (svm_fifo_t *f, session_evt_type_t evt_type)
 
int session_send_io_evt_to_thread_custom (void *data, u32 thread_index, session_evt_type_t evt_type)
 
int session_send_ctrl_evt_to_thread (session_t *s, session_evt_type_t evt_type)
 
void session_send_rpc_evt_to_thread_force (u32 thread_index, void *fp, void *rpc_args)
 
void session_send_rpc_evt_to_thread (u32 thread_index, void *fp, void *rpc_args)
 
void session_add_self_custom_tx_evt (transport_connection_t *tc, u8 has_prio)
 
void sesssion_reschedule_tx (transport_connection_t *tc)
 
static void session_program_transport_ctrl_evt (session_t *s, session_evt_type_t evt)
 
session_tsession_alloc (u32 thread_index)
 
void session_free (session_t *s)
 
u8 session_is_valid (u32 si, u8 thread_index)
 
static void session_cleanup_notify (session_t *s, session_cleanup_ntf_t ntf)
 
void session_free_w_fifos (session_t *s)
 
static void session_delete (session_t *s)
 Cleans up session and lookup table. More...
 
void session_cleanup_half_open (session_handle_t ho_handle)
 
static void session_half_open_free (session_t *ho)
 
static void session_half_open_free_rpc (void *args)
 
void session_half_open_delete_notify (transport_connection_t *tc)
 
void session_half_open_migrate_notify (transport_connection_t *tc)
 
int session_half_open_migrated_notify (transport_connection_t *tc)
 
session_tsession_alloc_for_connection (transport_connection_t *tc)
 
session_tsession_alloc_for_half_open (transport_connection_t *tc)
 
static void session_enqueue_discard_chain_bytes (vlib_main_t *vm, vlib_buffer_t *b, vlib_buffer_t **chain_b, u32 n_bytes_to_drop)
 Discards bytes from buffer chain. More...
 
static int session_enqueue_chain_tail (session_t *s, vlib_buffer_t *b, u32 offset, u8 is_in_order)
 Enqueue buffer chain tail. More...
 
void session_fifo_tuning (session_t *s, svm_fifo_t *f, session_ft_action_t act, u32 len)
 
int session_enqueue_stream_connection (transport_connection_t *tc, vlib_buffer_t *b, u32 offset, u8 queue_event, u8 is_in_order)
 
int session_enqueue_dgram_connection (session_t *s, session_dgram_hdr_t *hdr, vlib_buffer_t *b, u8 proto, u8 queue_event)
 
int session_tx_fifo_peek_bytes (transport_connection_t *tc, u8 *buffer, u32 offset, u32 max_bytes)
 
u32 session_tx_fifo_dequeue_drop (transport_connection_t *tc, u32 max_bytes)
 
static int session_notify_subscribers (u32 app_index, session_t *s, svm_fifo_t *f, session_evt_type_t evt_type)
 
static int session_enqueue_notify_inline (session_t *s)
 Notify session peer that new data has been enqueued. More...
 
int session_enqueue_notify (session_t *s)
 
static void session_enqueue_notify_rpc (void *arg)
 
void session_enqueue_notify_thread (session_handle_t sh)
 Like session_enqueue_notify, but can be called from a thread that does not own the session. More...
 
int session_dequeue_notify (session_t *s)
 
int session_main_flush_enqueue_events (u8 transport_proto, u32 thread_index)
 Flushes queue of sessions that are to be notified of new data enqueued events. More...
 
int session_main_flush_all_enqueue_events (u8 transport_proto)
 
int session_stream_connect_notify (transport_connection_t *tc, session_error_t err)
 
static void session_switch_pool_reply (void *arg)
 
static void session_switch_pool (void *cb_args)
 Notify old thread of the session pool switch. More...
 
int session_dgram_connect_notify (transport_connection_t *tc, u32 old_thread_index, session_t **new_session)
 Move dgram session to the right thread. More...
 
void session_transport_closing_notify (transport_connection_t *tc)
 Notification from transport that connection is being closed. More...
 
void session_transport_delete_notify (transport_connection_t *tc)
 Notification from transport that connection is being deleted. More...
 
void session_transport_closed_notify (transport_connection_t *tc)
 Notification from transport that it is closed. More...
 
void session_transport_reset_notify (transport_connection_t *tc)
 Notify application that connection has been reset. More...
 
int session_stream_accept_notify (transport_connection_t *tc)
 
int session_stream_accept (transport_connection_t *tc, u32 listener_index, u32 thread_index, u8 notify)
 Accept a stream session. More...
 
int session_dgram_accept (transport_connection_t *tc, u32 listener_index, u32 thread_index)
 
int session_open_cl (session_endpoint_cfg_t *rmt, session_handle_t *rsh)
 
int session_open_vc (session_endpoint_cfg_t *rmt, session_handle_t *rsh)
 
int session_open_app (session_endpoint_cfg_t *rmt, session_handle_t *rsh)
 
int session_open (session_endpoint_cfg_t *rmt, session_handle_t *rsh)
 Ask transport to open connection to remote transport endpoint. More...
 
int session_listen (session_t *ls, session_endpoint_cfg_t *sep)
 Ask transport to listen on session endpoint. More...
 
int session_stop_listen (session_t *s)
 Ask transport to stop listening on local transport endpoint. More...
 
void session_half_close (session_t *s)
 Initialize session half-closing procedure. More...
 
void session_close (session_t *s)
 Initialize session closing procedure. More...
 
void session_reset (session_t *s)
 Force a close without waiting for data to be flushed. More...
 
void session_transport_half_close (session_t *s)
 Notify transport the session can be half-disconnected. More...
 
void session_transport_close (session_t *s)
 Notify transport the session can be disconnected. More...
 
void session_transport_reset (session_t *s)
 Force transport close. More...
 
void session_transport_cleanup (session_t *s)
 Cleanup transport and session state. More...
 
void session_vpp_event_queues_allocate (session_main_t *smm)
 Allocate event queues in the shared-memory segment. More...
 
fifo_segment_tsession_main_get_evt_q_segment (void)
 
u64 session_segment_handle (session_t *s)
 
void session_register_transport (transport_proto_t transport_proto, const transport_proto_vft_t *vft, u8 is_ip4, u32 output_node)
 Initialize session layer for given transport proto and ip version. More...
 
transport_proto_t session_add_transport_proto (void)
 
transport_connection_tsession_get_transport (session_t *s)
 
void session_get_endpoint (session_t *s, transport_endpoint_t *tep, u8 is_lcl)
 
int session_transport_attribute (session_t *s, u8 is_get, transport_endpt_attr_t *attr)
 
transport_connection_tlisten_session_get_transport (session_t *s)
 
void session_queue_run_on_main_thread (vlib_main_t *vm)
 
static clib_error_tsession_manager_main_enable (vlib_main_t *vm)
 
static void session_manager_main_disable (vlib_main_t *vm)
 
void session_node_enable_disable (u8 is_en)
 
clib_error_tvnet_session_enable_disable (vlib_main_t *vm, u8 is_en)
 
clib_error_tsession_main_init (vlib_main_t *vm)
 
static clib_error_tsession_main_loop_init (vlib_main_t *vm)
 
static clib_error_tsession_config_fn (vlib_main_t *vm, unformat_input_t *input)
 

Variables

session_main_t session_main
 
static session_open_service_fn session_open_srv_fns [TRANSPORT_N_SERVICES]
 
static session_fifo_rx_fnsession_tx_fns [TRANSPORT_TX_N_FNS]
 

Detailed Description

Session and session manager.

Definition in file session.c.

Typedef Documentation

◆ session_open_service_fn

typedef int(* session_open_service_fn) (session_endpoint_cfg_t *, session_handle_t *)

Definition at line 1382 of file session.c.

◆ session_switch_pool_args_t

typedef struct _session_switch_pool_args session_switch_pool_args_t

Function Documentation

◆ listen_session_get_transport()

transport_connection_t* listen_session_get_transport ( session_t s)

Definition at line 1778 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_add_self_custom_tx_evt()

void session_add_self_custom_tx_evt ( transport_connection_t tc,
u8  has_prio 
)

Definition at line 128 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_add_transport_proto()

transport_proto_t session_add_transport_proto ( void  )

Definition at line 1725 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_alloc()

session_t* session_alloc ( u32  thread_index)

Definition at line 201 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_alloc_for_connection()

session_t* session_alloc_for_connection ( transport_connection_t tc)

Definition at line 392 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_alloc_for_half_open()

session_t* session_alloc_for_half_open ( transport_connection_t tc)

Definition at line 411 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_cleanup_half_open()

void session_cleanup_half_open ( session_handle_t  ho_handle)

Definition at line 304 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_cleanup_notify()

static void session_cleanup_notify ( session_t s,
session_cleanup_ntf_t  ntf 
)
static

Definition at line 268 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_close()

void session_close ( session_t s)

Initialize session closing procedure.

Request is always sent to session node to ensure that all outstanding requests are served before transport is notified.

Definition at line 1494 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_config_fn()

static clib_error_t* session_config_fn ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 1988 of file session.c.

+ Here is the call graph for this function:

◆ session_delete()

static void session_delete ( session_t s)
static

Cleans up session and lookup table.

Transport connection must still be valid.

Definition at line 292 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_dequeue_notify()

int session_dequeue_notify ( session_t s)

Definition at line 816 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_dgram_accept()

int session_dgram_accept ( transport_connection_t tc,
u32  listener_index,
u32  thread_index 
)

Definition at line 1263 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_dgram_connect_notify()

int session_dgram_connect_notify ( transport_connection_t tc,
u32  old_thread_index,
session_t **  new_session 
)

Move dgram session to the right thread.

Definition at line 1008 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_enqueue_chain_tail()

static int session_enqueue_chain_tail ( session_t s,
vlib_buffer_t b,
u32  offset,
u8  is_in_order 
)
inlinestatic

Enqueue buffer chain tail.

Definition at line 459 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_enqueue_dgram_connection()

int session_enqueue_dgram_connection ( session_t s,
session_dgram_hdr_t hdr,
vlib_buffer_t b,
u8  proto,
u8  queue_event 
)

Definition at line 619 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_enqueue_discard_chain_bytes()

static void session_enqueue_discard_chain_bytes ( vlib_main_t vm,
vlib_buffer_t b,
vlib_buffer_t **  chain_b,
u32  n_bytes_to_drop 
)
inlinestatic

Discards bytes from buffer chain.

It discards n_bytes_to_drop starting at first buffer after chain_b

Definition at line 428 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_enqueue_notify()

int session_enqueue_notify ( session_t s)

Definition at line 778 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_enqueue_notify_inline()

static int session_enqueue_notify_inline ( session_t s)
inlinestatic

Notify session peer that new data has been enqueued.

Parameters
sStream session for which the event is to be generated.
lockFlag to indicate if call should lock message queue.
Returns
0 on success or negative number if failed to send notification.

Definition at line 739 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_enqueue_notify_rpc()

static void session_enqueue_notify_rpc ( void *  arg)
static

Definition at line 784 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_enqueue_notify_thread()

void session_enqueue_notify_thread ( session_handle_t  sh)

Like session_enqueue_notify, but can be called from a thread that does not own the session.

Definition at line 801 of file session.c.

+ Here is the call graph for this function:

◆ session_enqueue_stream_connection()

int session_enqueue_stream_connection ( transport_connection_t tc,
vlib_buffer_t b,
u32  offset,
u8  queue_event,
u8  is_in_order 
)

Definition at line 564 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_fifo_tuning()

void session_fifo_tuning ( session_t s,
svm_fifo_t f,
session_ft_action_t  act,
u32  len 
)

Definition at line 532 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_free()

void session_free ( session_t s)

Definition at line 227 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_free_w_fifos()

void session_free_w_fifos ( session_t s)

Definition at line 279 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_get_endpoint()

void session_get_endpoint ( session_t s,
transport_endpoint_t tep,
u8  is_lcl 
)

Definition at line 1754 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_get_transport()

transport_connection_t* session_get_transport ( session_t s)

Definition at line 1743 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_half_close()

void session_half_close ( session_t s)

Initialize session half-closing procedure.

Note that half-closing will not change the state of the session.

Definition at line 1479 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_half_open_delete_notify()

void session_half_open_delete_notify ( transport_connection_t tc)

Definition at line 347 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_half_open_free()

static void session_half_open_free ( session_t ho)
static

Definition at line 329 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_half_open_free_rpc()

static void session_half_open_free_rpc ( void *  args)
static

Definition at line 340 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_half_open_migrate_notify()

void session_half_open_migrate_notify ( transport_connection_t tc)

Definition at line 363 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_half_open_migrated_notify()

int session_half_open_migrated_notify ( transport_connection_t tc)

Definition at line 373 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_is_valid()

u8 session_is_valid ( u32  si,
u8  thread_index 
)

Definition at line 241 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_listen()

int session_listen ( session_t ls,
session_endpoint_cfg_t sep 
)

Ask transport to listen on session endpoint.

Parameters
sSession for which listen will be called. Note that unlike established sessions, listen sessions are not associated to a thread.
sepLocal endpoint to be listened on.

Definition at line 1423 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_main_flush_all_enqueue_events()

int session_main_flush_all_enqueue_events ( u8  transport_proto)

Definition at line 878 of file session.c.

+ Here is the call graph for this function:

◆ session_main_flush_enqueue_events()

int session_main_flush_enqueue_events ( u8  transport_proto,
u32  thread_index 
)

Flushes queue of sessions that are to be notified of new data enqueued events.

Parameters
thread_indexThread index for which the flush is to be performed.
Returns
0 on success or a positive number indicating the number of failures due to API queue being full.

Definition at line 846 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_main_get_evt_q_segment()

fifo_segment_t* session_main_get_evt_q_segment ( void  )

Definition at line 1674 of file session.c.

+ Here is the caller graph for this function:

◆ session_main_init()

clib_error_t* session_main_init ( vlib_main_t vm)

Definition at line 1947 of file session.c.

◆ session_main_loop_init()

static clib_error_t* session_main_loop_init ( vlib_main_t vm)
static

Definition at line 1972 of file session.c.

+ Here is the call graph for this function:

◆ session_manager_main_disable()

static void session_manager_main_disable ( vlib_main_t vm)
static

Definition at line 1877 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_manager_main_enable()

static clib_error_t* session_manager_main_enable ( vlib_main_t vm)
static

Definition at line 1792 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_node_enable_disable()

void session_node_enable_disable ( u8  is_en)

Definition at line 1883 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_notify_subscribers()

static int session_notify_subscribers ( u32  app_index,
session_t s,
svm_fifo_t f,
session_evt_type_t  evt_type 
)
inlinestatic

Definition at line 707 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_open()

int session_open ( session_endpoint_cfg_t rmt,
session_handle_t rsh 
)

Ask transport to open connection to remote transport endpoint.

Stores handle for matching request with reply since the call can be asynchronous. For instance, for TCP the 3-way handshake must complete before reply comes. Session is only created once connection is established.

Parameters
app_indexIndex of the application requesting the connect
stSession type requested.
tepRemote transport endpoint
opaqueOpaque data (typically, api_context) the application expects on open completion.

Definition at line 1407 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_open_app()

int session_open_app ( session_endpoint_cfg_t rmt,
session_handle_t rsh 
)

Definition at line 1373 of file session.c.

+ Here is the call graph for this function:

◆ session_open_cl()

int session_open_cl ( session_endpoint_cfg_t rmt,
session_handle_t rsh 
)

Definition at line 1294 of file session.c.

+ Here is the call graph for this function:

◆ session_open_vc()

int session_open_vc ( session_endpoint_cfg_t rmt,
session_handle_t rsh 
)

Definition at line 1332 of file session.c.

+ Here is the call graph for this function:

◆ session_program_transport_ctrl_evt()

static void session_program_transport_ctrl_evt ( session_t s,
session_evt_type_t  evt 
)
static

Definition at line 177 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_queue_run_on_main_thread()

void session_queue_run_on_main_thread ( vlib_main_t vm)

Definition at line 1785 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_register_transport()

void session_register_transport ( transport_proto_t  transport_proto,
const transport_proto_vft_t vft,
u8  is_ip4,
u32  output_node 
)

Initialize session layer for given transport proto and ip version.

Allocates per session type (transport proto + ip version) data structures and adds arc from session queue node to session type output node.

Parameters
transport_prototransport proto to be registered
vftvirtual function table for transport
is_ip4flag that indicates if transports uses ipv4 as underlying network layer
output_nodeoutput node for transport

Definition at line 1702 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_reset()

void session_reset ( session_t s)

Force a close without waiting for data to be flushed.

Definition at line 1517 of file session.c.

+ Here is the call graph for this function:

◆ session_segment_handle()

u64 session_segment_handle ( session_t s)

Definition at line 1680 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_send_ctrl_evt_to_thread()

int session_send_ctrl_evt_to_thread ( session_t s,
session_evt_type_t  evt_type 
)

Definition at line 98 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_send_evt_to_thread()

static int session_send_evt_to_thread ( void *  data,
void *  args,
u32  thread_index,
session_evt_type_t  evt_type 
)
inlinestatic

Definition at line 28 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_send_io_evt_to_thread()

int session_send_io_evt_to_thread ( svm_fifo_t f,
session_evt_type_t  evt_type 
)

Definition at line 84 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_send_io_evt_to_thread_custom()

int session_send_io_evt_to_thread_custom ( void *  data,
u32  thread_index,
session_evt_type_t  evt_type 
)

Definition at line 91 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_send_rpc_evt_to_thread()

void session_send_rpc_evt_to_thread ( u32  thread_index,
void *  fp,
void *  rpc_args 
)

Definition at line 116 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_send_rpc_evt_to_thread_force()

void session_send_rpc_evt_to_thread_force ( u32  thread_index,
void *  fp,
void *  rpc_args 
)

Definition at line 108 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_stop_listen()

int session_stop_listen ( session_t s)

Ask transport to stop listening on local transport endpoint.

Parameters
sSession to stop listening on. It must be in state LISTENING.

Definition at line 1452 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_stream_accept()

int session_stream_accept ( transport_connection_t tc,
u32  listener_index,
u32  thread_index,
u8  notify 
)

Accept a stream session.

Optionally ping the server by callback.

Definition at line 1228 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_stream_accept_notify()

int session_stream_accept_notify ( transport_connection_t tc)

Definition at line 1202 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_stream_connect_notify()

int session_stream_connect_notify ( transport_connection_t tc,
session_error_t  err 
)

Definition at line 888 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_switch_pool()

static void session_switch_pool ( void *  cb_args)
static

Notify old thread of the session pool switch.

Definition at line 965 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_switch_pool_reply()

static void session_switch_pool_reply ( void *  arg)
static

Definition at line 940 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_transport_attribute()

int session_transport_attribute ( session_t s,
u8  is_get,
transport_endpt_attr_t attr 
)

Definition at line 1766 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_transport_cleanup()

void session_transport_cleanup ( session_t s)

Cleanup transport and session state.

Notify transport of the cleanup and free the session. This should be called only if transport reported some error and is already closed.

Definition at line 1605 of file session.c.

+ Here is the call graph for this function:

◆ session_transport_close()

void session_transport_close ( session_t s)

Notify transport the session can be disconnected.

This should eventually result in a delete notification that allows us to cleanup session state. Called for both active/passive disconnects.

Must be called from the session's thread.

Definition at line 1553 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_transport_closed_notify()

void session_transport_closed_notify ( transport_connection_t tc)

Notification from transport that it is closed.

Should be called by transport, prior to calling delete notify, once it knows that no more data will be exchanged. This could serve as an early acknowledgment of an active close especially if transport delete can be delayed a long time, e.g., tcp time-wait.

Definition at line 1150 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_transport_closing_notify()

void session_transport_closing_notify ( transport_connection_t tc)

Notification from transport that connection is being closed.

A disconnect is sent to application but state is not removed. Once disconnect is acknowledged by application, session disconnect is called. Ultimately this leads to close being called on transport (passive close).

Definition at line 1062 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_transport_delete_notify()

void session_transport_delete_notify ( transport_connection_t tc)

Notification from transport that connection is being deleted.

This removes the session if it is still valid. It should be called only on previously fully established sessions. For instance failed connects should call stream_session_connect_notify and indicate that the connect has failed.

Definition at line 1084 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_transport_half_close()

void session_transport_half_close ( session_t s)

Notify transport the session can be half-disconnected.

Must be called from the session's thread.

Definition at line 1533 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_transport_reset()

void session_transport_reset ( session_t s)

Force transport close.

Definition at line 1581 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_transport_reset_notify()

void session_transport_reset_notify ( transport_connection_t tc)

Notify application that connection has been reset.

Definition at line 1187 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_fifo_dequeue_drop()

u32 session_tx_fifo_dequeue_drop ( transport_connection_t tc,
u32  max_bytes 
)

Definition at line 692 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_tx_fifo_peek_bytes()

int session_tx_fifo_peek_bytes ( transport_connection_t tc,
u8 buffer,
u32  offset,
u32  max_bytes 
)

Definition at line 684 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ session_vpp_event_queues_allocate()

void session_vpp_event_queues_allocate ( session_main_t smm)

Allocate event queues in the shared-memory segment.

That can only be a newly created memfd segment, that must be mapped by all apps/stack users.

Definition at line 1625 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sesssion_reschedule_tx()

void sesssion_reschedule_tx ( transport_connection_t tc)

Definition at line 161 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_session_enable_disable()

clib_error_t* vnet_session_enable_disable ( vlib_main_t vm,
u8  is_en 
)

Definition at line 1925 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ session_main

session_main_t session_main

Definition at line 25 of file session.c.

◆ session_open_srv_fns

session_open_service_fn session_open_srv_fns[TRANSPORT_N_SERVICES]
static
Initial value:

Definition at line 1386 of file session.c.

◆ session_tx_fns

session_tx_fifo_dequeue_and_snd
session_fifo_rx_fn session_tx_fifo_dequeue_and_snd
session_open_app
int session_open_app(session_endpoint_cfg_t *rmt, session_handle_t *rsh)
Definition: session.c:1373
session_tx_fifo_peek_and_snd
session_fifo_rx_fn session_tx_fifo_peek_and_snd
session_open_cl
int session_open_cl(session_endpoint_cfg_t *rmt, session_handle_t *rsh)
Definition: session.c:1294
session_open_vc
int session_open_vc(session_endpoint_cfg_t *rmt, session_handle_t *rsh)
Definition: session.c:1332
session_tx_fifo_dequeue_internal
session_fifo_rx_fn session_tx_fifo_dequeue_internal