31#ifndef _WEB_SOCKET_MISC_H
32#define _WEB_SOCKET_MISC_H
51 const char_t message[28];
56void webSocketChangeState(WebSocket *webSocket,
WebSocketState newState);
58error_t webSocketParseHandshake(WebSocket *webSocket);
59error_t webSocketParseRequestLine(WebSocket *webSocket, char_t *line);
60error_t webSocketParseStatusLine(WebSocket *webSocket, char_t *line);
61error_t webSocketParseHeaderField(WebSocket *webSocket, char_t *line);
63void webSocketParseConnectionField(WebSocket *webSocket, char_t *value);
65error_t webSocketFormatClientHandshake(WebSocket *webSocket, uint16_t serverPort);
66error_t webSocketFormatServerHandshake(WebSocket *webSocket);
68error_t webSocketFormatErrorResponse(WebSocket *webSocket,
69 uint_t statusCode,
const char_t *message);
71error_t webSocketVerifyClientHandshake(WebSocket *webSocket);
72error_t webSocketVerifyServerHandshake(WebSocket *webSocket);
74error_t webSocketGenerateClientKey(WebSocket *webSocket);
75error_t webSocketGenerateServerKey(WebSocket *webSocket);
77error_t webSocketVerifyClientKey(WebSocket *webSocket);
78error_t webSocketVerifyServerKey(WebSocket *webSocket);
80bool_t webSocketCheckStatusCode(uint16_t statusCode);
82error_t webSocketDecodePercentEncodedString(
const char_t *input,
83 char_t *output,
size_t outputSize);
86 const uint8_t *data,
size_t length,
size_t remaining);
error_t
Error codes.
Definition error.h:43
HTTP status code.
Definition web_socket_misc.h:49
UTF-8 decoding context.
Definition web_socket.h:415
WebSocket API (client and server)
WebSocketState
WebSocket states.
Definition web_socket.h:225