From 2ad4edb966fe2c22ea24cf7be418277435bdc519 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 30 Sep 2017 20:05:21 +0300 Subject: [PATCH] Packet logging. --- od-win32/win32_uaenet.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/od-win32/win32_uaenet.cpp b/od-win32/win32_uaenet.cpp index e56d58b1..d073d93e 100644 --- a/od-win32/win32_uaenet.cpp +++ b/od-win32/win32_uaenet.cpp @@ -30,6 +30,7 @@ #include "win32_uaenet.h" #include "win32.h" +int log_ethernet; static struct netdriverdata tds[MAX_TOTAL_NET_DEVICES]; static int enumerated; static int ethernet_paused; @@ -212,6 +213,16 @@ static void *uaenet_trap_threadw (void *arg) int towrite = sd->mtu; uae_sem_wait (&sd->change_sem); if (sd->getfunc ((struct s2devstruct*)sd->user, sd->writebuffer, &towrite)) { + if (log_ethernet & 1) { + TCHAR out[1600 * 2], *p; + p = out; + for (int i = 0; i < towrite && i < 1600; i++) { + _stprintf(p, _T("%02x"), sd->writebuffer[i]); + p += 2; + *p = 0; + } + write_log(_T("OUT %4d: %s\n"), towrite, out); + } ppcap_sendpacket(sd->fp, sd->writebuffer, towrite); donotwait = 1; } -- 2.47.3