0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-19 20:05:21 +00:00
bird/lib/cbor_parse_tools.h
Katerina Kubecova 4e6cea4ed9 Porting the CBOR encoder from the YANG branch
Minor cleanups by commiter.

(source commit 43ff10204b but expected
to be rebased later, don't worry if you fail to find it)
2024-09-11 09:25:44 +02:00

43 lines
580 B
C

#include "sysdep/config.h"
#include "lib/birdlib.h"
enum functions {
SHOW_STATUS = 0,
SHOW_MEMORY = 1,
SHOW_SYMBOLS = 2,
SHOW_OSPF = 3,
SHOW_PROTOCOLS = 4,
};
enum cbor_majors {
UINT = 0,
NEG_INT = 1,
BYTE_STR = 2,
TEXT = 3,
ARRAY = 4,
BLOCK = 5,
TAG = 6,
FLOAT = 7,
};
struct value {
int major;
int64_t val;
};
struct buff_reader {
byte *buff;
uint pt;
uint size;
};
uint compare_buff_str(struct buff_reader *buf_read, uint length, char *string);
struct value
get_value(struct buff_reader *reader);
int val_is_break(struct value val);