X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/9c9c8a93dd58cf34395fa57cd0997031e4e25ea3..d584b1caba87f30e88e20941d6ac6e87c3e8751a:/addrtoname.c diff --git a/addrtoname.c b/addrtoname.c index 34e2ff47..33ae2752 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -33,75 +33,67 @@ #include "netdissect-stdinc.h" -#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) - /* - * OK, just include . - */ - #include - #elif defined(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST) - /* - * OK, just include - */ - #include - #elif defined(SYS_ETHERNET_H_DECLARES_ETHER_NTOHOST) - /* - * OK, just include - */ - #include - #elif defined(ARPA_INET_H_DECLARES_ETHER_NTOHOST) - /* - * OK, just include - */ - #include - #elif defined(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST) - /* - * OK, include , after all the other stuff we - * need to include or define for its benefit. - */ +#ifdef USE_ETHER_NTOHOST + #if defined(NET_ETHERNET_H_DECLARES_ETHER_NTOHOST) + /* + * OK, just include . + */ + #include + #elif defined(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST) + /* + * OK, just include + */ + #include + #elif defined(SYS_ETHERNET_H_DECLARES_ETHER_NTOHOST) + /* + * OK, just include + */ + #include + #elif defined(ARPA_INET_H_DECLARES_ETHER_NTOHOST) + /* + * OK, just include + */ + #include + #elif defined(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST) + /* + * OK, include , after all the other stuff we + * need to include or define for its benefit. + */ + #define NEED_NETINET_IF_ETHER_H + #else + /* + * We'll have to declare it ourselves. + * If defines struct ether_addr, include + * it. Otherwise, define it ourselves. + */ + #ifdef HAVE_STRUCT_ETHER_ADDR #define NEED_NETINET_IF_ETHER_H - #else - /* - * We'll have to declare it ourselves. - * If defines struct ether_addr, include - * it. Otherwise, define it ourselves. - */ - #ifdef HAVE_STRUCT_ETHER_ADDR - #define NEED_NETINET_IF_ETHER_H - #else /* HAVE_STRUCT_ETHER_ADDR */ + #else /* HAVE_STRUCT_ETHER_ADDR */ struct ether_addr { /* Beware FreeBSD calls this "octet". */ unsigned char ether_addr_octet[MAC_ADDR_LEN]; }; - #endif /* HAVE_STRUCT_ETHER_ADDR */ - #endif /* what declares ether_ntohost() */ - - #ifdef NEED_NETINET_IF_ETHER_H - /* - * Include diag-control.h before , which too defines a macro - * named ND_UNREACHABLE. - */ - #include "diag-control.h" - #include /* Needed on some platforms */ - #include /* Needed on some platforms */ - #include - #endif /* NEED_NETINET_IF_ETHER_H */ - - #ifndef HAVE_DECL_ETHER_NTOHOST - /* - * No header declares it, so declare it ourselves. - */ - extern int ether_ntohost(char *, const struct ether_addr *); - #endif /* !defined(HAVE_DECL_ETHER_NTOHOST) */ - #endif /* USE_ETHER_NTOHOST */ -#endif /* _WIN32 */ + #endif /* HAVE_STRUCT_ETHER_ADDR */ + #endif /* what declares ether_ntohost() */ + + #ifdef NEED_NETINET_IF_ETHER_H + /* + * Include diag-control.h before , which too defines a macro + * named ND_UNREACHABLE. + */ + #include "diag-control.h" + #include /* Needed on some platforms */ + #include /* Needed on some platforms */ + #include + #endif /* NEED_NETINET_IF_ETHER_H */ + + #ifndef HAVE_DECL_ETHER_NTOHOST + /* + * No header declares it, so declare it ourselves. + */ + extern int ether_ntohost(char *, const struct ether_addr *); + #endif /* !defined(HAVE_DECL_ETHER_NTOHOST) */ +#endif /* USE_ETHER_NTOHOST */ #include #include