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 | #ifndef VBOX
|
---|
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 | #endif /* !VBOX */
|
---|
24 |
|
---|
25 | /*
|
---|
26 | * Get the difference in 2 times from updtim()
|
---|
27 | * Allow for wraparound times, "just in case"
|
---|
28 | * x is the greater of the 2 (current time) and y is
|
---|
29 | * what it's being compared against.
|
---|
30 | */
|
---|
31 | #define TIME_DIFF(x,y) (x)-(y) < 0 ? ~0-(y)+(x) : (x)-(y)
|
---|
32 |
|
---|
33 | #ifndef VBOX
|
---|
34 | extern char *slirp_tty;
|
---|
35 | extern char *exec_shell;
|
---|
36 | extern u_int curtime;
|
---|
37 | extern fd_set *global_readfds, *global_writefds, *global_xfds;
|
---|
38 | extern struct in_addr ctl_addr;
|
---|
39 | extern struct in_addr special_addr;
|
---|
40 | extern struct in_addr alias_addr;
|
---|
41 | extern struct in_addr our_addr;
|
---|
42 | extern struct in_addr loopback_addr;
|
---|
43 | extern struct in_addr dns_addr;
|
---|
44 | extern char *username;
|
---|
45 | extern char *socket_path;
|
---|
46 | extern int towrite_max;
|
---|
47 | extern int ppp_exit;
|
---|
48 | extern int so_options;
|
---|
49 | extern int tcp_keepintvl;
|
---|
50 | extern uint8_t client_ethaddr[6];
|
---|
51 | #endif /* !VBOX */
|
---|
52 |
|
---|
53 | #define PROTO_SLIP 0x1
|
---|
54 | #ifdef USE_PPP
|
---|
55 | #define PROTO_PPP 0x2
|
---|
56 | #endif
|
---|
57 |
|
---|
58 | #ifdef VBOX
|
---|
59 | void if_encap(PNATState pData, const uint8_t *ip_data, int ip_data_len);
|
---|
60 | #else /* !VBOX */
|
---|
61 | void if_encap(const uint8_t *ip_data, int ip_data_len);
|
---|
62 | #endif /* !VBOX */
|
---|