# # spec file for package libpcap # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: libpcap Version: 1.9.0 Release: 1.1 Summary: A Library for Network Sniffers License: BSD-3-Clause Group: Development/Libraries/C and C++ Url: http://www.tcpdump.org/ Source: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz Source2: baselibs.conf Source3: http://www.tcpdump.org/tcpdump-workers.asc#/%{name}.keyring Source4: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz.sig # https://github.com/the-tcpdump-group/libpcap/pull/556 Patch2: libpcap-1.0.0-ppp.patch Patch3: libpcap-1.0.0-s390.patch Patch5: libpcap-no-old-socket.patch Patch6: Check-only-VID-in-VLAN-test-issue-461.patch BuildRequires: autoconf >= 2.64 BuildRequires: automake BuildRequires: bison BuildRequires: bluez-devel BuildRequires: dbus-1-devel BuildRequires: flex BuildRequires: libnl3-devel BuildRequires: pkgconfig BuildRequires: pkgconfig(libusb-1.0) BuildRoot: %{_tmppath}/%{name}-%{version}-build %description libpcap is a library used by packet sniffer programs. It provides an interface for them to capture and analyze packets from network devices. This package is only needed if you plan to compile or write such a program yourself. %package -n libpcap1 Summary: A Library for Network Sniffers Group: System/Libraries Provides: libpcap = %{version} Obsoletes: libpcap < %{version} %description -n libpcap1 libpcap is a library used by packet sniffer programs. It provides an interface for them to capture and analyze packets from network devices. This package is only needed if you plan to compile or write such a program yourself. %package devel Summary: A Library for Network Sniffers Group: Development/Libraries/C and C++ Requires: glibc-devel Requires: libpcap1 = %{version} %description devel libpcap is a library used by packet sniffer programs. It provides an interface for them to capture and analyze packets from network devices. This package is only needed if you plan to compile or write such a program yourself. %package devel-static Summary: A Library for Network Sniffers Group: Development/Libraries/C and C++ Requires: %{name}-devel = %{version} Requires: bluez-devel Requires: dbus-1-devel Requires: libnl3-devel Requires: pkgconfig(libusb-1.0) %description devel-static libpcap static libraries %prep %setup -q %patch2 %patch3 -p1 %patch5 -p1 %patch6 -p1 %build autoreconf -fiv %ifarch %sparc pic="PIC" %else pic="pic" %endif export CFLAGS="%{optflags} -f$pic" CXXFLAGS="%{optflags} -f$pic" %configure \ --enable-ipv6 make %{?_smp_mflags} all shared %install mkdir -p %{buildroot}%{_bindir} make DESTDIR=%{buildroot} install install-shared %post -n libpcap1 -p /sbin/ldconfig %postun -n libpcap1 -p /sbin/ldconfig %files -n libpcap1 %defattr(-, root, root) %doc CHANGES CREDITS LICENSE README.md doc/README.linux.md TODO %{_libdir}/*.so.* %{_mandir}/man7/* %files devel-static %defattr(-, root, root) %{_libdir}/*.*a %files devel %defattr(-, root, root) %{_mandir}/man[1-6]/* %{_includedir}/* %{_bindir}/pcap-config %{_libdir}/*.so %{_libdir}/pkgconfig/%{name}.pc %changelog * Mon Sep 24 2018 mkubecek@suse.cz - update to 1.9.0 * add testing system to libpcap, independent of tcpdump * changes to how pcap_t is activated * update included copies of BSD 4-clause license to 3-clause * additions to TCP header parsing, per RFC3168 * support setting non-blocking mode before activating * fixes so that non-AF_INET addresses, are not ==AF_INET6 addresses * 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 (bsc#874131 bsc#993691 fate#321405) * D-Bus captures can now be up to 128MB in size * add DLT_LORATAP and DLT_VSOCK * allow specifying a specific capture protocol * RDMA sniffing support for pcap * increase minimum autoconf version requirement to 2.64 * rpcapd: support for xinetd.conf and systemd units * provide pkgconfig file - add BuildRequires for autoconf >= 2.64 - package (newly added) pkgconfig file - Check-only-VID-in-VLAN-test-issue-461.patch: fix "vlan " test to check only VID, not complete TCI - drop disable-remote.diff (superseded by upstream changes) * Thu Mar 1 2018 jengelh@inai.de - Fix SRPM group * Tue Sep 12 2017 asterios.dramis@gmail.com - Added a patch (disable-remote.diff) to fix applications to FTBFS if they define HAVE_REMOTE (deb#843384). Patch taken from Debian. * Thu Mar 23 2017 jengelh@inai.de - Restore section setting $pic * Wed Mar 1 2017 tchvatal@suse.com - Do not put conditions about the provides for < 11.0 * Wed Feb 15 2017 pmonrealgonzalez@suse.com - Dropped patches not required after review * libpcap-1.0.0-pcap-bpf.patch * libpcap-1.5.2-filter-fix.patch - Reference of the pull request for the rest of the patches * https://github.com/the-tcpdump-group/libpcap/issues/196 - Changed libpcap-1.0.0-s390.patch to the git formatted one * Thu Feb 2 2017 pmonrealgonzalez@suse.com - Formatted the specs file using spec-cleaner. * Thu Feb 2 2017 pmonrealgonzalez@suse.com - Allow bluetooth monitoring support unconditionally. * Thu Feb 2 2017 pmonrealgonzalez@suse.com - update to 1.8.1 * Clean up the name-to-DLT mapping table. * Add some newer DLT_ values: IPMI_HPM_2,ZWAVE_R1_R2,ZWAVE_R3,WATTSTOPPER_DLM,ISO_14443,RDS * Fix handling of packet count in the TPACKET_V3 inner loop: GitHub issue [#493]. * Filter out duplicate looped back CAN frames. * Fix the handling of loopback filters for IPv6 packets. * Add a link-layer header type for RDS (IEC 62106) groups. * On Linux, handle all CAN captures with pcap-linux.c, in cooked mode. * Removes the need for the "host-endian" link-layer header type. * Compile with '-Wused-but-marked-unused' in devel mode if supported * Have separate DLTs for big-endian and host-endian SocketCAN headers. * Require that version.h be generated: all build procedures we support generate version.h (autoconf, CMake, MSVC)! * Properly check for sock_recv() errors. * Re-impose some of Winsock's limitations on sock_recv(). * Replace sprintf() with pcap_snprintf(). * Fix signature of pcap_stats_ex_remote(). * Have rpcap_remoteact_getsock() return a SOCKET and supply an "is active" flag. * Clean up {DAG, Septel, Myricom SNF}-only builds. * pcap_create_interface() needs the interface name on Linux. * Clean up hardware time stamp support: the "any" device does not support any time stamp types. * Recognize 802.1ad nested VLAN tag in vlan filter. - dropped libpcap-ocloexec.patch, never upstreamed. - refreshed libpcap-1.0.0-ppp.patch * Sun Apr 17 2016 crrodriguez@opensuse.org - libpcap-no-old-socket.patch: never fallback to the obsolete SOCK_PACKET (kernel < 2.2) interface, this still happens for example, when you update the kernel, run iftop and the old kernel af_packet module wasn't loaded, program fails and the kernel prints "iftop uses obsolete (PF_INET,SOCK_PACKET)" * Sun Jun 21 2015 crrodriguez@opensuse.org - remove dependency on libusb-devel, only libusb-1.0 is used for build. - split a -devel-static subpackage that contains the static libraries and all the extra dependencies which are not needed for dynamic linking. * Sun Apr 26 2015 astieger@suse.com - libpcap 1.7.3: * work around a Linux bonding driver bug. * Fri Mar 13 2015 vcizek@suse.com - update to 1.7.2 * Support for filtering Geneve encapsulated packets. * Fix handling of zones for BPF on Solaris * new DLT for ZWAVE * clarifications for read timeouts. * added bpf_filter1() with extensions * some fixes to compilation without stdint.h * EBUSY can now be returned by SNFv3 code. - refreshed libpcap-ocloexec.patch * Fri Nov 14 2014 dimstar@opensuse.org - No longer perform gpg validation; osc source_validator does it implicit: + Drop gpg-offline BuildRequires. + No longer execute gpg_verify. * Wed Sep 3 2014 andreas.stieger@gmx.de - libpcap 1.6.2: * Don't crash on filters testing a non-existent link-layer type field. * Fix sending in non-blocking mode on Linux with memory-mapped capture. * Fix timestamps when reading pcap-ng files on big-endian machines. * Sun Aug 17 2014 andreas.stieger@gmx.de - libpcap 1.6.1: * some fixes for the any device * changes for how --enable-XXX works - includes changes from 1.6.0: * fixes for byte order issues with NFLOG captures * Handle using cooked mode for DLT_NETLINK in activate_new(). removing libpcap-netlink.patch, upstream, [bnc#863823] * on platforms where you can not capture on down interfaces, do not list them, but: do list interfaces which are down, if you can capture on them! - libpcap does not build with bluez 5.21, disable bluetooth ( bluetooth/mgmt.h moved to kernel ) * Thu Feb 13 2014 vcizek@suse.com - added support for netlink (bnc#863823) * libpcap-netlink.patch * Thu Feb 13 2014 vcizek@suse.com - update to 1.5.3 * Don't let packets that don't match the current filter get to the application when TPACKET_V3 is used. (GitHub issue #331) * Fix handling of pcap_loop()/pcap_dispatch() with a packet count of 0 on some platforms (including Linux with TPACKET_V3). (GitHub issue #333) * Work around TPACKET_V3 deficiency that causes packets to be lost when a timeout of 0 is specified. (GitHub issue #335) * Man page formatting fixes. - refreshed libpcap-1.5.2-filter-fix.patch * Sat Dec 14 2013 andreas.stieger@gmx.de - update to 1.5.2 Version 1.5.0 revised for non-code related edits Version, 1.5.1 revised for for interop against Linux 3.1.0 * TPACKET_V3 support added for Linux * Point users to the the-tcpdump-group repository on GitHub rather than the mcr repository * Checks added for malloc()/realloc()/etc. failures * Support filtering filtering E1 SS7 traffic on MTP2 layer Annex A * Use "ln -s" to link man pages by default * Added pcap_open_dead_with_tstamp_precision API interface. * Many changes to autoconf to deal better with non-GCC compilers added many new DLT types - require pkg-config for devel library support detection - add support for D-Bus capture - modified patches for upstream changes: * libpcap-ocloexec.patch * libpcap-1.0.0-filter-fix.patch to libpcap-1.5.2-filter-fix.patch * Fri Sep 13 2013 andreas.stieger@gmx.de - update to 1.4.0: * add netfilter/nfqueue interface * support IPv6 filter expressions when no IPv6 address resolution availavle * Fix pcap-config to include -lpthread if canusb support is present * Try to fix "pcap_parse not defined" problems when --without-flex and --without-bison are used when you have Flex and Bison * Fix some issues with the pcap_loop man page. * Fix pcap_getnonblock() and pcap_setnonblock() to fill in the supplied error message buffer * Fix typo that, it appeared, would cause pcap-libdlpi.c not to compile (perhaps systems with libdlpi also have BPF and use that instead) * Catch attempts to call pcap_compile() on a non-activated pcap_t * Fix crash on Linux with CAN-USB support without usbfs * Fix addition of VLAN tags for Linux cooked captures * Check for both EOPNOTSUPP and EINVAL after SIOCETHTOOL ioctl, so that the driver can report either one if it doesn't support SIOCETHTOOL * Add DLT_INFINIBAND and DLT_SCTP * Describe "proto XXX" and "protochain XXX" in the pcap-filter man page * Handle either directories, or symlinks to directories, that correspond to interfaces in /sys/class/net * Fix handling of VLAN tag insertion to check, on Linux 3.x kernels, for VLAN tag valid flag * Clean up some man pages * Support libnl3 as well as libnl1 and libnl2 on Linux - packaging changes: * build with libnl * refresh libpcap-ocloexec.patch for upstream changes * verify source signatures * Mon Aug 27 2012 crrodriguez@opensuse.org - BuildRequire libusb-devel for "usb sniffing" * Mon Aug 27 2012 crrodriguez@opensuse.org - Added libpcap-ocloexec.patch: Use O_CLOEXEC in all internal fds so they do not leak on fork()..execve() * Fri Jun 15 2012 jslaby@suse.de - remove some patches - libpcap-1.0.0-fcode.patch -- not needed, if this emitted a warning, it was a compiler bug - libpcap-1.0.0-mac_syntax.patch -- already handled by MAC rule - libpcap-1.0.0-man.patch -- tcpdump is man 1, not 8 - libpcap-1.1.1-scanif.patch -- misapplied, this was fixed upstream already - libpcap-1.2.1-netfilter-dont-fail-on-EPROTONOSUPPORT.patch * Thu Jun 14 2012 jslaby@suse.de - update to 1.3.0 - Handle DLT_PFSYNC in {FreeBSD, other *BSD+Mac OS X, other}. - Linux: Don't fail if netfilter isn't enabled in the kernel. - Add new link-layer type for NFC Forum LLCP. - Put the CANUSB stuff into EXTRA_DIST, so it shows up in the release tarball. - Add LINKTYPE_NG40/DLT_NG40. - Add DLT_MPEG_2_TS/LINKTYPE_MPEG_2_TS for MPEG-2 transport streams. - [PATCH] Fix AIX-3.5 crash with read failure during stress - AIX fixes. - Introduce --disable-shared configure option. - Added initial support for canusb devices. - Include the pcap(3PCAP) additions as 1.2.1 changes. - many updates to documentation: pcap.3pcap.in - Improve 'inbound'/'outbound' capture filters under Linux. - Note the cleanup of handling of new DLT_/LINKTYPE_ values. - On Lion, don't build for PPC. - For mac80211 devices we need to clean up monitor mode on exit. * Tue Feb 28 2012 jslaby@suse.de - make it work also on kernels without netfilter (bnc#746356) * Tue Jan 3 2012 puzel@suse.com - update to libpcap-1.2.1 - Support 802.1 QinQ as a form of VLAN in filters. - Treat "carp" as equivalent to "vrrp" in filters. - Fix code generated for "ip6 protochain". - Add some new link-layer header types. - Support capturing NetFilter log messages on Linux. - Turn off monitor mode on exit for mac80211 interfaces on Linux. - Fix problems turning monitor mode on for non-mac80211 interfaces - on Linux. - Properly fail if /sys/class/net or /proc/net/dev exist but can't - be opened. - Fail if pcap_activate() is called on an already-activated - pcap_t, and add a test program for that. - Fix filtering in pcap-ng files. - Simplify handling of new DLT_/LINKTYPE_ values. - Expand pcap(3PCAP) man page. - drop libpcap-fix-calculation-of-frame-size.patch (upstream) * Fri Sep 16 2011 jengelh@medozas.de - Add libpcap-devel to baselibs - Remove redundant tags/sections * Thu May 19 2011 puzel@novell.com - add libpcap-fix-calculation-of-frame-size.patch (bnc#694779) - clean up specfile * Mon Mar 14 2011 cyliu@novell.com - fix bug#674278: pcap_findalldevs error with bonding device libpcap-1.1.1-scanif.patch * Tue Apr 6 2010 puzel@novell.com - update to libpcap-1.1.1 - notable changes : - Add SocketCAN capture support - Add Myricom SNF API support - Update Endace DAG and ERF support - Support monitor mode on mac80211 devices on Linux - Fix USB memory-mapped capturing on Linux - On Linux, scan /sys/class/net for devices if we have it - Add limited support for reading pcap-ng files - see /usr/share/doc/packages/libpcap1/CHANGES for full list of changes - drop fix-any-interface-handling.patch (fixed upstream) - drop fix-usb-nic.patch (fixed upstream) * Tue Jan 26 2010 jengelh@medozas.de - large PIC model is required on SPARC * Wed Dec 16 2009 jengelh@medozas.de - add baselibs.conf as a source - enable parallel building * Tue Nov 3 2009 coolo@novell.com - updated patches to apply with fuzz=0 * Thu Oct 29 2009 puzel@novell.com - move pcap-filter and pcap-linktype out from -devel subpackage (bnc#550372) * Tue May 26 2009 poeml@suse.de - don't obsolete an old libpcap (0.9.x) package on openSUSE 11.0 or older (bnc#507083) * Thu Mar 19 2009 puzel@suse.cz - add fix-usb-nic.patch (bnc#455774) * Fri Feb 20 2009 puzel@suse.cz - fix-any-interface-handling.patch (bnc#463182) * Wed Jan 14 2009 prusnak@suse.cz - updated to 1.0.0 * Compile with IPv6 support by default * Compile with large file support on by default * Add pcap-config script, which deals with -I/-L flags for compiling * DLT: Add IPMB * DLT: Add LAPD * DLT: Add AX25 (AX.25 w/KISS header) * DLT: Add JUNIPER_ST * 802.15.4 support * Variable length 802.11 header support * X2E data type support * SITA ACN Interface support - see README.sita * Support for zerocopy BPF on platforms that support it * Better support for dealing with VLAN tagging/stripping on Linux * Fix dynamic library support on OSX * Return PCAP_ERROR_IFACE_NOT_UP if the interface isn't 'UP', so applications can print better diagnostic information * Return PCAP_ERROR_PERM_DENIED if we don't have permission to open a device, so applications can tell the user they need to go play with permissions * On Linux, ignore ENETDOWN so we can continue to capture packets if the interface goes down and comes back up again. * On Linux, support new tpacket frame headers (2.6.27+) * On Mac OS X, add scripts for changing permissions on /dev/pbf* and launchd plist * On Solaris, support 'passive mode' on systems that support it * Fixes to autoconf and general build environment * Man page reorganization + cleanup * Autogenerate VERSION numbers better - dropped obsoleted shared.patch * Tue Jan 13 2009 olh@suse.de - obsolete old -XXbit packages (bnc#437293) * Mon Sep 15 2008 dmueller@suse.de - adjust buildrequires * Thu Sep 4 2008 prusnak@suse.cz - updated to CVS-20080503 * support for USB and Bluetooth capture * Wed Aug 20 2008 prusnak@suse.cz - renamed libpcap package to libpcap0 - added ppp.patch and s390.patch (small issues) * Thu Apr 10 2008 ro@suse.de - added baselibs.conf file to build xxbit packages for multilib support * Tue Jan 8 2008 prusnak@suse.cz - update to 0.9.8 * Change build process to put public libpcap headers into pcap subdir * DLT: Add value for IPMI IPMB packets * DLT: Add value for u10 Networks boards * Require for pf definitions - allows reading of pflog formatted libpcap files on an OS other than where the file was generated - added pcap-bpf.patch * add two structs needed for tahi testsuite * Thu Jul 26 2007 prusnak@suse.cz - updated to 0.9.7 * added flags/configuration for cloning bpf device. * added DLT_MTP2_WITH_PHDR support (PPI) * introduced support for the DAG ERF type TYPE_COLOR_MC_HDLC_POS * added basic BPF filtering support for DLT_MTP2_WITH_PHDR * add support for DLT_JUNIPER_ISM * allocate DLT_ for 802.15.4 without any header munging * header for 802.16 MAC Common Part Sublayer plus a radiotap radio header - branch -devel subpackage * Thu Jul 12 2007 prusnak@suse.cz - updated to 0.9.6 * added Bluetooth support * added USB capturing support * added support for the binary USB sniffing interface * added additional filter operations for 802.11 frame types * added support for filtering on MTP2 frame types * added LINKTYPE_ for IEEE 802.15.4, with address fields padded * added LINKTYPE_ value corresponding to DLT_IEEE802_16_MAC_CPS * added DLT for IEEE 802.16 (WiMAX) MAC Common Part Sublayer * added DLT for Bluetooth HCI UART transport layer * fixed discarding of unread packets when changing filters * fixed a bug in pcap_open_live() * Wed May 2 2007 pth@suse.de - Use correct version for naming the shared library (#270226) * Thu Mar 29 2007 rguenther@suse.de - add flex and bison BuildRequires * Tue Jan 16 2007 prusnak@suse.cz - implemented socket timeout (socket-timeout.diff) [#234034] * Wed Jan 3 2007 prusnak@suse.cz - update to 0.9.5 * Support for LAPD frames with vISDN * Support for ERF on channelized T1/E1 cards via DAG API * Better failure detection on PacketGetAdapterNames() * Fixes for MPLS packet generation (link layer) * OP_PACKET now matches the beginning of the packet, instead of beginning+link-layer * Fix allocation of buffer for list of link-layer types * Add support for DLT_JUNIPER_VP * Don't double-count received packets on Linux systems * Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires * Mon Jan 9 2006 mjancar@suse.cz - update to 0.9.4 * Tue Aug 9 2005 kkeil@suse.de - Reverse the -fno-strict-aliasing work around * Sun Aug 7 2005 aj@suse.de - Compile with -fno-strict-aliasing to work around compiler bug for now. * Thu Aug 4 2005 ro@suse.de - do not package all of libdir (debuginfo) * Tue Aug 2 2005 mjancar@suse.cz - update to 0.9.3 * Tue Apr 12 2005 ro@suse.de - added return value to non-void functions * Thu Nov 18 2004 ro@suse.de - fixed file list * Tue Aug 24 2004 kkeil@suse.de - add DLT_PPP_WITHDIRECTION from libpcap cvs to handle PPP filters in a compatible way Thanks to Hannes Gredler for implementing it * Wed Aug 4 2004 postadal@suse.cz - updated to version 0.8.3 * Mon Feb 9 2004 postadal@suse.cz - updated to version 0.8.1 * the include file include/net/bpf.h renamed to include/pcap-bpf - fixed config (LIBOBJS issue) * Sat Jan 10 2004 schwab@suse.de - Use autoreconf. * Thu Jul 24 2003 postadal@suse.cz - update to version 0.7.2 * support frame relay * support for ARPHRD_RAWHDLC * support eg (Octane/O2xxx/O3xxx Gigabit) devices * add new reserved DLT types * Mon May 20 2002 postadal@suse.de - security fix (get spurious packets before kernel filter kicks in) - update to 0.7.1 * pcap_stats() has been documented as to what its counters mean on each platform * Added pcap_findalldevs() call to get list of interfaces in a MI way * Wed Mar 13 2002 postadal@suse.cz - fixed Makefile.in to created shared library * Thu Jan 10 2002 cihlar@suse.cz - use %%{_lib} * Fri Feb 23 2001 cihlar@suse.cz - update to 0.6.2 - it should handle isdn without patch * Thu Dec 7 2000 schwab@suse.de - Compile with -fpic so that it can be included in a shared library. * Wed Oct 11 2000 smid@suse.cz - new version 0.5.2 * Thu Jun 8 2000 cihlar@suse.cz - Group sorted * Fri Apr 21 2000 smid@suse.cz - buildroot added * Thu Mar 2 2000 uli@suse.de - moved man page to %%{_mandir} * Mon Sep 13 1999 bs@suse.de - ran old prepare_spec on spec file to switch to new prepare_spec. * Thu Sep 9 1999 bs@suse.de - fixed call of Check at the end of %%install section * Sun Jul 11 1999 @suse.de - new package: libpcap now an extra package, because many network tools use it (so far it was included in .srpm packages that needed it, like tcpdump)