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 | */ |
Markus Armbruster | 175de52 | 2016-06-29 15:29:06 +0200 | [diff] [blame] | 7 | |
Paolo Bonzini | cb9c377 | 2012-12-06 12:15:58 +0100 | [diff] [blame] | 8 | #ifndef SLIRP_MAIN_H |
Markus Armbruster | 175de52 | 2016-06-29 15:29:06 +0200 | [diff] [blame] | 9 | #define SLIRP_MAIN_H |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 10 | |
| 11 | #ifdef HAVE_SYS_SELECT_H |
| 12 | #include <sys/select.h> |
| 13 | #endif |
| 14 | |
| 15 | #define TOWRITEMAX 512 |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 16 | |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 17 | extern int slirp_socket; |
| 18 | extern int slirp_socket_unit; |
| 19 | extern int slirp_socket_port; |
Stefan Weil | b6dce92 | 2010-07-22 22:15:23 +0200 | [diff] [blame] | 20 | extern uint32_t slirp_socket_addr; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 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; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 35 | extern struct in_addr loopback_addr; |
Anthony Liguori | 0b8db8f | 2012-08-06 19:31:55 -0500 | [diff] [blame] | 36 | extern unsigned long loopback_mask; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 37 | extern char *username; |
| 38 | extern char *socket_path; |
| 39 | extern int towrite_max; |
| 40 | extern int ppp_exit; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 41 | extern int tcp_keepintvl; |
bellard | f0cbd3e | 2004-04-22 00:10:48 +0000 | [diff] [blame] | 42 | |
| 43 | #define PROTO_SLIP 0x1 |
| 44 | #ifdef USE_PPP |
| 45 | #define PROTO_PPP 0x2 |
| 46 | #endif |
| 47 | |
Fabien Chouteau | 1ab74ce | 2011-08-01 18:18:37 +0200 | [diff] [blame] | 48 | int if_encap(Slirp *slirp, struct mbuf *ifm); |
aliguori | e1c5a2b | 2009-01-08 19:18:21 +0000 | [diff] [blame] | 49 | ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags); |
Paolo Bonzini | cb9c377 | 2012-12-06 12:15:58 +0100 | [diff] [blame] | 50 | |
| 51 | #endif |