root / slirp / main.h @ a8c490cd
History | View | Annotate | Download (1.3 kB)
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 |
#define min(x,y) ((x) < (y) ? (x) : (y))
|
14 |
|
15 |
extern struct timeval tt; |
16 |
extern int link_up; |
17 |
extern int slirp_socket; |
18 |
extern int slirp_socket_unit; |
19 |
extern int slirp_socket_port; |
20 |
extern u_int32_t slirp_socket_addr;
|
21 |
extern char *slirp_socket_passwd; |
22 |
extern int ctty_closed; |
23 |
|
24 |
/*
|
25 |
* Get the difference in 2 times from updtim()
|
26 |
* Allow for wraparound times, "just in case"
|
27 |
* x is the greater of the 2 (current time) and y is
|
28 |
* what it's being compared against.
|
29 |
*/
|
30 |
#define TIME_DIFF(x,y) (x)-(y) < 0 ? ~0-(y)+(x) : (x)-(y) |
31 |
|
32 |
extern char *slirp_tty; |
33 |
extern char *exec_shell; |
34 |
extern u_int curtime;
|
35 |
extern fd_set *global_readfds, *global_writefds, *global_xfds;
|
36 |
extern struct in_addr ctl_addr; |
37 |
extern struct in_addr special_addr; |
38 |
extern struct in_addr our_addr; |
39 |
extern struct in_addr loopback_addr; |
40 |
extern struct in_addr dns_addr; |
41 |
extern char *username; |
42 |
extern char *socket_path; |
43 |
extern int towrite_max; |
44 |
extern int ppp_exit; |
45 |
extern int so_options; |
46 |
extern int tcp_keepintvl; |
47 |
extern uint8_t client_ethaddr[6]; |
48 |
|
49 |
#define PROTO_SLIP 0x1 |
50 |
#ifdef USE_PPP
|
51 |
#define PROTO_PPP 0x2 |
52 |
#endif
|
53 |
|
54 |
void if_encap(const uint8_t *ip_data, int ip_data_len); |