facil.io

#./fio-stl/004 websocket parser.h

29 public symbols.

#Macros

#FIO_WEBSOCKET_DEFAULT_MAX_FRAME

c
#define FIO_WEBSOCKET_DEFAULT_MAX_FRAME (1ULL << 30)

Symbol type: macro

#FIO_WEBSOCKET_PARSE_ERROR

c
#define FIO_WEBSOCKET_PARSE_ERROR ((size_t)-1)

Parse error sentinel.

Symbol type: macro

#FIO_WEBSOCKET_RSV1

c
#define FIO_WEBSOCKET_RSV1 0x4U /* byte-0 bit 6 (permessage-deflate) */

RSV bit constants for the send-side API. These are the 3-bit values shifted into byte-0 bits 4..6 on the wire (0x4 → RSV1=0x40, 0x2 → RSV2=0x20, 0x1 → RSV3=0x10).

Symbol type: macro

#FIO_WEBSOCKET_RSV2

c
#define FIO_WEBSOCKET_RSV2 0x2U /* byte-0 bit 5 */

Symbol type: macro

#FIO_WEBSOCKET_RSV3

c
#define FIO_WEBSOCKET_RSV3 0x1U /* byte-0 bit 4 */

Symbol type: macro

#FIO_WEBSOCKET_OP_CONT

c
#define FIO_WEBSOCKET_OP_CONT   0x0

Symbol type: macro

#FIO_WEBSOCKET_OP_TEXT

c
#define FIO_WEBSOCKET_OP_TEXT   0x1

Symbol type: macro

#FIO_WEBSOCKET_OP_BINARY

c
#define FIO_WEBSOCKET_OP_BINARY 0x2

Symbol type: macro

#FIO_WEBSOCKET_OP_CLOSE

c
#define FIO_WEBSOCKET_OP_CLOSE  0x8

Symbol type: macro

#FIO_WEBSOCKET_OP_PING

c
#define FIO_WEBSOCKET_OP_PING   0x9

Symbol type: macro

#FIO_WEBSOCKET_OP_PONG

c
#define FIO_WEBSOCKET_OP_PONG   0xA

Symbol type: macro

#FIO_WEBSOCKET_STATE_HEADER

c
#define FIO_WEBSOCKET_STATE_HEADER  0

Symbol type: macro

#FIO_WEBSOCKET_STATE_PAYLOAD

c
#define FIO_WEBSOCKET_STATE_PAYLOAD 1

Symbol type: macro

#FIO_WEBSOCKET_STATE_CLOSED

c
#define FIO_WEBSOCKET_STATE_CLOSED  0xFE

Symbol type: macro

#FIO_WEBSOCKET_STATE_ERROR

c
#define FIO_WEBSOCKET_STATE_ERROR   0xFF

Symbol type: macro

#FIO_WEBSOCKET_FLAG_FIN

c
#define FIO_WEBSOCKET_FLAG_FIN             0x80

Symbol type: macro

#FIO_WEBSOCKET_FLAG_MASKED

c
#define FIO_WEBSOCKET_FLAG_MASKED          0x40

Symbol type: macro

#FIO_WEBSOCKET_FLAG_OPCODE_MASK

c
#define FIO_WEBSOCKET_FLAG_OPCODE_MASK     0x3C

Symbol type: macro

#FIO_WEBSOCKET_FLAG_OPCODE_SHIFT

c
#define FIO_WEBSOCKET_FLAG_OPCODE_SHIFT    2

Symbol type: macro

#FIO_WEBSOCKET_FLAG_MSG_OPCODE_MASK

c
#define FIO_WEBSOCKET_FLAG_MSG_OPCODE_MASK 0x03

Symbol type: macro

#FIO_WEBSOCKET_FLAG2_PAUSED

c
#define FIO_WEBSOCKET_FLAG2_PAUSED        0x80

Symbol type: macro

#FIO_WEBSOCKET_FLAG2_MSG_RSV_MASK

c
#define FIO_WEBSOCKET_FLAG2_MSG_RSV_MASK  0x70

Symbol type: macro

#FIO_WEBSOCKET_FLAG2_MSG_RSV_SHIFT

c
#define FIO_WEBSOCKET_FLAG2_MSG_RSV_SHIFT 4

Symbol type: macro

#FIO_WEBSOCKET_GET_FIN

c
#define FIO_WEBSOCKET_GET_FIN(p) (((p)->flags & FIO_WEBSOCKET_FLAG_FIN) != 0)

Read the FIN bit from the current frame.

Symbol type: macro

#FIO_WEBSOCKET_GET_MASKED

c
#define FIO_WEBSOCKET_GET_MASKED(p)   \
  (((p)->flags & FIO_WEBSOCKET_FLAG_MASKED) != 0)

Read the MASK bit from the current frame.

Symbol type: macro

#FIO_WEBSOCKET_GET_OPCODE

c
#define FIO_WEBSOCKET_GET_OPCODE(p)   \
  (((p)->flags & FIO_WEBSOCKET_FLAG_OPCODE_MASK) >>   \
   FIO_WEBSOCKET_FLAG_OPCODE_SHIFT)

Read the opcode from the current frame.

Symbol type: macro

#FIO_WEBSOCKET_GET_MSG_OPCODE

c
#define FIO_WEBSOCKET_GET_MSG_OPCODE(p)   \
  ((p)->flags & FIO_WEBSOCKET_FLAG_MSG_OPCODE_MASK)

Read the message opcode (1=text, 2=binary, 0=none open).

Symbol type: macro

#FIO_WEBSOCKET_GET_PAUSED

c
#define FIO_WEBSOCKET_GET_PAUSED(p)   \
  (((p)->flags2 & FIO_WEBSOCKET_FLAG2_PAUSED) != 0)

Read the paused flag (one-message-per-parse gate).

Symbol type: macro

#FIO_WEBSOCKET_GET_MSG_RSV

c
#define FIO_WEBSOCKET_GET_MSG_RSV(p)   \
  (((p)->flags2 & FIO_WEBSOCKET_FLAG2_MSG_RSV_MASK) >>   \
   FIO_WEBSOCKET_FLAG2_MSG_RSV_SHIFT)

Read the RSV bits from the opening frame (3-bit format).

Symbol type: macro