30#ifndef PROTOCORE_WS_CLIENT_H
31#define PROTOCORE_WS_CLIENT_H
35#if PROTOCORE_ENABLE_WS_CLIENT
44#define PROTOCORE_WS_KEY_CAP 25
47#define PROTOCORE_WS_ACCEPT_CAP 29
65typedef void (*WsClientMessageCb)(uint8_t opcode,
const uint8_t *payload,
size_t len);
78 const char *resource_name;
80 const char *subprotocol;
90 const uint8_t *payload;
94 const uint8_t *masking_key;
112 WsClientMessageCb on_message;
160 WsHandshakeArgs handshake;
169extern WsClientVars WsClientV;
174 void (*
const accept_for_key)(uint8_t *work);
175 void (*
const build_opening_handshake)(uint8_t *work);
176 void (*
const check_server_handshake)(uint8_t *work);
177 void (*
const build_frame)(uint8_t *work);
178 void (*
const parse_frame)(uint8_t *work);
179 void (*
const on_message)(uint8_t *work);
180 void (*
const connect)(uint8_t *work);
181 void (*
const send_text)(uint8_t *work);
182 void (*
const send_binary)(uint8_t *work);
183 void (*
const loop)(uint8_t *work);
184 void (*
const connected)(uint8_t *work);
185 void (*
const close)(uint8_t *work);
190void protocore_ws_client_accept_for_key(uint8_t *work);
191void protocore_ws_client_build_opening_handshake(uint8_t *work);
192void protocore_ws_client_check_server_handshake(uint8_t *work);
193void protocore_ws_client_build_frame(uint8_t *work);
194void protocore_ws_client_parse_frame(uint8_t *work);
195void protocore_ws_client_on_message(uint8_t *work);
196void protocore_ws_client_connect(uint8_t *work);
197void protocore_ws_client_send_text(uint8_t *work);
198void protocore_ws_client_send_binary(uint8_t *work);
199void protocore_ws_client_loop(uint8_t *work);
200void protocore_ws_client_connected(uint8_t *work);
201void protocore_ws_client_close(uint8_t *work);
207static const WsClientNs WsClient __attribute__((unused)) = {
208 .accept_for_key = protocore_ws_client_accept_for_key,
209 .build_opening_handshake = protocore_ws_client_build_opening_handshake,
210 .check_server_handshake = protocore_ws_client_check_server_handshake,
211 .build_frame = protocore_ws_client_build_frame,
212 .parse_frame = protocore_ws_client_parse_frame,
213 .on_message = protocore_ws_client_on_message,
214 .connect = protocore_ws_client_connect,
215 .send_text = protocore_ws_client_send_text,
216 .send_binary = protocore_ws_client_send_binary,
217 .loop = protocore_ws_client_loop,
218 .connected = protocore_ws_client_connected,
219 .close = protocore_ws_client_close,
231#if PROTOCORE_HAS_NET_STACK
232uint8_t *protocore_ws_client_span(
void);
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS