43 struct lws_sspc_handle;
45 #if defined(LWS_SS_USE_SSPC)
46 #define lws_ss_handle lws_sspc_handle
47 #define lws_ss_create lws_sspc_create
48 #define lws_ss_destroy lws_sspc_destroy
49 #define lws_ss_request_tx lws_sspc_request_tx
50 #define lws_ss_request_tx_len lws_sspc_request_tx_len
51 #define lws_ss_client_connect lws_sspc_client_connect
52 #define lws_ss_get_sequencer lws_sspc_get_sequencer
53 #define lws_ss_proxy_create lws_sspc_proxy_create
54 #define lws_ss_get_context lws_sspc_get_context
55 #define lws_ss_rideshare lws_sspc_rideshare
56 #define lws_ss_set_metadata lws_sspc_set_metadata
57 #define lws_ss_get_metadata lws_sspc_get_metadata
58 #define lws_ss_add_peer_tx_credit lws_sspc_add_peer_tx_credit
59 #define lws_ss_get_est_peer_tx_credit lws_sspc_get_est_peer_tx_credit
60 #define lws_ss_start_timeout lws_sspc_start_timeout
61 #define lws_ss_cancel_timeout lws_sspc_cancel_timeout
62 #define lws_ss_to_user_object lws_sspc_to_user_object
63 #define lws_ss_change_handlers lws_sspc_change_handlers
64 #define lws_smd_ss_rx_forward lws_smd_sspc_rx_forward
65 #define lws_ss_tag lws_sspc_tag
66 #define _lws_fi_user_ss_fi _lws_fi_user_sspc_fi
67 #define lwsl_ss_get_cx lwsl_sspc_get_cx
69 LWS_VISIBLE LWS_EXTERN
void
70 lws_log_prepend_sspc(
struct lws_log_cx *cx,
void *obj,
char **p,
char *e);
73 lwsl_sspc_get_cx(
struct lws_sspc_handle *ss);
76 #define lwsl_ss lwsl_sspc
78 #undef lwsl_hexdump_ss
79 #define lwsl_hexdump_ss lwsl_hexdump_sspc
82 #define lwsl_sspc(_h, _fil, ...) \
83 _lws_log_cx(lwsl_sspc_get_cx(_h), lws_log_prepend_sspc, _h, \
84 _fil, __func__, __VA_ARGS__)
86 #define lwsl_hexdump_sspc(_h, _fil, _buf, _len) \
87 lwsl_hexdump_level_cx(lwsl_sspc_get_cx(_h), \
88 lws_log_prepend_sspc, \
95 #if (_LWS_ENABLED_LOGS & LLL_ERR)
96 #define lwsl_sspc_err(_w, ...) lwsl_sspc(_w, LLL_ERR, __VA_ARGS__)
98 #define lwsl_sspc_err(_w, ...) do {} while(0)
101 #if (_LWS_ENABLED_LOGS & LLL_WARN)
102 #define lwsl_sspc_warn(_w, ...) lwsl_sspc(_w, LLL_WARN, __VA_ARGS__)
104 #define lwsl_sspc_warn(_w, ...) do {} while(0)
107 #if (_LWS_ENABLED_LOGS & LLL_NOTICE)
108 #define lwsl_sspc_notice(_w, ...) lwsl_sspc(_w, LLL_NOTICE, __VA_ARGS__)
110 #define lwsl_sspc_notice(_w, ...) do {} while(0)
113 #if (_LWS_ENABLED_LOGS & LLL_INFO)
114 #define lwsl_sspc_info(_w, ...) lwsl_sspc(_w, LLL_INFO, __VA_ARGS__)
116 #define lwsl_sspc_info(_w, ...) do {} while(0)
119 #if (_LWS_ENABLED_LOGS & LLL_DEBUG)
120 #define lwsl_sspc_debug(_w, ...) lwsl_sspc(_w, LLL_DEBUG, __VA_ARGS__)
122 #define lwsl_sspc_debug(_w, ...) do {} while(0)
125 #if (_LWS_ENABLED_LOGS & LLL_PARSER)
126 #define lwsl_sspc_parser(_w, ...) lwsl_sspc(_w, LLL_PARSER, __VA_ARGS__)
128 #define lwsl_sspc_parser(_w, ...) do {} while(0)
131 #if (_LWS_ENABLED_LOGS & LLL_HEADER)
132 #define lwsl_sspc_header(_w, ...) lwsl_sspc(_w, LLL_HEADER, __VA_ARGS__)
134 #define lwsl_sspc_header(_w, ...) do {} while(0)
137 #if (_LWS_ENABLED_LOGS & LLL_EXT)
138 #define lwsl_sspc_ext(_w, ...) lwsl_sspc(_w, LLL_EXT, __VA_ARGS__)
140 #define lwsl_sspc_ext(_w, ...) do {} while(0)
143 #if (_LWS_ENABLED_LOGS & LLL_CLIENT)
144 #define lwsl_sspc_client(_w, ...) lwsl_sspc(_w, LLL_CLIENT, __VA_ARGS__)
146 #define lwsl_sspc_client(_w, ...) do {} while(0)
149 #if (_LWS_ENABLED_LOGS & LLL_LATENCY)
150 #define lwsl_sspc_latency(_w, ...) lwsl_sspc(_w, LLL_LATENCY, __VA_ARGS__)
152 #define lwsl_sspc_latency(_w, ...) do {} while(0)
155 #if (_LWS_ENABLED_LOGS & LLL_THREAD)
156 #define lwsl_sspc_thread(_w, ...) lwsl_sspc(_w, LLL_THREAD, __VA_ARGS__)
158 #define lwsl_sspc_thread(_w, ...) do {} while(0)
161 #if (_LWS_ENABLED_LOGS & LLL_USER)
162 #define lwsl_sspc_user(_w, ...) lwsl_sspc(_w, LLL_USER, __VA_ARGS__)
164 #define lwsl_sspc_user(_w, ...) do {} while(0)
167 #define lwsl_hexdump_sspc_err(_v, ...) lwsl_hexdump_sspc(_v, LLL_ERR, __VA_ARGS__)
168 #define lwsl_hexdump_sspc_warn(_v, ...) lwsl_hexdump_sspc(_v, LLL_WARN, __VA_ARGS__)
169 #define lwsl_hexdump_sspc_notice(_v, ...) lwsl_hexdump_sspc(_v, LLL_NOTICE, __VA_ARGS__)
170 #define lwsl_hexdump_sspc_info(_v, ...) lwsl_hexdump_sspc(_v, LLL_INFO, __VA_ARGS__)
171 #define lwsl_hexdump_sspc_debug(_v, ...) lwsl_hexdump_sspc(_v, LLL_DEBUG, __VA_ARGS__)
174 LWS_VISIBLE LWS_EXTERN
int
175 lws_sspc_create(
struct lws_context *context,
int tsi,
const lws_ss_info_t *ssi,
176 void *opaque_user_data,
struct lws_sspc_handle **ppss,
177 struct lws_sequencer *seq_owner,
const char **ppayload_fmt);
186 LWS_VISIBLE LWS_EXTERN
void
187 lws_sspc_destroy(
struct lws_sspc_handle **ppss);
198 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t
199 lws_sspc_request_tx(
struct lws_sspc_handle *pss);
218 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t
219 lws_sspc_request_tx_len(
struct lws_sspc_handle *h,
unsigned long len);
228 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t
229 lws_sspc_client_connect(
struct lws_sspc_handle *h);
241 LWS_VISIBLE LWS_EXTERN
struct lws_sequencer *
242 lws_sspc_get_sequencer(
struct lws_sspc_handle *h);
252 LWS_VISIBLE LWS_EXTERN
int
253 lws_sspc_proxy_create(
struct lws_context *context);
264 LWS_VISIBLE LWS_EXTERN
struct lws_context *
265 lws_sspc_get_context(
struct lws_sspc_handle *h);
267 LWS_VISIBLE
extern const struct lws_protocols lws_sspc_protocols[2];
269 LWS_VISIBLE LWS_EXTERN
const char *
270 lws_sspc_rideshare(
struct lws_sspc_handle *h);
296 LWS_VISIBLE LWS_EXTERN
int
297 lws_sspc_set_metadata(
struct lws_sspc_handle *h,
const char *
name,
298 const void *value,
size_t len);
300 LWS_VISIBLE LWS_EXTERN
int
301 lws_sspc_get_metadata(
struct lws_sspc_handle *h,
const char *
name,
302 const void **value,
size_t *len);
304 LWS_VISIBLE LWS_EXTERN
int
305 lws_sspc_add_peer_tx_credit(
struct lws_sspc_handle *h, int32_t add);
307 LWS_VISIBLE LWS_EXTERN
int
308 lws_sspc_get_est_peer_tx_credit(
struct lws_sspc_handle *h);
310 LWS_VISIBLE LWS_EXTERN
void
311 lws_sspc_start_timeout(
struct lws_sspc_handle *h,
unsigned int timeout_ms);
313 LWS_VISIBLE LWS_EXTERN
void
314 lws_sspc_cancel_timeout(
struct lws_sspc_handle *h);
316 LWS_VISIBLE LWS_EXTERN
void *
317 lws_sspc_to_user_object(
struct lws_sspc_handle *h);
319 LWS_VISIBLE LWS_EXTERN
void
320 lws_sspc_change_handlers(
struct lws_sspc_handle *h,
321 lws_ss_state_return_t (*rx)(
void *userobj,
const uint8_t *buf,
322 size_t len,
int flags),
323 lws_ss_state_return_t (*tx)(
void *userobj, lws_ss_tx_ordinal_t ord,
324 uint8_t *buf,
size_t *len,
int *flags),
325 lws_ss_state_return_t (*state)(
void *userobj,
void *h_src
327 lws_ss_constate_t state,
328 lws_ss_tx_ordinal_t ack));
331 lws_sspc_tag(
struct lws_sspc_handle *h);
Definition: lws-logs.h:80
Definition: lws-protocols-plugins.h:44
const char * name
Definition: lws-protocols-plugins.h:45
Definition: lws-secure-streams.h:364