diff options
| author | Osmium Sorcerer <os@sof.beauty> | 2026-03-22 18:16:52 +0000 |
|---|---|---|
| committer | Osmium Sorcerer <os@sof.beauty> | 2026-03-29 22:22:25 +0000 |
| commit | 6c30e71ed08cdb838b77b3fe52dea30774574230 (patch) | |
| tree | 9620ee98a417f82f29c7ae101de0b021720c3612 /src/vli.h | |
| parent | ade040cfa6c402bb336e7772de5e675549ded18e (diff) | |
Add the extension packets
Introduce the subprotocol ("Einsof"), its prototype serialization and
parsing functions, and its first set of messages.
These messages are carriers of public-key authentication mechanism which
involves client request, server challenge, and client response. An
"ident" message is used to tell a compatible server that you support a
particular version of the subprotocol.
Note: the functions that handle encoding are very specialized.
They're not representative of how the wire format should be generally
handled, and were written this way because the first set of messages is
tiny and simple enough.
Diffstat (limited to 'src/vli.h')
| -rw-r--r-- | src/vli.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vli.h b/src/vli.h new file mode 100644 index 0000000..97e066a --- /dev/null +++ b/src/vli.h @@ -0,0 +1,19 @@ +#ifndef EXT_VLI_H +#define EXT_VLI_H + +#include <stdint.h> +#include <string.h> + +size_t vli64_encode(uint8_t *p, uint64_t u); +size_t vli64_decode(uint8_t const *p, uint64_t *u); + +size_t vli64_encode_signed(uint8_t *p, int64_t i); +size_t vli64_decode_signed(uint8_t const *p, int64_t *i); + +size_t vli32_encode(uint8_t *p, uint32_t u); +size_t vli32_decode(uint8_t const *p, uint32_t *u); + +size_t vli32_encode_signed(uint8_t *p, int32_t i); +size_t vli32_decode_signed(uint8_t const *p, int32_t *i); + +#endif /* EXT_VLI_H */ |
