1 /* headers to use the BSD sockets */
10 #define socket_error() WSAGetLastError()
12 int inet_aton(const char *cp
, struct in_addr
*ia
);
16 #include <sys/types.h>
17 #include <sys/socket.h>
18 #include <netinet/in.h>
19 #include <netinet/tcp.h>
20 #include <arpa/inet.h>
24 #define socket_error() errno
25 #define closesocket(s) close(s)
29 #include "qemu-option.h"
32 int qemu_socket(int domain
, int type
, int protocol
);
33 int qemu_accept(int s
, struct sockaddr
*addr
, socklen_t
*addrlen
);
34 int socket_set_cork(int fd
, int v
);
35 void socket_set_block(int fd
);
36 void socket_set_nonblock(int fd
);
37 int send_all(int fd
, const void *buf
, int len1
);
39 /* New, ipv6-ready socket helper functions, see qemu-sockets.c */
40 int inet_listen_opts(QemuOpts
*opts
, int port_offset
);
41 int inet_listen(const char *str
, char *ostr
, int olen
,
42 int socktype
, int port_offset
);
43 int inet_connect_opts(QemuOpts
*opts
);
44 int inet_connect(const char *str
, int socktype
);
45 int inet_dgram_opts(QemuOpts
*opts
);
46 const char *inet_strfamily(int family
);
48 int unix_listen_opts(QemuOpts
*opts
);
49 int unix_listen(const char *path
, char *ostr
, int olen
);
50 int unix_connect_opts(QemuOpts
*opts
);
51 int unix_connect(const char *path
);
53 /* Old, ipv4 only bits. Don't use for new code. */
54 int parse_host_port(struct sockaddr_in
*saddr
, const char *str
);
55 int socket_init(void);
57 #endif /* QEMU_SOCKET_H */