blob: 90053ce5eca6c5a5f6dc1708c65c1a58d70cc084 [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 */
Markus Armbruster175de522016-06-29 15:29:06 +02007
Paolo Bonzinicb9c3772012-12-06 12:15:58 +01008#ifndef SLIRP_MAIN_H
Markus Armbruster175de522016-06-29 15:29:06 +02009#define SLIRP_MAIN_H
bellardf0cbd3e2004-04-22 00:10:48 +000010
11#ifdef HAVE_SYS_SELECT_H
12#include <sys/select.h>
13#endif
14
15#define TOWRITEMAX 512
bellardf0cbd3e2004-04-22 00:10:48 +000016
bellardf0cbd3e2004-04-22 00:10:48 +000017extern int slirp_socket;
18extern int slirp_socket_unit;
19extern int slirp_socket_port;
Stefan Weilb6dce922010-07-22 22:15:23 +020020extern uint32_t slirp_socket_addr;
bellardf0cbd3e2004-04-22 00:10:48 +000021extern char *slirp_socket_passwd;
22extern 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
32extern char *slirp_tty;
33extern char *exec_shell;
34extern u_int curtime;
bellardf0cbd3e2004-04-22 00:10:48 +000035extern struct in_addr loopback_addr;
Anthony Liguori0b8db8f2012-08-06 19:31:55 -050036extern unsigned long loopback_mask;
bellardf0cbd3e2004-04-22 00:10:48 +000037extern char *username;
38extern char *socket_path;
39extern int towrite_max;
40extern int ppp_exit;
bellardf0cbd3e2004-04-22 00:10:48 +000041extern int tcp_keepintvl;
bellardf0cbd3e2004-04-22 00:10:48 +000042
43#define PROTO_SLIP 0x1
44#ifdef USE_PPP
45#define PROTO_PPP 0x2
46#endif
47
Fabien Chouteau1ab74ce2011-08-01 18:18:37 +020048int if_encap(Slirp *slirp, struct mbuf *ifm);
aliguorie1c5a2b2009-01-08 19:18:21 +000049ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags);
Paolo Bonzinicb9c3772012-12-06 12:15:58 +010050
51#endif