[Yunq] Move serialization to yunq library.

This commit is contained in:
Drew Galbraith 2024-01-11 20:36:41 -08:00
parent 0135d8d844
commit 7ec4f696a8
9 changed files with 316 additions and 486 deletions

22
lib/yunq/yunq.h Normal file
View file

@ -0,0 +1,22 @@
#pragma once
#include <stdint.h>
namespace yunq {
struct MessageHeader {
uint32_t ident;
uint32_t core_length;
uint32_t length;
uint32_t crc32;
uint64_t options;
} __attribute__((packed));
const uint64_t kHeaderSize = 24; // 4x uint32, 1x uint64
struct ExtensionPointer {
uint32_t offset;
uint32_t length;
};
} // namespace yunq