]>
Commit | Line | Data |
---|---|---|
f0cbd3ec FB |
1 | #ifndef _LIBSLIRP_H |
2 | #define _LIBSLIRP_H | |
3 | ||
101c5935 FB |
4 | #ifdef __cplusplus |
5 | extern "C" { | |
6 | #endif | |
7 | ||
c92ef6a2 JK |
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); | |
f0cbd3ec | 13 | |
5fafdf24 | 14 | void slirp_select_fill(int *pnfds, |
f0cbd3ec FB |
15 | fd_set *readfds, fd_set *writefds, fd_set *xfds); |
16 | ||
17 | void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds); | |
18 | ||
19 | void slirp_input(const uint8_t *pkt, int pkt_len); | |
20 | ||
21 | /* you must provide the following functions: */ | |
22 | int slirp_can_output(void); | |
23 | void slirp_output(const uint8_t *pkt, int pkt_len); | |
24 | ||
3c6a0580 | 25 | int slirp_add_hostfwd(int is_udp, struct in_addr host_addr, int host_port, |
c92ef6a2 | 26 | struct in_addr guest_addr, int guest_port); |
3c6a0580 | 27 | int slirp_remove_hostfwd(int is_udp, struct in_addr host_addr, int host_port); |
c92ef6a2 JK |
28 | int slirp_add_exec(int do_pty, const void *args, struct in_addr guest_addr, |
29 | int guest_port); | |
9bf05444 | 30 | |
31a60e22 | 31 | void slirp_stats(void); |
c92ef6a2 JK |
32 | void slirp_socket_recv(struct in_addr guest_addr, int guest_port, |
33 | const uint8_t *buf, int size); | |
34 | size_t slirp_socket_can_recv(struct in_addr guest_addr, int guest_port); | |
31a60e22 | 35 | |
101c5935 FB |
36 | #ifdef __cplusplus |
37 | } | |
38 | #endif | |
39 | ||
f0cbd3ec | 40 | #endif |