aboutsummaryrefslogtreecommitdiff
path: root/ksocket/berkeley.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-09-15 11:21:31 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-09-15 11:21:31 +0200
commit0cbfbe129934976359460fdbe69fb97632d81d24 (patch)
tree3d4685fc1f02244c80d4f5de2fa6c80fae94a425 /ksocket/berkeley.h
parent37d1e657e5e79bc240ea036cfb8da377b1640490 (diff)
Added C++ (`ksocket/ksocket.hpp`) Socket wrapper classes.
* another flatbuffers example (WiP!) * Makefile improvements Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'ksocket/berkeley.h')
-rw-r--r--ksocket/berkeley.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/ksocket/berkeley.h b/ksocket/berkeley.h
index b879d3c..1475a89 100644
--- a/ksocket/berkeley.h
+++ b/ksocket/berkeley.h
@@ -1,6 +1,11 @@
-#pragma once
+#ifndef KSOCKET_BERKELEY_H
+#define KSOCKET_BERKELEY_H 1
+
+#ifdef BUILD_USERMODE
+#error "This file should only be included if building for kernel mode! Include <ksocket/ksocket.hpp> wrapper instead."
+#endif
+
#include <ntddk.h>
-#include <stdint.h>
#include <ksocket/wsk.h>
#define socket socket_connection
@@ -12,11 +17,6 @@ extern "C" {
typedef int socklen_t;
typedef intptr_t ssize_t;
-uint32_t htonl(uint32_t hostlong);
-uint16_t htons(uint16_t hostshort);
-uint32_t ntohl(uint32_t netlong);
-uint16_t ntohs(uint16_t netshort);
-
int getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res);
void freeaddrinfo(struct addrinfo *res);
@@ -39,3 +39,5 @@ int closesocket(int sockfd);
#ifdef __cplusplus
}
#endif
+
+#endif