On Windows, we have our own ether_ntohost(); declare it.

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.
This commit is contained in:
Guy Harris 2018-01-23 09:28:27 -08:00
parent c331dc185f
commit 0d9efb9596
5 changed files with 14 additions and 9 deletions

View 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`

View File

@ -40,7 +40,13 @@
#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)
/*

View File

@ -29,13 +29,11 @@
#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 */

View 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

View File

@ -3791,7 +3791,7 @@
</FileConfiguration>
</File>
<File RelativePath="..\Src\ether_ntohost.c">
<File RelativePath="..\..\missing\win_ether_ntohost.c">
<FileConfiguration
Name="Debug|Win32"
>