From: Guy Harris Date: Sun, 27 Sep 2015 03:03:54 +0000 (-0700) Subject: Merge branch 'aix-large-files' of https://github.com/bonsaiviking/libpcap into bonsai... X-Git-Tag: libpcap-1.8.0-bp~159^2 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/c3a9edf7ebc0d2bfaa269aceb4dddf980da771f9?hp=-c Merge branch 'aix-large-files' of https://github.com/bonsaiviking/libpcap into bonsaiviking-aix-large-files --- c3a9edf7ebc0d2bfaa269aceb4dddf980da771f9 diff --combined scanner.l index acc02a0a,764f7cb5..d149726b --- a/scanner.l +++ b/scanner.l @@@ -1,3 -1,10 +1,10 @@@ + %top{ + /* Must come first for _LARGE_FILE_API on AIX. */ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + } + %{ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@@ -20,23 -27,19 +27,19 @@@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ - #ifdef HAVE_CONFIG_H - #include "config.h" -#ifdef WIN32 -#include -#else /* WIN32 */ -#if HAVE_INTTYPES_H -#include -#elif HAVE_STDINT_H -#include --#endif - -#ifdef HAVE_SYS_BITYPES_H -#include +#ifdef _WIN32 + #include +#else + #if HAVE_INTTYPES_H + #include + #elif HAVE_STDINT_H + #include + #endif + #ifdef HAVE_SYS_BITYPES_H + #include + #endif + #include #endif -#include -#endif /* WIN32 */ #include #include @@@ -44,45 -47,23 +47,45 @@@ #include "pcap-int.h" #include "gencode.h" + #ifdef INET6 -#ifdef WIN32 -#include -#ifdef __MINGW32__ -#include "ip6_misc.h" -#endif -#else /* WIN32 */ +#ifdef _WIN32 +/* + * To quote the MSDN page for getaddrinfo() at + * + * https://msdn.microsoft.com/en-us/library/windows/desktop/ms738520(v=vs.85).aspx + * + * "Support for getaddrinfo on Windows 2000 and older versions + * The getaddrinfo function was added to the Ws2_32.dll on Windows XP and + * later. To execute an application that uses this function on earlier + * versions of Windows, then you need to include the Ws2tcpip.h and + * Wspiapi.h files. When the Wspiapi.h include file is added, the + * getaddrinfo function is defined to the WspiapiGetAddrInfo inline + * function in the Wspiapi.h file. At runtime, the WspiapiGetAddrInfo + * function is implemented in such a way that if the Ws2_32.dll or the + * Wship6.dll (the file containing getaddrinfo in the IPv6 Technology + * Preview for Windows 2000) does not include getaddrinfo, then a + * version of getaddrinfo is implemented inline based on code in the + * Wspiapi.h header file. This inline code will be used on older Windows + * platforms that do not natively support the getaddrinfo function." + * + * We use getaddrinfo(), so we include Wspiapi.h here. pcap-stdinc.h + * includes Ws2tcpip.h, so we don't need to include it ourselves. + */ +#include +#else /* _WIN32 */ #include /* for "struct sockaddr" in "struct addrinfo" */ #include /* for "struct addrinfo" */ -#endif /* WIN32 */ +#endif /* _WIN32 */ /* Workaround for AIX 4.3 */ #if !defined(AI_NUMERICHOST) #define AI_NUMERICHOST 0x04 #endif + #endif /*INET6*/ + #include #include "tokdefs.h" @@@ -301,7 -282,6 +304,7 @@@ vlan return VLAN mpls return MPLS; pppoed return PPPOED; pppoes return PPPOES; +geneve return GENEVE; lane return LANE; llc return LLC;