More cleanups to separate main code from platform support and UI support, plus a few bugfixes.

This commit is contained in:
waltje
2017-10-12 14:25:17 -04:00
parent aa7e85d0d7
commit 724e5c44df
46 changed files with 217 additions and 259 deletions

View File

@@ -6,6 +6,9 @@
* terms and conditions of the copyright.
*/
#ifndef WIN32
# include <unistd.h>
#endif
#include "slirp.h"
FILE *dfd = NULL;

View File

@@ -7,6 +7,9 @@
#define WANT_SYS_IOCTL_H
#include <stdlib.h>
#ifndef WIN32
# include <unistd.h>
#endif
#include "slirp.h"
u_int curtime, time_fasttimo, last_slowtimo, detach_time;

View File

@@ -59,6 +59,12 @@ typedef unsigned long ioctlsockopt_t;
# define init_udp slirp_init_udp
# define final_udp slirp_final_udp
#else
# include <inttypes.h>
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
typedef uint64_t u_int64_t;
typedef char *SLIRPcaddr_t;
typedef int ioctlsockopt_t;
# define ioctlsocket ioctl
# define closesocket(s) close(s)

View File

@@ -7,6 +7,9 @@
#define WANT_SYS_IOCTL_H
#include <stdlib.h>
#ifndef WIN32
# include <unistd.h>
#endif
#include "slirp.h"
#include "ip_icmp.h"
#include "main.h"

View File

@@ -40,6 +40,9 @@
#define WANT_SYS_IOCTL_H
#include <stdlib.h>
#ifndef WIN32
# include <unistd.h>
#endif
#include "slirp.h"
/* patchable/settable parameters for tcp */

View File

@@ -39,6 +39,9 @@
*/
#include <stdlib.h>
#ifndef WIN32
# include <unistd.h>
#endif
#include "slirp.h"
#include "ip_icmp.h"