aboutsummaryrefslogtreecommitdiff
path: root/src/socket.h
blob: 1b1a7623b3b9b5d74d60890f4774bba543362f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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