2016-11-10 22:36:42 +00:00
|
|
|
#ifndef P2PNET_H
|
|
|
|
#define P2PNET_H
|
2016-11-10 22:31:55 +00:00
|
|
|
|
|
|
|
int socket_bind4(int s, uint32_t ip, uint16_t port);
|
|
|
|
int socket_bind4_reuse(int s, uint32_t ip, uint16_t port);
|
|
|
|
int socket_accept4(int s, uint32_t *ip, uint16_t *port);
|
|
|
|
int socket_local4(int s, uint32_t *ip, uint16_t *port);
|
|
|
|
int socket_connect4(int s, uint32_t ip, uint16_t port);
|
|
|
|
int socket_listen(int s, uint32_t *localip, uint16_t *localport);
|
2016-11-10 22:40:27 +00:00
|
|
|
ssize_t socket_read(int s, char *buf, size_t len, int flags);
|
|
|
|
ssize_t socket_write(int s, char *buf, size_t len, int flags);
|
2016-11-10 22:36:42 +00:00
|
|
|
|
|
|
|
int socket_tcp4(void);
|
2016-11-10 22:40:27 +00:00
|
|
|
|
|
|
|
int socket_stream_sctp4(void);
|
2016-11-10 22:43:31 +00:00
|
|
|
|
|
|
|
int socket_udp4(void);
|
2016-11-10 22:36:42 +00:00
|
|
|
#endif // P2PNET_H
|