1/* headers to use the BSD sockets */
2#ifndef QEMU__SOCKET_H
3#define QEMU__SOCKET_H
4
5#include "qemu/option.h"
6
7#include "android/sockets.h"
8#define  socket_error()  errno
9#define  closesocket     socket_close
10
11/* New, ipv6-ready socket helper functions, see qemu-sockets.c */
12int inet_listen_opts(QemuOpts *opts, int port_offset);
13int inet_listen(const char *str, char *ostr, int olen,
14                int socktype, int port_offset);
15int inet_connect_opts(QemuOpts *opts);
16int inet_connect(const char *str, int socktype);
17int inet_dgram_opts(QemuOpts *opts);
18const char *inet_strfamily(int family);
19
20int unix_listen_opts(QemuOpts *opts);
21int unix_listen(const char *path, char *ostr, int olen);
22int unix_connect_opts(QemuOpts *opts);
23int unix_connect(const char *path);
24
25/* Old, ipv4 only bits.  Don't use for new code. */
26int parse_host_port(SockAddress*  saddr, const char *str);
27int parse_host_src_port(SockAddress*  haddr, SockAddress*  saddr,
28                        const char *str);
29
30void qemu_set_block(int fd);
31
32#endif /* QEMU__SOCKET_H */
33