aboutsummaryrefslogtreecommitdiff
path: root/slirp/libslirp.h
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-06-24 14:42:30 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 08:52:49 -0500
commitd918f23efaf486293b96418fe5deaff8a5583304 (patch)
tree59fa071ef2883a5c1a92c305cee42864b8236b3e /slirp/libslirp.h
parent8ec7f4edcfcca6ef5d197f1d9323137ece5f7a89 (diff)
slirp: Kill slirp_is_inited
Avoid the need for slirp_is_inited by refactoring the protected slirp_select_* functions. This also avoids the clearing of all fd sets on select errors. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'slirp/libslirp.h')
-rw-r--r--slirp/libslirp.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/slirp/libslirp.h b/slirp/libslirp.h
index 8117187f94..b0496d546f 100644
--- a/slirp/libslirp.h
+++ b/slirp/libslirp.h
@@ -3,6 +3,8 @@
#include <qemu-common.h>
+#ifdef CONFIG_SLIRP
+
void slirp_init(int restricted, struct in_addr vnetwork,
struct in_addr vnetmask, struct in_addr vhost,
const char *vhostname, const char *tftp_path,
@@ -12,7 +14,8 @@ void slirp_init(int restricted, struct in_addr vnetwork,
void slirp_select_fill(int *pnfds,
fd_set *readfds, fd_set *writefds, fd_set *xfds);
-void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds);
+void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
+ int select_error);
void slirp_input(const uint8_t *pkt, int pkt_len);
@@ -32,4 +35,13 @@ void slirp_socket_recv(struct in_addr guest_addr, int guest_port,
const uint8_t *buf, int size);
size_t slirp_socket_can_recv(struct in_addr guest_addr, int guest_port);
+#else /* !CONFIG_SLIRP */
+
+static inline void slirp_select_fill(int *pnfds, fd_set *readfds,
+ fd_set *writefds, fd_set *xfds) { }
+
+static inline void slirp_select_poll(fd_set *readfds, fd_set *writefds,
+ fd_set *xfds, int select_error) { }
+#endif /* !CONFIG_SLIRP */
+
#endif