• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "sockets.h"
8 #define  socket_error()  errno
9 #define  closesocket     socket_close
10 
11 /* New, ipv6-ready socket helper functions, see qemu-sockets.c */
12 int inet_listen_opts(QemuOpts *opts, int port_offset);
13 int inet_listen(const char *str, char *ostr, int olen,
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);
19 
20 int unix_listen_opts(QemuOpts *opts);
21 int unix_listen(const char *path, char *ostr, int olen);
22 int unix_connect_opts(QemuOpts *opts);
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 */
31