From 0cbfbe129934976359460fdbe69fb97632d81d24 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Fri, 15 Sep 2023 11:21:31 +0200 Subject: Added C++ (`ksocket/ksocket.hpp`) Socket wrapper classes. * another flatbuffers example (WiP!) * Makefile improvements Signed-off-by: Toni Uhlig --- ksocket/utils.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ksocket/utils.h (limited to 'ksocket/utils.h') diff --git a/ksocket/utils.h b/ksocket/utils.h new file mode 100644 index 0000000..e3c0474 --- /dev/null +++ b/ksocket/utils.h @@ -0,0 +1,30 @@ +#ifndef KSOCKET_UTILS_H +#define KSOCKET_UTILS_H 1 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +uint64_t htonll(uint64_t hostlonglong); + +#ifndef BUILD_USERMODE +uint32_t htonl(uint32_t hostlong); + +uint16_t htons(uint16_t hostshort); +#endif + +uint64_t ntohll(uint64_t netlonglong); + +#ifndef BUILD_USERMODE +uint32_t ntohl(uint32_t netlong); + +uint16_t ntohs(uint16_t netshort); +#endif + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3