r58370 - in /trunk/libnetpacket-perl: ./ debian/ debian/patches/ lib/ lib/NetPacket/ t/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Mon May 24 04:35:15 UTC 2010
Author: ansgar-guest
Date: Mon May 24 04:34:38 2010
New Revision: 58370
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=58370
Log:
* New upstream release.
* Refresh patch.
* debian/copyright: Add information for new files.
* debian/rules: Use Build.PL explicitly.
* debian/control: Suggests: libnet-pcap-perl for capturing packets.
* Add myself to Uploaders.
Added:
trunk/libnetpacket-perl/lib/NetPacket/ICMPv6.pm
- copied unchanged from r58368, branches/upstream/libnetpacket-perl/current/lib/NetPacket/ICMPv6.pm
trunk/libnetpacket-perl/lib/NetPacket/IPv6.pm
- copied unchanged from r58368, branches/upstream/libnetpacket-perl/current/lib/NetPacket/IPv6.pm
trunk/libnetpacket-perl/lib/NetPacket/PFLog.pm
- copied unchanged from r58368, branches/upstream/libnetpacket-perl/current/lib/NetPacket/PFLog.pm
trunk/libnetpacket-perl/t/icmp.t
- copied unchanged from r58368, branches/upstream/libnetpacket-perl/current/t/icmp.t
trunk/libnetpacket-perl/t/tcp.t
- copied unchanged from r58368, branches/upstream/libnetpacket-perl/current/t/tcp.t
trunk/libnetpacket-perl/t/udp-checksum.t
- copied unchanged from r58368, branches/upstream/libnetpacket-perl/current/t/udp-checksum.t
Modified:
trunk/libnetpacket-perl/Build.PL
trunk/libnetpacket-perl/Changes
trunk/libnetpacket-perl/MANIFEST
trunk/libnetpacket-perl/META.yml
trunk/libnetpacket-perl/Makefile.PL
trunk/libnetpacket-perl/debian/changelog
trunk/libnetpacket-perl/debian/control
trunk/libnetpacket-perl/debian/copyright
trunk/libnetpacket-perl/debian/patches/spelling.patch
trunk/libnetpacket-perl/debian/rules
trunk/libnetpacket-perl/lib/NetPacket.pm
trunk/libnetpacket-perl/lib/NetPacket/ARP.pm
trunk/libnetpacket-perl/lib/NetPacket/Ethernet.pm
trunk/libnetpacket-perl/lib/NetPacket/ICMP.pm
trunk/libnetpacket-perl/lib/NetPacket/IGMP.pm
trunk/libnetpacket-perl/lib/NetPacket/IP.pm
trunk/libnetpacket-perl/lib/NetPacket/TCP.pm
trunk/libnetpacket-perl/lib/NetPacket/UDP.pm
trunk/libnetpacket-perl/t/checksum.t
Modified: trunk/libnetpacket-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/Build.PL?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/Build.PL (original)
+++ trunk/libnetpacket-perl/Build.PL Mon May 24 04:34:38 2010
@@ -3,19 +3,17 @@
use Module::Build;
my $builder = Module::Build->new(
- module_name => 'NetPacket',
- dist_version_from => 'lib/NetPacket.pm',
- create_license => 1,
- license => 'artistic_2',
- create_makefile_pl => 'small',
- configure_requires => {
- 'Module::Build' => 0,
- },
- meta_merge => {
+ module_name => 'NetPacket',
+ dist_version_from => 'lib/NetPacket.pm',
+ create_license => 1,
+ license => 'artistic_2',
+ create_makefile_pl => 'small',
+ configure_requires => { 'Module::Build' => 0, },
+ meta_merge => {
resources => {
repository => 'git://github.com/yanick/netpacket.git',
bugtracker =>
- 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=NetPacket',
+ 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=NetPacket',
},
},
);
Modified: trunk/libnetpacket-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/Changes?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/Changes (original)
+++ trunk/libnetpacket-perl/Changes Mon May 24 04:34:38 2010
@@ -1,4 +1,15 @@
revision history for NetPacket
+
+0.43.0 May 23rd, 2010
+ * Fixed UDP checksum. Thanks to Hal Finkel. (RT#56235)
+ * Added Joel Knight's code for IPv6 support from
+ http://www.packetmischief.ca/code/netpacket/.
+ Thanks to Doug Farley for the bug report. (RT#57560)
+
+0.42.0 March 25th, 2010
+ * Updated license to Artistic 2.0
+ * Fixed bad call to 'data()' in ICMP. Thanks to Ventz Petkov.
+ (RT#52627)
0.41.1
* Fixed bug 37931: export of ICMP_MASKREQ
Modified: trunk/libnetpacket-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/MANIFEST?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/MANIFEST (original)
+++ trunk/libnetpacket-perl/MANIFEST Mon May 24 04:34:38 2010
@@ -10,6 +10,9 @@
lib/NetPacket/IP.pm
lib/NetPacket/UDP.pm
lib/NetPacket/TCP.pm
+lib/NetPacket/IPv6.pm
+lib/NetPacket/ICMPv6.pm
+lib/NetPacket/PFLog.pm
t/ip_encode.t
Changes
t/ip_trailing.t
@@ -17,4 +20,7 @@
t/bug-37931.t
t/general.t
t/checksum.t
+t/icmp.t
+t/tcp.t
+t/udp-checksum.t
LICENSE
Modified: trunk/libnetpacket-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/META.yml?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/META.yml (original)
+++ trunk/libnetpacket-perl/META.yml Mon May 24 04:34:38 2010
@@ -6,7 +6,7 @@
- 'Yanick Champoux <yanick at cpan.org>'
configure_requires:
Module::Build: 0
-generated_by: 'Module::Build version 0.3601'
+generated_by: 'Module::Build version 0.3603'
license: artistic_2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -15,30 +15,39 @@
provides:
NetPacket:
file: lib/NetPacket.pm
- version: v0.42.0
+ version: v0.43.0
NetPacket::ARP:
file: lib/NetPacket/ARP.pm
- version: v0.42.0
+ version: v0.43.0
NetPacket::Ethernet:
file: lib/NetPacket/Ethernet.pm
- version: v0.42.0
+ version: v0.43.0
NetPacket::ICMP:
file: lib/NetPacket/ICMP.pm
- version: v0.42.0
+ version: v0.43.0
+ NetPacket::ICMPv6:
+ file: lib/NetPacket/ICMPv6.pm
+ version: v0.43.0
NetPacket::IGMP:
file: lib/NetPacket/IGMP.pm
- version: v0.42.0
+ version: v0.43.0
NetPacket::IP:
file: lib/NetPacket/IP.pm
- version: v0.42.0
+ version: v0.43.0
+ NetPacket::IPv6:
+ file: lib/NetPacket/IPv6.pm
+ version: v0.43.0
+ NetPacket::PFLog:
+ file: lib/NetPacket/PFLog.pm
+ version: v0.43.0
NetPacket::TCP:
file: lib/NetPacket/TCP.pm
- version: v0.42.0
+ version: v0.43.0
NetPacket::UDP:
file: lib/NetPacket/UDP.pm
- version: v0.42.0
+ version: v0.43.0
resources:
bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=NetPacket
license: http://www.perlfoundation.org/artistic_license_2_0
repository: git://github.com/yanick/netpacket.git
-version: v0.42.0
+version: v0.43.0
Modified: trunk/libnetpacket-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/Makefile.PL?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/Makefile.PL (original)
+++ trunk/libnetpacket-perl/Makefile.PL Mon May 24 04:34:38 2010
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.3601
+# Note: this file was auto-generated by Module::Build::Compat version 0.3603
use Module::Build::Compat 0.02;
Module::Build::Compat->run_build_pl(args => \@ARGV);
Modified: trunk/libnetpacket-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/debian/changelog?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/debian/changelog (original)
+++ trunk/libnetpacket-perl/debian/changelog Mon May 24 04:34:38 2010
@@ -1,3 +1,14 @@
+libnetpacket-perl (0.43.0-1) unstable; urgency=low
+
+ * New upstream release.
+ * Refresh patch.
+ * debian/copyright: Add information for new files.
+ * debian/rules: Use Build.PL explicitly.
+ * debian/control: Suggests: libnet-pcap-perl for capturing packets.
+ * Add myself to Uploaders.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Mon, 24 May 2010 13:33:47 +0900
+
libnetpacket-perl (0.42.0-1) unstable; urgency=low
* New upstream release.
Modified: trunk/libnetpacket-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/debian/control?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/debian/control (original)
+++ trunk/libnetpacket-perl/debian/control Mon May 24 04:34:38 2010
@@ -1,11 +1,12 @@
Source: libnetpacket-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7.0.17), perl (>= 5.10) | libmodule-build-perl
+Build-Depends: debhelper (>= 7.3.7~), perl (>= 5.10) | libmodule-build-perl
Build-Depends-Indep: perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Benoit Mortier <benoit.mortier at opensides.be>,
- gregor herrmann <gregoa at debian.org>
+ gregor herrmann <gregoa at debian.org>,
+ Ansgar Burchardt <ansgar at 43-1.org>
Standards-Version: 3.8.4
Homepage: http://search.cpan.org/dist/NetPacket/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnetpacket-perl/
@@ -14,6 +15,7 @@
Package: libnetpacket-perl
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends}
+Suggests: libnet-pcap-perl
Description: modules to assemble/disassemble network packets at the protocol level
NetPacket provides a base class for a cluster of modules related to
decoding and encoding of network protocols. Each NetPacket
Modified: trunk/libnetpacket-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/debian/copyright?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/debian/copyright (original)
+++ trunk/libnetpacket-perl/debian/copyright Mon May 24 04:34:38 2010
@@ -11,20 +11,16 @@
CRC for Advanced Computational Systems ('ACSys')
License: Artistic-2.0
+Files: ./lib/NetPacket/ICMPv6.pm, ./lib/NetPacket/IPv6.pm,
+ ./lib/NetPacket/PFLog.pm
+Copyright: 2003-2009, Joel Knight <knight.joel at gmail.com>
+License: ISC
+
Files: debian/*
Copyright: 2009, Benoit Mortier <benoit.mortier at opensides.be>
2009, Cajus Pollmeier <cajus at debian.org>
2010, gregor herrmann <gregoa at debian.org>
License: Artistic or GPL-1+
-
-License: GPL-1+
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 1, or (at your option)
- any later version.
- .
- On Debian GNU/Linux systems, the complete text of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL'
License: Artistic
This program is free software; you can redistribute it and/or modify
@@ -223,3 +219,25 @@
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: GPL-1+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian GNU/Linux systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL'
+
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Modified: trunk/libnetpacket-perl/debian/patches/spelling.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/debian/patches/spelling.patch?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/debian/patches/spelling.patch (original)
+++ trunk/libnetpacket-perl/debian/patches/spelling.patch Mon May 24 04:34:38 2010
@@ -2,9 +2,9 @@
Description: spelling fix
Forwarded: no
---- a/lib/NetPacket/UDP.pm
-+++ b/lib/NetPacket/UDP.pm
-@@ -326,7 +326,7 @@ sub alterPacket
+--- libnetpacket-perl.orig/lib/NetPacket/UDP.pm
++++ libnetpacket-perl/lib/NetPacket/UDP.pm
+@@ -307,7 +307,7 @@
# replace foo in the payload with bar
$udp_obj->{data} =~ s/foo/bar/g;
Modified: trunk/libnetpacket-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/debian/rules?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/debian/rules (original)
+++ trunk/libnetpacket-perl/debian/rules Mon May 24 04:34:38 2010
@@ -1,4 +1,4 @@
#!/usr/bin/make -f
%:
- dh $@
+ dh --buildsystem=perl_build $@
Modified: trunk/libnetpacket-perl/lib/NetPacket.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/lib/NetPacket.pm?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/lib/NetPacket.pm (original)
+++ trunk/libnetpacket-perl/lib/NetPacket.pm Mon May 24 04:34:38 2010
@@ -10,7 +10,7 @@
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-our $VERSION = '0.42.0';
+our $VERSION = '0.43.0';
BEGIN {
@ISA = qw(Exporter);
Modified: trunk/libnetpacket-perl/lib/NetPacket/ARP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/lib/NetPacket/ARP.pm?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/lib/NetPacket/ARP.pm (original)
+++ trunk/libnetpacket-perl/lib/NetPacket/ARP.pm Mon May 24 04:34:38 2010
@@ -7,7 +7,7 @@
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-our $VERSION = '0.42.0';
+our $VERSION = '0.43.0';
BEGIN {
@ISA = qw(Exporter NetPacket);
Modified: trunk/libnetpacket-perl/lib/NetPacket/Ethernet.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/lib/NetPacket/Ethernet.pm?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/lib/NetPacket/Ethernet.pm (original)
+++ trunk/libnetpacket-perl/lib/NetPacket/Ethernet.pm Mon May 24 04:34:38 2010
@@ -6,7 +6,7 @@
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-our $VERSION = '0.42.0';
+our $VERSION = '0.43.0';
BEGIN {
@ISA = qw(Exporter NetPacket);
Modified: trunk/libnetpacket-perl/lib/NetPacket/ICMP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/lib/NetPacket/ICMP.pm?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/lib/NetPacket/ICMP.pm (original)
+++ trunk/libnetpacket-perl/lib/NetPacket/ICMP.pm Mon May 24 04:34:38 2010
@@ -9,7 +9,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-our $VERSION = '0.42.0';
+our $VERSION = '0.43.0';
BEGIN {
@ISA = qw(Exporter NetPacket);
@@ -231,7 +231,7 @@
=item exportable
-Icmp message types:
+ICMP message types:
ICMP_ECHOREPLY ICMP_UNREACH ICMP_SOURCEQUENCH
ICMP_REDIRECT ICMP_ECHO ICMP_ROUTERADVERT
ICMP_ROUTERSOLICIT ICMP_TIMXCEED ICMP_PARAMPROB
@@ -245,6 +245,14 @@
=over
+=item C<:types>
+
+ ICMP_ECHOREPLY ICMP_UNREACH ICMP_SOURCEQUENCH
+ ICMP_REDIRECT ICMP_ECHO ICMP_ROUTERADVERT
+ ICMP_ROUTERSOLICIT ICMP_TIMXCEED ICMP_PARAMPROB
+ ICMP_TSTAMP ICMP_TSTAMPREPLY ICMP_IREQ
+ ICMP_IREQREPLY ICMP_MASKREQ ICMP_MASKREPLY
+
=item C<:strip>
Import the strip function C<icmp_strip>.
@@ -259,13 +267,35 @@
=head1 EXAMPLE
+The following example prints the ICMP type, code, and checksum
+fields.
+
+ #!/usr/bin/perl -w
+
+ use strict;
+ use Net::PcapUtils;
+ use NetPacket::Ethernet qw(:strip);
+ use NetPacket::IP qw(:strip);
+ use NetPacket::ICMP;
+
+ sub process_pkt {
+ my ($user, $hdr, $pkt) = @_;
+
+ my $ip_obj = NetPacket::IP->decode(eth_strip($pkt));
+ my $icmp_obj = NetPacket::ICMP->decode(ip_strip($ip_obj));
+
+ print("Type: $icmp_obj->{type}\n");
+ print("Code: $icmp_obj->{code}\n");
+ print("Checksum: $icmp_obj->{cksum}\n\n");
+ }
+
+ Net::PcapUtils::loop(\&process_pkt, FILTER => 'icmp');
+
=head1 TODO
=over
=item Create constants
-
-=item Write example
=back
Modified: trunk/libnetpacket-perl/lib/NetPacket/IGMP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/lib/NetPacket/IGMP.pm?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/lib/NetPacket/IGMP.pm (original)
+++ trunk/libnetpacket-perl/lib/NetPacket/IGMP.pm Mon May 24 04:34:38 2010
@@ -8,7 +8,7 @@
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-our $VERSION = '0.42.0';
+our $VERSION = '0.43.0';
BEGIN {
@ISA = qw(Exporter NetPacket);
Modified: trunk/libnetpacket-perl/lib/NetPacket/IP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/lib/NetPacket/IP.pm?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/lib/NetPacket/IP.pm (original)
+++ trunk/libnetpacket-perl/lib/NetPacket/IP.pm Mon May 24 04:34:38 2010
@@ -9,7 +9,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
use NetPacket;
-our $VERSION = '0.42.0';
+our $VERSION = '0.43.0';
BEGIN {
@ISA = qw(Exporter NetPacket);
@@ -119,7 +119,7 @@
# Decode variable length header options and remaining data in field
my $olen = $self->{hlen} - 5;
- $olen = 0, if ($olen < 0); # Check for bad hlen
+ $olen = 0 if $olen < 0; # Check for bad hlen
# Option length is number of 32 bit words
@@ -243,7 +243,7 @@
Return an IP packet encoded with the instance data specified. This
will infer the total length of the packet automatically from the
-payload lenth and also adjust the checksum.
+payload length and also adjust the checksum.
=back
Modified: trunk/libnetpacket-perl/lib/NetPacket/TCP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/lib/NetPacket/TCP.pm?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/lib/NetPacket/TCP.pm (original)
+++ trunk/libnetpacket-perl/lib/NetPacket/TCP.pm Mon May 24 04:34:38 2010
@@ -23,7 +23,7 @@
use constant ECE => 0x40;
use constant CWR => 0x80;
-our $VERSION = '0.42.0';
+our $VERSION = '0.43.0';
BEGIN {
@ISA = qw(Exporter NetPacket);
Modified: trunk/libnetpacket-perl/lib/NetPacket/UDP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/lib/NetPacket/UDP.pm?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/lib/NetPacket/UDP.pm (original)
+++ trunk/libnetpacket-perl/lib/NetPacket/UDP.pm Mon May 24 04:34:38 2010
@@ -9,7 +9,7 @@
use NetPacket;
use NetPacket::IP;
-our $VERSION = '0.42.0';
+our $VERSION = '0.43.0';
BEGIN {
@ISA = qw(Exporter NetPacket);
@@ -117,17 +117,12 @@
no warnings;
my $packet = pack 'a4a4CCnnnnna*' =>
- # fake ip header part
- $src_ip,
- $dest_ip,
- 0,
- $proto,
- # proper UDP part
- $self->{src_port},
- $self->{dest_port},
- $self->{len},
- 0,
- $self->{data};
+
+ # fake ip header part
+ $src_ip, $dest_ip, 0, $proto, $self->{len},
+
+ # proper UDP part
+ $self->{src_port}, $self->{dest_port}, $self->{len}, 0, $self->{data};
$packet .= "\x00" if length($packet) % 2;
@@ -174,10 +169,10 @@
It is the responsibility of the programmer to ensure valid packet data
is passed to this method.
-=item C<NetPacket::UDP-E<gt>encode(param =E<gt> value)>
+=item C<NetPacket::UDP-E<gt>encode($ip_obj)>
Return a UDP packet encoded with the instance data specified. Needs parts
-of the ip header contained in $ip_obj, the IP object, in order to calculate
+of the IP header contained in $ip_obj, the IP object, in order to calculate
the UDP checksum. The length field will also be set automatically.
=back
@@ -237,9 +232,7 @@
=item exportable
-igmp_strip IGMP_VERSION_RFC998 IGMP_VERSION_RFC1112
-IGMP_MSG_HOST_MQUERY IGMP_MSG_HOST_MREPORT IGMP_IP_NO_HOSTS
-IGMP_IP_ALL_HOSTS IGMP_IP_ALL_ROUTERS
+udp_strip
=item tags
@@ -249,19 +242,7 @@
=item C<:strip>
-Import the strip function C<igmp_strip>.
-
-=item C<:versions>
-
-IGMP_VERSION_RFC998 IGMP_VERSION_RFC1112
-
-=item C<:msgtypes>
-
-IGMP_HOST_MQUERY IGMP_HOST_MREPORT
-
-=item C<:group_addrs>
-
-IGMP_IP_NO_HOSTS IGMP_IP_ALL_HOSTS IGMP_IP_ALL_ROUTERS
+Import the strip function C<udp_strip>.
=item C<:ALL>
@@ -273,8 +254,8 @@
=head1 EXAMPLE
-The following script dumps IGMP the contents of IGMP frames to
-standard output.
+The following example prints the source IP address and port, the
+destination IP address and port, and the UDP packet length:
#!/usr/bin/perl -w
Modified: trunk/libnetpacket-perl/t/checksum.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetpacket-perl/t/checksum.t?rev=58370&op=diff
==============================================================================
--- trunk/libnetpacket-perl/t/checksum.t (original)
+++ trunk/libnetpacket-perl/t/checksum.t Mon May 24 04:34:38 2010
@@ -42,4 +42,4 @@
bless $udp, 'NetPacket::UDP';
-is NetPacket::UDP::checksum( $udp, $ip ) => 49177, 'UDP padding';
+is NetPacket::UDP::checksum( $udp, $ip ) => 60058, 'UDP padding';
More information about the Pkg-perl-cvs-commits
mailing list