FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
tls.c File Reference
+ Include dependency graph for tls.c:

Go to the source code of this file.

Macros

#define TLS_INVALID_HANDLE   ~0
 
#define TLS_IDX_MASK   0x00FFFFFF
 
#define TLS_ENGINE_TYPE_SHIFT   29
 

Functions

void tls_disconnect (u32 ctx_handle, u32 thread_index)
 
tls_engine_type_t tls_get_available_engine (void)
 
int tls_add_vpp_q_evt (svm_fifo_t *f, u8 evt_type)
 
static int tls_add_app_q_evt (application_t *app, stream_session_t *app_session)
 
u32 tls_listener_ctx_alloc (void)
 
void tls_listener_ctx_free (tls_ctx_t *ctx)
 
tls_ctx_ttls_listener_ctx_get (u32 ctx_index)
 
u32 tls_listener_ctx_index (tls_ctx_t *ctx)
 
u32 tls_ctx_half_open_alloc (void)
 
void tls_ctx_half_open_free (u32 ho_index)
 
tls_ctx_ttls_ctx_half_open_get (u32 ctx_index)
 
void tls_ctx_half_open_reader_unlock ()
 
u32 tls_ctx_half_open_index (tls_ctx_t *ctx)
 
void tls_notify_app_enqueue (tls_ctx_t *ctx, stream_session_t *app_session)
 
int tls_notify_app_accept (tls_ctx_t *ctx)
 
int tls_notify_app_connected (tls_ctx_t *ctx, u8 is_failed)
 
static void tls_ctx_parse_handle (u32 ctx_handle, u32 *ctx_index, u32 *engine_type)
 
static tls_engine_type_t tls_get_engine_type (tls_engine_type_t preferred)
 
static u32 tls_ctx_alloc (tls_engine_type_t engine_type)
 
static void tls_ctx_free (tls_ctx_t *ctx)
 
static tls_ctx_ttls_ctx_get (u32 ctx_handle)
 
static tls_ctx_ttls_ctx_get_w_thread (u32 ctx_handle, u8 thread_index)
 
static int tls_ctx_init_server (tls_ctx_t *ctx)
 
static int tls_ctx_init_client (tls_ctx_t *ctx)
 
static int tls_ctx_write (tls_ctx_t *ctx, stream_session_t *app_session)
 
static int tls_ctx_read (tls_ctx_t *ctx, stream_session_t *tls_session)
 
static u8 tls_ctx_handshake_is_over (tls_ctx_t *ctx)
 
void tls_session_reset_callback (stream_session_t *s)
 
int tls_add_segment_callback (u32 client_index, const ssvm_private_t *fs)
 
int tls_del_segment_callback (u32 client_index, const ssvm_private_t *fs)
 
void tls_session_disconnect_callback (stream_session_t *tls_session)
 
int tls_session_accept_callback (stream_session_t *tls_session)
 
int tls_app_tx_callback (stream_session_t *app_session)
 
int tls_app_rx_callback (stream_session_t *tls_session)
 
int tls_session_connected_callback (u32 tls_app_index, u32 ho_ctx_index, stream_session_t *tls_session, u8 is_fail)
 
int tls_connect (transport_endpoint_t *tep)
 
u32 tls_start_listen (u32 app_listener_index, transport_endpoint_t *tep)
 
u32 tls_stop_listen (u32 lctx_index)
 
transport_connection_ttls_connection_get (u32 ctx_index, u32 thread_index)
 
transport_connection_ttls_listener_get (u32 listener_index)
 
u8format_tls_ctx (u8 *s, va_list *args)
 
u8format_tls_connection (u8 *s, va_list *args)
 
u8format_tls_listener (u8 *s, va_list *args)
 
u8format_tls_half_open (u8 *s, va_list *args)
 
void tls_register_engine (const tls_engine_vft_t *vft, tls_engine_type_t type)
 
static clib_error_ttls_init (vlib_main_t *vm)
 
static clib_error_ttls_config_fn (vlib_main_t *vm, unformat_input_t *input)
 
tls_main_tvnet_tls_get_main (void)
 

Variables

static tls_main_t tls_main
 
static tls_engine_vft_ttls_vfts
 
static session_cb_vft_t tls_app_cb_vft
 
static const transport_proto_vft_t tls_proto
 

Macro Definition Documentation

#define TLS_ENGINE_TYPE_SHIFT   29

Definition at line 25 of file tls.c.

#define TLS_IDX_MASK   0x00FFFFFF

Definition at line 24 of file tls.c.

#define TLS_INVALID_HANDLE   ~0

Definition at line 23 of file tls.c.

Function Documentation

u8* format_tls_connection ( u8 s,
va_list *  args 
)

Definition at line 645 of file tls.c.

+ Here is the call graph for this function:

u8* format_tls_ctx ( u8 s,
va_list *  args 
)

Definition at line 629 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_tls_half_open ( u8 s,
va_list *  args 
)

Definition at line 680 of file tls.c.

+ Here is the call graph for this function:

u8* format_tls_listener ( u8 s,
va_list *  args 
)

Definition at line 667 of file tls.c.

+ Here is the call graph for this function:

static int tls_add_app_q_evt ( application_t app,
stream_session_t app_session 
)
inlinestatic

Definition at line 67 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tls_add_segment_callback ( u32  client_index,
const ssvm_private_t fs 
)

Definition at line 349 of file tls.c.

int tls_add_vpp_q_evt ( svm_fifo_t f,
u8  evt_type 
)

Definition at line 42 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tls_app_rx_callback ( stream_session_t tls_session)

Definition at line 419 of file tls.c.

+ Here is the call graph for this function:

int tls_app_tx_callback ( stream_session_t app_session)

Definition at line 408 of file tls.c.

+ Here is the call graph for this function:

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

Definition at line 764 of file tls.c.

+ Here is the call graph for this function:

int tls_connect ( transport_endpoint_t tep)

Definition at line 483 of file tls.c.

+ Here is the call graph for this function:

transport_connection_t* tls_connection_get ( u32  ctx_index,
u32  thread_index 
)

Definition at line 613 of file tls.c.

+ Here is the call graph for this function:

static u32 tls_ctx_alloc ( tls_engine_type_t  engine_type)
inlinestatic

Definition at line 282 of file tls.c.

+ Here is the caller graph for this function:

static void tls_ctx_free ( tls_ctx_t ctx)
inlinestatic

Definition at line 290 of file tls.c.

+ Here is the caller graph for this function:

static tls_ctx_t* tls_ctx_get ( u32  ctx_handle)
inlinestatic

Definition at line 297 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static tls_ctx_t* tls_ctx_get_w_thread ( u32  ctx_handle,
u8  thread_index 
)
inlinestatic

Definition at line 305 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tls_ctx_half_open_alloc ( void  )

Definition at line 133 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tls_ctx_half_open_free ( u32  ho_index)

Definition at line 159 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

tls_ctx_t* tls_ctx_half_open_get ( u32  ctx_index)

Definition at line 168 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tls_ctx_half_open_index ( tls_ctx_t ctx)

Definition at line 182 of file tls.c.

void tls_ctx_half_open_reader_unlock ( )

Definition at line 176 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 tls_ctx_handshake_is_over ( tls_ctx_t ctx)
inlinestatic

Definition at line 337 of file tls.c.

+ Here is the caller graph for this function:

static int tls_ctx_init_client ( tls_ctx_t ctx)
inlinestatic

Definition at line 319 of file tls.c.

+ Here is the caller graph for this function:

static int tls_ctx_init_server ( tls_ctx_t ctx)
inlinestatic

Definition at line 313 of file tls.c.

+ Here is the caller graph for this function:

static void tls_ctx_parse_handle ( u32  ctx_handle,
u32 ctx_index,
u32 engine_type 
)
inlinestatic

Definition at line 267 of file tls.c.

+ Here is the caller graph for this function:

static int tls_ctx_read ( tls_ctx_t ctx,
stream_session_t tls_session 
)
inlinestatic

Definition at line 331 of file tls.c.

+ Here is the caller graph for this function:

static int tls_ctx_write ( tls_ctx_t ctx,
stream_session_t app_session 
)
inlinestatic

Definition at line 325 of file tls.c.

+ Here is the caller graph for this function:

int tls_del_segment_callback ( u32  client_index,
const ssvm_private_t fs 
)

Definition at line 356 of file tls.c.

void tls_disconnect ( u32  ctx_handle,
u32  thread_index 
)

Definition at line 528 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

tls_engine_type_t tls_get_available_engine ( void  )

Definition at line 30 of file tls.c.

+ Here is the caller graph for this function:

static tls_engine_type_t tls_get_engine_type ( tls_engine_type_t  preferred)
inlinestatic

Definition at line 274 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* tls_init ( vlib_main_t vm)
static

Definition at line 713 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tls_listener_ctx_alloc ( void  )

Definition at line 104 of file tls.c.

+ Here is the caller graph for this function:

void tls_listener_ctx_free ( tls_ctx_t ctx)

Definition at line 115 of file tls.c.

+ Here is the caller graph for this function:

tls_ctx_t* tls_listener_ctx_get ( u32  ctx_index)

Definition at line 121 of file tls.c.

+ Here is the caller graph for this function:

u32 tls_listener_ctx_index ( tls_ctx_t ctx)

Definition at line 127 of file tls.c.

transport_connection_t* tls_listener_get ( u32  listener_index)

Definition at line 621 of file tls.c.

+ Here is the call graph for this function:

int tls_notify_app_accept ( tls_ctx_t ctx)

Definition at line 197 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tls_notify_app_connected ( tls_ctx_t ctx,
u8  is_failed 
)

Definition at line 226 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tls_notify_app_enqueue ( tls_ctx_t ctx,
stream_session_t app_session 
)

Definition at line 188 of file tls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tls_register_engine ( const tls_engine_vft_t vft,
tls_engine_type_t  type 
)

Definition at line 706 of file tls.c.

+ Here is the caller graph for this function:

int tls_session_accept_callback ( stream_session_t tls_session)

Definition at line 381 of file tls.c.

+ Here is the call graph for this function:

int tls_session_connected_callback ( u32  tls_app_index,
u32  ho_ctx_index,
stream_session_t tls_session,
u8  is_fail 
)

Definition at line 429 of file tls.c.

+ Here is the call graph for this function:

void tls_session_disconnect_callback ( stream_session_t tls_session)

Definition at line 362 of file tls.c.

+ Here is the call graph for this function:

void tls_session_reset_callback ( stream_session_t s)

Definition at line 343 of file tls.c.

u32 tls_start_listen ( u32  app_listener_index,
transport_endpoint_t tep 
)

Definition at line 551 of file tls.c.

+ Here is the call graph for this function:

u32 tls_stop_listen ( u32  lctx_index)

Definition at line 600 of file tls.c.

+ Here is the call graph for this function:

tls_main_t* vnet_tls_get_main ( void  )

Definition at line 783 of file tls.c.

+ Here is the caller graph for this function:

Variable Documentation

session_cb_vft_t tls_app_cb_vft
static
Initial value:
= {
.session_accept_callback = tls_session_accept_callback,
.session_disconnect_callback = tls_session_disconnect_callback,
.session_connected_callback = tls_session_connected_callback,
.session_reset_callback = tls_session_reset_callback,
.add_segment_callback = tls_add_segment_callback,
.del_segment_callback = tls_del_segment_callback,
.builtin_app_rx_callback = tls_app_rx_callback,
.builtin_app_tx_callback = tls_app_tx_callback,
}
int tls_add_segment_callback(u32 client_index, const ssvm_private_t *fs)
Definition: tls.c:349
void tls_session_reset_callback(stream_session_t *s)
Definition: tls.c:343
int tls_session_accept_callback(stream_session_t *tls_session)
Definition: tls.c:381
int tls_app_rx_callback(stream_session_t *tls_session)
Definition: tls.c:419
int tls_app_tx_callback(stream_session_t *app_session)
Definition: tls.c:408
int tls_del_segment_callback(u32 client_index, const ssvm_private_t *fs)
Definition: tls.c:356
int tls_session_connected_callback(u32 tls_app_index, u32 ho_ctx_index, stream_session_t *tls_session, u8 is_fail)
Definition: tls.c:429
void tls_session_disconnect_callback(stream_session_t *tls_session)
Definition: tls.c:362

Definition at line 470 of file tls.c.

tls_main_t tls_main
static

Definition at line 20 of file tls.c.

const transport_proto_vft_t tls_proto
static
Initial value:
= {
.open = tls_connect,
.close = tls_disconnect,
.get_connection = tls_connection_get,
.get_listener = tls_listener_get,
.unbind = tls_stop_listen,
.service_type = TRANSPORT_SERVICE_APP,
.format_connection = format_tls_connection,
.format_half_open = format_tls_half_open,
.format_listener = format_tls_listener,
}
int tls_connect(transport_endpoint_t *tep)
Definition: tls.c:483
u8 * format_tls_connection(u8 *s, va_list *args)
Definition: tls.c:645
transport_connection_t * tls_connection_get(u32 ctx_index, u32 thread_index)
Definition: tls.c:613
app transport service
u8 * format_tls_listener(u8 *s, va_list *args)
Definition: tls.c:667
void tls_disconnect(u32 ctx_handle, u32 thread_index)
Definition: tls.c:528
transport_connection_t * tls_listener_get(u32 listener_index)
Definition: tls.c:621
apps acting as transports
u32 tls_stop_listen(u32 lctx_index)
Definition: tls.c:600
u8 * format_tls_half_open(u8 *s, va_list *args)
Definition: tls.c:680
u32 tls_start_listen(u32 app_listener_index, transport_endpoint_t *tep)
Definition: tls.c:551

Definition at line 690 of file tls.c.

tls_engine_vft_t* tls_vfts
static

Definition at line 21 of file tls.c.