slirp: Rework external configuration interface
[qemu-kvm/fedora.git] / slirp / libslirp.h
blobe4c9c99c3ba2d128a3ad2c1716edb426439421dd
1 #ifndef _LIBSLIRP_H
2 #define _LIBSLIRP_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 void slirp_init(int restricted, struct in_addr vnetwork,
9 struct in_addr vnetmask, struct in_addr vhost,
10 const char *vhostname, const char *tftp_path,
11 const char *bootfile, struct in_addr vdhcp_start,
12 struct in_addr vnameserver);
14 void slirp_select_fill(int *pnfds,
15 fd_set *readfds, fd_set *writefds, fd_set *xfds);
17 void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds);
19 void slirp_input(const uint8_t *pkt, int pkt_len);
21 /* you must provide the following functions: */
22 int slirp_can_output(void);
23 void slirp_output(const uint8_t *pkt, int pkt_len);
25 int slirp_add_hostfwd(int is_udp, int host_port,
26 struct in_addr guest_addr, int guest_port);
27 int slirp_remove_hostfwd(int is_udp, int host_port);
29 int slirp_add_exec(int do_pty, const void *args, struct in_addr guest_addr,
30 int guest_port);
32 void slirp_stats(void);
33 void slirp_socket_recv(struct in_addr guest_addr, int guest_port,
34 const uint8_t *buf, int size);
35 size_t slirp_socket_can_recv(struct in_addr guest_addr, int guest_port);
37 #ifdef __cplusplus
39 #endif
41 #endif