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>
This commit is contained in:
Marc-André Lureau 2018-11-14 16:36:40 +04:00 committed by Samuel Thibault
parent 37b9117faa
commit e05ae1d9fb
7 changed files with 72 additions and 15 deletions

View file

@ -30,6 +30,7 @@
#include "net/colo-compare.h"
#include "migration/colo.h"
#include "migration/migration.h"
#include "util.h"
#define TYPE_COLO_COMPARE "colo-compare"
#define COLO_COMPARE(obj) \
@ -129,19 +130,19 @@ static int compare_chr_send(CompareState *s,
static gint seq_sorter(Packet *a, Packet *b, gpointer data)
{
struct tcphdr *atcp, *btcp;
struct tcp_hdr *atcp, *btcp;
atcp = (struct tcphdr *)(a->transport_header);
btcp = (struct tcphdr *)(b->transport_header);
atcp = (struct tcp_hdr *)(a->transport_header);
btcp = (struct tcp_hdr *)(b->transport_header);
return ntohl(atcp->th_seq) - ntohl(btcp->th_seq);
}
static void fill_pkt_tcp_info(void *data, uint32_t *max_ack)
{
Packet *pkt = data;
struct tcphdr *tcphd;
struct tcp_hdr *tcphd;
tcphd = (struct tcphdr *)pkt->transport_header;
tcphd = (struct tcp_hdr *)pkt->transport_header;
pkt->tcp_seq = ntohl(tcphd->th_seq);
pkt->tcp_ack = ntohl(tcphd->th_ack);