blob: 1f3b84de92372a25543d2a9832ac4f2fe4acdbd5 [file] [log] [blame]
bellardf0cbd3e2004-04-22 00:10:48 +00001/*
2 * Copyright (c) 1995 Danny Gasparovski.
ths5fafdf22007-09-16 21:08:06 +00003 *
4 * Please read the file COPYRIGHT for the
bellardf0cbd3e2004-04-22 00:10:48 +00005 * 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
bellardf0cbd3e2004-04-22 00:10:48 +000013
bellardf0cbd3e2004-04-22 00:10:48 +000014extern int slirp_socket;
15extern int slirp_socket_unit;
16extern int slirp_socket_port;
Stefan Weilb6dce922010-07-22 22:15:23 +020017extern uint32_t slirp_socket_addr;
bellardf0cbd3e2004-04-22 00:10:48 +000018extern char *slirp_socket_passwd;
19extern 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
29extern char *slirp_tty;
30extern char *exec_shell;
31extern u_int curtime;
32extern fd_set *global_readfds, *global_writefds, *global_xfds;
bellardf0cbd3e2004-04-22 00:10:48 +000033extern struct in_addr loopback_addr;
Anthony Liguori0b8db8f2012-08-06 19:31:55 -050034extern unsigned long loopback_mask;
bellardf0cbd3e2004-04-22 00:10:48 +000035extern char *username;
36extern char *socket_path;
37extern int towrite_max;
38extern int ppp_exit;
bellardf0cbd3e2004-04-22 00:10:48 +000039extern int tcp_keepintvl;
bellardf0cbd3e2004-04-22 00:10:48 +000040
41#define PROTO_SLIP 0x1
42#ifdef USE_PPP
43#define PROTO_PPP 0x2
44#endif
45
Fabien Chouteau1ab74ce2011-08-01 18:18:37 +020046int if_encap(Slirp *slirp, struct mbuf *ifm);
aliguorie1c5a2b2009-01-08 19:18:21 +000047ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags);