From 17337a736ff0e7ebd7d5272eba7466a627795215 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Fri, 21 May 2021 11:14:48 +0200 Subject: passt: Introduce packet capture implementation With -DDEBUG, passt now saves guest-side traffic captures in pcap format at /tmp/passt_.pcap. The timestamp refers to time and date of start-up. Signed-off-by: Stefano Brivio --- passt.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'passt.c') diff --git a/passt.c b/passt.c index d0dcb26..6b6a317 100644 --- a/passt.c +++ b/passt.c @@ -53,6 +53,7 @@ #include "icmp.h" #include "tcp.h" #include "udp.h" +#include "pcap.h" #define EPOLL_EVENTS 10 @@ -601,6 +602,8 @@ static int tap_handler(struct ctx *c, struct timespec *now) return 0; } + pcap(p, len); + msg[msg_count].start = p; msg[msg_count++].len = len; @@ -792,6 +795,8 @@ int main(int argc, char **argv) memset(&c.mac_guest, 0xff, sizeof(c.mac_guest)); + pcap_init(); + if (c.v4) { info("ARP:"); info(" address: %02x:%02x:%02x:%02x:%02x:%02x from %s", -- cgit v1.2.3