Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/libpcap/dist Import libpcap-1.9.0



details:   https://anonhg.NetBSD.org/src/rev/3f28fcb22861
branches:  trunk
changeset: 835660:3f28fcb22861
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Sep 03 14:43:43 2018 +0000

description:
Import libpcap-1.9.0

Sunday, June 24, 2018, by mcr%sandelman.ca@localhost
  Summary for 1.9.0 libpcap release
    Added testing system to libpcap, independent of tcpdump
    Changes to how pcap_t is activated
    Adding support for Large stream buffers on Endace DAG cards
    Changes to BSD 3-clause license to 2-clause licence
    Additions to TCP header parsing, per RFC3168
    Add CMake build process (extensive number of changes)
    Assign a value for OpenBSD DLT_OPENFLOW.
    Support setting non-blocking mode before activating.
    Extensive build support for Windows VS2010 and MINGW (many many changes, over many months)
    Added RPCAPD support when --enable-remote (default no)
    Add the rpcap daemon source and build instructions.
    Put back the greasy "save the capture filter string so we can tweak it"
        hack, that keeps libpcap from capturing rpcap traffic.
    Fixes for captures on MacOS, utun0
    fixes so that non-AF_INET addresses, are not ==AF_INET6 addresses.
    Add a linktype for IBM SDLC frames containing SNA PDUs.
    pcap_compile() in 1.8.0 and later is newly thread-safe.
    bound snaplen for linux tpacket_v2 to ~64k
    Make VLAN filter handle both metadata and inline tags
    D-Bus captures can now be up to 128MB in size
    Added LORATAP DLT value
    Added DLT_VSOCK for http://qemu-project.org/Features/VirtioVsock
    probe_devices() fixes not to overrun buffer for name of device
    Add linux-specific pcap_set_protocol_linux() to allow specifying a specific capture protocol.
    RDMA sniffing support for pcap
    Add Nordic Semiconductor Bluetooth LE sniffer link-layer header type.
    fixes for reading /etc/ethers
    Make it possible to build on Windows without packet.dll.
    Add tests for large file support on UN*X.
    Solaris fixes to work with 2.8.6
    configuration test now looks for header files, not capture devices present
    Fix to work with Berkeley YACC.
    fixes for DragonBSD compilation of pcap-netmap.c
    Clean up the ether_hostton() stuff.
    Add an option to disable Linux memory-mapped capture support.
    Add DAG API support checks.
    Add Septel, Myricom SNF, and Riverbed TurboCap checks.
    Add checks for Linux USB, Linux Bluetooth, D-Bus, and RDMA sniffing support.
    Add a check for hardware time stamping on Linux.
    Don't bother supporting pre-2005 Visual Studio.
    Increased minimum autoconf version requirement to 2.64
    Add DLT value 273 for XRA-31 sniffer
    Clean up handing of signal interrupts in pcap_read_nocb_remote().
    Use the XPG 4.2 versions of the networking APIs in Solaris.
    Fix, and better explain, the "IPv6 means IPv6, not IPv4" option setting.
    Explicitly warn that negative packet buffer timeouts should not be used.
    rpcapd: Add support inetd-likes, including xinetd.conf, and systemd units
    Rename DLT_IEEE802_15_4 to DLT_IEEE802_15_4_WITHFCS.
    Add DISPLAYPORT AUX link type
    Remove the sunos4 kernel modules and all references to them.
    Add more interface flags to pcap_findalldevs().
  Summary for 1.9.0 libpcap release (to 2017-01-25 by guy%alum.mit.edu@localhost)
    Man page improvements
    Fix Linux cooked mode userspace filtering (GitHub pull request #429)
    Fix compilation if IPv6 support not enabled
    Fix some Linux memory-mapped capture buffer size issues
    Don't fail if kernel filter can't be set on Linux (GitHub issue
      #549)
    Improve sorting of interfaces for pcap_findalldevs()
    Don't list Linux usbmon devices if usbmon module isn't loaded
    Report PCAP_ERROR_PERM_DENIED if no permission to open Linux usbmon
      devices
    Fix DLT_ type for Solaris IPNET devices
    Always return an error message for errors finding DAG or Myricom
      devices
    If possible, don't require that a device be openable when
      enumerating them for pcap_findalldevs()
    Don't put incompletely-initialized addresses in the address list for
    When finding Myricom devices, update description for regular
      interfaces that are Myricom devices and handle SNF_FLAGS=0x2(port
      aggregation enabled)
    Fix compilation error in DAG support
    Fix issues with CMake configuration
    Add support for stream buffers larger than 2GB on newer DAG cards
    Remove support for building against DAG versions without STREAMS
      support (before dag-3.0.0 2007)

diffstat:

 external/bsd/libpcap/dist/CHANGES                                |    79 +
 external/bsd/libpcap/dist/CMakeLists.txt                         |  2346 ++++-
 external/bsd/libpcap/dist/CONTRIBUTING.md                        |    29 +
 external/bsd/libpcap/dist/CREDITS                                |    30 +-
 external/bsd/libpcap/dist/INSTALL.md                             |   353 +
 external/bsd/libpcap/dist/Makefile.in                            |   280 +-
 external/bsd/libpcap/dist/README.md                              |    93 +
 external/bsd/libpcap/dist/VERSION                                |     2 +-
 external/bsd/libpcap/dist/Win32/Prj/wpcap.vcxproj                |    13 +-
 external/bsd/libpcap/dist/Win32/Prj/wpcap.vcxproj.filters        |     2 +-
 external/bsd/libpcap/dist/aclocal.m4                             |   467 +-
 external/bsd/libpcap/dist/bpf_filter.c                           |   539 +
 external/bsd/libpcap/dist/chmod_bpf                              |     2 +-
 external/bsd/libpcap/dist/cmake/Modules/FindDAG.cmake            |    32 +
 external/bsd/libpcap/dist/cmake/Modules/FindFseeko.cmake         |    85 +
 external/bsd/libpcap/dist/cmake/Modules/FindLFS.cmake            |   153 +
 external/bsd/libpcap/dist/cmake/Modules/FindPacket.cmake         |    81 +
 external/bsd/libpcap/dist/cmake/Modules/FindSNF.cmake            |    24 +
 external/bsd/libpcap/dist/cmake/Modules/FindTC.cmake             |    24 +
 external/bsd/libpcap/dist/cmake/have_siocglifconf.c              |     6 +
 external/bsd/libpcap/dist/cmake_uninstall.cmake.in               |    21 +
 external/bsd/libpcap/dist/cmakeconfig.h.in                       |   229 +-
 external/bsd/libpcap/dist/config.h.in                            |   203 +-
 external/bsd/libpcap/dist/configure                              |  4922 ++++++---
 external/bsd/libpcap/dist/configure.ac                           |  1447 +-
 external/bsd/libpcap/dist/diag-control.h                         |   219 +
 external/bsd/libpcap/dist/doc/DLT_ALLOCATE_HOWTO.md              |    29 +
 external/bsd/libpcap/dist/doc/README.Win32                       |    46 +
 external/bsd/libpcap/dist/doc/README.aix                         |    88 +
 external/bsd/libpcap/dist/doc/README.dag                         |   122 +
 external/bsd/libpcap/dist/doc/README.hpux                        |   254 +
 external/bsd/libpcap/dist/doc/README.linux.md                    |   108 +
 external/bsd/libpcap/dist/doc/README.macos                       |    74 +
 external/bsd/libpcap/dist/doc/README.septel                      |    50 +
 external/bsd/libpcap/dist/doc/README.sita                        |    64 +
 external/bsd/libpcap/dist/doc/README.tru64                       |    49 +
 external/bsd/libpcap/dist/extract.h                              |    16 +-
 external/bsd/libpcap/dist/fmtutils.c                             |   131 +
 external/bsd/libpcap/dist/fmtutils.h                             |    50 +
 external/bsd/libpcap/dist/ftmacros.h                             |   115 +
 external/bsd/libpcap/dist/libpcap.pc.in                          |    18 +
 external/bsd/libpcap/dist/missing/getopt.c                       |     5 +-
 external/bsd/libpcap/dist/missing/getopt.h                       |     2 +-
 external/bsd/libpcap/dist/missing/strtok_r.c                     |     2 +-
 external/bsd/libpcap/dist/msdos/makefile                         |     6 +-
 external/bsd/libpcap/dist/msdos/makefile.dj                      |     2 +-
 external/bsd/libpcap/dist/msdos/makefile.wc                      |     4 +-
 external/bsd/libpcap/dist/msdos/readme.dos                       |     2 +-
 external/bsd/libpcap/dist/nomkdep                                |     6 +
 external/bsd/libpcap/dist/optimize.h                             |    28 +
 external/bsd/libpcap/dist/pcap-dll.rc                            |    36 +
 external/bsd/libpcap/dist/pcap-filter.manmisc.in                 |    42 +-
 external/bsd/libpcap/dist/pcap-linktype.manmisc.in               |     2 +-
 external/bsd/libpcap/dist/pcap-netmap.c                          |   306 +
 external/bsd/libpcap/dist/pcap-netmap.h                          |     2 +
 external/bsd/libpcap/dist/pcap-new.c                             |  1095 +-
 external/bsd/libpcap/dist/pcap-npf.c                             |  2098 ++++
 external/bsd/libpcap/dist/pcap-rdmasniff.c                       |   436 +
 external/bsd/libpcap/dist/pcap-rdmasniff.h                       |     2 +
 external/bsd/libpcap/dist/pcap-rpcap-int.h                       |    75 +
 external/bsd/libpcap/dist/pcap-rpcap.c                           |  3464 ++++--
 external/bsd/libpcap/dist/pcap-rpcap.h                           |   478 +-
 external/bsd/libpcap/dist/pcap-tc.c                              |    71 +-
 external/bsd/libpcap/dist/pcap-tc.h                              |     2 +-
 external/bsd/libpcap/dist/pcap-tstamp.manmisc.in                 |     6 +-
 external/bsd/libpcap/dist/pcap-types.h                           |    50 +
 external/bsd/libpcap/dist/pcap/can_socketcan.h                   |    12 +-
 external/bsd/libpcap/dist/pcap/compiler-tests.h                  |   163 +
 external/bsd/libpcap/dist/pcap/dlt.h                             |   107 +-
 external/bsd/libpcap/dist/pcap/funcattrs.h                       |   261 +
 external/bsd/libpcap/dist/pcap/pcap-inttypes.h                   |   117 +
 external/bsd/libpcap/dist/pcap_compile.3pcap.in                  |    12 +-
 external/bsd/libpcap/dist/pcap_datalink.3pcap.in                 |     2 +-
 external/bsd/libpcap/dist/pcap_get_required_select_timeout.3pcap |    84 +
 external/bsd/libpcap/dist/pcap_open_dead.3pcap.in                |     2 +-
 external/bsd/libpcap/dist/pcap_set_protocol_linux.3pcap          |    67 +
 external/bsd/libpcap/dist/pcap_set_tstamp_type.3pcap.in          |     2 +-
 external/bsd/libpcap/dist/portability.h                          |   114 +-
 external/bsd/libpcap/dist/rpcap-protocol.c                       |   195 +
 external/bsd/libpcap/dist/rpcap-protocol.h                       |   450 +
 external/bsd/libpcap/dist/rpcapd/CMakeLists.txt                  |   118 +
 external/bsd/libpcap/dist/rpcapd/Makefile.in                     |   130 +
 external/bsd/libpcap/dist/rpcapd/config_params.h                 |    56 +
 external/bsd/libpcap/dist/rpcapd/daemon.c                        |  2554 +++++
 external/bsd/libpcap/dist/rpcapd/daemon.h                        |    45 +
 external/bsd/libpcap/dist/rpcapd/fileconf.c                      |   216 +
 external/bsd/libpcap/dist/rpcapd/fileconf.h                      |    39 +
 external/bsd/libpcap/dist/rpcapd/log-stderr.c                    |    41 +
 external/bsd/libpcap/dist/rpcapd/log.h                           |    12 +
 external/bsd/libpcap/dist/rpcapd/org.tcpdump.rpcapd.plist        |    30 +
 external/bsd/libpcap/dist/rpcapd/rpcapd.c                        |  1309 ++
 external/bsd/libpcap/dist/rpcapd/rpcapd.h                        |    44 +
 external/bsd/libpcap/dist/rpcapd/rpcapd.inetd.conf               |     2 +
 external/bsd/libpcap/dist/rpcapd/rpcapd.manadmin.in              |   223 +
 external/bsd/libpcap/dist/rpcapd/rpcapd.rc                       |    39 +
 external/bsd/libpcap/dist/rpcapd/rpcapd.socket                   |     9 +
 external/bsd/libpcap/dist/rpcapd/rpcapd.xinetd.conf              |     8 +
 external/bsd/libpcap/dist/rpcapd/rpcapd@.service                 |     6 +
 external/bsd/libpcap/dist/rpcapd/win32-svc.c                     |   182 +
 external/bsd/libpcap/dist/rpcapd/win32-svc.h                     |    33 +
 external/bsd/libpcap/dist/sf-pcapng.c                            |  1475 ++
 external/bsd/libpcap/dist/sf-pcapng.h                            |    32 +
 external/bsd/libpcap/dist/sockutils.c                            |   485 +-
 external/bsd/libpcap/dist/sockutils.h                            |    79 +-
 external/bsd/libpcap/dist/testprogs/CMakeLists.txt               |    40 +
 external/bsd/libpcap/dist/testprogs/Makefile.in                  |   144 +
 external/bsd/libpcap/dist/testprogs/can_set_rfmon_test.c         |    96 +
 external/bsd/libpcap/dist/testprogs/capturetest.c                |   299 +
 external/bsd/libpcap/dist/testprogs/filtertest.c                 |   359 +
 external/bsd/libpcap/dist/testprogs/findalldevstest.c            |   311 +
 external/bsd/libpcap/dist/testprogs/opentest.c                   |   236 +
 external/bsd/libpcap/dist/testprogs/reactivatetest.c             |    88 +
 external/bsd/libpcap/dist/testprogs/selpolltest.c                |   443 +
 external/bsd/libpcap/dist/testprogs/threadsignaltest.c           |   393 +
 external/bsd/libpcap/dist/testprogs/unix.h                       |    58 +
 external/bsd/libpcap/dist/testprogs/valgrindtest.c               |   427 +
 external/bsd/libpcap/dist/tests/shb-option-too-long.pcapng       |   Bin 
 external/bsd/libpcap/dist/varattrs.h                             |    59 +
 118 files changed, 26895 insertions(+), 5930 deletions(-)

diffs (truncated from 37191 to 300 lines):

diff -r 79f2d892102b -r 3f28fcb22861 external/bsd/libpcap/dist/CHANGES
--- a/external/bsd/libpcap/dist/CHANGES Mon Sep 03 14:37:01 2018 +0000
+++ b/external/bsd/libpcap/dist/CHANGES Mon Sep 03 14:43:43 2018 +0000
@@ -1,3 +1,82 @@
+Sunday, June 24, 2018, by mcr%sandelman.ca@localhost
+  Summary for 1.9.0 libpcap release
+    Added testing system to libpcap, independent of tcpdump
+    Changes to how pcap_t is activated
+    Adding support for Large stream buffers on Endace DAG cards
+    Changes to BSD 3-clause license to 2-clause licence
+    Additions to TCP header parsing, per RFC3168
+    Add CMake build process (extensive number of changes)
+    Assign a value for OpenBSD DLT_OPENFLOW.
+    Support setting non-blocking mode before activating.
+    Extensive build support for Windows VS2010 and MINGW (many many changes, over many months)
+    Added RPCAPD support when --enable-remote (default no)
+    Add the rpcap daemon source and build instructions.
+    Put back the greasy "save the capture filter string so we can tweak it"
+        hack, that keeps libpcap from capturing rpcap traffic.
+    Fixes for captures on MacOS, utun0
+    fixes so that non-AF_INET addresses, are not ==AF_INET6 addresses.
+    Add a linktype for IBM SDLC frames containing SNA PDUs.
+    pcap_compile() in 1.8.0 and later is newly thread-safe.
+    bound snaplen for linux tpacket_v2 to ~64k
+    Make VLAN filter handle both metadata and inline tags
+    D-Bus captures can now be up to 128MB in size
+    Added LORATAP DLT value
+    Added DLT_VSOCK for http://qemu-project.org/Features/VirtioVsock
+    probe_devices() fixes not to overrun buffer for name of device
+    Add linux-specific pcap_set_protocol_linux() to allow specifying a specific capture protocol.
+    RDMA sniffing support for pcap
+    Add Nordic Semiconductor Bluetooth LE sniffer link-layer header type.
+    fixes for reading /etc/ethers
+    Make it possible to build on Windows without packet.dll.
+    Add tests for large file support on UN*X.
+    Solaris fixes to work with 2.8.6
+    configuration test now looks for header files, not capture devices present
+    Fix to work with Berkeley YACC.
+    fixes for DragonBSD compilation of pcap-netmap.c
+    Clean up the ether_hostton() stuff.
+    Add an option to disable Linux memory-mapped capture support.
+    Add DAG API support checks.
+    Add Septel, Myricom SNF, and Riverbed TurboCap checks.
+    Add checks for Linux USB, Linux Bluetooth, D-Bus, and RDMA sniffing support.
+    Add a check for hardware time stamping on Linux.
+    Don't bother supporting pre-2005 Visual Studio.
+    Increased minimum autoconf version requirement to 2.64
+    Add DLT value 273 for XRA-31 sniffer
+    Clean up handing of signal interrupts in pcap_read_nocb_remote().
+    Use the XPG 4.2 versions of the networking APIs in Solaris.
+    Fix, and better explain, the "IPv6 means IPv6, not IPv4" option setting.
+    Explicitly warn that negative packet buffer timeouts should not be used.
+    rpcapd: Add support inetd-likes, including xinetd.conf, and systemd units
+    Rename DLT_IEEE802_15_4 to DLT_IEEE802_15_4_WITHFCS.
+    Add DISPLAYPORT AUX link type
+    Remove the sunos4 kernel modules and all references to them.
+    Add more interface flags to pcap_findalldevs().
+  Summary for 1.9.0 libpcap release (to 2017-01-25 by guy%alum.mit.edu@localhost)
+    Man page improvements
+    Fix Linux cooked mode userspace filtering (GitHub pull request #429)
+    Fix compilation if IPv6 support not enabled
+    Fix some Linux memory-mapped capture buffer size issues
+    Don't fail if kernel filter can't be set on Linux (GitHub issue
+      #549)
+    Improve sorting of interfaces for pcap_findalldevs()
+    Don't list Linux usbmon devices if usbmon module isn't loaded
+    Report PCAP_ERROR_PERM_DENIED if no permission to open Linux usbmon
+      devices
+    Fix DLT_ type for Solaris IPNET devices
+    Always return an error message for errors finding DAG or Myricom
+      devices
+    If possible, don't require that a device be openable when
+      enumerating them for pcap_findalldevs()
+    Don't put incompletely-initialized addresses in the address list for
+    When finding Myricom devices, update description for regular
+      interfaces that are Myricom devices and handle SNF_FLAGS=0x2(port
+      aggregation enabled)
+    Fix compilation error in DAG support
+    Fix issues with CMake configuration
+    Add support for stream buffers larger than 2GB on newer DAG cards
+    Remove support for building against DAG versions without STREAMS
+      support (before dag-3.0.0 2007)
+
 Tuesday, Oct. 25, 2016 mcr%sandelman.ca@localhost
   Summary for 1.8.1 libpcap release
     Add a target in Makefile.in for Exuberant Ctags use: 'extags'.
diff -r 79f2d892102b -r 3f28fcb22861 external/bsd/libpcap/dist/CMakeLists.txt
--- a/external/bsd/libpcap/dist/CMakeLists.txt  Mon Sep 03 14:37:01 2018 +0000
+++ b/external/bsd/libpcap/dist/CMakeLists.txt  Mon Sep 03 14:43:43 2018 +0000
@@ -1,167 +1,848 @@
-cmake_minimum_required( VERSION 2.8.8 )
+cmake_minimum_required(VERSION 2.8.6)
+
+#
+# Apple doesn't build with an install_name starting with @rpath, and
+# neither do we with autotools; don't do so with CMake, either, and
+# suppress warnings about that.
+#
+if(POLICY CMP0042)
+    cmake_policy(SET CMP0042 OLD)
+endif()
+
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
+
+project(pcap)
 
-project( pcap )
+#
+# Try to enable as many C99 features as we can.
+# At minimum, we want C++/C99-style // comments.
+#
+# Newer versions of compilers might default to supporting C99, but older
+# versions may require a special flag.
+#
+# Prior to CMake 3.1, setting CMAKE_C_STANDARD will not have any effect,
+# so, unless and until we require CMake 3.1 or later, we have to do it
+# ourselves on pre-3.1 CMake, so we just do it ourselves on all versions
+# of CMake.
 #
-# Call the library "wpcap" on Windows, for backwards compatibility.
+# Note: with CMake 3.1 through 3.5, the only compilers for which CMake
+# handles CMAKE_C_STANDARD are GCC and Clang.  3.6 adds support only
+# for Intel C; 3.9 adds support for PGI C, Sun C, and IBM XL C, and
+# 3.10 adds support for Cray C and IAR C, but no version of CMake has
+# support for HP C.  Therefore, even if we use CMAKE_C_STANDARD with
+# compilers for which CMake supports it, we may still have to do it
+# ourselves on other compilers.
+#
+# See the CMake documentation for the CMAKE_<LANG>_COMPILER_ID variables
+# for a list of compiler IDs.
+#
+# We don't worry about MSVC; it doesn't have such a flag - either it
+# doesn't support the C99 features we need at all, or it supports them
+# regardless of the compiler flag.
 #
-if( WIN32 )
-    set( LIBRARY_NAME wpcap )
-else()
-    set( LIBRARY_NAME pcap )
+# XXX - this just tests whether the option works and adds it if it does.
+# We don't test whether it's necessary in order to get the C99 features
+# that we use; if we ever have a user who tries to compile with a compiler
+# that can't be made to support those features, we can add a test to make
+# sure we actually *have* C99 support.
+#
+include(CheckCCompilerFlag)
+macro(check_and_add_compiler_option _option)
+    message(STATUS "Checking C compiler flag ${_option}")
+    string(REPLACE "=" "-" _temp_option_variable ${_option})
+    string(REGEX REPLACE "^-" "" _option_variable ${_temp_option_variable})
+    check_c_compiler_flag("${_option}" ${_option_variable})
+    if(${${_option_variable}})
+        set(C_ADDITIONAL_FLAGS "${C_ADDITIONAL_FLAGS} ${_option}")
+    endif()
+endmacro()
+
+set(C_ADDITIONAL_FLAGS "")
+if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR
+   CMAKE_C_COMPILER_ID MATCHES "Clang")
+    check_and_add_compiler_option("-std=gnu99")
+elseif(CMAKE_C_COMPILER_ID MATCHES "XL")
+    #
+    # We want support for extensions picked up for GNU C compatibility,
+    # so we use -qlanglvl=extc99.
+    #
+    check_and_add_compiler_option("-qlanglvl=extc99")
+elseif(CMAKE_C_COMPILER_ID MATCHES "HP")
+    check_and_add_compiler_option("-AC99")
+elseif(CMAKE_C_COMPILER_ID MATCHES "Sun")
+    check_and_add_compiler_option("-xc99")
+elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
+    check_and_add_compiler_option("-c99")
 endif()
 
+#
+# Build all runtimes in the top-level binary directory; that way,
+# on Windows, the executables will be in the same directory as
+# the DLLs, so the system will find pcap.dll when any of the
+# executables are run.
+#
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run)
+
 ###################################################################
 #   Parameters
 ###################################################################
 
-option (INET6 "Enable IPv6" ON)
-if( MSVC )
-    option (USE_STATIC_RT "Use static Runtime" ON)
-endif( MSVC )
-option (BUILD_SHARED_LIBS "Build shared libraries" ON)
-if( WIN32 )
+if(WIN32)
+    #
+    # On Windows, allow the library name to be overridden, for the
+    # benefit of projects that combine libpcap with their own
+    # kernel-mode code to support capturing.
+    #
+    set(LIBRARY_NAME pcap CACHE STRING "Library name")
+else()
+    #
+    # On UN*X, it's always been libpcap.
+    #
+    set(LIBRARY_NAME pcap)
+endif()
+
+option(INET6 "Enable IPv6" ON)
+if(WIN32)
+    option(USE_STATIC_RT "Use static Runtime" ON)
+endif(WIN32)
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+if(WIN32)
     set(PACKET_DLL_DIR "" CACHE PATH "Path to directory with include and lib subdirectories for packet.dll")
-endif( WIN32 )
+endif(WIN32)
+
+# To pacify those who hate the protochain instruction
+option(NO_PROTOCHAIN "Disable protochain instruction" OFF)
+
+#
+# Start out with the capture mechanism type unspecified; the user
+# can explicitly specify it and, if they don't, we'll pick an
+# appropriate one.
+#
+set(PCAP_TYPE "" CACHE STRING "Packet capture type")
+
+#
+# Default to having remote capture support on Windows and, for now, to
+# not having it on UN*X.
+#
+if(WIN32)
+    option(ENABLE_REMOTE "Enable remote capture" ON)
+else()
+    option(ENABLE_REMOTE "Enable remote capture" OFF)
+endif(WIN32)
+
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    option(PCAP_SUPPORT_PACKET_RING "Enable Linux packet ring support" ON)
+    option(BUILD_WITH_LIBNL "Build with libnl" ON)
+endif()
 
 #
-# XXX - this should be an option, defaulting to "yes" for Windows and to
-# "no", for now, on UN*X.
+# By default, build universal with the appropriate set of architectures
+# for the OS on which we're doing the build.
 #
-if( WIN32 )
-    set( HAVE_REMOTE 1 )
-endif( WIN32 )
+if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+    #
+    # Get the major version of Darwin.
+    #
+    string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MAJOR "${CMAKE_SYSTEM_VERSION}")
+
+    if(SYSTEM_VERSION_MAJOR LESS 8)
+        #
+        # Pre-Tiger.  Build only for 32-bit PowerPC.
+        #
+        set(CMAKE_OSX_ARCHITECTURES "ppc")
+    elseif(SYSTEM_VERSION_MAJOR EQUAL 8)
+        #
+        # Tiger.  Is this prior to, or with, Intel support?
+        #
+        # Get the minor version of Darwin.
+        #
+        string(REPLACE "${SYSTEM_VERSION_MAJOR}." "" SYSTEM_MINOR_AND_PATCH_VERSION ${CMAKE_SYSTEM_VERSION})
+        string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MINOR "${SYSTEM_MINOR_AND_PATCH_VERSION}")
+        if(SYSTEM_VERSION_MINOR LESS 4)
+            #
+            # Prior to Intel support.  Build for 32-bit
+            # PowerPC and 64-bit PowerPC, with 32-bit PowerPC
+            # first.  (I'm guessing that's what Apple does.)
+            #
+            set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64")
+        elseif(SYSTEM_VERSION_MINOR LESS 7)
+            #
+            # With Intel support but prior to x86-64 support.
+            # Build for 32-bit PowerPC, 64-bit PowerPC, and x86,
+            # with 32-bit PowerPC first.
+            # (I'm guessing that's what Apple does.)
+            #
+            set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386")
+        else()
+            #
+            # With Intel support including x86-64 support.
+            # Build for 32-bit PowerPC, 64-bit PowerPC, x86,
+            # and x86-64, with 32-bit PowerPC first.
+            # (I'm guessing that's what Apple does.)
+            #
+            set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386;x86_64")
+        endif()
+    elseif(SYSTEM_VERSION_MAJOR EQUAL 9)
+        #
+        # Leopard.  Build for 32-bit PowerPC, 64-bit
+        # PowerPC, x86, and x86-64, with 32-bit PowerPC
+        # first.  (That's what Apple does.)
+        #
+        set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386;x86_64")



Home | Main Index | Thread Index | Old Index