[SCM] Debian packaging of libnetpacket-perl branch, master, updated. upstream/1.2.0-48-ge5b7262
gregor herrmann
gregoa at debian.org
Sun Nov 20 16:15:23 UTC 2011
The following commit has been merged in the master branch:
commit efd1e33a82986653f4f1a1ea5d8cedb3c9804b87
Author: gregor herrmann <gregoa at debian.org>
Date: Sun Nov 20 17:01:19 2011 +0100
Imported Upstream version 1.3.0
diff --git a/Build.PL b/Build.PL
index 47ba8f6..f0cd058 100644
--- a/Build.PL
+++ b/Build.PL
@@ -6,31 +6,33 @@ use Module::Build 0.3601;
my %module_build_args = (
- 'build_requires' => {
- 'Carp' => '0',
- 'Module::Build' => '0.3601',
- 'Scalar::Util' => '0',
- 'Test::More' => '0.94',
- 'perl' => '5.004'
+ "build_requires" => {
+ "Carp" => 0,
+ "Module::Build" => "0.3601",
+ "Scalar::Util" => 0,
+ "Test::More" => "0.94",
+ "perl" => "5.004"
},
- 'configure_requires' => {
- 'Module::Build' => '0.3601'
+ "configure_requires" => {
+ "Module::Build" => "0.3601"
},
- 'dist_abstract' => 'assemble/disassemble network packets at the protocol level',
- 'dist_author' => [
- 'Yanick Champoux <yanick at cpan.org>'
+ "dist_abstract" => "assemble/disassemble network packets at the protocol level",
+ "dist_author" => [
+ "Yanick Champoux <yanick\@cpan.org>"
],
- 'dist_name' => 'NetPacket',
- 'dist_version' => '1.2.0',
- 'license' => 'artistic_2',
- 'module_name' => 'NetPacket',
- 'recommends' => {},
- 'recursive_test_files' => 1,
- 'requires' => {
- 'constant' => '0',
- 'vars' => '0'
+ "dist_name" => "NetPacket",
+ "dist_version" => "1.3.0",
+ "license" => "artistic_2",
+ "module_name" => "NetPacket",
+ "recommends" => {},
+ "recursive_test_files" => 1,
+ "requires" => {
+ "constant" => 0,
+ "strict" => 0,
+ "vars" => 0,
+ "warnings" => 0
},
- 'script_files' => []
+ "script_files" => []
);
diff --git a/Changes b/Changes
index 5bdd650..fb33934 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
revision history for NetPacket
+1.3.0 2011-11-13
+ [ENHANCEMENTS]
+ - 'parse_tcp_options()' method added to NetPacket::TCP (patch by Tom
+ Linden) [RT#71320]
+
1.2.0 2011-07-26
[ENHANCEMENTS]
- Add support for Ethernet VLAN (thanks to Kai Chan)
diff --git a/LICENSE b/LICENSE
index fcdd2d3..9f01d13 100644
--- a/LICENSE
+++ b/LICENSE
@@ -2,7 +2,7 @@ This software is Copyright (c) 2011 by Yanick Champoux.
This is free software, licensed under:
- The Artistic License 2.0
+ The Artistic License 2.0 (GPL Compatible)
The Artistic License 2.0
diff --git a/META.json b/META.json
index 1c88249..18eab1d 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
"Yanick Champoux <yanick at cpan.org>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 4.102345, CPAN::Meta::Converter version 2.101590",
+ "generated_by" : "Dist::Zilla version 4.300002, CPAN::Meta::Converter version 2.112150",
"license" : [
"artistic_2"
],
@@ -27,7 +27,9 @@
"runtime" : {
"requires" : {
"constant" : 0,
- "vars" : 0
+ "strict" : 0,
+ "vars" : 0,
+ "warnings" : 0
}
},
"test" : {
@@ -42,35 +44,35 @@
"provides" : {
"NetPacket" : {
"file" : "lib/NetPacket.pm",
- "version" : "v1.2.0"
+ "version" : "v1.3.0"
},
"NetPacket::ARP" : {
"file" : "lib/NetPacket/ARP.pm",
- "version" : "v1.2.0"
+ "version" : "v1.3.0"
},
"NetPacket::Ethernet" : {
"file" : "lib/NetPacket/Ethernet.pm",
- "version" : "v1.2.0"
+ "version" : "v1.3.0"
},
"NetPacket::ICMP" : {
"file" : "lib/NetPacket/ICMP.pm",
- "version" : "v1.2.0"
+ "version" : "v1.3.0"
},
"NetPacket::IGMP" : {
"file" : "lib/NetPacket/IGMP.pm",
- "version" : "v1.2.0"
+ "version" : "v1.3.0"
},
"NetPacket::IP" : {
"file" : "lib/NetPacket/IP.pm",
- "version" : "v1.2.0"
+ "version" : "v1.3.0"
},
"NetPacket::TCP" : {
"file" : "lib/NetPacket/TCP.pm",
- "version" : "v1.2.0"
+ "version" : "v1.3.0"
},
"NetPacket::UDP" : {
"file" : "lib/NetPacket/UDP.pm",
- "version" : "v1.2.0"
+ "version" : "v1.3.0"
}
},
"release_status" : "stable",
@@ -82,11 +84,11 @@
"homepage" : "http://search.cpan.org/dist/NetPacket/",
"repository" : {
"type" : "git",
- "url" : "git://github.com/yanick/netpacket.git",
- "web" : "http://github.com/yanick/netpacket/tree"
+ "url" : "https://github.com/yanick/netpacket.git",
+ "web" : "https://github.com/yanick/netpacket"
}
},
- "version" : "1.2.0",
- "x_authority" : "cpan:yanick"
+ "version" : "1.3.0",
+ "x_authority" : "cpan:YANICK"
}
diff --git a/META.yml b/META.yml
index 477a1fd..93f2262 100644
--- a/META.yml
+++ b/META.yml
@@ -11,8 +11,8 @@ build_requires:
configure_requires:
Module::Build: 0.3601
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.102345, CPAN::Meta::Converter version 2.101590'
-license: artistic2
+generated_by: 'Dist::Zilla version 4.300002, CPAN::Meta::Converter version 2.112150'
+license: artistic_2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
@@ -20,34 +20,36 @@ name: NetPacket
provides:
NetPacket:
file: lib/NetPacket.pm
- version: v1.2.0
+ version: v1.3.0
NetPacket::ARP:
file: lib/NetPacket/ARP.pm
- version: v1.2.0
+ version: v1.3.0
NetPacket::Ethernet:
file: lib/NetPacket/Ethernet.pm
- version: v1.2.0
+ version: v1.3.0
NetPacket::ICMP:
file: lib/NetPacket/ICMP.pm
- version: v1.2.0
+ version: v1.3.0
NetPacket::IGMP:
file: lib/NetPacket/IGMP.pm
- version: v1.2.0
+ version: v1.3.0
NetPacket::IP:
file: lib/NetPacket/IP.pm
- version: v1.2.0
+ version: v1.3.0
NetPacket::TCP:
file: lib/NetPacket/TCP.pm
- version: v1.2.0
+ version: v1.3.0
NetPacket::UDP:
file: lib/NetPacket/UDP.pm
- version: v1.2.0
+ version: v1.3.0
requires:
constant: 0
+ strict: 0
vars: 0
+ warnings: 0
resources:
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=NetPacket
homepage: http://search.cpan.org/dist/NetPacket/
- repository: git://github.com/yanick/netpacket.git
-version: 1.2.0
-x_authority: cpan:yanick
+ repository: https://github.com/yanick/netpacket.git
+version: 1.3.0
+x_authority: cpan:YANICK
diff --git a/README b/README
index ab24ac3..59b0902 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
NetPacket - assemble/disassemble network packets at the protocol level
VERSION
- version 1.2.0
+ version 1.3.0
SYNOPSIS
# NetPacket is a base class only
diff --git a/README.mkdn b/README.mkdn
index b7dd631..29e253f 100644
--- a/README.mkdn
+++ b/README.mkdn
@@ -4,7 +4,7 @@ NetPacket - assemble/disassemble network packets at the protocol level
# VERSION
-version 1.2.0
+version 1.3.0
# SYNOPSIS
diff --git a/SIGNATURE b/SIGNATURE
index a532e59..8fef22c 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -1,5 +1,5 @@
This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.64.
+signed via the Module::Signature module, version 0.68.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
@@ -14,24 +14,24 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 9fcf135d0e07b435c1e4079dd87ff4e687198654 Build.PL
-SHA1 65087ea5b61338a8d8633e5ab53256477f49b2ca Changes
+SHA1 d552046804703d0a4ae1c01c9ff7de76ad35f749 Build.PL
+SHA1 b8b41609285b45c87fd5f119f1d5baf16d121b3a Changes
SHA1 29b0b7b9d088441a05d8786d0dc4bb3bd558d205 INSTALL
-SHA1 fa6e44d3372502992b6f871b615edc033606b2d7 LICENSE
+SHA1 7e3315d45bf2c2bf96cdf8bd0dfac221e6e641f9 LICENSE
SHA1 478b16e5cba6c6811d80345400e08f98893f8034 MANIFEST
-SHA1 b85cc6d66d585b6851111124d2509ccfb6072816 META.json
-SHA1 8111dcf39d0d31276b4c5990bbae6d66b7b32770 META.yml
-SHA1 0c6963c11f8aaed52a562503072bc5e9013a9868 README
-SHA1 a976b5b7a6ea4cc835029d6dd1c90e74e7af2ea4 README.mkdn
-SHA1 dc3d6f608a07eac9a349ccefeac090808e20315c lib/NetPacket.pm
-SHA1 a889640b16d3ea0cbf2b248687abd0cf024c3bf0 lib/NetPacket/ARP.pm
-SHA1 872afd6e0352a76629732f705e556fe9df87718a lib/NetPacket/Ethernet.pm
-SHA1 0c8d467ac4c717a5a90e46a926780050054a7666 lib/NetPacket/ICMP.pm
-SHA1 f8b0d335e25c82e987970f938636cfef5ce95ae5 lib/NetPacket/IGMP.pm
-SHA1 a810c5b56396606c07d4ec004c9e8446ca633c93 lib/NetPacket/IP.pm
-SHA1 fedec0973bbf28311f921aa4674aa7f8b989c9ba lib/NetPacket/TCP.pm
-SHA1 128d59aad300c4d1d282343060b5610548e20be1 lib/NetPacket/UDP.pm
-SHA1 050aa113e828a52db3c86065c0c0ed50198b7ce8 t/000-report-versions.t
+SHA1 0f92e5721d3c80e495a0adc14c343fd58d658951 META.json
+SHA1 0350c8c5545cc1377ac68b55d9c67b96ad751d06 META.yml
+SHA1 063f8342ed75585c2bededa2c6d5efe9e0ad92cf README
+SHA1 7dde6e5b4e58b9f1e9fbd7c60432c211bbaa1eb7 README.mkdn
+SHA1 b86c1cfd4bf42803da9b693f1571a2827c5b4d77 lib/NetPacket.pm
+SHA1 dbfe911cb4bc7b7c89f30479451afd67882b5081 lib/NetPacket/ARP.pm
+SHA1 b7c6bd5c90aaddfebf12c7dadc046a387e47e1ed lib/NetPacket/Ethernet.pm
+SHA1 6e4124f72ce5818599d46edf7eafabc0af22835c lib/NetPacket/ICMP.pm
+SHA1 5a8bdd6fbda564644becbb9e08d1c640a74917e0 lib/NetPacket/IGMP.pm
+SHA1 c2d7ffdb6921f90d298b301c59f88f8e8521054f lib/NetPacket/IP.pm
+SHA1 0a5fe57aea3ab8abf40442d63e4a83e7402787f2 lib/NetPacket/TCP.pm
+SHA1 95b7fe053b6325415074b7d2ddbe0d0af3086b7e lib/NetPacket/UDP.pm
+SHA1 473906254ecd96009795d4b7fbc82fac48c03ecd t/000-report-versions.t
SHA1 2f95a288a42eed0173859c5bb9d37caee7e4b26b t/bug-37931.t
SHA1 721a206d861139f8f73081b8d337bfcdce4247e5 t/checksum.t
SHA1 1a8ee75b43167c0a2d1d6e512743bb56d02ce9e8 t/ethernet.t
@@ -39,12 +39,12 @@ SHA1 4ae3b86ce2b7dc5faaf06a566aa0c5c80bb7d326 t/general.t
SHA1 58f7294a0c74eedb982f75b1c8e8bc9fa5395288 t/icmp.t
SHA1 a22909fb4a8ce8621107618ef50c6f92a7a6d36a t/ip_encode.t
SHA1 1d4a9e2b54461f15aab9557a081db42eaef2c4b0 t/ip_trailing.t
-SHA1 4ee10569d37d2463ffe0a89771607ad32031f4d2 t/tcp.t
+SHA1 3092c7c3b99c321c00435d662b1256ec341782ae t/tcp.t
SHA1 540bff42594ee78beb63a7316a4478bc58d7e37b t/udp-checksum.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
-iEYEARECAAYFAk4vZCIACgkQ34Hwf+GwC4yKnQCg+D0YxcNpEOXaPiwsW9H4YdVn
-lakAniIMH6xX/JCzk8n2IUYnU97585pH
-=NkZ4
+iEYEARECAAYFAk7ALhMACgkQ34Hwf+GwC4zIuQCgiU2wR29FrffiTtNU9gsZ0dM9
+jU4AmgNcB8JIeRBHA2uJa8+HZu/ulMN1
+=Ppnt
-----END PGP SIGNATURE-----
diff --git a/lib/NetPacket.pm b/lib/NetPacket.pm
index d21eb68..3ef9dad 100644
--- a/lib/NetPacket.pm
+++ b/lib/NetPacket.pm
@@ -6,10 +6,10 @@
package NetPacket;
BEGIN {
- $NetPacket::AUTHORITY = 'cpan:yanick';
+ $NetPacket::AUTHORITY = 'cpan:YANICK';
}
-BEGIN {
- $NetPacket::VERSION = '1.2.0';
+{
+ $NetPacket::VERSION = '1.3.0';
}
# ABSTRACT: assemble/disassemble network packets at the protocol level
@@ -117,7 +117,7 @@ NetPacket - assemble/disassemble network packets at the protocol level
=head1 VERSION
-version 1.2.0
+version 1.3.0
=head1 SYNOPSIS
diff --git a/lib/NetPacket/ARP.pm b/lib/NetPacket/ARP.pm
index 1b3d2fd..40d2f33 100644
--- a/lib/NetPacket/ARP.pm
+++ b/lib/NetPacket/ARP.pm
@@ -1,9 +1,9 @@
package NetPacket::ARP;
BEGIN {
- $NetPacket::ARP::AUTHORITY = 'cpan:yanick';
+ $NetPacket::ARP::AUTHORITY = 'cpan:YANICK';
}
-BEGIN {
- $NetPacket::ARP::VERSION = '1.2.0';
+{
+ $NetPacket::ARP::VERSION = '1.3.0';
}
# ABSTRACT: Assemble and disassemble ARP (Address Resolution Protocol) packets.
@@ -114,7 +114,7 @@ NetPacket::ARP - Assemble and disassemble ARP (Address Resolution Protocol) pack
=head1 VERSION
-version 1.2.0
+version 1.3.0
=head1 SYNOPSIS
diff --git a/lib/NetPacket/Ethernet.pm b/lib/NetPacket/Ethernet.pm
index ffda0c4..2135f4b 100644
--- a/lib/NetPacket/Ethernet.pm
+++ b/lib/NetPacket/Ethernet.pm
@@ -1,9 +1,9 @@
package NetPacket::Ethernet;
BEGIN {
- $NetPacket::Ethernet::AUTHORITY = 'cpan:yanick';
+ $NetPacket::Ethernet::AUTHORITY = 'cpan:YANICK';
}
-BEGIN {
- $NetPacket::Ethernet::VERSION = '1.2.0';
+{
+ $NetPacket::Ethernet::VERSION = '1.3.0';
}
# ABSTRACT: Assemble and disassemble ethernet packets.
@@ -151,7 +151,7 @@ NetPacket::Ethernet - Assemble and disassemble ethernet packets.
=head1 VERSION
-version 1.2.0
+version 1.3.0
=head1 SYNOPSIS
diff --git a/lib/NetPacket/ICMP.pm b/lib/NetPacket/ICMP.pm
index 912003f..c070b6b 100644
--- a/lib/NetPacket/ICMP.pm
+++ b/lib/NetPacket/ICMP.pm
@@ -1,9 +1,9 @@
package NetPacket::ICMP;
BEGIN {
- $NetPacket::ICMP::AUTHORITY = 'cpan:yanick';
+ $NetPacket::ICMP::AUTHORITY = 'cpan:YANICK';
}
-BEGIN {
- $NetPacket::ICMP::VERSION = '1.2.0';
+{
+ $NetPacket::ICMP::VERSION = '1.3.0';
}
# ABSTRACT: Assemble and disassemble ICMP (Internet Control Message Protocol) packets.
@@ -158,7 +158,7 @@ NetPacket::ICMP - Assemble and disassemble ICMP (Internet Control Message Protoc
=head1 VERSION
-version 1.2.0
+version 1.3.0
=head1 SYNOPSIS
diff --git a/lib/NetPacket/IGMP.pm b/lib/NetPacket/IGMP.pm
index dbe6e89..a3895b4 100644
--- a/lib/NetPacket/IGMP.pm
+++ b/lib/NetPacket/IGMP.pm
@@ -4,10 +4,10 @@
package NetPacket::IGMP;
BEGIN {
- $NetPacket::IGMP::AUTHORITY = 'cpan:yanick';
+ $NetPacket::IGMP::AUTHORITY = 'cpan:YANICK';
}
-BEGIN {
- $NetPacket::IGMP::VERSION = '1.2.0';
+{
+ $NetPacket::IGMP::VERSION = '1.3.0';
}
# ABSTRACT: Assemble and disassemble IGMP (Internet Group Mangement Protocol) packets.
@@ -156,7 +156,7 @@ NetPacket::IGMP - Assemble and disassemble IGMP (Internet Group Mangement Protoc
=head1 VERSION
-version 1.2.0
+version 1.3.0
=head1 SYNOPSIS
diff --git a/lib/NetPacket/IP.pm b/lib/NetPacket/IP.pm
index e127528..9077d51 100644
--- a/lib/NetPacket/IP.pm
+++ b/lib/NetPacket/IP.pm
@@ -5,10 +5,10 @@
package NetPacket::IP;
BEGIN {
- $NetPacket::IP::AUTHORITY = 'cpan:yanick';
+ $NetPacket::IP::AUTHORITY = 'cpan:YANICK';
}
-BEGIN {
- $NetPacket::IP::VERSION = '1.2.0';
+{
+ $NetPacket::IP::VERSION = '1.3.0';
}
# ABSTRACT: Assemble and disassemble IP (Internet Protocol) packets.
@@ -223,7 +223,7 @@ NetPacket::IP - Assemble and disassemble IP (Internet Protocol) packets.
=head1 VERSION
-version 1.2.0
+version 1.3.0
=head1 SYNOPSIS
diff --git a/lib/NetPacket/TCP.pm b/lib/NetPacket/TCP.pm
index ede5737..a5bdd92 100644
--- a/lib/NetPacket/TCP.pm
+++ b/lib/NetPacket/TCP.pm
@@ -6,10 +6,10 @@
package NetPacket::TCP;
BEGIN {
- $NetPacket::TCP::AUTHORITY = 'cpan:yanick';
+ $NetPacket::TCP::AUTHORITY = 'cpan:YANICK';
}
-BEGIN {
- $NetPacket::TCP::VERSION = '1.2.0';
+{
+ $NetPacket::TCP::VERSION = '1.3.0';
}
# ABSTRACT: Assemble and disassemble TCP (Transmission Control Protocol) packets.
@@ -181,6 +181,85 @@ sub checksum {
$self->{cksum} = NetPacket::htons(NetPacket::in_cksum($packet));
}
+sub parse_tcp_options {
+ #
+ # dissect tcp options header. see:
+ # http://www.networksorcery.com/enp/protocol/tcp.htm#Options
+ #
+ # we create an byte array from the options header
+ # and iterate through that. If we find an option
+ # kind number we act accordingly (sometimes it has
+ # a fixed length, sometimes a variable one).
+ # once we've got the option stored, we shift the
+ # bytes we fetched away from the byte array and
+ # re-enter the loop.
+
+ my $self = shift;
+
+ my $opts = $self->{options};
+ my @bytes = split //, $opts;
+ my %options;
+ my $size;
+ ENTRY:
+ $size = $#bytes;
+ foreach my $byte (@bytes) {
+ my $kind = unpack('C', $byte);
+ if($kind == 2) {
+ # MSS.
+ # next byte is size, set to 4
+ # next 2 bytes are mss value 16 bit unsigned short
+ $options{mss} = unpack('n', $bytes[2] . $bytes[3]);
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ goto ENTRY;
+ }
+ elsif ($kind == 1) {
+ # a noop
+ shift @bytes;
+ goto ENTRY;
+ }
+ elsif ($kind == 3) {
+ # Windows Scale Factor
+ # next byte is size, set to 3
+ # next byte is shift count, 8 bit unsigned
+ $options{ws} = unpack('C', $bytes[2]);
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ goto ENTRY;
+ }
+ elsif ($kind == 4) {
+ # SACK Permitted
+ # next byte is length
+ $options{sack} = unpack('C', $bytes[1]);
+ shift @bytes;
+ shift @bytes;
+ goto ENTRY;
+ }
+ elsif ($kind == 8) {
+ # timestamp
+ # next byte is length, set to 10
+ # next 4 byte is timestamp, 32 bit unsigned int
+ # next 4 byte is timestamp echo reply, 32 bit unsigned int
+ $options{ts} = unpack('N', join '', @bytes[2..5]);
+ $options{er} = unpack('n', join '', @bytes[6,7,8,9]);
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ shift @bytes;
+ goto ENTRY;
+ }
+ }
+ return wantarray ? %options : \%options;
+}
#
# Module initialisation
#
@@ -199,7 +278,7 @@ NetPacket::TCP - Assemble and disassemble TCP (Transmission Control Protocol) pa
=head1 VERSION
-version 1.2.0
+version 1.3.0
=head1 SYNOPSIS
@@ -231,6 +310,15 @@ Return a TCP packet encoded with the instance data specified.
Needs parts of the ip header contained in $ip_obj in order to calculate
the TCP checksum.
+=item C<$packet->parse_tcp_options>
+
+Returns a hash (or a hash ref in scalar context) contaning the packet's options.
+
+For now the method only recognizes well-known and widely
+used options (MSS, noop, windows scale factor, SACK permitted,
+timestamp).
+If the packet contains options unknown to the method, it may fail.
+
=back
=head2 Functions
diff --git a/lib/NetPacket/UDP.pm b/lib/NetPacket/UDP.pm
index 9dfa882..ac8ab4b 100644
--- a/lib/NetPacket/UDP.pm
+++ b/lib/NetPacket/UDP.pm
@@ -4,10 +4,10 @@
package NetPacket::UDP;
BEGIN {
- $NetPacket::UDP::AUTHORITY = 'cpan:yanick';
+ $NetPacket::UDP::AUTHORITY = 'cpan:YANICK';
}
-BEGIN {
- $NetPacket::UDP::VERSION = '1.2.0';
+{
+ $NetPacket::UDP::VERSION = '1.3.0';
}
# ABSTRACT: Assemble and disassemble UDP (User Datagram Protocol) packets.
@@ -147,7 +147,7 @@ NetPacket::UDP - Assemble and disassemble UDP (User Datagram Protocol) packets.
=head1 VERSION
-version 1.2.0
+version 1.3.0
=head1 SYNOPSIS
diff --git a/t/000-report-versions.t b/t/000-report-versions.t
index 2d4a9a1..04c5394 100644
--- a/t/000-report-versions.t
+++ b/t/000-report-versions.t
@@ -415,6 +415,7 @@ BEGIN {
Test::Pod::Coverage
Test::Portability::Files
Test::YAML::Meta
+ open
);
my $Test = Test::Builder->new;
@@ -437,7 +438,7 @@ BEGIN {
next;
}
local $SIG{__WARN__} = sub { note "$module: $_[0]" };
- use_ok $module or BAIL_OUT("can't load $module");
+ require_ok $module or BAIL_OUT("can't load $module");
my $version = $module->VERSION;
$version = 'undefined' unless defined $version;
diag(" $module version is $version");
diff --git a/t/tcp.t b/t/tcp.t
index ba47fec..eb12058 100644
--- a/t/tcp.t
+++ b/t/tcp.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 2; # last test to print
+use Test::More tests => 4;
use NetPacket::Ethernet;
use NetPacket::IP;
@@ -65,7 +65,26 @@ $tcp = NetPacket::TCP->decode( $ip->{data}, $ip );
like $tcp->{data} => qr/^HTTP.*4624$/ms, 'TCP payload';
+is_deeply scalar $tcp->parse_tcp_options, {
+ er => 1420,
+ ts => 811717733,
+}, 'options';
+$datagram = binarize( <<'END_DATAGRAM');
+d3 55 00 50 85 cf 98 36 00 00 00 00 a0 02 16 d0
+9b 76 00 00 02 04 05 b4 04 02 08 0a 85 82 12 6d
+00 00 00 00 01 03 03 04
+END_DATAGRAM
+
+$tcp = NetPacket::TCP->decode( $datagram );
+
+is_deeply scalar $tcp->parse_tcp_options, {
+ er => 0,
+ ts => 2239894125,
+ mss => 1460,
+ ws => 4,
+ sack => 2,
+}, 'options';
sub binarize {
my $string = shift;
--
Debian packaging of libnetpacket-perl
More information about the Pkg-perl-cvs-commits
mailing list