42 #ifndef ATCAPROV_BSON_H
43 #define ATCAPROV_BSON_H
48 #define BSON_TYPE_DOUBLE (0x01)
49 #define BSON_TYPE_STRING (0x02)
50 #define BSON_TYPE_DOCUMENT (0x03)
51 #define BSON_TYPE_ARRAY (0x04)
52 #define BSON_TYPE_BINARY (0x05)
53 #define BSON_TYPE_OBJID (0x07)
54 #define BSON_TYPE_BOOL (0x08)
55 #define BSON_TYPE_DATETIME (0x09)
56 #define BSON_TYPE_NULL (0x0A)
57 #define BSON_TYPE_REGEX (0x0B)
58 #define BSON_TYPE_DBPTR (0x0C)
59 #define BSON_TYPE_JAVASCRIPT (0x0D)
60 #define BSON_TYPE_JAVASCRIPTWS (0x0F)
61 #define BSON_TYPE_INT32 (0x10)
62 #define BSON_TYPE_TIMESTAMP (0x11)
63 #define BSON_TYPE_INT64 (0x12)
64 #define BSON_TYPE_MINKEY (0xFF)
65 #define BSON_TYPE_MAXKEY (0x7F)
74 const uint8_t*
bson_memfind(
const uint8_t* area,
size_t area_size,
const uint8_t* data,
size_t data_size);
107 const uint8_t*
bson_find_field(
const uint8_t* area,
size_t area_size, uint8_t type,
const char* name, uint32_t* size,
int index);
int32_t bson_dec_int32(const uint8_t *data)
Decode a BSON int32 value.
Definition: atcaprov_bson.c:56
void bson_enc_int32(uint8_t *data, int32_t value)
Encode a BSON int32 value.
Definition: atcaprov_bson.c:61
const uint8_t * bson_find_field(const uint8_t *area, size_t area_size, uint8_t type, const char *name, uint32_t *size, int index)
Simple routine to find fields in BSON data.
Definition: atcaprov_bson.c:74
const uint8_t * bson_memfind(const uint8_t *area, size_t area_size, const uint8_t *data, size_t data_size)
Find binary data within a search area.
Definition: atcaprov_bson.c:44
void bson_enc_bool(uint8_t *data, int value)
Encode a BSON boolean value.
Definition: atcaprov_bson.c:69