net: do not depend on slirp internals
Only slirp/libslirp.h should be included.
Instead of using some slirp declarations and utility functions directly,
let's copy them in net/util.h.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
index 2e26839..b464abe 100644
--- a/net/filter-rewriter.c
+++ b/net/filter-rewriter.c
@@ -22,6 +22,7 @@
#include "net/checksum.h"
#include "net/colo.h"
#include "migration/colo.h"
+#include "util.h"
#define FILTER_COLO_REWRITER(obj) \
OBJECT_CHECK(RewriterState, (obj), TYPE_FILTER_REWRITER)
@@ -73,9 +74,9 @@
Connection *conn,
Packet *pkt, ConnectionKey *key)
{
- struct tcphdr *tcp_pkt;
+ struct tcp_hdr *tcp_pkt;
- tcp_pkt = (struct tcphdr *)pkt->transport_header;
+ tcp_pkt = (struct tcp_hdr *)pkt->transport_header;
if (trace_event_get_state_backends(TRACE_COLO_FILTER_REWRITER_DEBUG)) {
trace_colo_filter_rewriter_pkt_info(__func__,
inet_ntoa(pkt->ip->ip_src), inet_ntoa(pkt->ip->ip_dst),
@@ -176,9 +177,9 @@
Connection *conn,
Packet *pkt, ConnectionKey *key)
{
- struct tcphdr *tcp_pkt;
+ struct tcp_hdr *tcp_pkt;
- tcp_pkt = (struct tcphdr *)pkt->transport_header;
+ tcp_pkt = (struct tcp_hdr *)pkt->transport_header;
if (trace_event_get_state_backends(TRACE_COLO_FILTER_REWRITER_DEBUG)) {
trace_colo_filter_rewriter_pkt_info(__func__,