cmdmon: define 64-bit integer

Add a structure for 64-bit integers without requiring 64-bit alignment
to be usable in CMD_Reply without struct packing.

Add utility functions for conversion to/from network order. Avoid using
be64toh() and htobe64() as they don't seem to be available on all
supported systems.
This commit is contained in:
Miroslav Lichvar
2023-03-23 11:37:11 +01:00
parent 0845df7684
commit a511029cc2
4 changed files with 33 additions and 0 deletions

3
util.h
View File

@@ -172,6 +172,9 @@ extern double UTI_Log2ToDouble(int l);
extern void UTI_TimespecNetworkToHost(const Timespec *src, struct timespec *dest);
extern void UTI_TimespecHostToNetwork(const struct timespec *src, Timespec *dest);
uint64_t UTI_Integer64NetworkToHost(Integer64 i);
Integer64 UTI_Integer64HostToNetwork(uint64_t i);
extern double UTI_FloatNetworkToHost(Float x);
extern Float UTI_FloatHostToNetwork(double x);