]>
git.proxmox.com Git - qemu.git/blob - slirp/slirp.h
12 #include "slirp_config.h"
14 #include <sys/types.h>
15 #ifdef HAVE_SYS_BITYPES_H
16 # include <sys/bitypes.h>
21 typedef unsigned char u_int8_t
;
23 # if SIZEOF_SHORT == 2
24 typedef short int16_t;
25 typedef unsigned short u_int16_t
;
29 typedef unsigned int u_int16_t
;
31 #error Cannot find a type with sizeof() == 2
35 # if SIZEOF_SHORT == 4
36 typedef short int32_t;
37 typedef unsigned short u_int32_t
;
41 typedef unsigned int u_int32_t
;
43 #error Cannot find a type with sizeof() == 4
46 #endif /* NEED_TYPEDEFS */
60 #define memmove(x, y, z) bcopy(y, x, z)
63 #if TIME_WITH_SYS_TIME
64 # include <sys/time.h>
68 # include <sys/time.h>
90 #include <netinet/in.h>
91 #include <arpa/inet.h>
93 #ifdef GETTIMEOFDAY_ONE_ARG
94 #define gettimeofday(x, y) gettimeofday(x)
97 /* Systems lacking strdup() definition in <string.h>. */
99 char *strdup
_P((const char *));
102 /* Systems lacking malloc() definition in <stdlib.h>. */
103 #if defined(ultrix) || defined(hcx)
104 void *malloc
_P((size_t arg
));
105 void free
_P((void *ptr
));
108 #ifndef HAVE_INET_ATON
109 int inet_aton
_P((const char *cp
, struct in_addr
*ia
));
113 #ifndef NO_UNIX_SOCKETS
117 #ifdef HAVE_SYS_SIGNAL_H
118 # include <sys/signal.h>
120 #include <sys/socket.h>
122 #if defined(WANT_SYS_IOCTL_H) && defined(HAVE_SYS_IOCTL_H)
123 # include <sys/ioctl.h>
125 # define WANT_SYS_TERMIOS_H
128 #ifdef WANT_SYS_TERMIOS_H
129 # ifndef INCLUDED_TERMIOS_H
130 # ifdef HAVE_TERMIOS_H
131 # include <termios.h>
135 # define INCLUDED_TERMIOS_H
141 #ifdef HAVE_SYS_SELECT_H
142 # include <sys/select.h>
145 #ifdef HAVE_SYS_WAIT_H
146 # include <sys/wait.h>
149 #ifdef HAVE_SYS_FILIO_H
150 # include <sys/filio.h>
154 #include <ppp/slirppp.h>
163 #include <sys/stat.h>
165 /* Avoid conflicting with the libc insque() and remque(), which
166 have different prototypes. */
167 #define insque slirp_insque
168 #define remque slirp_remque
170 #ifdef HAVE_SYS_STROPTS_H
171 #include <sys/stropts.h>
178 #include "tcp_timer.h"
182 #include "icmp_var.h"
191 #include "ppp/pppd.h"
196 #include "libslirp.h"
198 extern struct ttys
*ttys_unit
[MAX_INTERFACES
];
201 #define NULL (void *)0
205 void if_start
_P((void));
207 void if_start
_P((struct ttys
*));
211 # define vsprintf vsprintf_len
212 # define sprintf sprintf_len
213 extern int vsprintf_len
_P((char *, const char *, va_list));
214 extern int sprintf_len
_P((char *, const char *, ...));
217 #ifdef DECLARE_SPRINTF
219 extern int vsprintf
_P((char *, const char *, va_list));
221 extern int vfprintf
_P((FILE *, const char *, va_list));
224 #ifndef HAVE_STRERROR
225 extern char *strerror
_P((int error
));
229 char *index
_P((const char *, int));
232 #ifndef HAVE_GETHOSTID
233 long gethostid
_P((void));
236 void lprint
_P((const char *, ...));
240 #if SIZEOF_CHAR_P == 4
241 # define insque_32 insque
242 # define remque_32 remque
244 inline void insque_32
_P((void *, void *));
245 inline void remque_32
_P((void *));
251 #define DEFAULT_BAUD 115200
254 int cksum(struct mbuf
*m
, int len
);
257 void if_init
_P((void));
258 void if_output
_P((struct socket
*, struct mbuf
*));
261 void ip_init
_P((void));
262 void ip_input
_P((struct mbuf
*));
263 struct ip
* ip_reass
_P((register struct ipasfrag
*, register struct ipq
*));
264 void ip_freef
_P((struct ipq
*));
265 void ip_enq
_P((register struct ipasfrag
*, register struct ipasfrag
*));
266 void ip_deq
_P((register struct ipasfrag
*));
267 void ip_slowtimo
_P((void));
268 void ip_stripoptions
_P((register struct mbuf
*, struct mbuf
*));
271 int ip_output
_P((struct socket
*, struct mbuf
*));
274 int tcp_reass
_P((register struct tcpcb
*, register struct tcpiphdr
*, struct mbuf
*));
275 void tcp_input
_P((register struct mbuf
*, int, struct socket
*));
276 void tcp_dooptions
_P((struct tcpcb
*, u_char
*, int, struct tcpiphdr
*));
277 void tcp_xmit_timer
_P((register struct tcpcb
*, int));
278 int tcp_mss
_P((register struct tcpcb
*, u_int
));
281 int tcp_output
_P((register struct tcpcb
*));
282 void tcp_setpersist
_P((register struct tcpcb
*));
285 void tcp_init
_P((void));
286 void tcp_template
_P((struct tcpcb
*));
287 void tcp_respond
_P((struct tcpcb
*, register struct tcpiphdr
*, register struct mbuf
*, tcp_seq
, tcp_seq
, int));
288 struct tcpcb
* tcp_newtcpcb
_P((struct socket
*));
289 struct tcpcb
* tcp_close
_P((register struct tcpcb
*));
290 void tcp_drain
_P((void));
291 void tcp_sockclosed
_P((struct tcpcb
*));
292 int tcp_fconnect
_P((struct socket
*));
293 void tcp_connect
_P((struct socket
*));
294 int tcp_attach
_P((struct socket
*));
295 u_int8_t tcp_tos
_P((struct socket
*));
296 int tcp_emu
_P((struct socket
*, struct mbuf
*));
297 int tcp_ctl
_P((struct socket
*));
298 struct tcpcb
*tcp_drop(struct tcpcb
*tp
, int errno
);
301 #define MIN_MRU MINMRU
302 #define MAX_MRU MAXMRU
305 #define MAX_MRU 16384