]> The Tcpdump Group git mirrors - tcpdump/commitdiff
On Windows, we have our own ether_ntohost(); declare it.
authorGuy Harris <[email protected]>
Tue, 23 Jan 2018 17:28:27 +0000 (09:28 -0800)
committerGuy Harris <[email protected]>
Tue, 23 Jan 2018 17:28:44 +0000 (09:28 -0800)
Move the source to our own ether_ntohost() to the "missing" directory,
just as we do in libpcap for the Windows snprintf() wrapper around
_snprintf().

Add a header file for it, and include it in both the wrapper and in
addrtoname.c on Windows.

Makefile.in
addrtoname.c
missing/win_ether_ntohost.c [moved from win32/src/ether_ntohost.c with 98% similarity]
win32/prj/WinDump.dsp
win32/prj/WinDump.vcproj

index 311bba6d666aa0149866df78346a99b7ac766f1c..1ecef174e5477d03dadc52ef3fea4ba8596fd975 100644 (file)
@@ -355,6 +355,8 @@ EXTRA_DIST = \
        missing/strlcat.c \
        missing/strlcpy.c \
        missing/strsep.c \
+       missing/win_ether_ntohost.c \
+       missing/win_ether_ntohost.h \
        mkdep \
        packetdat.awk \
        pcap_dump_ftell.c \
@@ -368,8 +370,7 @@ EXTRA_DIST = \
        win32/prj/WinDump.dsp \
        win32/prj/WinDump.dsw \
        win32/prj/WinDump.sln \
-       win32/prj/WinDump.vcproj \
-       win32/src/ether_ntohost.c
+       win32/prj/WinDump.vcproj
 
 TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print`
 
index 03fd5a07f82e3b17273d04f9659f2ccd3f713682..5593792934a07e11b771670a56389806ba215993 100644 (file)
 #define HTONS(x)       (x) = htons(x)
 #endif
 
-#ifndef _WIN32
+#ifdef _WIN32
+  /*
+   * We have our own ether_ntohost(), reading from the system's
+   * Ethernet address file.
+   */
+  #include "missing/win_ether_ntohost.h"
+#else
   #ifdef USE_ETHER_NTOHOST
     #if defined(NET_ETHERNET_H_DECLARES_ETHER_NTOHOST)
       /*
similarity index 98%
rename from win32/src/ether_ntohost.c
rename to missing/win_ether_ntohost.c
index 63f5cdd2ffc2db74c8797aa9efa02f9d2b110112..05930923af83612ab303e9aa7c68eff78726c53b 100644 (file)
 
 #include <netdissect-stdinc.h>
 
+#include "missing/win_ether_ntohost.h"
+
 #include "netdissect.h"
 #include "addrtoname.h"
 
-typedef struct ether_addr {
-        unsigned char octet[MAC_ADDR_LEN];
-      } ether_address;
-
 typedef struct ether_entry {
         ether_address      eth_addr;  /* MAC address */
         char               *name;     /* name of MAC-address */
index ea05ba0cce892560b9987f21c1fa37c5c5e61318..528bc28b819aa8d657c2a51d82226d8c6c4b93cd 100644 (file)
@@ -741,7 +741,7 @@ SOURCE=..\..\tcpdump.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\Src\ether_ntohost.c
+SOURCE=..\..\missing\win_ether_ntohost.c
 # End Source File
 # Begin Source File
 
index d1787ab9c5a7aa37621040985c1e3714050c9920..fb13a855db68fc428792673409bff584d76645b1 100644 (file)
                        </FileConfiguration>
                </File>
 
-               <File RelativePath="..\Src\ether_ntohost.c">
+               <File RelativePath="..\..\missing\win_ether_ntohost.c">
                        <FileConfiguration
                                Name="Debug|Win32"
                                >