aboutgitcodebugslistschat
path: root/passt.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-05-21 11:14:48 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-05-21 11:14:48 +0200
commit17337a736ff0e7ebd7d5272eba7466a627795215 (patch)
treec1ebb233dbec7a926315f354eb9f9feb709da07b /passt.c
parent59182924f01e4d2e8f6d8af27c355c191f332eba (diff)
downloadpasst-17337a736ff0e7ebd7d5272eba7466a627795215.tar
passt-17337a736ff0e7ebd7d5272eba7466a627795215.tar.gz
passt-17337a736ff0e7ebd7d5272eba7466a627795215.tar.bz2
passt-17337a736ff0e7ebd7d5272eba7466a627795215.tar.lz
passt-17337a736ff0e7ebd7d5272eba7466a627795215.tar.xz
passt-17337a736ff0e7ebd7d5272eba7466a627795215.tar.zst
passt-17337a736ff0e7ebd7d5272eba7466a627795215.zip
passt: Introduce packet capture implementation
With -DDEBUG, passt now saves guest-side traffic captures in pcap format at /tmp/passt_<ISO8601 timestamp>.pcap. The timestamp refers to time and date of start-up. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'passt.c')
-rw-r--r--passt.c5
1 files changed, 5 insertions, 0 deletions
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",