4 #include "qemu-common.h"
7 typedef struct Slirp Slirp
;
9 int get_dns_addr(struct in_addr
*pdns_addr
);
11 Slirp
*slirp_init(int restricted
, struct in_addr vnetwork
,
12 struct in_addr vnetmask
, struct in_addr vhost
,
13 const char *vhostname
, const char *tftp_path
,
14 const char *bootfile
, struct in_addr vdhcp_start
,
15 struct in_addr vnameserver
, const char **vdnssearch
,
17 void slirp_cleanup(Slirp
*slirp
);
19 void slirp_update_timeout(uint32_t *timeout
);
20 void slirp_pollfds_fill(GArray
*pollfds
);
22 void slirp_pollfds_poll(GArray
*pollfds
, int select_error
);
24 void slirp_input(Slirp
*slirp
, const uint8_t *pkt
, int pkt_len
);
26 /* you must provide the following functions: */
27 void slirp_output(void *opaque
, const uint8_t *pkt
, int pkt_len
);
29 int slirp_add_hostfwd(Slirp
*slirp
, int is_udp
,
30 struct in_addr host_addr
, int host_port
,
31 struct in_addr guest_addr
, int guest_port
);
32 int slirp_remove_hostfwd(Slirp
*slirp
, int is_udp
,
33 struct in_addr host_addr
, int host_port
);
34 int slirp_add_exec(Slirp
*slirp
, int do_pty
, const void *args
,
35 struct in_addr
*guest_addr
, int guest_port
);
37 void slirp_connection_info(Slirp
*slirp
, Monitor
*mon
);
39 void slirp_socket_recv(Slirp
*slirp
, struct in_addr guest_addr
,
40 int guest_port
, const uint8_t *buf
, int size
);
41 size_t slirp_socket_can_recv(Slirp
*slirp
, struct in_addr guest_addr
,