libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Data Structures | |
struct | lws_metric_policy |
struct | lws_ss_x509 |
struct | lws_ss_trust_store |
struct | lws_ss_metadata |
struct | lws_ss_http_respmap |
struct | lws_ss_auth |
struct | lws_ss_policy |
union | lws_ss_policy.u |
union | lws_ss_policy.trust |
struct | lws_ss_policy.trust.server |
Typedefs | |
typedef int(* | plugin_auth_status_cb) (struct lws_ss_handle *ss, int status) |
typedef struct lws_metric_policy | lws_metric_policy_t |
typedef struct lws_ss_x509 | lws_ss_x509_t |
typedef struct lws_ss_trust_store | lws_ss_trust_store_t |
typedef struct lws_ss_metadata | lws_ss_metadata_t |
typedef struct lws_ss_http_respmap | lws_ss_http_respmap_t |
typedef struct lws_ss_auth | lws_ss_auth_t |
typedef struct lws_ss_policy | lws_ss_policy_t |
Functions | |
LWS_VISIBLE LWS_EXTERN int | lws_ss_policy_parse_begin (struct lws_context *context, int overlay) |
LWS_VISIBLE LWS_EXTERN int | lws_ss_policy_parse_abandon (struct lws_context *context) |
LWS_VISIBLE LWS_EXTERN int | lws_ss_policy_parse (struct lws_context *context, const uint8_t *buf, size_t len) |
LWS_VISIBLE LWS_EXTERN int | lws_ss_policy_overlay (struct lws_context *context, const char *overlay) |
LWS_VISIBLE LWS_EXTERN const lws_ss_policy_t * | lws_ss_policy_get (struct lws_context *context) |
LWS_VISIBLE LWS_EXTERN const lws_ss_auth_t * | lws_ss_auth_get (struct lws_context *context) |
struct lws_metric_policy |
lws_ss_plugin_auth_t - api for an auth plugin
Auth plugins create and sequence authenticated connections that can carry one or more streams to an endpoint. That may involve other connections to other places to eg, gather authenticated tokens and then make the real connection using the tokens.
The secure stream object contains members to record which auth plugin the stream is bound to and an over-allocation of the secure stream object to contain the plugin auth private data.
The auth plugin controls the state of the stream connection via the status callback, and handles retries.
Network connections may require one kind of auth sequencing, and streams inside those connections another kind of auth sequencing depending on their role. So the secure stream object allows defining plugins for both kinds.
Streams may disappear at any time and require reauth to bring a new one up. The auth plugin sequencer will connect / reconnect either on demand, or from the start and after any connectivity loss if any stream using the connection has the LWSSSPOLF_NAILED_UP flag.
Definition at line 56 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
const struct lws_metric_policy * | next | |
const char * | name | |
const char * | report |
the metrics policy name in the policy, used to bind to it |
uint64_t | us_schedule |
us interval between lws_system metrics api reports |
uint32_t | us_decay_unit |
how many us to decay avg by half, 0 = no decay |
uint8_t | min_contributors |
before we can judge something is an outlier |
struct lws_ss_x509 |
Definition at line 73 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
struct lws_ss_x509 * | next | |
const char * | vhost_name |
vhost name using cert ctx |
const uint8_t * | ca_der |
DER x.509 cert |
size_t | ca_der_len |
length of DER cert |
uint8_t | keep:1 |
ie, if used in server tls |
struct lws_ss_trust_store |
Definition at line 144 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
struct lws_ss_trust_store * | next | |
const char * | name | |
const lws_ss_x509_t * | ssx509[6] | |
int | count |
struct lws_ss_metadata |
Definition at line 173 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
struct lws_ss_metadata * | next | |
const char * | name | |
void * | value__may_own_heap | |
size_t | length | |
uint8_t | value_length | |
uint8_t | value_is_http_token | |
uint8_t | value_on_lws_heap:1 |
struct lws_ss_http_respmap |
Definition at line 190 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
uint16_t | resp | |
uint16_t | state |
struct lws_ss_auth |
Definition at line 201 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
struct lws_ss_auth * | next | |
const char * | name | |
const char * | type | |
const char * | streamtype | |
uint8_t | blob_index |
struct lws_ss_policy |
lws_ss_policy_t: policy database entry for a stream type
Decides the system policy for how to implement connections of name .streamtype.
Streams may need one kind of auth sequencing for the network connection and another kind of auth sequencing for the streams that are carried inside it, this is the purpose of .nauth and .sauth. Both are optional and may be NULL.
An array of these is set at context creation time, ending with one with a NULL streamtype.
Definition at line 223 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
struct lws_ss_policy * | next | |
const char * | streamtype |
stream type lhs to match on |
const char * | endpoint |
DNS address to connect to |
const char * | rideshare_streamtype |
optional transport on another, preexisting stream of this streamtype name |
const char * | payload_fmt | |
const char * | socks5_proxy | |
lws_ss_metadata_t * | metadata | |
const lws_metric_policy_t * | metrics | |
const lws_ss_auth_t * | auth | |
union lws_ss_policy | u | |
union lws_ss_policy | trust | |
const lws_retry_bo_t * | retry_bo |
retry policy to use |
int32_t | txc | |
int32_t | txc_peer | |
uint32_t | proxy_buflen |
max dsh alloc for proxy |
uint32_t | proxy_buflen_rxflow_on_above | |
uint32_t | proxy_buflen_rxflow_off_below | |
uint32_t | client_buflen |
max dsh alloc for client |
uint32_t | client_buflen_rxflow_on_above | |
uint32_t | client_buflen_rxflow_off_below | |
uint32_t | timeout_ms |
default message response timeout in ms |
uint32_t | flags |
stream attribute flags |
uint16_t | port |
endpoint port |
uint8_t | metadata_count |
metadata count |
uint8_t | protocol |
protocol index |
uint8_t | client_cert |
which client cert to apply 0 = none, 1+ = cc 0+ |
uint8_t | priority |
union lws_ss_policy.u |
Definition at line 243 of file lws-secure-streams-policy.h.
union lws_ss_policy.trust |
Definition at line 324 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
const lws_ss_trust_store_t * | store |
CA certs needed for conn validation, only set between policy parsing and vhost creation |
trust | server |
struct lws_ss_policy.trust.server |
Definition at line 328 of file lws-secure-streams-policy.h.
Data Fields | ||
---|---|---|
const lws_ss_x509_t * | cert |
the server's signed cert with the pubkey |
const lws_ss_x509_t * | key |
the server's matching private key |
typedef int(* plugin_auth_status_cb) (struct lws_ss_handle *ss, int status) |
Definition at line 27 of file lws-secure-streams-policy.h.
typedef struct lws_metric_policy lws_metric_policy_t |
lws_ss_plugin_auth_t - api for an auth plugin
Auth plugins create and sequence authenticated connections that can carry one or more streams to an endpoint. That may involve other connections to other places to eg, gather authenticated tokens and then make the real connection using the tokens.
The secure stream object contains members to record which auth plugin the stream is bound to and an over-allocation of the secure stream object to contain the plugin auth private data.
The auth plugin controls the state of the stream connection via the status callback, and handles retries.
Network connections may require one kind of auth sequencing, and streams inside those connections another kind of auth sequencing depending on their role. So the secure stream object allows defining plugins for both kinds.
Streams may disappear at any time and require reauth to bring a new one up. The auth plugin sequencer will connect / reconnect either on demand, or from the start and after any connectivity loss if any stream using the connection has the LWSSSPOLF_NAILED_UP flag.
typedef struct lws_ss_x509 lws_ss_x509_t |
typedef struct lws_ss_trust_store lws_ss_trust_store_t |
typedef struct lws_ss_metadata lws_ss_metadata_t |
typedef struct lws_ss_http_respmap lws_ss_http_respmap_t |
typedef struct lws_ss_auth lws_ss_auth_t |
typedef struct lws_ss_policy lws_ss_policy_t |
lws_ss_policy_t: policy database entry for a stream type
Decides the system policy for how to implement connections of name .streamtype.
Streams may need one kind of auth sequencing for the network connection and another kind of auth sequencing for the streams that are carried inside it, this is the purpose of .nauth and .sauth. Both are optional and may be NULL.
An array of these is set at context creation time, ending with one with a NULL streamtype.
anonymous enum |
Definition at line 81 of file lws-secure-streams-policy.h.
anonymous enum |
Enumerator | |
---|---|
LWSSSP_H1 | |
LWSSSP_H2 | |
LWSSSP_WS | |
LWSSSP_MQTT | |
LWSSSP_RAW | |
LWSSS_HBI_AUTH | |
LWSSS_HBI_DSN | |
LWSSS_HBI_FWV | |
LWSSS_HBI_TYPE | |
_LWSSS_HBI_COUNT |
Definition at line 152 of file lws-secure-streams-policy.h.
LWS_VISIBLE LWS_EXTERN int lws_ss_policy_parse_begin | ( | struct lws_context * | context, |
int | overlay | ||
) |
LWS_VISIBLE LWS_EXTERN int lws_ss_policy_parse_abandon | ( | struct lws_context * | context | ) |
LWS_VISIBLE LWS_EXTERN int lws_ss_policy_parse | ( | struct lws_context * | context, |
const uint8_t * | buf, | ||
size_t | len | ||
) |
LWS_VISIBLE LWS_EXTERN int lws_ss_policy_overlay | ( | struct lws_context * | context, |
const char * | overlay | ||
) |
LWS_VISIBLE LWS_EXTERN const lws_ss_policy_t* lws_ss_policy_get | ( | struct lws_context * | context | ) |
LWS_VISIBLE LWS_EXTERN const lws_ss_auth_t* lws_ss_auth_get | ( | struct lws_context * | context | ) |