]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Packet logging.
authorToni Wilen <twilen@winuae.net>
Sat, 30 Sep 2017 17:05:21 +0000 (20:05 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 30 Sep 2017 17:05:21 +0000 (20:05 +0300)
od-win32/win32_uaenet.cpp

index e56d58b158951ab00ac79e2a4fb59cfbbdb20f16..d073d93e07e57f813da5bf27bd9a687b247521c1 100644 (file)
@@ -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;
                }