提交 b7221056 编写于 作者: P Paolo Bonzini 提交者: Jan Kiszka

slirp: clean up conflicts with system headers

Right now, slirp/slirp.h cannot include some system headers and,
indirectly, qemu_socket.h.  Clean this up, and remove a duplicate
prototype that was introduced because of that.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
上级 1658dd32
...@@ -88,10 +88,6 @@ void *malloc(size_t arg); ...@@ -88,10 +88,6 @@ void *malloc(size_t arg);
void free(void *ptr); void free(void *ptr);
#endif #endif
#ifndef HAVE_INET_ATON
int inet_aton(const char *cp, struct in_addr *ia);
#endif
#include <fcntl.h> #include <fcntl.h>
#ifndef NO_UNIX_SOCKETS #ifndef NO_UNIX_SOCKETS
#include <sys/un.h> #include <sys/un.h>
...@@ -144,6 +140,7 @@ int inet_aton(const char *cp, struct in_addr *ia); ...@@ -144,6 +140,7 @@ int inet_aton(const char *cp, struct in_addr *ia);
#include "debug.h" #include "debug.h"
#include "qemu-queue.h" #include "qemu-queue.h"
#include "qemu_socket.h"
#include "libslirp.h" #include "libslirp.h"
#include "ip.h" #include "ip.h"
...@@ -167,9 +164,6 @@ int inet_aton(const char *cp, struct in_addr *ia); ...@@ -167,9 +164,6 @@ int inet_aton(const char *cp, struct in_addr *ia);
#include "bootp.h" #include "bootp.h"
#include "tftp.h" #include "tftp.h"
/* osdep.c */
int qemu_socket(int domain, int type, int protocol);
#define ETH_ALEN 6 #define ETH_ALEN 6
#define ETH_HLEN 14 #define ETH_HLEN 14
......
...@@ -45,6 +45,7 @@ typedef uint32_t tcp_seq; ...@@ -45,6 +45,7 @@ typedef uint32_t tcp_seq;
* TCP header. * TCP header.
* Per RFC 793, September, 1981. * Per RFC 793, September, 1981.
*/ */
#define tcphdr slirp_tcphdr
struct tcphdr { struct tcphdr {
uint16_t th_sport; /* source port */ uint16_t th_sport; /* source port */
uint16_t th_dport; /* destination port */ uint16_t th_dport; /* destination port */
...@@ -58,12 +59,6 @@ struct tcphdr { ...@@ -58,12 +59,6 @@ struct tcphdr {
th_off:4; /* data offset */ th_off:4; /* data offset */
#endif #endif
uint8_t th_flags; uint8_t th_flags;
#define TH_FIN 0x01
#define TH_SYN 0x02
#define TH_RST 0x04
#define TH_PUSH 0x08
#define TH_ACK 0x10
#define TH_URG 0x20
uint16_t th_win; /* window */ uint16_t th_win; /* window */
uint16_t th_sum; /* checksum */ uint16_t th_sum; /* checksum */
uint16_t th_urp; /* urgent pointer */ uint16_t th_urp; /* urgent pointer */
...@@ -71,6 +66,16 @@ struct tcphdr { ...@@ -71,6 +66,16 @@ struct tcphdr {
#include "tcp_var.h" #include "tcp_var.h"
#ifndef TH_FIN
#define TH_FIN 0x01
#define TH_SYN 0x02
#define TH_RST 0x04
#define TH_PUSH 0x08
#define TH_ACK 0x10
#define TH_URG 0x20
#endif
#ifndef TCPOPT_EOL
#define TCPOPT_EOL 0 #define TCPOPT_EOL 0
#define TCPOPT_NOP 1 #define TCPOPT_NOP 1
#define TCPOPT_MAXSEG 2 #define TCPOPT_MAXSEG 2
...@@ -86,6 +91,7 @@ struct tcphdr { ...@@ -86,6 +91,7 @@ struct tcphdr {
#define TCPOPT_TSTAMP_HDR \ #define TCPOPT_TSTAMP_HDR \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
#endif
/* /*
* Default maximum segment size for TCP. * Default maximum segment size for TCP.
...@@ -95,10 +101,13 @@ struct tcphdr { ...@@ -95,10 +101,13 @@ struct tcphdr {
* *
* We make this 1460 because we only care about Ethernet in the qemu context. * We make this 1460 because we only care about Ethernet in the qemu context.
*/ */
#undef TCP_MSS
#define TCP_MSS 1460 #define TCP_MSS 1460
#undef TCP_MAXWIN
#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ #define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
#undef TCP_MAX_WINSHIFT
#define TCP_MAX_WINSHIFT 14 /* maximum window shift */ #define TCP_MAX_WINSHIFT 14 /* maximum window shift */
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册