aboutsummaryrefslogtreecommitdiff
path: root/berkeley.h
diff options
context:
space:
mode:
Diffstat (limited to 'berkeley.h')
-rw-r--r--berkeley.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/berkeley.h b/berkeley.h
index 75cdb0f..0d09c77 100644
--- a/berkeley.h
+++ b/berkeley.h
@@ -1,38 +1,41 @@
#pragma once
#include <ntddk.h>
-#include <wsk.h>
#include <stdint.h>
+#include <wsk.h>
+
+#define socket socket_connection
#ifdef __cplusplus
extern "C" {
#endif
-typedef int socklen_t;
-typedef intptr_t ssize_t;
+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);
+int getaddrinfo(const char *node, const char *service,
+ const struct addrinfo *hints, struct addrinfo **res);
void freeaddrinfo(struct addrinfo *res);
int socket_connection(int domain, int type, int protocol);
int socket_listen(int domain, int type, int protocol);
int socket_datagram(int domain, int type, int protocol);
-int connect(int sockfd, const struct sockaddr* addr, socklen_t addrlen);
+int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
int listen(int sockfd, int backlog);
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
-int send(int sockfd, const void* buf, size_t len, int flags);
-int sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen);
-int recv(int sockfd, void* buf, size_t len, int flags);
-int recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen);
+int send(int sockfd, const void *buf, size_t len, int flags);
+int sendto(int sockfd, const void *buf, size_t len, int flags,
+ const struct sockaddr *dest_addr, socklen_t addrlen);
+int recv(int sockfd, void *buf, size_t len, int flags);
+int recvfrom(int sockfd, void *buf, size_t len, int flags,
+ struct sockaddr *src_addr, socklen_t *addrlen);
int closesocket(int sockfd);
-#define socket socket_connection
-
#ifdef __cplusplus
}
#endif