bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 1995 Danny Gasparovski. |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 3 | * |
| 4 | * Please read the file COPYRIGHT for the |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 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 |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 13 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 14 | extern int slirp_socket; |
| 15 | extern int slirp_socket_unit; |
| 16 | extern int slirp_socket_port; |
Stefan Weil | b6dce92 | 2010-07-22 22:15:23 +0200 | [diff] [blame] | 17 | extern uint32_t slirp_socket_addr; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 18 | extern char *slirp_socket_passwd; |
| 19 | extern int ctty_closed; |
| 20 | |
| 21 | /* |
| 22 | * Get the difference in 2 times from updtim() |
| 23 | * Allow for wraparound times, "just in case" |
| 24 | * x is the greater of the 2 (current time) and y is |
| 25 | * what it's being compared against. |
| 26 | */ |
| 27 | #define TIME_DIFF(x,y) (x)-(y) < 0 ? ~0-(y)+(x) : (x)-(y) |
| 28 | |
| 29 | extern char *slirp_tty; |
| 30 | extern char *exec_shell; |
| 31 | extern u_int curtime; |
| 32 | extern fd_set *global_readfds, *global_writefds, *global_xfds; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 33 | extern struct in_addr loopback_addr; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 34 | extern char *username; |
| 35 | extern char *socket_path; |
| 36 | extern int towrite_max; |
| 37 | extern int ppp_exit; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 38 | extern int tcp_keepintvl; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 39 | |
| 40 | #define PROTO_SLIP 0x1 |
| 41 | #ifdef USE_PPP |
| 42 | #define PROTO_PPP 0x2 |
| 43 | #endif |
| 44 | |
Jan Kiszka | 460fec6 | 2009-06-24 14:42:31 +0200 | [diff] [blame] | 45 | void if_encap(Slirp *slirp, const uint8_t *ip_data, int ip_data_len); |
aliguori | e1c5a2b | 2009-01-08 19:18:21 +0000 | [diff] [blame] | 46 | ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags); |