]> git.proxmox.com Git - qemu.git/blame - slirp/main.h
USB: add usb network redirection support
[qemu.git] / slirp / main.h
CommitLineData
f0cbd3ec
FB
1/*
2 * Copyright (c) 1995 Danny Gasparovski.
5fafdf24
TS
3 *
4 * Please read the file COPYRIGHT for the
f0cbd3ec
FB
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
f0cbd3ec 13
f0cbd3ec
FB
14extern int slirp_socket;
15extern int slirp_socket_unit;
16extern int slirp_socket_port;
b6dce92e 17extern uint32_t slirp_socket_addr;
f0cbd3ec
FB
18extern 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;
f0cbd3ec 33extern struct in_addr loopback_addr;
f0cbd3ec
FB
34extern char *username;
35extern char *socket_path;
36extern int towrite_max;
37extern int ppp_exit;
f0cbd3ec 38extern int tcp_keepintvl;
f0cbd3ec
FB
39
40#define PROTO_SLIP 0x1
41#ifdef USE_PPP
42#define PROTO_PPP 0x2
43#endif
44
460fec67 45void if_encap(Slirp *slirp, const uint8_t *ip_data, int ip_data_len);
e1c5a2b3 46ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags);