Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Net-Pcap for openSUSE:Factory checked in at 2022-11-24 12:24:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Net-Pcap (Old) and /work/SRC/openSUSE:Factory/.perl-Net-Pcap.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Net-Pcap" Thu Nov 24 12:24:10 2022 rev:9 rq:1037713 version:0.20 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Net-Pcap/perl-Net-Pcap.changes 2018-11-14 14:43:48.538653148 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Net-Pcap.new.1597/perl-Net-Pcap.changes 2022-11-24 12:24:15.353688991 +0100 @@ -1,0 +2,25 @@ +Tue Nov 22 19:57:04 UTC 2022 - Pedro Monreal <[email protected]> + +- Add missing dependencies for pcapdump [bsc#1201615] +- Remove patch not applied and not mentioned in the changelog. + * perl-Net-Pcap-avoid-pcap_rmtauth-redefinition.patch + +------------------------------------------------------------------- +Wed Aug 24 09:12:32 UTC 2022 - Dirk Stoecker <[email protected]> + +- updated to 0.20 + see /usr/share/doc/packages/perl-Net-Pcap/Changes + + 0.19 - 2021-11-27 - Max Maischein (CORION) + [Bugfixes] + - CPAN RT #127685 Restore compilation with libpcap 1.9+ + This incorporates the RedHat patch from + + https://www.cpan.org/authors/id/S/SR/SREZIC/patches/Net-Pcap-0.18-RT127685-RH1485429.patch + + and guards it with the newly introduced version #define + - GH #9, CPAN RT #117831 , CPAN RT #125352 Too strict test for + error message from libpcap + Fix contributed by KENTNL + +------------------------------------------------------------------- @@ -81 +105,0 @@ - Old: ---- Net-Pcap-0.18.tar.gz perl-Net-Pcap-avoid-pcap_rmtauth-redefinition.patch New: ---- Net-Pcap-0.20.tar.gz cpanspec.yml ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Net-Pcap.spec ++++++ --- /var/tmp/diff_new_pack.vgPk9U/_old 2022-11-24 12:24:15.961692854 +0100 +++ /var/tmp/diff_new_pack.vgPk9U/_new 2022-11-24 12:24:15.965692880 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Net-Pcap # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,46 +16,36 @@ # +%define cpan_name Net-Pcap Name: perl-Net-Pcap -Version: 0.18 +Version: 0.20 Release: 0 -Summary: Interface to pcap LBL packet capture library License: Artistic-1.0 OR GPL-1.0-or-later -Group: Development/Libraries/Perl -URL: https://metacpan.org/release/Net-Pcap -Source: https://cpan.metacpan.org/authors/id/S/SA/SAPER/Net-Pcap-%{version}.tar.gz -Patch1: perl-Net-Pcap-avoid-pcap_rmtauth-redefinition.patch -BuildRequires: gcc -BuildRequires: make +Summary: Interface to the pcap(3) LBL packet capture library +URL: https://metacpan.org/release/%{cpan_name} +Source0: https://cpan.metacpan.org/authors/id/C/CO/CORION/%{cpan_name}-%{version}.tar.gz +Source1: cpanspec.yml +BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(Carp) -BuildRequires: perl(ExtUtils::MakeMaker) -BuildRequires: perl(Socket) -BuildRequires: perl(Sys::Hostname) -BuildRequires: perl(Test::More) >= 0.45 -BuildRequires: perl(XSLoader) -Requires: perl(Carp) -Requires: perl(Socket) -Requires: perl(Sys::Hostname) -Requires: perl(Test::More) >= 0.45 -Requires: perl(XSLoader) %{perl_requires} -%if 0%{?suse_version} == 0 || 0%{?suse_version} >= 1030 +# MANUAL BEGIN BuildRequires: libpcap-devel -%else -BuildRequires: libpcap -%endif +Requires: perl(Data::Hexdumper) +Requires: perl(NetPacket) +# MANUAL END %description -Net::Pcap is a Perl binding to the LBL pcap(3) library. The README for libpcap -describes itself as: "a system-independent interface for user-level packet -capture. libpcap provides a portable framework for low-level network -monitoring. Applications include network statistics collection, security -monitoring, network debugging, etc." +'Net::Pcap' is a Perl binding to the LBL pcap(3) library and its Win32 +counterpart, the WinPcap library. Pcap (packet capture) is a portable API +to capture network packet: it allows applications to capture packets at +link-layer, bypassing the normal protocol stack. It also provides features +like kernel-level packet filtering and access to internal statistics. + +Common applications include network statistics collection, security +monitoring, network debugging, etc. %package -n pcapdump Summary: Dump packets from the network -Group: Productivity/Networking/Diagnostic Requires: %{name} = %{version} %description -n pcapdump @@ -66,7 +56,6 @@ %package -n pcapinfo Summary: Prints detailed information about the network devices -Group: Productivity/Networking/Diagnostic Requires: %{name} = %{version} %description -n pcapinfo @@ -74,34 +63,29 @@ available on the current host. %prep -%setup -q -n "Net-Pcap-%{version}" - -if pkg-config --atleast-version=1.9.0 libpcap; then -%patch1 -p1 -fi - -sed -i '/^auto_install/d' Makefile.PL +%autosetup -n %{cpan_name}-%{version} +find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644 %build -perl Makefile.PL PREFIX="%{_prefix}" -make %{?_smp_mflags} \ - CCFLAGS="-Wall -Wextra -I/usr/include/pcap" \ - CC="gcc" +perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" +%make_build + +%check +make test %install %perl_make_install -install -D -m0755 eg/pcapdump "%{buildroot}%{_bindir}/pcapdump" %perl_process_packlist +# MANUAL BEGIN +install -D -m0755 eg/pcapdump "%{buildroot}%{_bindir}/pcapdump" +# MANUAL END +%perl_gen_filelist -# make test is just borked when not running as root - -%files +%files -f %{name}.files %doc Changes README -%dir %{perl_vendorarch}/Net -%{perl_vendorarch}/Net/Pcap.pm -%dir %{perl_vendorarch}/auto/Net -%{perl_vendorarch}/auto/Net/Pcap -%doc %{perl_man3dir}/Net::Pcap.%{perl_man3ext}%{ext_man} +%exclude %{_bindir}/pcapinfo +%exclude %{_bindir}/pcapdump +%exclude %{_mandir}/man1/pcapinfo.1%{?ext_man} %files -n pcapdump %{_bindir}/pcapdump @@ -109,5 +93,6 @@ %files -n pcapinfo %{_bindir}/pcapinfo %{_mandir}/man1/pcapinfo.1%{?ext_man} +%doc Changes README stubs.inc %changelog ++++++ Net-Pcap-0.18.tar.gz -> Net-Pcap-0.20.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/.gitignore new/Net-Pcap-0.20/.gitignore --- old/Net-Pcap-0.18/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/.gitignore 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,21 @@ +Makefile +Makefile.old +*.tar.gz +*.bak +pm_to_blib +blib/ +Net-Pcap-* +Net-Pcap-*/ +.releaserc +cover_db +MYMETA.* +*.bs +*.def +Pcap.c +*.a +*.o +const-c.inc +const-xs.inc +funcs.txt +macros.all +pcap_version.exe diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/Changes new/Net-Pcap-0.20/Changes --- old/Net-Pcap-0.18/Changes 2016-05-15 15:40:42.000000000 +0200 +++ new/Net-Pcap-0.20/Changes 2021-12-17 11:43:39.000000000 +0100 @@ -1,12 +1,22 @@ The revision history for Net-Pcap +0.19 - 2021-11-27 - Max Maischein (CORION) + [Bugfixes] + - CPAN RT #127685 Restore compilation with libpcap 1.9+ + This incorporates the RedHat patch from + + https://www.cpan.org/authors/id/S/SR/SREZIC/patches/Net-Pcap-0.18-RT127685-RH1485429.patch + + and guards it with the newly introduced version #define + - GH #9, CPAN RT #117831 , CPAN RT #125352 Too strict test for + error message from libpcap + Fix contributed by KENTNL + 0.18 - 2016-05-15 - Sebastien Aperghis-Tramoni (SAPER) [Bugfixes] - CPAN RT #77807: Net::Pcap is no longer limited to one callback function, thanks to a patch by James Rouzier. - - CPAN RT #55163: Typo in eg/pcapdump (Iain Arnell and Jose Pedro Oliveira). - - CPAN RT #83842: Typo in Net:Pcap (Xavier Guimard). [API] - Added pcap_offline_filter() (Martijn Lievaart). @@ -15,6 +25,8 @@ - use warnings (David Farrell). [Documentation] + - CPAN RT #55163: Typo in eg/pcapdump (Iain Arnell and Jose Pedro Oliveira). + - CPAN RT #83842: Typo in Net:Pcap (Xavier Guimard). - Moved HISTORY from README to main documentation. - Rewrote AUTHORS to acknowledge all contributors. - Updated copyright years. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/MANIFEST new/Net-Pcap-0.20/MANIFEST --- old/Net-Pcap-0.18/MANIFEST 2016-05-15 15:41:37.000000000 +0200 +++ new/Net-Pcap-0.20/MANIFEST 2021-12-17 11:43:39.000000000 +0100 @@ -1,19 +1,21 @@ +.gitignore +bin/pcapinfo +Changes +eg/pcapdump +eg/pktdump.pl +fallback/const-c.inc +fallback/const-xs.inc Makefile.PL MANIFEST +MANIFEST.SKIP +META.json META.yml -README -Changes Pcap.pm Pcap.xs -typemap +pcap_version.c ppport.h -fallback/const-c.inc -fallback/const-xs.inc +README stubs.inc -bin/pcapinfo -eg/pktdump.pl -eg/pcapdump -t/Utils.pm t/00-load.t t/01-api.t t/02-lookup.t @@ -38,15 +40,23 @@ t/21-next_ex.t t/22-open.t t/23-srcstr.t +t/24-offline_filter.t t/50-anyevent-pcap.t t/50-net-pcap-easy.t t/50-poe-component-pcap.t t/distchk.t +t/leaktests/leaktest1.pl +t/leaktests/leaktest2.pl +t/leaktests/leaktest3.pl +t/leaktests/leaktest4.pl +t/leaktests/leaktest5.pl +t/leaktests/leaktest6.pl +t/pod.t t/podcover.t t/podspell.t -t/pod.t t/portfs.t t/README t/samples/ping-ietf-20pk-be.dmp t/samples/ping-ietf-20pk-le.dmp -META.json Module JSON meta-data (added by MakeMaker) +t/Utils.pm +typemap diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/MANIFEST.SKIP new/Net-Pcap-0.20/MANIFEST.SKIP --- old/Net-Pcap-0.18/MANIFEST.SKIP 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/MANIFEST.SKIP 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,29 @@ +^\.git\/ +maint +^tags$ +.last_cover_stats +.travis.yml +.appveyor.yml +^\.github +Makefile$ +^blib +^pm_to_blib +^.*\.bak +^.*\.old +^.*\.o +^.*\.bs +^.*\.exe +^const-c.inc +^const-xs.inc +^Pcap.c +^t.*sessions +^\.prove +^.*\.log +^.*\.swp$ +^MYMETA +^.releaserc +^.*\.cmd +^Net-Pcap +^funcs.txt +^macros.all +^wpcap.def diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/META.json new/Net-Pcap-0.20/META.json --- old/Net-Pcap-0.18/META.json 2016-05-15 15:41:37.000000000 +0200 +++ new/Net-Pcap-0.20/META.json 2021-12-17 11:43:49.000000000 +0100 @@ -4,13 +4,13 @@ "Sebastien Aperghis-Tramoni <[email protected]>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150005", + "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "Net-Pcap", "no_index" : { @@ -47,6 +47,6 @@ "url" : "https://github.com/maddingue/Net-Pcap" } }, - "version" : "0.18", - "x_serialization_backend" : "JSON::PP version 2.27300" + "version" : "0.20", + "x_serialization_backend" : "JSON::PP version 4.04" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/META.yml new/Net-Pcap-0.20/META.yml --- old/Net-Pcap-0.18/META.yml 2016-05-15 15:41:37.000000000 +0200 +++ new/Net-Pcap-0.20/META.yml 2021-12-17 11:43:49.000000000 +0100 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150005' +generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -26,5 +26,5 @@ perl: '5.006001' resources: repository: https://github.com/maddingue/Net-Pcap -version: '0.18' -x_serialization_backend: 'CPAN::Meta::YAML version 0.012' +version: '0.20' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/Makefile.PL new/Net-Pcap-0.20/Makefile.PL --- old/Net-Pcap-0.18/Makefile.PL 2016-05-09 23:23:13.000000000 +0200 +++ new/Net-Pcap-0.20/Makefile.PL 2021-12-17 11:43:39.000000000 +0100 @@ -33,10 +33,10 @@ } -# The detection logic is: -# 1. first try to check if the pcap library is available; -# 2. then try to use the pcap_lib_version() function which is present -# in recent version and is the only function that can be called +# The detection logic is: +# 1. first try to check if the pcap library is available; +# 2. then try to use the pcap_lib_version() function which is present +# in recent version and is the only function that can be called # with no argument. if ($has_Win32) { # ActivePerl, Cygwin die <<"REASON" unless have_library('wpcap', 'blank', 'pcap'); @@ -52,9 +52,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - You appear to lack the WinPcap developer pack. \a -If it is installed in a non-standard location, please try setting the LIBS -and INC values on the command line. For instance, if you have unziped the -developer's pack in C:\\WpdPack, you should execute: +If it is installed in a non-standard location, please try setting the LIBS +and INC values on the command line. For instance, if you have unziped the +developer's pack in C:\\WpdPack, you should execute: perl Makefile.PL INC=-IC:/WpdPack/Include "LIBS=-LC:/WpdPack/Lib -lwpcap" @@ -68,14 +68,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - You appear to lack the pcap(3) library. \a -If it is installed in a non-standard location, please try setting the LIBS +If it is installed in a non-standard location, please try setting the LIBS and INC values on the command line. Or get the sources and install the pcap library from http://www.tcpdump.org/ -If you install the pcap library using a system package, make sure to also -install the corresponding -devel package, which contains the C headers needed -to compile this module. +If you install the pcap library using a system package, make sure to also +install the corresponding -devel package, which contains the C headers needed +to compile this module. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REASON @@ -83,30 +83,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - You appear to have an old version of the pcap library. \a -This module need a recent version of the pcap library in order to provide -access to all its features. You can still compile it with your old pcap -library but some functions won't be available, and trying to use them in -Perl programs will generate errors. Programs only using the old functions -should perform as previously. If not, don't hesitate to fill a bug. +This module need a recent version of the pcap library in order to provide +access to all its features. You can still compile it with your old pcap +library but some functions won't be available, and trying to use them in +Perl programs will generate errors. Programs only using the old functions +should perform as previously. If not, don't hesitate to fill a bug. You can get the latest sources of the pcap library at http://www.tcpdump.org/ -If you install the pcap library using a system package, make sure to also -install the corresponding -devel package, which contains the C headers needed -to compile this module. +If you install the pcap library using a system package, make sure to also +install the corresponding -devel package, which contains the C headers needed +to compile this module. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REASON } -# Now trying to detect which functions are actually available. -# We have to do this because the pcap library still doesn't have any macro -# to identify its API version and the pcap_lib_version() is only available -# since version 0.8 or so. Therefore we add defines in order to replace -# missing functions with croaking stubs. -# We also store the list of available functions in a file for skipping the -# corresponding tests. +# Now trying to detect which functions are actually available. +# We have to do this because the pcap library still doesn't have any macro +# to identify its API version and the pcap_lib_version() is only available +# since version 0.8 or so. Therefore we add defines in order to replace +# missing functions with croaking stubs. +# We also store the list of available functions in a file for skipping the +# corresponding tests. my @funcs = have_functions(find_functions()); + +# Get the version of the pcap library, hoping that we have a libpcap +# more recent than 0.8: +my $pcap_version; # this should come from %ENV or the command line +$pcap_version //= get_pcap_version(); + +$pcap_version =~ m!(\d+\.\S+)! + or warn "Couldn't determine version number from [$pcap_version]"; +my $pcap_version_number = $1 || '1.8.0'; # a guess + +# Expand the numbers with leading zeroes for easy stringy comparison +$pcap_version_number =~ s!(\d+)!sprintf '%03d', $1!ge; +$pcap_version_number =~ s!\.!!g; + +if( $pcap_version_number > 1009000 ) { + # 1.9.0 adds pcap_setsampling() + $options{DEFINE} .= ' -DHAVE_PCAP_SETSAMPLING'; +} + $options{DEFINE} .= cpp_defines(@funcs); + +# Since PCAP doesn't have a version define, we introduce one: +(my $define = $pcap_version_number) =~ s!\.!!; +$define =~ s!^0+!!; +print "Setting -DPERL_PCAP_VERSION=$define\n"; +$options{DEFINE} .= " -DPERL_PCAP_VERSION=$define"; + open(FUNCS, '>funcs.txt') or warn "warning: can't write 'funcs.txt': $!\n"; print FUNCS join("\n", @funcs), "\n"; close(FUNCS); @@ -120,8 +146,8 @@ VERSION_FROM => 'Pcap.pm', ABSTRACT_FROM => 'Pcap.pm', MIN_PERL_VERSION=> 5.6.1, - PL_FILES => {}, - EXE_FILES => [ 'bin/pcapinfo' ], + PL_FILES => {}, + EXE_FILES => [ 'bin/pcapinfo' ], PREREQ_PM => { # module prereqs 'Carp' => '0', @@ -139,8 +165,8 @@ repository => "https://github.com/maddingue/Net-Pcap", }, }, - dist => { 'COMPRESS' => "gzip -9f", 'SUFFIX' => "gz" }, - clean => { FILES => 'Net-Pcap-* macros.all' }, + dist => { 'COMPRESS' => "gzip -9f", 'SUFFIX' => "gz" }, + clean => { FILES => 'Net-Pcap-* macros.all' }, %options, # appropriate CCFLAGS, LDFLAGS and Define's ); @@ -175,9 +201,9 @@ DLT_USER13 DLT_USER14 DLT_USER15 DLT_USER2 DLT_USER3 DLT_USER4 DLT_USER5 DLT_USER6 DLT_USER7 DLT_USER8 DLT_USER9 MODE_CAPT MODE_MON MODE_STAT PCAP_ERRBUF_SIZE PCAP_IF_LOOPBACK - PCAP_VERSION_MAJOR PCAP_VERSION_MINOR OPENFLAG_PROMISCUOUS + PCAP_VERSION_MAJOR PCAP_VERSION_MINOR OPENFLAG_PROMISCUOUS OPENFLAG_DATATX_UDP OPENFLAG_NOCAPTURE_RPCAP RMTAUTH_NULL RMTAUTH_PWD - PCAP_SAMP_NOSAMP PCAP_SAMP_FIRST_AFTER_N_MS PCAP_SAMP_1_EVERY_N + PCAP_SAMP_NOSAMP PCAP_SAMP_FIRST_AFTER_N_MS PCAP_SAMP_1_EVERY_N PCAP_SRC_FILE PCAP_SRC_IFLOCAL PCAP_SRC_IFREMOTE )); @@ -208,7 +234,7 @@ } -# The following function patches ActivePerl CORE/sys/socket.h +# The following function patches ActivePerl CORE/sys/socket.h sub win32_sys_socket_patch { my $sockfile; @@ -230,13 +256,13 @@ last } } - + die "file 'socket.h' not found\n" unless $sockfile; open H, "<$sockfile" or die "can't read file '$sockfile': $!\n"; my $h; { local $/; $h = <H>; } # slurp file close H; - + if ($h =~ /\#include <winsock2.h>/) { print "socket.h already patched... ok\n" } else { @@ -275,8 +301,8 @@ } } -# The rest of the code, up to the end of this file, has been copied -# from XML::LibXML::Common Makefile.PL, then modified in order to +# The rest of the code, up to the end of this file, has been copied +# from XML::LibXML::Common Makefile.PL, then modified in order to # make all this detection stuff works under Win32 ################################################################### @@ -388,7 +414,7 @@ my $cfile = gensym(); $opt ||= ''; - + # local $options{LIBS}; # $options{LIBS} .= $opt; unless (mkdir(".testlink", 0777)) { @@ -553,6 +579,25 @@ return join '', sort map { " -DHAVE_\U$_" } @_ } +sub get_pcap_version { + print "detecting libpcap version... "; + + use Config; + + my $cc = "$Config{cc} $options{CCFLAGS} $options{LDFLAGS} 'pcap_version.c' $options{LIBS} -o pcap_version.exe"; + print "Running [$cc]\n"; + system($cc) == 0 + or return undef; + + my $res = `./pcap_version.exe`; + if( $res ) { + $res =~ s!\s+$!!; + }; + print "ok ($res)\n"; + + return $res +} + sub find_functions { # these functions are present since the very beginning so there's no need diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/Pcap.pm new/Net-Pcap-0.20/Pcap.pm --- old/Net-Pcap-0.18/Pcap.pm 2016-05-15 15:24:03.000000000 +0200 +++ new/Net-Pcap-0.20/Pcap.pm 2021-12-17 11:43:39.000000000 +0100 @@ -50,7 +50,7 @@ { no strict "vars"; - $VERSION = '0.18'; + $VERSION = '0.20'; @ISA = qw(Exporter); @@ -212,7 +212,7 @@ =head1 VERSION -Version 0.18 +Version 0.20 =head1 SYNOPSIS @@ -255,7 +255,7 @@ Since version 5.7.3, Perl uses a mechanism called "deferred signals" to delay signals delivery until "safe" points in the interpreter. -See L<perlipc/"Deferred Signals (Safe Signals)"> for a detailled +See L<perlipc/"Deferred Signals (Safe Signals)"> for a detailed explanation. Since C<Net::Pcap> version 0.08, released in October 2005, the module @@ -1288,7 +1288,7 @@ Version 0.05 was released by Marco Carnut with fixes to make it work with Cygwin and WinPcap. -Version 0.04.02 was independantly created by Jean-Louis Morel +Version 0.04.02 was independently created by Jean-Louis Morel but not uploaded on the CPAN. It can be found here: L<http://www.bribes.org/perl/wnetpcap.html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/README new/Net-Pcap-0.20/README --- old/Net-Pcap-0.18/README 2016-05-10 01:16:22.000000000 +0200 +++ new/Net-Pcap-0.20/README 2021-12-17 11:43:39.000000000 +0100 @@ -5,11 +5,11 @@ DESCRIPTION - The Net::Pcap module is a Perl binding to the LBL pcap(3) packet + The Net::Pcap module is a Perl binding to the LBL pcap(3) packet capture library. - The latest source code for the Pcap library can be found at - <http://www.tcpdump.org/>. The source code and binary for the + The latest source code for the Pcap library can be found at + <http://www.tcpdump.org/>. The source code and binary for the Win32 port can be found at <http://www.winpcap.org/>. @@ -35,22 +35,22 @@ To install the extension in a private directory, you can use the PREFIX option when creating Makefile.PL. - For most of the tests, an administrative account is required - since opening a network interface in promiscuous mode is a - privileged operation. Some tests also require a working network - interface with traffic on it otherwise the tests will appear to - hang. You can generate traffic by pinging a non existing IP - address on your network segment. Consult the source for individual + For most of the tests, an administrative account is required + since opening a network interface in promiscuous mode is a + privileged operation. Some tests also require a working network + interface with traffic on it otherwise the tests will appear to + hang. You can generate traffic by pinging a non existing IP + address on your network segment. Consult the source for individual tests for more information. - You can select the interface Net::Pcap will use for its tests by - creating a file device.txt in the distribution root directory and + You can select the interface Net::Pcap will use for its tests by + creating a file device.txt in the distribution root directory and putting the device name inside. - Net::Pcap is compatible with all the versions of the Pcap library, + Net::Pcap is compatible with all the versions of the Pcap library, including the old BSD ones and the Windows port WinPcap. - Net::Pcap should work on any Perl since 5.004_05. This module has + Net::Pcap should work on any Perl since 5.004_05. This module has been tested by the author on the following Perl and system versions but is likely to run on many more: @@ -65,11 +65,11 @@ 5.8.8 i386-freebsd-64int 3.4.4 0.9.1 5.8.6 darwin-thread-multi-2level (PowerPC) 4.0.1 - For Perl 5.004, you may need to install ExtUtils::Constant with - this patch: + For Perl 5.004, you may need to install ExtUtils::Constant with + this patch: http://public.activestate.com/cgi-bin/perlbrowse?patch=25927 - See also the corresponding CPAN Testers page: + See also the corresponding CPAN Testers page: http://testers.cpan.org/show/Net-Pcap.html and the CPAN Testers Matrix: @@ -91,7 +91,7 @@ CPAN Request Tracker: http://rt.cpan.org/Dist/Display.html?Name=Net-Pcap - AnnoCPAN, annotated CPAN documentation: + AnnoCPAN, annotated CPAN documentation: http://annocpan.org/dist/Net-Pcap CPAN Ratings: @@ -105,10 +105,10 @@ Copyright (C) 2005-2016 Sebastien Aperghis-Tramoni and contributors. All rights reserved. - Copyright (C) 2003 Marco Carnut. All rights reserved. - Copyright (C) 1999-2000 Tim Potter. All rights reserved. - Copyright (C) 1998 Bo Adler. All rights reserved. - Copyright (C) 1997 Peter Lister. All rights reserved. + Copyright (C) 2003 Marco Carnut. All rights reserved. + Copyright (C) 1999-2000 Tim Potter. All rights reserved. + Copyright (C) 1998 Bo Adler. All rights reserved. + Copyright (C) 1997 Peter Lister. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/pcap_version.c new/Net-Pcap-0.20/pcap_version.c --- old/Net-Pcap-0.18/pcap_version.c 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/pcap_version.c 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,6 @@ +#include <stdio.h> +#include <pcap.h> + +int main(int argc, char *argv[]) { + printf("%s\n", pcap_lib_version()); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/stubs.inc new/Net-Pcap-0.20/stubs.inc --- old/Net-Pcap-0.18/stubs.inc 2006-10-16 00:00:58.000000000 +0200 +++ new/Net-Pcap-0.20/stubs.inc 2021-12-17 11:43:39.000000000 +0100 @@ -2,10 +2,10 @@ * stubs.inc - compatibility definitions to make this module compile in every cases * * Copyright (C) 2005, 2006 Sebastien Aperghis-Tramoni. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify + * + * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. - * + * */ /* Macros and constants */ @@ -354,11 +354,14 @@ #ifdef _MSC_VER #pragma message( "Warning: the function pcap_open() is not available" ) #endif + +#if PERL_PCAP_VERSION < 1009000 struct pcap_rmtauth { int type; char *username; char *password; }; +#endif pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err); pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err) { @@ -516,10 +519,12 @@ #ifdef _MSC_VER #pragma message( "Warning: the function pcap_setsampling() is not available" ) #endif +#if PERL_PCAP_VERSION < 1009000 struct pcap_samp { int method; int value; }; +#endif struct pcap_samp *pcap_setsampling(pcap_t *p); struct pcap_samp *pcap_setsampling(pcap_t *p) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/t/09-error.t new/Net-Pcap-0.20/t/09-error.t --- old/Net-Pcap-0.18/t/09-error.t 2007-12-22 20:31:22.000000000 +0100 +++ new/Net-Pcap-0.20/t/09-error.t 2021-12-17 11:43:39.000000000 +0100 @@ -22,7 +22,7 @@ is( $res, -1, " - result must not be null: $res" ); eval { $err = Net::Pcap::geterr($pcap) }; is( $@, '', "geterr()" ); -like( $err, '/^(?:parse|syntax) error$/', " - \$err must not be null: $err" ); +like( $err, '/(^|: )(?:parse|syntax) error$/', " - \$err must not be null: $err" ); # Testing compile() with a valid filter eval { $res = Net::Pcap::compile($pcap, \$filter, "tcp", 0, $mask) }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/t/24-offline_filter.t new/Net-Pcap-0.20/t/24-offline_filter.t --- old/Net-Pcap-0.18/t/24-offline_filter.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/t/24-offline_filter.t 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,48 @@ +#!perl -T +use strict; +use File::Spec; +use Test::More; +use Net::Pcap; +use lib 't'; +use Utils; + +my $has_test_exception = eval "use Test::Exception; 1"; + +plan tests => 7; + +my ($r, $err, $icmpfilter, $tcpfilter); + +my $path = File::Spec->catfile(qw(t samples ping-ietf-20pk-be.dmp)); +my $pcap = pcap_open_offline($path, \$err); +ok $pcap, 'open testfile'; + +$r = eval { pcap_compile($pcap, \$icmpfilter, 'icmp', 1, 0xffffffff) }; +is $r, 0, 'compile icmp filter'; + +$r = eval { pcap_compile($pcap, \$tcpfilter, 'tcp', 1, 0xffffffff) }; +is $r, 0, 'compile tcp filter'; + +SKIP: { + skip "Test::Exception not available", 1 unless $has_test_exception; + + # check offline_filter() errors + throws_ok(sub { + pcap_offline_filter($tcpfilter, undef, undef) + }, '/^arg2 not a hash ref/', + "calling offline_filter() with no argument"); +} + +my (%header, $packet); +my ($n, $icmp, $tcp) = (0, 0, 0); + +while (pcap_next_ex($pcap, \%header, \$packet) == 1) { + $n++; + $icmp++ if pcap_offline_filter($icmpfilter, \%header, $packet); + $tcp++ if pcap_offline_filter($tcpfilter, \%header, $packet); +} + +pcap_close($pcap); + +is $n, 20, 'read all packets'; +is $icmp, 20, 'found all icmp packets'; +is $tcp, 0, 'test for tcp packets in an icmp-only testfile'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/t/leaktests/leaktest1.pl new/Net-Pcap-0.20/t/leaktests/leaktest1.pl --- old/Net-Pcap-0.18/t/leaktests/leaktest1.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/t/leaktests/leaktest1.pl 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w +# +# Test for memory leaks by sitting in an infinite loop and flood +# pinging from another window. Memory leaks become apparent quickly. +# +# $Id: leaktest1.pl,v 1.3 1999/05/05 02:11:58 tpot Exp $ +# + +use strict; +use English; + +use ExtUtils::testlib; +use Net::Pcap; + +die("Must run as root!\n"), if ($UID != 0); + +my($dev, $err, $pcap_t); + +$dev = Net::Pcap::lookupdev(\$err); +$pcap_t = Net::Pcap::open_live($dev, 1024, 1, 0, \$err); + +if (!defined($pcap_t)) { + die("Net::Pcap::open_live returned error $err"); +} + +my $count; + +sub process_pkt { + my($user, $hdr, $pkt) = @_; + + $count++; + + print("$count\n"), if (($count % 1000) == 0); +} + +Net::Pcap::loop($pcap_t, 0, \&process_pkt, "1234"); +Net::Pcap::close($pcap_t); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/t/leaktests/leaktest2.pl new/Net-Pcap-0.20/t/leaktests/leaktest2.pl --- old/Net-Pcap-0.18/t/leaktests/leaktest2.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/t/leaktests/leaktest2.pl 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,19 @@ +#!/usr/bin/perl -w +# +# Test for memory leaks in lookup functions +# +# $Id: leaktest2.pl,v 1.3 1999/05/05 02:11:58 tpot Exp $ +# + +use strict; +use English; + +use ExtUtils::testlib; +use Net::Pcap; + +my($dev, $net, $mask, $err, $result); + +while(1) { + $dev = Net::Pcap::lookupdev(\$err); + $result = Net::Pcap::lookupnet($dev, \$net, \$mask, \$err); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/t/leaktests/leaktest3.pl new/Net-Pcap-0.20/t/leaktests/leaktest3.pl --- old/Net-Pcap-0.18/t/leaktests/leaktest3.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/t/leaktests/leaktest3.pl 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,39 @@ +#!/usr/bin/perl -w +# +# Test for memory leaks in dispatch() function. +# +# $Id: leaktest3.pl,v 1.3 1999/05/05 02:11:59 tpot Exp $ +# + +use strict; +use English; + +use ExtUtils::testlib; +use Net::Pcap; + +die("Must run as root!\n"), if ($UID != 0); + +my($dev, $err, $pcap_t); + +$dev = Net::Pcap::lookupdev(\$err); +$pcap_t = Net::Pcap::open_live($dev, 1024, 1, 0, \$err); + +if (!defined($pcap_t)) { + die("Net::Pcap::open_live returned error $err"); +} + +my $count; + +sub process_pkt { + my($user, $hdr, $pkt) = @_; + + $count++; + + print("$count\n"), if (($count % 1000) == 0); +} + +while(1) { + Net::Pcap::dispatch($pcap_t, 0, \&process_pkt, "1234"); +} + +Net::Pcap::close($pcap_t); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/t/leaktests/leaktest4.pl new/Net-Pcap-0.20/t/leaktests/leaktest4.pl --- old/Net-Pcap-0.18/t/leaktests/leaktest4.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/t/leaktests/leaktest4.pl 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,40 @@ +#!/usr/bin/perl -w +# +# Test for memory leaks in dump() function +# +# $Id: leaktest4.pl,v 1.3 1999/05/05 02:11:59 tpot Exp $ +# + +use strict; +use English; + +use ExtUtils::testlib; +use Net::Pcap; + +die("Must run as root!\n"), if ($UID != 0); + +my($dev, $err, $pcap_t, $pcap_dumper_t); + +$dev = Net::Pcap::lookupdev(\$err); +$pcap_t = Net::Pcap::open_live($dev, 1024, 1, 0, \$err); +$pcap_dumper_t = Net::Pcap::dump_open($pcap_t, "/dev/null"); + +if (!defined($pcap_t)) { + die("Net::Pcap::open_live returned error $err"); +} + +my $count; + +sub process_pkt { + my($user, $hdr, $pkt) = @_; + + $count++; + + Net::Pcap::dump($pcap_dumper_t, $hdr, $pkt); + print("$count\n"), if (($count % 1000) == 0); +} + +Net::Pcap::loop($pcap_t, 0, \&process_pkt, "1234"); + +Net::Pcap::dump_close($pcap_dumper_t); +Net::Pcap::close($pcap_t); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/t/leaktests/leaktest5.pl new/Net-Pcap-0.20/t/leaktests/leaktest5.pl --- old/Net-Pcap-0.18/t/leaktests/leaktest5.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/t/leaktests/leaktest5.pl 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,40 @@ +#!/usr/bin/perl -w +# +# Test for memory leaks in next() function. +# +# $Id: leaktest5.pl,v 1.3 1999/05/05 02:11:59 tpot Exp $ +# + +use strict; +use English; + +use ExtUtils::testlib; +use Net::Pcap; + +die("Must run as root!\n"), if ($UID != 0); + +my($dev, $err, $pcap_t); + +$dev = Net::Pcap::lookupdev(\$err); +$pcap_t = Net::Pcap::open_live($dev, 1024, 1, 0, \$err); + +if (!defined($pcap_t)) { + die("Net::Pcap::open_live returned error $err"); +} + +my $count; + +while(1) { + my($pkt, %hdr); + + while (!($pkt = Net::Pcap::next($pcap_t, \%hdr))) { + } + + $count++; + + print("$count\n"), if (($count % 1000) == 0); +} + + +Net::Pcap::loop($pcap_t, 0, \&process_pkt, "1234"); +Net::Pcap::close($pcap_t); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-Pcap-0.18/t/leaktests/leaktest6.pl new/Net-Pcap-0.20/t/leaktests/leaktest6.pl --- old/Net-Pcap-0.18/t/leaktests/leaktest6.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Net-Pcap-0.20/t/leaktests/leaktest6.pl 2021-12-17 11:43:39.000000000 +0100 @@ -0,0 +1,39 @@ +#!/usr/bin/perl -w +# +# Test for memory leaks in stats() function +# +# $Id: leaktest6.pl,v 1.3 1999/05/05 02:11:59 tpot Exp $ +# + +use strict; +use English; + +use ExtUtils::testlib; +use Net::Pcap; + +die("Must run as root!\n"), if ($UID != 0); + +my($dev, $err, $pcap_t); + +$dev = Net::Pcap::lookupdev(\$err); +$pcap_t = Net::Pcap::open_live($dev, 1024, 1, 0, \$err); + +if (!defined($pcap_t)) { + die("Net::Pcap::open_live returned error $err"); +} + +my $count; + +sub process_pkt { + my($user, $hdr, $pkt) = @_; + my(%stats); + + $count++; + + Net::Pcap::stats($pcap_t, \%stats); + + print("$count\n"), if (($count % 1000) == 0); +} + +Net::Pcap::loop($pcap_t, 0, \&process_pkt, "1234"); +Net::Pcap::close($pcap_t); ++++++ cpanspec.yml ++++++ --- #description_paragraphs: 3 #description: |- # override description from CPAN #summary: override summary from CPAN #no_testing: broken upstream #sources: # - source1 # - source2 #patches: # foo.patch: -p1 # bar.patch: # baz.patch: PATCH-FIX-OPENSUSE preamble: |- BuildRequires: libpcap-devel Requires: perl-Data-Hexdumper Requires: perl-NetPacket #post_prep: |- # hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'` # sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL #post_build: |- # rm unused.files post_install: |- install -D -m0755 eg/pcapdump "%{buildroot}%{_bindir}/pcapdump" #license: SUSE-NonFree #skip_noarch: 1 #custom_build: |- #./Build build flags=%{?_smp_mflags} --myflag #custom_test: |- #startserver && make test #ignore_requires: Bizarre::Module skip_doc: stubs.inc #add_doc: files to add to docs misc: |- %exclude %{_bindir}/pcapinfo %exclude %{_bindir}/pcapdump %exclude %{_mandir}/man1/pcapinfo.1%{?ext_man} %package -n pcapdump Summary: Dump packets from the network Requires: %{name} = %{version} %description -n pcapdump Command line tool to dump packets from the network. pcapdump mimics the very basic features of tcpdump(1) and provides a good example of how to use Net::Pcap. %package -n pcapinfo Summary: Prints detailed information about the network devices Requires: %{name} = %{version} %description -n pcapinfo pcapinfo prints detailed information about the network devices and Pcap library available on the current host. %files -n pcapdump %{_bindir}/pcapdump %files -n pcapinfo %{_bindir}/pcapinfo %{_mandir}/man1/pcapinfo.1%{?ext_man}
