libwebsockets
Lightweight C library for HTML5 websockets
lws-tls-sessions.h File Reference

Go to the source code of this file.

Data Structures

struct  lws_tls_session_dump
 

Macros

#define LWS_SESSION_TAG_LEN   96
 

Typedefs

typedef int(* lws_tls_sess_cb_t) (struct lws_context *cx, struct lws_tls_session_dump *info)
 

Functions

LWS_VISIBLE LWS_EXTERN int lws_tls_session_dump_save (struct lws_vhost *vh, const char *host, uint16_t port, lws_tls_sess_cb_t cb_save, void *opq)
 
LWS_VISIBLE LWS_EXTERN int lws_tls_session_dump_load (struct lws_vhost *vh, const char *host, uint16_t port, lws_tls_sess_cb_t cb_load, void *opq)
 

Data Structure Documentation

◆ lws_tls_session_dump

struct lws_tls_session_dump

Definition at line 34 of file lws-tls-sessions.h.

+ Collaboration diagram for lws_tls_session_dump:
Data Fields
char tag[LWS_SESSION_TAG_LEN]
void * blob
void * opaque
size_t blob_len

Macro Definition Documentation

◆ LWS_SESSION_TAG_LEN

#define LWS_SESSION_TAG_LEN   96

Definition at line 32 of file lws-tls-sessions.h.

Typedef Documentation

◆ lws_tls_sess_cb_t

typedef int(* lws_tls_sess_cb_t) (struct lws_context *cx, struct lws_tls_session_dump *info)

Definition at line 42 of file lws-tls-sessions.h.

Function Documentation

◆ lws_tls_session_dump_save()

LWS_VISIBLE LWS_EXTERN int lws_tls_session_dump_save ( struct lws_vhost *  vh,
const char *  host,
uint16_t  port,
lws_tls_sess_cb_t  cb_save,
void *  opq 
)

lws_tls_session_dump_save() - serialize a tls session via a callback

Parameters
vhthe vhost to load into the session cache
hostthe name of the host the session relates to
portthe port the session connects to on the host
cb_savethe callback to perform the saving of the session blob
opqan opaque pointer passed into the callback

If a session matching the vhost/host/port exists in the vhost's session cache, serialize it via the provided callback.

opq is passed to the callback without being used by lws at all.

◆ lws_tls_session_dump_load()

LWS_VISIBLE LWS_EXTERN int lws_tls_session_dump_load ( struct lws_vhost *  vh,
const char *  host,
uint16_t  port,
lws_tls_sess_cb_t  cb_load,
void *  opq 
)

lws_tls_session_dump_load() - deserialize a tls session via a callback

Parameters
vhthe vhost to load into the session cache
hostthe name of the host the session relates to
portthe port the session connects to on the host
cb_loadthe callback to retreive the session blob from
opqan opaque pointer passed into the callback

Try to preload a session described by the first three parameters into the client session cache, from the given callback.

opq is passed to the callback without being used by lws at all.