David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 1 | /* headers to use the BSD sockets */ |
| 2 | #ifndef QEMU__SOCKET_H |
| 3 | #define QEMU__SOCKET_H |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 4 | |
David Turner | 315ceb8 | 2010-09-10 14:15:17 +0200 | [diff] [blame] | 5 | #include "qemu-option.h" |
| 6 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 7 | #include "sockets.h" |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 8 | #define socket_error() errno |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 9 | #define closesocket socket_close |
| 10 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 11 | /* New, ipv6-ready socket helper functions, see qemu-sockets.c */ |
David Turner | 315ceb8 | 2010-09-10 14:15:17 +0200 | [diff] [blame] | 12 | int inet_listen_opts(QemuOpts *opts, int port_offset); |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 13 | int inet_listen(const char *str, char *ostr, int olen, |
David Turner | 315ceb8 | 2010-09-10 14:15:17 +0200 | [diff] [blame] | 14 | int socktype, int port_offset); |
| 15 | int inet_connect_opts(QemuOpts *opts); |
| 16 | int inet_connect(const char *str, int socktype); |
| 17 | int inet_dgram_opts(QemuOpts *opts); |
| 18 | const char *inet_strfamily(int family); |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 19 | |
David Turner | 315ceb8 | 2010-09-10 14:15:17 +0200 | [diff] [blame] | 20 | int unix_listen_opts(QemuOpts *opts); |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 21 | int unix_listen(const char *path, char *ostr, int olen); |
David Turner | 315ceb8 | 2010-09-10 14:15:17 +0200 | [diff] [blame] | 22 | int unix_connect_opts(QemuOpts *opts); |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 23 | int unix_connect(const char *path); |
| 24 | |
| 25 | /* Old, ipv4 only bits. Don't use for new code. */ |
| 26 | int parse_host_port(SockAddress* saddr, const char *str); |
| 27 | int parse_host_src_port(SockAddress* haddr, SockAddress* saddr, |
| 28 | const char *str); |
| 29 | |
| 30 | #endif /* QEMU__SOCKET_H */ |