libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Data Structures | |
struct | lecp_item |
struct | _lecp_stack |
struct | _lecp_parsing_stack |
struct | lecp_ctx |
struct | lws_lec_pctx |
union | lecp_item.u |
Macros | |
#define | LECP_MAX_PARSING_STACK_DEPTH 5 |
#define | LECP_MAX_DEPTH 12 |
#define | LECP_MAX_INDEX_DEPTH 8 |
#define | LECP_MAX_PATH 128 |
#define | LECP_STRING_CHUNK 254 |
#define | LECP_FLAG_CB_IS_VALUE 64 |
Typedefs | |
typedef signed char(* | lecp_callback) (struct lecp_ctx *ctx, char reason) |
typedef struct lws_lec_pctx | lws_lec_pctx_t |
struct lecp_item |
Definition at line 198 of file lws-lecp.h.
Data Fields | ||
---|---|---|
union lecp_item.u | u | |
uint8_t | opcode |
struct _lecp_stack |
struct _lecp_parsing_stack |
Definition at line 236 of file lws-lecp.h.
Data Fields | ||
---|---|---|
void * | user | |
lecp_callback | cb | |
const char *const * | paths | |
uint8_t | count_paths | |
uint8_t | ppos | |
uint8_t | path_match |
struct lecp_ctx |
Definition at line 245 of file lws-lecp.h.
Data Fields | ||
---|---|---|
void * | user | |
uint8_t * | collect_tgt | |
struct _lecp_parsing_stack | pst[LECP_MAX_PARSING_STACK_DEPTH] | |
struct _lecp_stack | st[LECP_MAX_DEPTH] | |
uint16_t | i[LECP_MAX_INDEX_DEPTH] | |
uint16_t | wild[LECP_MAX_INDEX_DEPTH] | |
char | path[LECP_MAX_PATH] | |
uint8_t | cbor[64] | |
struct lecp_item | item | |
size_t | path_stride | |
size_t | used_in | |
uint16_t | uni | |
uint8_t | npos | |
uint8_t | dcount | |
uint8_t | f | |
uint8_t | sp | |
uint8_t | ipos | |
uint8_t | count_paths | |
uint8_t | path_match | |
uint8_t | path_match_len | |
uint8_t | wildcount | |
uint8_t | pst_sp | |
uint8_t | outer_array | |
uint8_t | cbor_pos | |
uint8_t | literal_cbor_report | |
char | present | |
uint8_t | be | |
char | buf[LECP_STRING_CHUNK+1] |
struct lws_lec_pctx |
Definition at line 324 of file lws-lecp.h.
Data Fields | ||
---|---|---|
uint8_t | stack[16] | |
uint8_t | vaa[16] | |
uint8_t | indet[16] | |
uint8_t | scratch[24] | |
uint8_t * | start | |
uint8_t * | buf | |
uint8_t * | end | |
const uint8_t * | ongoing_src | |
uint64_t | ongoing_len | |
uint64_t | ongoing_done | |
struct lecp_item | item | |
size_t | used | |
int | opaque[4] | |
enum cbp_state | state | |
unsigned int | fmt_pos | |
uint8_t | sp | |
uint8_t | scratch_len | |
uint8_t | escflag | |
uint8_t | _long | |
uint8_t | vaa_pos | |
uint8_t | dotstar |
union lecp_item.u |
Definition at line 199 of file lws-lecp.h.
Data Fields | ||
---|---|---|
uint64_t | u64 | |
int64_t | i64 | |
uint64_t | u32 | |
uint16_t | hf | |
uint32_t | f | |
uint64_t | d |
#define LECP_MAX_PARSING_STACK_DEPTH 5 |
Definition at line 36 of file lws-lecp.h.
#define LECP_MAX_DEPTH 12 |
Definition at line 39 of file lws-lecp.h.
#define LECP_MAX_INDEX_DEPTH 8 |
Definition at line 42 of file lws-lecp.h.
#define LECP_MAX_PATH 128 |
Definition at line 45 of file lws-lecp.h.
#define LECP_STRING_CHUNK 254 |
Definition at line 49 of file lws-lecp.h.
#define LECP_FLAG_CB_IS_VALUE 64 |
Definition at line 52 of file lws-lecp.h.
typedef signed char(* lecp_callback) (struct lecp_ctx *ctx, char reason) |
Definition at line 218 of file lws-lecp.h.
typedef struct lws_lec_pctx lws_lec_pctx_t |
anonymous enum |
Definition at line 58 of file lws-lecp.h.
enum lecp_callbacks |
Definition at line 144 of file lws-lecp.h.
enum lecp_reasons |
Enumerator | |
---|---|
LECP_CONTINUE | |
LECP_REJECT_BAD_CODING | |
LECP_REJECT_UNKNOWN | |
LECP_REJECT_CALLBACK | |
LECP_STACK_OVERFLOW |
Definition at line 189 of file lws-lecp.h.
enum lws_lec_pctx_ret |
Enumerator | |
---|---|
LWS_LECPCTX_RET_FINISHED | |
LWS_LECPCTX_RET_AGAIN | |
LWS_LECPCTX_RET_FAIL |
Definition at line 303 of file lws-lecp.h.
enum cbp_state |
Enumerator | |
---|---|
CBPS_IDLE | |
CBPS_PC1 | |
CBPS_PC2 | |
CBPS_PC3 | |
CBPS_STRING_BODY | |
CBPS_NUM_LIT | |
CBPS_STRING_LIT | |
CBPS_CONTYPE |
Definition at line 309 of file lws-lecp.h.
LWS_VISIBLE LWS_EXTERN void lws_lec_int | ( | lws_lec_pctx_t * | ctx, |
uint8_t | opcode, | ||
uint8_t | indet, | ||
uint64_t | num ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN int lws_lec_scratch | ( | lws_lec_pctx_t * | ctx | ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN void lws_lec_init | ( | lws_lec_pctx_t * | ctx, |
uint8_t * | buf, | ||
size_t | len ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN void lws_lec_setbuf | ( | lws_lec_pctx_t * | ctx, |
uint8_t * | buf, | ||
size_t | len ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN enum lws_lec_pctx_ret lws_lec_vsprintf | ( | lws_lec_pctx_t * | ctx, |
const char * | format, | ||
va_list | args ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN enum lws_lec_pctx_ret lws_lec_printf | ( | lws_lec_pctx_t * | ctx, |
const char * | format, | ||
... ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN void lecp_construct | ( | struct lecp_ctx * | ctx, |
lecp_callback | cb, | ||
void * | user, | ||
const char *const * | paths, | ||
unsigned char | paths_count ) |
lecp_construct() - Construct an LECP parser context
ctx | the parser context object to be initialized |
cb | the user callback to receive the parsing events |
user | an opaque user pointer available at cb |
paths | an optional array of parsing paths |
paths_count | how many paths in paths |
Prepares an LECP parser context for parsing.
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN void lecp_destruct | ( | struct lecp_ctx * | ctx | ) |
lecp_destruct() - Destroys an LECP parser context
ctx | the parser context object to be destroyed |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN int lecp_parse | ( | struct lecp_ctx * | ctx, |
const uint8_t * | cbor, | ||
size_t | len ) |
lecp_parse() - parses a chunk of input CBOR
ctx:
the parsing context cbor:
the start of the chunk of CBOR len:
the number of bytes of CBOR available at cbor
Returns LECP_CONTINUE if more input needed, one of enum lecp_reasons for a fatal error, else 0 for successful parsing completion.
On success or _CONTINUE, ctx->used_in is set to the number of input bytes consumed.
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN void lecp_change_callback | ( | struct lecp_ctx * | ctx, |
lecp_callback | cb ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN const char * lecp_error_to_string | ( | int | e | ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN void lecp_parse_report_raw | ( | struct lecp_ctx * | ctx, |
int | on ) |
lecp_parse_report_raw() - turn cbor raw reporting on and off
ctx | the lecp context |
on | 0 to disable (defaults disabled), 1 to enable |
For cose_sign, it needs access to raw cbor subtrees for the hash input. This api causes LECPCB_LITERAL_CBOR parse callbacks when there are ctx->cbor_pos bytes of raw cbor available in ctx->cbor[]. the callbacks occur when the ctx->cbor[] buffer fills or if it holds anything when this spi is used to stop the reports.
The same CBOR that is being captured continues to be passed for parsing.
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN int lecp_parse_map_is_key | ( | struct lecp_ctx * | ctx | ) |
lecp_parse_map_is_key() - return nonzero if we're in a map and this is a key
ctx | the lwcp context |
Checks if the current value is a key in a map, ie, that you are on a "key" in a list of "{key: value}" pairs. Zero means you're either not in a map or not on the key part, and nonzero means you are in a map and on a key part.
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN int lecp_parse_subtree | ( | struct lecp_ctx * | ctx, |
const uint8_t * | in, | ||
size_t | len ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN void lws_singles2halfp | ( | uint16_t * | hp, |
uint32_t | x ) |
References LWS_EXTERN, and LWS_VISIBLE.
LWS_VISIBLE LWS_EXTERN void lws_halfp2singles | ( | uint32_t * | xp, |
uint16_t | h ) |