1 #ifndef _XSOCKET_H____
2 #define _XSOCKET_H____
3 
4 #include "hasipv6.h"
5 
6 #define XSOCKET_V4 4
7 #define XSOCKET_V6 6
8 
9 extern int xsocket_tcp(int);
10 extern int xsocket_udp(int);
11 
12 extern long long xsocket_send(int, int, const unsigned char *, long long, const unsigned char *, const unsigned char *, long long);
13 extern long long xsocket_recv(int, int, unsigned char *, long long, unsigned char *, unsigned char *, long long *);
14 
15 extern int xsocket_bind(int, int, const unsigned char *, const unsigned char *, long long);
16 extern int xsocket_bind_reuse(int, int, const unsigned char *, const unsigned char *, long long);
17 extern void xsocket_tryreservein(int, int);
18 extern int xsocket_listen(int, long long);
19 extern int xsocket_accept(int, int, unsigned char *, unsigned char *, long long *);
20 extern int xsocket_local(int, int, unsigned char *, unsigned char *, long long *);
21 
22 extern int xsocket_connect(int, int, const unsigned char *, const unsigned char *, long long);
23 extern int xsocket_connected(int);
24 
25 extern int xsocket_ipoptionskill(int);
26 extern int xsocket_tcpnodelay(int);
27 extern long long xsocket_getscopeid(const char *);
28 
29 extern int xsocket_type(const unsigned char *);
30 
31 #define xsocket_ANYIP6 (const unsigned char *)"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
32 #define xsocket_ANYIP4 (const unsigned char *)"\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0"
33 #define xsocket_PREFIX4 (const unsigned char *)"\0\0\0\0\0\0\0\0\0\0\377\377"
34 
35 #ifdef HASIPV6
36   #define xsocket_ANYIP xsocket_ANYIP6
37 #else
38   #define xsocket_ANYIP xsocket_ANYIP4
39 #endif
40 
41 #endif
42