1 /* headers to use the BSD sockets */
6 #define WIN32_LEAN_AND_MEAN
7 #define WINVER 0x0501 /* needed for ipv6 bits */
12 #define socket_error() WSAGetLastError()
14 #define EWOULDBLOCK WSAEWOULDBLOCK
15 #define EINTR WSAEINTR
16 #define EINPROGRESS WSAEINPROGRESS
18 int inet_aton(const char *cp, struct in_addr *ia);
22 #include <sys/socket.h>
23 #include <netinet/in.h>
24 #include <netinet/tcp.h>
25 #include <arpa/inet.h>
29 #define socket_error() errno
30 #define closesocket(s) close(s)
35 void socket_set_nonblock(int fd);
36 int send_all(int fd, const void *buf, int len1);
38 /* New, ipv6-ready socket helper functions, see qemu-sockets.c */
39 int inet_listen(const char *str, char *ostr, int olen,
40 int socktype, int port_offset);
41 int inet_connect(const char *str, int socktype);
43 int unix_listen(const char *path, char *ostr, int olen);
44 int unix_connect(const char *path);
46 /* Old, ipv4 only bits. Don't use for new code. */
47 int parse_host_port(struct sockaddr_in *saddr, const char *str);
48 int parse_host_src_port(struct sockaddr_in *haddr,
49 struct sockaddr_in *saddr,
52 #endif /* QEMU_SOCKET_H */