diff options
Diffstat (limited to 'src/socket.h')
-rw-r--r-- | src/socket.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/socket.h b/src/socket.h new file mode 100644 index 0000000..1b1a762 --- /dev/null +++ b/src/socket.h @@ -0,0 +1,19 @@ +#ifndef POTD_SOCKET_H +#define POTD_SOCKET_H 1 + +#include <netinet/in.h> + +#define POTD_BACKLOG 3 + +typedef struct psocket { + int fd; + struct sockaddr_in sock; +} psocket; + + +int socket_init_in(psocket *psocket, const char *listen_addr, + unsigned int listen_port); + +int socket_bind_listen(psocket *psocket); + +#endif |