• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 struct timeval tt;
15 extern int link_up;
16 extern int slirp_socket;
17 extern int slirp_socket_unit;
18 extern int slirp_socket_port;
19 extern u_int32_t slirp_socket_addr;
20 extern char *slirp_socket_passwd;
21 extern int ctty_closed;
22 extern int slirp_restrict;
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 #define  DNS_ADDR_MAX  4
33 
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 uint32_t ctl_addr_ip;
39 extern uint32_t special_addr_ip;
40 extern uint32_t alias_addr_ip;
41 extern uint32_t our_addr_ip;
42 extern uint32_t loopback_addr_ip;
43 extern uint32_t dns_addr[DNS_ADDR_MAX];
44 extern int      dns_addr_count;
45 extern char *username;
46 extern char *socket_path;
47 extern int towrite_max;
48 extern int ppp_exit;
49 extern int tcp_keepintvl;
50 extern uint8_t client_ethaddr[6];
51 extern const char *slirp_special_ip;
52 extern int slirp_restrict;
53 
54 #define PROTO_SLIP 0x1
55 #ifdef USE_PPP
56 #define PROTO_PPP 0x2
57 #endif
58 
59 void if_encap(const uint8_t *ip_data, int ip_data_len);
60 ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags);
61