]> git.proxmox.com Git - qemu.git/blob - slirp/main.h
slirp: Factor out internal state structure
[qemu.git] / slirp / main.h
1 /*
2 * Copyright (c) 1995 Danny Gasparovski.
3 *
4 * Please read the file COPYRIGHT for the
5 * terms and conditions of the copyright.
6 */
7
8 #ifdef HAVE_SYS_SELECT_H
9 #include <sys/select.h>
10 #endif
11
12 #define TOWRITEMAX 512
13
14 extern int link_up;
15 extern int slirp_socket;
16 extern int slirp_socket_unit;
17 extern int slirp_socket_port;
18 extern u_int32_t slirp_socket_addr;
19 extern char *slirp_socket_passwd;
20 extern int ctty_closed;
21
22 /*
23 * Get the difference in 2 times from updtim()
24 * Allow for wraparound times, "just in case"
25 * x is the greater of the 2 (current time) and y is
26 * what it's being compared against.
27 */
28 #define TIME_DIFF(x,y) (x)-(y) < 0 ? ~0-(y)+(x) : (x)-(y)
29
30 extern char *slirp_tty;
31 extern char *exec_shell;
32 extern u_int curtime;
33 extern fd_set *global_readfds, *global_writefds, *global_xfds;
34 extern struct in_addr our_addr;
35 extern struct in_addr loopback_addr;
36 extern struct in_addr dns_addr;
37 extern char *username;
38 extern char *socket_path;
39 extern int towrite_max;
40 extern int ppp_exit;
41 extern int tcp_keepintvl;
42
43 #define PROTO_SLIP 0x1
44 #ifdef USE_PPP
45 #define PROTO_PPP 0x2
46 #endif
47
48 void if_encap(Slirp *slirp, const uint8_t *ip_data, int ip_data_len);
49 ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags);