15d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner/* headers to use the BSD sockets */
25d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner#ifndef QEMU__SOCKET_H
35d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner#define QEMU__SOCKET_H
48b23a6c7e1aee255004dd19098d4c2462b61b849The Android Open Source Project
58b23a6c7e1aee255004dd19098d4c2462b61b849The Android Open Source Project#include "sockets.h"
65d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner#define  socket_error()  errno
78b23a6c7e1aee255004dd19098d4c2462b61b849The Android Open Source Project#define  closesocket     socket_close
88b23a6c7e1aee255004dd19098d4c2462b61b849The Android Open Source Project
95d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner/* New, ipv6-ready socket helper functions, see qemu-sockets.c */
105d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turnerint inet_listen(const char *str, char *ostr, int olen,
115d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner                SocketType socktype, int port_offset);
125d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turnerint inet_connect(const char *str, SocketType socktype);
135d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner
145d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turnerint unix_listen(const char *path, char *ostr, int olen);
155d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turnerint unix_connect(const char *path);
165d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner
175d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner/* Old, ipv4 only bits.  Don't use for new code. */
185d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turnerint parse_host_port(SockAddress*  saddr, const char *str);
195d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turnerint parse_host_src_port(SockAddress*  haddr, SockAddress*  saddr,
205d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner                        const char *str);
215d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner
225d8f37ad78fc66901af50c762029a501561f3b23David 'Digit' Turner#endif /* QEMU__SOCKET_H */
23