-
Notifications
You must be signed in to change notification settings - Fork 0
/
mrepro.h
38 lines (22 loc) · 1.19 KB
/
mrepro.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int Socket(int domain, int type,int protocol);
ssize_t Sendto(int sockfd, const void *buf, size_t len, int flags,
const struct sockaddr *dest_addr, socklen_t addrlen);
ssize_t Recvfrom(int sockfd, void *buf, size_t len, int flags,
struct sockaddr *src_addr, socklen_t *addrlen);
int Bind(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 Accept(int socket, struct sockaddr *cliaddr, socklen_t *addrlen);
int Getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res);
int Inet_pton(int af, const char *src, void *dst);
const char *Inet_ntop(int af, const void *src, char *dst, socklen_t size);
ssize_t readn(int fd, void *vptr, size_t n);
ssize_t writen(int fd, const void *vptr, size_t n);
int read_till_newline(void *buffer, int tcp_sock_fd);
void my_print(int priority, const char *fmt, ...);
void bind_service(int sock_fd, char *serv_name, int socktype);
int read_http_req(int conn_fd, void **buf, int buf_len);