diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-09-01 14:47:43 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-09-01 15:33:20 +0200 |
commit | 9a623bfc32a56aa4142fdeacede57b98991edc4f (patch) | |
tree | c580618c0fbd63bfa58ee759fb4ce15d0b54356e /berkeley.h | |
parent | 7b42d7f3415149005b05b7b5ea14fca6cb01a261 (diff) |
initial commit
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'berkeley.h')
-rw-r--r-- | berkeley.h | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -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 |