Commit fd2ee114 authored by Utkarsh Gupta's avatar Utkarsh Gupta

New upstream version 1.7.1

parent c5926ecc
......@@ -18,6 +18,7 @@ patches, bug reports, help with troubleshooting, etc. A huge
* Robin Lee
* Stephanie Wehner
* Tim Potter
* Yanick Champoux
* Zak B. Elep
revision history for NetPacket
1.7.1 2019-06-08
[ BUG FIXES ]
- fixes inverted ethernet ports (reported by sanyacomua)
[ STATISTICS ]
- code churn: 4 files changed, 140 insertions(+), 130 deletions(-)
1.7.0 2018-12-30
[ ENHANCEMENTS ]
- Setup aliases at compile time (Nicolas R, GH#11)
......
This software is Copyright (c) 2018, 2015, 2014, 2013, 2011, 2010, 2009, 2008 by Tim Potter and Stephanie Wehner.
This software is Copyright (c) 2019, 2018, 2015, 2014, 2013, 2011, 2010, 2009, 2008 by Tim Potter and Stephanie Wehner.
This is free software, licensed under:
......
......@@ -59,51 +59,51 @@
"provides" : {
"NetPacket" : {
"file" : "lib/NetPacket.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::ARP" : {
"file" : "lib/NetPacket/ARP.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::Ethernet" : {
"file" : "lib/NetPacket/Ethernet.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::ICMP" : {
"file" : "lib/NetPacket/ICMP.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::ICMPv6" : {
"file" : "lib/NetPacket/ICMPv6.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::IGMP" : {
"file" : "lib/NetPacket/IGMP.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::IP" : {
"file" : "lib/NetPacket/IP.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::IPX" : {
"file" : "lib/NetPacket/IPX.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::IPv6" : {
"file" : "lib/NetPacket/IPv6.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::TCP" : {
"file" : "lib/NetPacket/TCP.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::UDP" : {
"file" : "lib/NetPacket/UDP.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
},
"NetPacket::USBMon" : {
"file" : "lib/NetPacket/USBMon.pm",
"version" : "v1.7.0"
"version" : "v1.7.1"
}
},
"release_status" : "stable",
......@@ -118,7 +118,7 @@
"web" : "https://github.com/yanick/netpacket"
}
},
"version" : "1.7.0",
"version" : "1.7.1",
"x_authority" : "cpan:YANICK",
"x_contributor_covenant" : {
"version" : 0.01
......@@ -136,6 +136,7 @@
"Robin Lee <cheeselee@fedoraproject.org>",
"Stephanie Wehner <atrak@cpan.org>",
"Tim Potter <timpotter@cpan.org>",
"Yanick Champoux <yanick@babyl.ca>",
"Zak B. Elep <zakame@zakame.net>"
],
"x_generated_by_perl" : "v5.20.2",
......
......@@ -22,40 +22,40 @@ name: NetPacket
provides:
NetPacket:
file: lib/NetPacket.pm
version: v1.7.0
version: v1.7.1
NetPacket::ARP:
file: lib/NetPacket/ARP.pm
version: v1.7.0
version: v1.7.1
NetPacket::Ethernet:
file: lib/NetPacket/Ethernet.pm
version: v1.7.0
version: v1.7.1
NetPacket::ICMP:
file: lib/NetPacket/ICMP.pm
version: v1.7.0
version: v1.7.1
NetPacket::ICMPv6:
file: lib/NetPacket/ICMPv6.pm
version: v1.7.0
version: v1.7.1
NetPacket::IGMP:
file: lib/NetPacket/IGMP.pm
version: v1.7.0
version: v1.7.1
NetPacket::IP:
file: lib/NetPacket/IP.pm
version: v1.7.0
version: v1.7.1
NetPacket::IPX:
file: lib/NetPacket/IPX.pm
version: v1.7.0
version: v1.7.1
NetPacket::IPv6:
file: lib/NetPacket/IPv6.pm
version: v1.7.0
version: v1.7.1
NetPacket::TCP:
file: lib/NetPacket/TCP.pm
version: v1.7.0
version: v1.7.1
NetPacket::UDP:
file: lib/NetPacket/UDP.pm
version: v1.7.0
version: v1.7.1
NetPacket::USBMon:
file: lib/NetPacket/USBMon.pm
version: v1.7.0
version: v1.7.1
recommends:
Net::Pcap: '0'
Net::PcapUtils: '0'
......@@ -72,7 +72,7 @@ resources:
bugtracker: https://github.com/yanick/netpacket/issues
homepage: https://github.com/yanick/netpacket
repository: https://github.com/yanick/netpacket.git
version: 1.7.0
version: 1.7.1
x_authority: cpan:YANICK
x_contributor_covenant:
version: 0.01
......@@ -89,6 +89,7 @@ x_contributors:
- 'Robin Lee <cheeselee@fedoraproject.org>'
- 'Stephanie Wehner <atrak@cpan.org>'
- 'Tim Potter <timpotter@cpan.org>'
- 'Yanick Champoux <yanick@babyl.ca>'
- 'Zak B. Elep <zakame@zakame.net>'
x_generated_by_perl: v5.20.2
x_serialization_backend: 'YAML::Tiny version 1.67'
......@@ -32,7 +32,7 @@ my %WriteMakefileArgs = (
"IPC::Open3" => 0,
"Test::More" => 0
},
"VERSION" => "1.7.0",
"VERSION" => "1.7.1",
"test" => {
"TESTS" => "t/*.t"
}
......
......@@ -4,7 +4,7 @@ NetPacket - assemble/disassemble network packets at the protocol level
# VERSION
version 1.7.0
version 1.7.1
# SYNOPSIS
......
......@@ -15,36 +15,36 @@ not run its Makefile.PL or Build.PL.
Hash: SHA1
SHA1 7d9ba9e46d6d5e79245c1d203595df77727385ef CODE_OF_CONDUCT.md
SHA1 018a7a67b9e530a75805240e5016ce840ccbae48 CONTRIBUTORS
SHA1 dc4294f69908310f6b595630eb0b8cea0df16409 Changes
SHA1 33cba30129cb74e88826f28fa478b0cc07b5abeb CONTRIBUTORS
SHA1 5d7e738b23c93edcf20dc4e1e86cac53abf97097 Changes
SHA1 293b69ba3817a41b4bdf1bd3e6f41167d5968899 INSTALL
SHA1 ac71dc7b0c7e3623c932cd2497323dcfda498cd7 LICENSE
SHA1 72832ad015dadb7d5df745c4b2b3638a06970d9f LICENSE
SHA1 fe805eed8def86242acf9aef12c02548b428a22c MANIFEST
SHA1 ae80e208fcf419e3e6b81644e3f4270d7b4dabec META.json
SHA1 1f8626343ee095d10b4f191f1b03fc4e310bc616 META.yml
SHA1 733878708125f2585afcdd64451add9df545e9b0 Makefile.PL
SHA1 d03578234d10143a7b0fcc8af9642e032950ffc4 META.json
SHA1 68fd2a464a72d877f7d02ead08421672edfa813a META.yml
SHA1 e755eb0829350dc31f0dcb58a0623a8cb2ecf73f Makefile.PL
SHA1 1ad83396aa0864c474877ffe53c6d1055d32e261 README
SHA1 7d15d52a4bde49ef966cf61e7173b4ec535a7d24 README.mkdn
SHA1 2a9fdd8814d6c34a7984173b60e4d600b6e79391 README.mkdn
SHA1 ee307d9117553ce0b1a0c0599cf14cdc8e3cc726 cpanfile
SHA1 f9bff94f3e62ecd60054b0855a4dad45b97c52ce doap.xml
SHA1 79797afdafadcd631134147a50e0a1c75e7f423c lib/NetPacket.pm
SHA1 f6ed2e9d423f8f008772dbbab25367619df954b6 lib/NetPacket/ARP.pm
SHA1 fca77a95ad8c008d948d5849da2b5cbbae792011 lib/NetPacket/Ethernet.pm
SHA1 61d825419cca911f6073da42a5f485d68e75bb67 lib/NetPacket/ICMP.pm
SHA1 f3bb1cb099ea410b5ddfce65d8158d87bd13faa2 lib/NetPacket/ICMPv6.pm
SHA1 11b2516ad5870d37ce98fb49722708b1dd2ab273 lib/NetPacket/IGMP.pm
SHA1 d791cb63324672e25296b86fc089ae57696a7bba lib/NetPacket/IP.pm
SHA1 4e095fb6ed8850966636ca9fe9e240b5f690e7fe lib/NetPacket/IPX.pm
SHA1 17dac999a050a32b94aca7f0963d2a50789272ef lib/NetPacket/IPv6.pm
SHA1 0d3ac1a6c9711cfd8c1c25e5d0ce744df22a450c lib/NetPacket/TCP.pm
SHA1 2828b0e0fe6337318740fa86215d56bce056c5a6 lib/NetPacket/UDP.pm
SHA1 319a1497f954a400f61af7c3902e8f3ee332a520 lib/NetPacket/USBMon.pm
SHA1 b44f2c5342fc6f36b0455827654da3bad4516ddc doap.xml
SHA1 0f268b4718f095261e562a056dc819b0e31fbd12 lib/NetPacket.pm
SHA1 2cb56cf7457b64f9dd2c58e1a7ce3f38f3439efa lib/NetPacket/ARP.pm
SHA1 b897842f3c4a6f8fd00fbd482dff9385c5ef2858 lib/NetPacket/Ethernet.pm
SHA1 7f7b007e4cb3b5fb1ed9f45ffbb201fc0a93b214 lib/NetPacket/ICMP.pm
SHA1 5a97f086320bba6c9dbfe71749c5ad984a35c36c lib/NetPacket/ICMPv6.pm
SHA1 ad9e742c8dd00f70ec2b14f04f00014d5c02c097 lib/NetPacket/IGMP.pm
SHA1 a1a8a1680a004ba87567ef50e544c54544a93747 lib/NetPacket/IP.pm
SHA1 3719959d847ee5cff22f537457544e5f136b52aa lib/NetPacket/IPX.pm
SHA1 0ee76e3aaeb308ce4200306b5a44d919ebfd29b0 lib/NetPacket/IPv6.pm
SHA1 7f02cac06cf59881dbf84a4a778b0ea28371255a lib/NetPacket/TCP.pm
SHA1 ebc2f74ad2fc1bba82909a1dd5875a5964c66cbf lib/NetPacket/UDP.pm
SHA1 d0e33c66b9266d2aaab57cb12b26c65030d84b64 lib/NetPacket/USBMon.pm
SHA1 e73071cec5aee169354426839ff7746a1182f235 t/00-compile.t
SHA1 72aaf28e5dfd60d333eb38c4743dc995fc87dd7f t/00-report-prereqs.dd
SHA1 6348689eee69681210251892bd47cbfbb7507d7d t/00-report-prereqs.t
SHA1 2f95a288a42eed0173859c5bb9d37caee7e4b26b t/bug-37931.t
SHA1 721a206d861139f8f73081b8d337bfcdce4247e5 t/checksum.t
SHA1 45f23540d419a608363a53ed11b81c589866406e t/ethernet.t
SHA1 6a3a9b98d847d009987766f2189d600d2a7aa956 t/ethernet.t
SHA1 382d9d077e64a0ea5ee3263579cbc03df0e5a003 t/general.t
SHA1 58f7294a0c74eedb982f75b1c8e8bc9fa5395288 t/icmp.t
SHA1 a75da30ccbd424509eb3900ea2c60a6b3ee5d828 t/icmpv6.t
......@@ -59,7 +59,7 @@ SHA1 86e62e4a5bceec942b536d2b29f7910f883c6387 t/usbmon.t
SHA1 d1fe7d94b3edc7847eb187d4ee41f66e19cf8907 xt/release/unused-vars.t
-----BEGIN PGP SIGNATURE-----
iEYEARECAAYFAlwo+IMACgkQ34Hwf+GwC4zbqQCfUl9g5uhT3y8lXEnGHX6i1weQ
5cMAoMbRlG6wXMdW/OsXgyGVsNHjoewE
=Il5k
iEYEARECAAYFAlz717gACgkQ34Hwf+GwC4wQZgCgs4f1C/rzZOQBuW1gHMtvS3Z+
GKwAmwV2kmNZIarhaBA4IREdRp1jPA1B
=JDfR
-----END PGP SIGNATURE-----
......@@ -98,6 +98,12 @@
<foaf:mbox rdf:resource="mailto:timpotter@cpan.org" />
</foaf:Person>
</helper>
<helper>
<foaf:Person>
<foaf:name>Yanick Champoux</foaf:name>
<foaf:mbox rdf:resource="mailto:yanick@babyl.ca" />
</foaf:Person>
</helper>
<helper>
<foaf:Person>
<foaf:name>Zak B. Elep</foaf:name>
......@@ -269,5 +275,11 @@
<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2015-03-13</dc:issued>
</Version>
</release>
<release>
<Version>
<revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1.7.0</revision>
<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-12-30</dc:issued>
</Version>
</release>
<programming-language>Perl</programming-language>
</Project>
package NetPacket;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: assemble/disassemble network packets at the protocol level
$NetPacket::VERSION = '1.7.0';
$NetPacket::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -88,7 +88,7 @@ NetPacket - assemble/disassemble network packets at the protocol level
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::ARP;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble ARP (Address Resolution Protocol) packets.
$NetPacket::ARP::VERSION = '1.7.0';
$NetPacket::ARP::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -128,7 +128,7 @@ NetPacket::ARP - Assemble and disassemble ARP (Address Resolution Protocol) pack
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::Ethernet;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble ethernet packets.
$NetPacket::Ethernet::VERSION = '1.7.0';
$NetPacket::Ethernet::VERSION = '1.7.1';
use strict;
use warnings;
use parent 'NetPacket';
my @eth_types = qw/ ETH_TYPE_IP
ETH_TYPE_ARP
ETH_TYPE_APPLETALK
ETH_TYPE_RARP
ETH_TYPE_SNMP
ETH_TYPE_IPv6
ETH_TYPE_PPP
ETH_TYPE_802_1Q
ETH_TYPE_IPX
ETH_TYPE_PPPOED
my @eth_types = qw/ ETH_TYPE_IP
ETH_TYPE_ARP
ETH_TYPE_APPLETALK
ETH_TYPE_RARP
ETH_TYPE_SNMP
ETH_TYPE_IPv6
ETH_TYPE_PPP
ETH_TYPE_802_1Q
ETH_TYPE_IPX
ETH_TYPE_PPPOED
ETH_TYPE_PPPOES /;
our @EXPORT_OK = ( 'eth_strip', 'ETH_HLEN', @eth_types );
our @EXPORT_OK = ( 'eth_strip', 'ETH_HLEN', @eth_types );
our %EXPORT_TAGS = (
ALL => [@EXPORT_OK],
......@@ -117,30 +117,19 @@ sub strip {
my $eth_obj = NetPacket::Ethernet->decode($pkt);
return $eth_obj->{data};
}
#
# Encode a packet - not implemented!
#
}
sub encode {
my ($self) = shift;
my ($self) = shift;
(my $dest = $self->{src_mac}) =~ s/://g;
(my $src = $self->{dest_mac}) =~ s/://g;
my @mac = map { $self->{$_} } qw/ dest_mac src_mac /;
s/://g for @mac;
my $frame = pack('H12H12n a*', $dest, $src, 0x0800, $self->{data});
return $frame;
return pack 'H12H12n a*', @mac, 0x0800, $self->{data};
}
#
# Module initialisation
#
1;
# autoloaded methods go after the END token (&& pod) below
=pod
=head1 NAME
......@@ -149,7 +138,7 @@ NetPacket::Ethernet - Assemble and disassemble ethernet packets.
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......@@ -162,7 +151,7 @@ version 1.7.0
=head1 DESCRIPTION
C<NetPacket::Ethernet> provides a set of routines for assembling and
disassembling packets using the Ethernet protocol.
disassembling packets using the Ethernet protocol.
=head2 Methods
......@@ -234,7 +223,7 @@ none
=item exportable
ETH_TYPE_IP ETH_TYPE_ARP ETH_TYPE_APPLETALK ETH_TYPE_SNMP
ETH_TYPE_IPv6 ETH_TYPE_PPP
ETH_TYPE_IPv6 ETH_TYPE_PPP
=item tags
......@@ -245,7 +234,7 @@ The following tags group together related exportable items.
=item C<:types>
ETH_TYPE_IP ETH_TYPE_ARP ETH_TYPE_APPLETALK ETH_TYPE_SNMP
ETH_TYPE_IPv6 ETH_TYPE_PPP
ETH_TYPE_IPv6 ETH_TYPE_PPP
=item C<:strip>
......@@ -292,7 +281,7 @@ to standard output.
Copyright (c) 2001 Tim Potter and Stephanie Wehner.
Copyright (c) 1995,1996,1997,1998,1999 ANU and CSIRO on behalf of
Copyright (c) 1995,1996,1997,1998,1999 ANU and CSIRO on behalf of
the participants in the CRC for Advanced Computational Systems
('ACSys').
......
package NetPacket::ICMP;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble ICMP (Internet Control Message Protocol) packets.
$NetPacket::ICMP::VERSION = '1.7.0';
$NetPacket::ICMP::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -209,7 +209,7 @@ NetPacket::ICMP - Assemble and disassemble ICMP (Internet Control Message Protoc
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::ICMPv6;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble ICMPv6 (Internet Control Message Protocol for IPv6) packets.
$NetPacket::ICMPv6::VERSION = '1.7.0';
$NetPacket::ICMPv6::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -294,7 +294,7 @@ NetPacket::ICMPv6 - Assemble and disassemble ICMPv6 (Internet Control Message Pr
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::IGMP;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble IGMP (Internet Group Mangement Protocol) packets.
$NetPacket::IGMP::VERSION = '1.7.0';
$NetPacket::IGMP::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -149,7 +149,7 @@ NetPacket::IGMP - Assemble and disassemble IGMP (Internet Group Mangement Protoc
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::IP;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble IP (Internet Protocol) packets.
$NetPacket::IP::VERSION = '1.7.0';
$NetPacket::IP::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -331,7 +331,7 @@ NetPacket::IP - Assemble and disassemble IP (Internet Protocol) packets.
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::IPX;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble IPX packets
$NetPacket::IPX::VERSION = '1.7.0';
$NetPacket::IPX::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -137,7 +137,7 @@ NetPacket::IPX - Assemble and disassemble IPX packets
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::IPv6;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble IPv6 (Internet Protocol version 6) packets.
$NetPacket::IPv6::VERSION = '1.7.0';
$NetPacket::IPv6::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -218,7 +218,7 @@ NetPacket::IPv6 - Assemble and disassemble IPv6 (Internet Protocol version 6) pa
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::TCP;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble TCP (Transmission Control Protocol) packets.
$NetPacket::TCP::VERSION = '1.7.0';
$NetPacket::TCP::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -282,7 +282,7 @@ NetPacket::TCP - Assemble and disassemble TCP (Transmission Control Protocol) pa
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::UDP;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Assemble and disassemble UDP (User Datagram Protocol) packets.
$NetPacket::UDP::VERSION = '1.7.0';
$NetPacket::UDP::VERSION = '1.7.1';
use strict;
use warnings;
......@@ -124,7 +124,7 @@ NetPacket::UDP - Assemble and disassemble UDP (User Datagram Protocol) packets.
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
package NetPacket::USBMon;
our $AUTHORITY = 'cpan:YANICK';
#ABSTRACT: Assemble and disassemble USB packets captured via Linux USBMon interface.
$NetPacket::USBMon::VERSION = '1.7.0';
$NetPacket::USBMon::VERSION = '1.7.1';
use 5.10.0;
use strict;
use warnings;
......@@ -145,7 +145,7 @@ NetPacket::USBMon - Assemble and disassemble USB packets captured via Linux USBM
=head1 VERSION
version 1.7.0
version 1.7.1
=head1 SYNOPSIS
......
use strict;
use warnings;
use Test::More tests => 2;
use Test::More tests => 3;
use NetPacket::Ethernet qw/ :types /;
......@@ -9,5 +9,15 @@ is ETH_TYPE_PPPOES() => 0x8864, 'imports';
is NetPacket::Ethernet::ETH_TYPE_IP() => 0x0800, 'with namespace';
subtest "don't invert the mac ports" => sub {
my $packet = NetPacket::Ethernet->decode(
NetPacket::Ethernet::encode({
src_mac => '001',
dest_mac => '002',
data => '',
})
);
like $packet->{src_mac}, qr'001', 'src_mac';
like $packet->{dest_mac}, qr'002', 'dest_mac';
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment