27#ifndef PROTOCORE_GRPCWEB_H
28#define PROTOCORE_GRPCWEB_H
37#define GRPCWEB_FLAG_COMPRESSED 0x01
38#define GRPCWEB_FLAG_TRAILER 0x80
39#define GRPCWEB_PREFIX_LEN 5
42size_t pc_grpcweb_frame(uint8_t *buf,
size_t cap, uint8_t flags,
const uint8_t *body,
size_t body_len);
45size_t pc_grpcweb_frame_message(uint8_t *buf,
size_t cap,
const uint8_t *msg,
size_t msg_len,
bool compressed);
52size_t pc_grpcweb_frame_trailer(uint8_t *buf,
size_t cap,
int status,
const char *message);
69bool pc_grpcweb_parse(
const uint8_t *buf,
size_t len, GrpcWebFrame *out,
size_t *consumed);
72bool pc_grpcweb_trailer_status(
const uint8_t *body,
size_t len,
int *status);
79bool pc_grpcweb_trailer_message(
const uint8_t *body,
size_t len,
const char **msg,
size_t *msg_len);
User-facing configuration for ProtoCore.