]> The Tcpdump Group git mirrors - libpcap/commitdiff
Merge branch 'aix-large-files' of https://github.com/bonsaiviking/libpcap into bonsai...
authorGuy Harris <[email protected]>
Sun, 27 Sep 2015 03:03:54 +0000 (20:03 -0700)
committerGuy Harris <[email protected]>
Sun, 27 Sep 2015 03:03:54 +0000 (20:03 -0700)
1  2 
scanner.l

diff --combined scanner.l
index acc02a0a8be23fa41250aeea683330d98a1863c4,764f7cb5f2a69a0eaba7af602e3388390b8a3b6b..d149726bf2d9c5d38d2431847c4877224c4fba44
+++ 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
   * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   */
  
- #ifdef HAVE_CONFIG_H
- #include "config.h"
 -#ifdef WIN32
 -#include <pcap-stdinc.h>
 -#else /* WIN32 */
 -#if HAVE_INTTYPES_H
 -#include <inttypes.h>
 -#elif HAVE_STDINT_H
 -#include <stdint.h>
--#endif
 -#ifdef HAVE_SYS_BITYPES_H
 -#include <sys/bitypes.h>
 +#ifdef _WIN32
 +  #include <pcap-stdinc.h>
 +#else
 +  #if HAVE_INTTYPES_H
 +    #include <inttypes.h>
 +  #elif HAVE_STDINT_H
 +    #include <stdint.h>
 +  #endif
 +  #ifdef HAVE_SYS_BITYPES_H
 +    #include <sys/bitypes.h>
 +  #endif
 +  #include <sys/types.h>
  #endif
 -#include <sys/types.h>
 -#endif /* WIN32 */
  
  #include <ctype.h>
  #include <string.h>
  #include "pcap-int.h"
  
  #include "gencode.h"
 +
  #ifdef INET6
 -#ifdef WIN32
 -#include <pcap-stdinc.h>
  
 -#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 <Wspiapi.h>
 +#else /* _WIN32 */
  #include <sys/socket.h>       /* for "struct sockaddr" in "struct addrinfo" */
  #include <netdb.h>    /* for "struct addrinfo" */
 -#endif /* WIN32 */
 +#endif /* _WIN32 */
  
  /* Workaround for AIX 4.3 */
  #if !defined(AI_NUMERICHOST)
  #define AI_NUMERICHOST 0x04
  #endif
 +
  #endif /*INET6*/
 +
  #include <pcap/namedb.h>
  #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;