diff options
author | Anton Kling <anton@kling.gg> | 2024-04-29 22:00:55 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-04-29 22:00:55 +0200 |
commit | 231301a6190605bd3ced4d961ee0d5d3fcd49d65 (patch) | |
tree | 8af67c28f9b638393f700fbaf2c9e33fd97a8b46 /userland/libc/include/socket.h | |
parent | 7d2ab3a71f4bda9d8ee997764d98b29e13a902c5 (diff) |
Kernel/IRC: Add setsockopt and move IRC client to use new socket interface
Diffstat (limited to 'userland/libc/include/socket.h')
-rw-r--r-- | userland/libc/include/socket.h | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/userland/libc/include/socket.h b/userland/libc/include/socket.h deleted file mode 100644 index bee592b..0000000 --- a/userland/libc/include/socket.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef SOCKET_H -#define SOCKET_H -#include <stddef.h> -#include <stdint.h> - -#define AF_UNIX 0 -#define AF_INET 1 -#define AF_LOCAL AF_UNIX - -#define SOCK_DGRAM 0 -#define SOCK_STREAM 1 - -#define INADDR_ANY 0 - -typedef struct { - int domain; - int type; - int protocol; - - // UNIX socket - char *path; - int incoming_fd; -} SOCKET; - -typedef struct { - char *path; - SOCKET *s; -} OPEN_UNIX_SOCKET; - -typedef uint32_t in_addr_t; -typedef uint16_t in_port_t; -typedef unsigned int sa_family_t; -typedef int socklen_t; - -struct sockaddr { - sa_family_t sa_family; /* Address family */ - char *sa_data; /* Socket address */ -}; - -struct sockaddr_in { - sa_family_t sin_family; - union { - uint32_t s_addr; - uint8_t a[4]; - } sin_addr; - uint16_t sin_port; -}; - -struct sockaddr_un { - sa_family_t sun_family; /* Address family */ - char *sun_path; /* Socket pathname */ -}; - -int socket(int domain, int type, int protocol); -int accept(int socket, struct sockaddr *address, socklen_t *address_len); -int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); -#endif // SOCKET_H |