1 /* headers to use the BSD sockets */
10 #define socket_error() WSAGetLastError()
12 #define EWOULDBLOCK WSAEWOULDBLOCK
13 #define EINTR WSAEINTR
14 #define EINPROGRESS WSAEINPROGRESS
16 int inet_aton(const char *cp
, struct in_addr
*ia
);
20 #include <sys/socket.h>
21 #include <netinet/in.h>
22 #include <netinet/tcp.h>
23 #include <arpa/inet.h>
27 #define socket_error() errno
28 #define closesocket(s) close(s)
32 #include "qemu-option.h"
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_opts(QemuOpts
*opts
, int port_offset
);
40 int inet_listen(const char *str
, char *ostr
, int olen
,
41 int socktype
, int port_offset
);
42 int inet_connect_opts(QemuOpts
*opts
);
43 int inet_connect(const char *str
, int socktype
);
44 int inet_dgram_opts(QemuOpts
*opts
);
46 int unix_listen_opts(QemuOpts
*opts
);
47 int unix_listen(const char *path
, char *ostr
, int olen
);
48 int unix_connect_opts(QemuOpts
*opts
);
49 int unix_connect(const char *path
);
51 /* Old, ipv4 only bits. Don't use for new code. */
52 int parse_host_port(struct sockaddr_in
*saddr
, const char *str
);
53 int parse_host_src_port(struct sockaddr_in
*haddr
,
54 struct sockaddr_in
*saddr
,
57 #endif /* QEMU_SOCKET_H */