diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-06-24 14:42:30 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-29 08:52:49 -0500 |
commit | fc398e1320220052b654325c58b648d9b07ee44c (patch) | |
tree | 2e7b5a5542b1255a87c65454e6252a930e516775 /libslirp.h | |
parent | 134b5339bed53fa185470c04b2936d58e3fc3695 (diff) | |
download | slirp-fc398e1320220052b654325c58b648d9b07ee44c.zip slirp-fc398e1320220052b654325c58b648d9b07ee44c.tar.gz slirp-fc398e1320220052b654325c58b648d9b07ee44c.tar.bz2 |
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 'libslirp.h')
-rw-r--r-- | libslirp.h | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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,17 @@ 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 |