root / slirp / libslirp.h @ 50d3eeae
History | View | Annotate | Download (929 Bytes)
1 | f0cbd3ec | bellard | #ifndef _LIBSLIRP_H
|
---|---|---|---|
2 | f0cbd3ec | bellard | #define _LIBSLIRP_H
|
3 | f0cbd3ec | bellard | |
4 | 379ff53d | bellard | #ifdef _WIN32
|
5 | 379ff53d | bellard | #include <winsock2.h> |
6 | 9bf05444 | bellard | int inet_aton(const char *cp, struct in_addr *ia); |
7 | 379ff53d | bellard | #else
|
8 | f0cbd3ec | bellard | #include <sys/select.h> |
9 | 9bf05444 | bellard | #include <arpa/inet.h> |
10 | 379ff53d | bellard | #endif
|
11 | f0cbd3ec | bellard | |
12 | 101c5935 | bellard | #ifdef __cplusplus
|
13 | 101c5935 | bellard | extern "C" { |
14 | 101c5935 | bellard | #endif
|
15 | 101c5935 | bellard | |
16 | f0cbd3ec | bellard | void slirp_init(void); |
17 | f0cbd3ec | bellard | |
18 | f0cbd3ec | bellard | void slirp_select_fill(int *pnfds, |
19 | f0cbd3ec | bellard | fd_set *readfds, fd_set *writefds, fd_set *xfds); |
20 | f0cbd3ec | bellard | |
21 | f0cbd3ec | bellard | void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds);
|
22 | f0cbd3ec | bellard | |
23 | f0cbd3ec | bellard | void slirp_input(const uint8_t *pkt, int pkt_len); |
24 | f0cbd3ec | bellard | |
25 | f0cbd3ec | bellard | /* you must provide the following functions: */
|
26 | f0cbd3ec | bellard | int slirp_can_output(void); |
27 | f0cbd3ec | bellard | void slirp_output(const uint8_t *pkt, int pkt_len); |
28 | f0cbd3ec | bellard | |
29 | 9bf05444 | bellard | int slirp_redir(int is_udp, int host_port, |
30 | 9bf05444 | bellard | struct in_addr guest_addr, int guest_port); |
31 | a3d4af03 | bellard | int slirp_add_exec(int do_pty, const char *args, int addr_low_byte, |
32 | a3d4af03 | bellard | int guest_port);
|
33 | 9bf05444 | bellard | |
34 | 9bf05444 | bellard | extern const char *tftp_prefix; |
35 | 3f423c9c | bellard | extern char slirp_hostname[33]; |
36 | 9bf05444 | bellard | |
37 | 101c5935 | bellard | #ifdef __cplusplus
|
38 | 101c5935 | bellard | } |
39 | 101c5935 | bellard | #endif
|
40 | 101c5935 | bellard | |
41 | f0cbd3ec | bellard | #endif |