1#ifndef _LIBSLIRP_H
2#define _LIBSLIRP_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8void slirp_init(int restricted, const char *special_ip);
9
10void slirp_select_fill(int *pnfds,
11                       fd_set *readfds, fd_set *writefds, fd_set *xfds);
12
13void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds);
14
15void slirp_input(const uint8_t *pkt, int pkt_len);
16
17/* you must provide the following functions: */
18int slirp_can_output(void);
19void slirp_output(const uint8_t *pkt, int pkt_len);
20
21void slirp_redir_loop(void (*func)(void *opaque, int is_udp,
22                                  struct in_addr *laddr, u_int lport,
23                                  struct in_addr *faddr, u_int fport),
24                     void *opaque);
25int slirp_redir_rm(int is_udp, int host_port);
26int slirp_redir(int is_udp, int host_port,
27                struct in_addr guest_addr, int guest_port);
28int slirp_add_exec(int do_pty, const void *args, int addr_low_byte,
29                   int guest_port);
30
31extern const char *tftp_prefix;
32extern char slirp_hostname[33];
33extern const char *bootp_filename;
34
35void slirp_stats(void);
36void slirp_socket_recv(int addr_low_byte, int guest_port, const uint8_t *buf,
37		int size);
38size_t slirp_socket_can_recv(int addr_low_byte, int guest_port);
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif
45