aboutsummaryrefslogtreecommitdiff
path: root/src/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket.h')
-rw-r--r--src/socket.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/socket.h b/src/socket.h
index 787b7a5..368c2b6 100644
--- a/src/socket.h
+++ b/src/socket.h
@@ -41,8 +41,6 @@ int sock_open(void);
41int sock_close(void); 41int sock_close(void);
42void sock_destroy(p_sock ps); 42void sock_destroy(p_sock ps);
43void sock_shutdown(p_sock ps, int how); 43void sock_shutdown(p_sock ps, int how);
44int sock_send(p_sock ps, const char *data, size_t count, size_t *sent, p_tm tm);
45int sock_recv(p_sock ps, char *data, size_t count, size_t *got, p_tm tm);
46int sock_sendto(p_sock ps, const char *data, size_t count, 44int sock_sendto(p_sock ps, const char *data, size_t count,
47 size_t *sent, SA *addr, socklen_t addr_len, p_tm tm); 45 size_t *sent, SA *addr, socklen_t addr_len, p_tm tm);
48int sock_recvfrom(p_sock ps, char *data, size_t count, 46int sock_recvfrom(p_sock ps, char *data, size_t count,
@@ -51,15 +49,22 @@ void sock_setnonblocking(p_sock ps);
51void sock_setblocking(p_sock ps); 49void sock_setblocking(p_sock ps);
52int sock_select(int n, fd_set *rfds, fd_set *wfds, fd_set *efds, p_tm tm); 50int sock_select(int n, fd_set *rfds, fd_set *wfds, fd_set *efds, p_tm tm);
53 51
54const char *sock_connect(p_sock ps, SA *addr, socklen_t addr_len, p_tm tm); 52int sock_connect(p_sock ps, SA *addr, socklen_t addr_len, p_tm tm);
55const char *sock_create(p_sock ps, int domain, int type, int protocol); 53int sock_create(p_sock ps, int domain, int type, int protocol);
56const char *sock_bind(p_sock ps, SA *addr, socklen_t addr_len); 54int sock_bind(p_sock ps, SA *addr, socklen_t addr_len);
57const char *sock_listen(p_sock ps, int backlog); 55int sock_listen(p_sock ps, int backlog);
58const char *sock_accept(p_sock ps, p_sock pa, SA *addr, 56int sock_accept(p_sock ps, p_sock pa, SA *addr, socklen_t *addr_len, p_tm tm);
59 socklen_t *addr_len, p_tm tm); 57
58const char *sock_hoststrerror(int err);
59const char *sock_strerror(int err);
60
61/* these are perfect to use with the io abstraction module
62 and the buffered input module */
63int sock_send(p_sock ps, const char *data, size_t count, size_t *sent, p_tm tm);
64int sock_recv(p_sock ps, char *data, size_t count, size_t *got, p_tm tm);
65const char *sock_ioerror(p_sock ps, int err);
60 66
61const char *sock_geterr(p_sock ps, int code); 67int sock_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp);
62const char *sock_hoststrerror(void); 68int sock_gethostbyname(const char *addr, struct hostent **hp);
63const char *sock_strerror(void);
64 69
65#endif /* SOCK_H */ 70#endif /* SOCK_H */