Net-Frame-Layer-IPv6-1.08000755001750001750 013103614513 14502 5ustar00gomorgomor000000000000Net-Frame-Layer-IPv6-1.08/Build.PL000444001750001750 100413103614513 16126 0ustar00gomorgomor000000000000# # $Id: Build.PL,v ee9a7f696b4d 2017/05/07 12:55:21 gomor $ # use strict; use warnings; use Module::Build; my $builder = Module::Build->new( module_name => 'Net::Frame::Layer::IPv6', license => 'artistic', dist_author => 'GomoR ', dist_version_from => 'lib/Net/Frame/Layer/IPv6.pm', requires => { 'perl' => '5.6.1', 'Net::Frame' => '0', 'Bit::Vector' => '0', }, configure_requires => { 'Module::Build' => 0, }, ); $builder->create_build_script; Net-Frame-Layer-IPv6-1.08/Changes000444001750001750 305013103614513 16130 0ustar00gomorgomor000000000000Revision history for Perl extension Net::Frame::Layer::IPv6. 1.08 Sun 7 May 14:54:52 CEST 2017 - update: IP in IP encapsulation should use IPv4 layer type - update: copyright notice 1.07 Tue Jan 20 19:15:48 CET 2015 - update: copyright notice - update: Kwalitee 1.06 Wed Apr 9 09:50:52 CEST 2014 - bugfix: https://rt.cpan.org/Ticket/Display.html?id=93409 - bugfix: https://rt.cpan.org/Ticket/Display.html?id=93408 - update: copyright notice 1.05 Wed Nov 14 21:47:44 CET 2012 - bugfix: on length calculation for IPv6::Option - NEW: IPv6 HopByHop and Destination options extension header and Option modules => contributed by vinsworld.com (Thanks Vince) - UPDATE: IPv6::Fragment and IPv6::Routing do not export consts at all. - update: added constants for hop-by-hop, destination and mobility extension headers, and many other protocols 1.04 Thu Feb 23 20:18:58 CET 2012 - UPDATE: renamed IGMPv4 to IGMP - NEW: IPv6 Fragment and Routing extension headers => contributed by vinsworld.com (Thanks Vince) - update: copyright notice 1.03 Thu Jun 3 14:43:39 CEST 2010 - bugfix: prereq matches use - update: copyright notice 1.02 Sun May 31 17:16:11 CEST 2009 - new: support for UDPLite layer - update: computeChecksum() and computeLengths() to reflect new computation scheme from Net::Frame::Simple - update: copyright notice 1.01 Sun Dec 17 17:55:09 CET 2006 - UPDATE: all layers moved to Net::Frame::Layer::* namespace 1.00 Sat Dec 16 16:45:03 CET 2006 - first public release Net-Frame-Layer-IPv6-1.08/LICENSE000444001750001750 26513103614513 15627 0ustar00gomorgomor000000000000LICENSE This program is free software. You can redistribute it and/or modify it under the following terms: - the Perl Artistic License (in the file LICENSE.Artistic), Net-Frame-Layer-IPv6-1.08/LICENSE.Artistic000444001750001750 1373413103614513 17455 0ustar00gomorgomor000000000000 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Net-Frame-Layer-IPv6-1.08/MANIFEST000444001750001750 105713103614513 15773 0ustar00gomorgomor000000000000Build.PL Changes examples/build-tcp-syn.pl examples/destination.pl examples/fragment-2x8.pl examples/fragment-8x1024.pl examples/fragment-NxM.pl examples/hopbyhop.pl examples/routing.pl lib/Net/Frame/Layer/IPv6/Destination.pm lib/Net/Frame/Layer/IPv6/Fragment.pm lib/Net/Frame/Layer/IPv6/HopByHop.pm lib/Net/Frame/Layer/IPv6/Option.pm lib/Net/Frame/Layer/IPv6.pm lib/Net/Frame/Layer/IPv6/Routing.pm LICENSE LICENSE.Artistic Makefile.PL MANIFEST This list of files README t/01-use.t t/02-pod-coverage.t t/03-test-pod.t t/04-layer-create.t META.yml META.json Net-Frame-Layer-IPv6-1.08/META.json000444001750001750 325613103614513 16266 0ustar00gomorgomor000000000000{ "abstract" : "Internet Protocol v6 layer object", "author" : [ "GomoR " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.4218", "license" : [ "artistic_1" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Net-Frame-Layer-IPv6", "prereqs" : { "configure" : { "requires" : { "Module::Build" : "0" } }, "runtime" : { "requires" : { "Bit::Vector" : "0", "Net::Frame" : "0", "perl" : "v5.6.1" } } }, "provides" : { "Net::Frame::Layer::IPv6" : { "file" : "lib/Net/Frame/Layer/IPv6.pm", "version" : "1.08" }, "Net::Frame::Layer::IPv6::Destination" : { "file" : "lib/Net/Frame/Layer/IPv6/Destination.pm", "version" : "1.08" }, "Net::Frame::Layer::IPv6::Fragment" : { "file" : "lib/Net/Frame/Layer/IPv6/Fragment.pm", "version" : "1.08" }, "Net::Frame::Layer::IPv6::HopByHop" : { "file" : "lib/Net/Frame/Layer/IPv6/HopByHop.pm", "version" : "1.08" }, "Net::Frame::Layer::IPv6::Option" : { "file" : "lib/Net/Frame/Layer/IPv6/Option.pm" }, "Net::Frame::Layer::IPv6::Routing" : { "file" : "lib/Net/Frame/Layer/IPv6/Routing.pm", "version" : "1.08" } }, "release_status" : "stable", "resources" : { "license" : [ "http://www.perlfoundation.org/artistic_license_1_0" ] }, "version" : "1.08", "x_serialization_backend" : "JSON::PP version 2.27300" } Net-Frame-Layer-IPv6-1.08/META.yml000444001750001750 225113103614513 16110 0ustar00gomorgomor000000000000--- abstract: 'Internet Protocol v6 layer object' author: - 'GomoR ' build_requires: {} configure_requires: Module::Build: '0' dynamic_config: 1 generated_by: 'Module::Build version 0.4218, CPAN::Meta::Converter version 2.150005' license: artistic meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Net-Frame-Layer-IPv6 provides: Net::Frame::Layer::IPv6: file: lib/Net/Frame/Layer/IPv6.pm version: '1.08' Net::Frame::Layer::IPv6::Destination: file: lib/Net/Frame/Layer/IPv6/Destination.pm version: '1.08' Net::Frame::Layer::IPv6::Fragment: file: lib/Net/Frame/Layer/IPv6/Fragment.pm version: '1.08' Net::Frame::Layer::IPv6::HopByHop: file: lib/Net/Frame/Layer/IPv6/HopByHop.pm version: '1.08' Net::Frame::Layer::IPv6::Option: file: lib/Net/Frame/Layer/IPv6/Option.pm Net::Frame::Layer::IPv6::Routing: file: lib/Net/Frame/Layer/IPv6/Routing.pm version: '1.08' requires: Bit::Vector: '0' Net::Frame: '0' perl: v5.6.1 resources: license: http://www.perlfoundation.org/artistic_license_1_0 version: '1.08' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' Net-Frame-Layer-IPv6-1.08/Makefile.PL000444001750001750 72113103614513 16571 0ustar00gomorgomor000000000000# # $Id: Makefile.PL,v ee9a7f696b4d 2017/05/07 12:55:21 gomor $ # use ExtUtils::MakeMaker; require v5.6.1; WriteMakefile( NAME => 'Net::Frame::Layer::IPv6', VERSION_FROM => 'lib/Net/Frame/Layer/IPv6.pm', LICENSE => 'artistic', ABSTRACT_FROM => 'lib/Net/Frame/Layer/IPv6.pm', AUTHOR => 'GomoR ', PREREQ_PM => { Net::Frame => 0, Bit::Vector => 0, }, MIN_PERL_VERSION => '5.6.1', ); Net-Frame-Layer-IPv6-1.08/README000444001750001750 117113103614513 15517 0ustar00gomorgomor000000000000Net::Frame::Layer::IPv6 ======================= INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: Perl v5.6.1 Net::Frame Bit::Vector GETTING HELP A mailing list is available for all questions concerning Net::Frame::*. https://www.secure-side.com/lists/mailman/listinfo/netframe COPYRIGHT AND LICENSE You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. Copyright (c) 2006-2017, Patrice Auffret Net-Frame-Layer-IPv6-1.08/examples000755001750001750 013103614513 16320 5ustar00gomorgomor000000000000Net-Frame-Layer-IPv6-1.08/examples/build-tcp-syn.pl000444001750001750 120213103614513 21477 0ustar00gomorgomor000000000000#!/usr/bin/perl use strict; use warnings; use Net::Frame::Layer::ETH qw(:consts); use Net::Frame::Layer::IPv6; use Net::Frame::Layer::TCP; use Net::Frame::Simple; my $eth = Net::Frame::Layer::ETH->new( src => '00:13:A9:2C:5B:A3', dst => '00:0c:29:1d:c9:21', type => NF_ETH_TYPE_IPv6, ); my $ip6 = Net::Frame::Layer::IPv6->new( src => 'fe80::213:a9ff:fe2c:5ba3', dst => 'fe80::20c:29ff:fe1d:c921', ); my $tcp = Net::Frame::Layer::TCP->new( options => "\x02\x04\x54\x0b", ); my $oSimple = Net::Frame::Simple->new( layers => [ $eth, $ip6, $tcp ], ); print $oSimple->print."\n"; print unpack('H*', $oSimple->raw)."\n"; Net-Frame-Layer-IPv6-1.08/examples/destination.pl000444001750001750 317213103614513 21336 0ustar00gomorgomor000000000000#!/usr/bin/perl use strict; use warnings; use Net::Frame 1.09; use Net::Frame::Simple 1.05; use Net::Frame::Layer qw(:subs); use Net::Frame::Layer::ETH qw(:consts); use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Destination; use Net::Frame::Layer::IPv6::Option; use Net::Frame::Layer::ICMPv6 qw(:consts); use Net::Frame::Layer::ICMPv6::Echo; # Get input print "What destination [ENTER for default]? "; my $dest = ; chomp $dest; print "\n"; # Validate $dest = $dest || 'ipv6.google.com'; if (!($dest = getHostIpv6Addr($dest))) { return } # Create layers my $ether = Net::Frame::Layer::ETH->new( type => NF_ETH_TYPE_IPv6, ); my $ipv6 = Net::Frame::Layer::IPv6->new( dst => $dest, nextHeader => NF_IPv6_PROTOCOL_IPv6DESTINATION, ); # Destination options my $option = Net::Frame::Layer::IPv6::Option->new( type => 1, value => pack("H*", '00000000'), ); my $option2 = Net::Frame::Layer::IPv6::Option->new( type => 1, value => pack("H*", '000000000000'), ); my $destination = Net::Frame::Layer::IPv6::Destination->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, options => [ $option, $option2, ], ); # MLD (ICMPv6) my $icmpv6 = Net::Frame::Layer::ICMPv6->new; my $echo = Net::Frame::Layer::ICMPv6::Echo->new( identifier => 16, sequenceNumber => 0, payload =>'echo', ); # Create packet my $packet = Net::Frame::Simple->new( layers => [ $ether, $ipv6, $destination, $icmpv6, $echo, ], ); print $packet->print."\n"; my $raw = $packet->pack; my $unpack = Net::Frame::Simple->new( firstLayer => 'ETH', raw => $raw, ); print $unpack->print."\n"; Net-Frame-Layer-IPv6-1.08/examples/fragment-2x8.pl000444001750001750 612113103614513 21234 0ustar00gomorgomor000000000000#!/usr/bin/perl # Not all hosts respond to IPv6 fragments # Examples that do: # 2001:559:0:4f::6011:4dc3 use strict; use warnings; use Net::Frame 1.09; use Net::Frame::Simple 1.05; use Net::Frame::Layer qw(:subs); use Net::Frame::Layer::ETH qw(:consts); use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Fragment; use Net::Frame::Layer::ICMPv6 qw(:consts); use Net::Frame::Layer::ICMPv6::Echo; # Get input print "What destination [ENTER for default]? "; my $dest = ; chomp $dest; print "\n"; # Validate $dest = $dest || 'ipv6.google.com'; if (!($dest = getHostIpv6Addr($dest))) { return } # Create original packet my $ether = Net::Frame::Layer::ETH->new( # src => 'aa:bb:cc:dd:ee:ff', # dst => '00:11:22:33:44:55', type => NF_ETH_TYPE_IPv6 ); my $ipv6 = Net::Frame::Layer::IPv6->new( # src => '2001::1', dst => $dest, nextHeader => NF_IPv6_PROTOCOL_ICMPv6 ); my $icmp = Net::Frame::Layer::ICMPv6->new; my $echo = Net::Frame::Layer::ICMPv6::Echo->new( identifier => 1, sequenceNumber => 1, payload => 'echofrg1echofrg2' ); my $packet = Net::Frame::Simple->new(layers=> [ $ether, $ipv6, $icmp, $echo ] ); # Update IPv6 nextHeader $ipv6->nextHeader(NF_IPv6_PROTOCOL_IPv6FRAGMENT); $ipv6->pack; # Create fragment extension headers my $frag1 = Net::Frame::Layer::IPv6::Fragment->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, mFlag => 1 ); $frag1->pack; my $frag2 = Net::Frame::Layer::IPv6::Fragment->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, # 1 8-byte unit for ICMPv6 header # 1 8-byte unit for first data chunk fragmentOffset => 2 ); $frag2->pack; # Update ICMPv6 checksum for frag packet from orignal packet $icmp->checksum($packet->ref->{ICMPv6}->checksum); $icmp->pack; # Create ICMPv6 Echo headers my $echofrag = Net::Frame::Layer::ICMPv6::Echo->new( identifier => 1, sequenceNumber => 1 ); $echofrag->pack; # IPv6 payload length for packet frag 1 is: # 8 byte frag header # 8 byte ICMPv6 header # 8 bytes data $ipv6->payloadLength(8 + 8 + 8); $ipv6->pack; my @frag; # Create first frag $frag[0] = $ether->raw . $ipv6->raw . $frag1->raw . $icmp->raw . $echofrag->raw . 'echofrg1'; # IPv6 payload length for packet frag 2... is: # 8 byte frag header # 8 bytes data $ipv6->payloadLength(8 + 8); $ipv6->pack; # Create remaining frag $frag[1] = $ether->raw . $ipv6->raw . $frag2->raw . 'echofrg2'; # 2 raw packets are stored in @frag # print my $packet1 = Net::Frame::Simple->new( raw => $frag[0], firstLayer => 'ETH' ); my $packet2 = Net::Frame::Simple->new( raw => $frag[1], firstLayer => 'ETH' ); print $packet1->print . "\n\n"; print $packet2->print . "\n"; ## #if (!$ARGV[0]) { exit } #use Net::Pcap qw(:functions); #my %devinfo; #my $err; #my $fp= pcap_open($ARGV[0], 100, 0, 1000, \%devinfo, \$err); #if (!defined($fp)) { # printf "Unable to open adapter `%s'\n", $ARGV[0]; # exit 1 #} #for my $packet (@frag) { # if (pcap_sendpacket($fp, $packet) != 0) { # printf "Error sending packet: %s\n", pcap_geterr($fp); # exit 1 # } #} Net-Frame-Layer-IPv6-1.08/examples/fragment-8x1024.pl000444001750001750 607313103614513 21467 0ustar00gomorgomor000000000000#!/usr/bin/perl # Not all hosts respond to IPv6 fragments # Examples that do: # 2001:559:0:4f::6011:4dc3 use strict; use warnings; use Net::Frame 1.09; use Net::Frame::Simple 1.05; use Net::Frame::Layer qw(:subs); use Net::Frame::Layer::ETH qw(:consts); use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Fragment; use Net::Frame::Layer::ICMPv6 qw(:consts); use Net::Frame::Layer::ICMPv6::Echo; # Get input print "What destination [ENTER for default]? "; my $dest = ; chomp $dest; print "\n"; # Validate $dest = $dest || 'ipv6.google.com'; if (!($dest = getHostIpv6Addr($dest))) { return } # Create original packet my $ether = Net::Frame::Layer::ETH->new( # src => 'aa:bb:cc:dd:ee:ff', # dst => '00:11:22:33:44:55', type => NF_ETH_TYPE_IPv6 ); my $ipv6 = Net::Frame::Layer::IPv6->new( # src => '2001::1', dst => $dest, nextHeader => NF_IPv6_PROTOCOL_ICMPv6 ); my $icmp = Net::Frame::Layer::ICMPv6->new; my $payload; for (1..8192) { $payload .= 'a'; } my $echo = Net::Frame::Layer::ICMPv6::Echo->new( identifier => 1, sequenceNumber => 1, payload => $payload ); my $packet = Net::Frame::Simple->new(layers=> [ $ether, $ipv6, $icmp, $echo ] ); # Update IPv6 nextHeader $ipv6->nextHeader(NF_IPv6_PROTOCOL_IPv6FRAGMENT); $ipv6->pack; # Create fragment extension headers my @f; $f[0] = Net::Frame::Layer::IPv6::Fragment->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, mFlag => 1 ); for (1..7) { push @f, Net::Frame::Layer::IPv6::Fragment->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, mFlag => 1, # 8192 total / 8 frags / 8-byte units, # plus 1 additional 8-byte ICMPv6 header fragmentOffset => (($_*8192/64)+1) ); } # Last frag has mFlag set to 0 $f[$#f]->mFlag(0); $_->pack for (@f); # Update ICMPv6 checksum for frag packet from orignal packet $icmp->checksum($packet->ref->{ICMPv6}->checksum); $icmp->pack; # Create ICMPv6 Echo header my $echofrag = Net::Frame::Layer::ICMPv6::Echo->new( identifier => 1, sequenceNumber => 1 ); $echofrag->pack; # IPv6 payload length for packet frag 1 is: # 8 byte frag header # 8 byte ICMPv6 header # 1024 bytes data $ipv6->payloadLength(8 + 8 + 1024); $ipv6->pack; my @frag; # Create first frag $frag[0] = $ether->raw . $ipv6->raw . $f[0]->raw . $icmp->raw . $echofrag->raw . substr $payload, 0, 1024; # IPv6 payload length for packet frag 2... is: # 8 byte frag header # 1024 bytes data $ipv6->payloadLength(8 + 1024); $ipv6->pack; # Create remaining 7 frags for (1..7) { $frag[$_] = $ether->raw . $ipv6->raw . $f[$_]->raw . substr $payload, 1024*$_, 1024; } # 8 raw packets are stored in @frag #if (!$ARGV[0]) { exit } #use Net::Pcap qw(:functions); #my %devinfo; #my $err; #my $fp= pcap_open($ARGV[0], 100, 0, 1000, \%devinfo, \$err); #if (!defined($fp)) { # printf "Unable to open adapter `%s'\n", $ARGV[0]; # exit 1 #} #for my $packet (@frag) { # if (pcap_sendpacket($fp, $packet) != 0) { # printf "Error sending packet: %s\n", pcap_geterr($fp); # exit 1 # } #} Net-Frame-Layer-IPv6-1.08/examples/fragment-NxM.pl000444001750001750 710413103614513 21317 0ustar00gomorgomor000000000000#!/usr/bin/perl # Not all hosts respond to IPv6 fragments # Examples that do: # 2001:559:0:4f::6011:4dc3 use strict; use warnings; use Net::Frame 1.09; use Net::Frame::Simple 1.05; use Net::Frame::Layer qw(:subs); use Net::Frame::Layer::ETH qw(:consts); use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Fragment; use Net::Frame::Layer::ICMPv6 qw(:consts); use Net::Frame::Layer::ICMPv6::Echo; # Get input print "What destination [ENTER for default]? "; my $dest = ; chomp $dest; print "\n"; # USE POWERS OF 2 OTHERWISE - ??? my $payloadSize = 2048; my $numFrags = 64; my $upperLayerLen = Net::Frame::Layer::ICMPv6->getLength + Net::Frame::Layer::ICMPv6::Echo->getLength; # Validate $dest = $dest || 'ipv6.google.com'; if (!($dest = getHostIpv6Addr($dest))) { return } # Create original packet my $ether = Net::Frame::Layer::ETH->new( # src => 'aa:bb:cc:dd:ee:ff', # dst => '00:11:22:33:44:55', type => NF_ETH_TYPE_IPv6 ); my $ipv6 = Net::Frame::Layer::IPv6->new( # src => '2001::1', dst => $dest, nextHeader => NF_IPv6_PROTOCOL_ICMPv6 ); my $icmp = Net::Frame::Layer::ICMPv6->new; my $payload; for (1..$payloadSize) { $payload .= 'a'; } my $echo = Net::Frame::Layer::ICMPv6::Echo->new( identifier => 1, sequenceNumber => 1, payload => $payload ); my $packet = Net::Frame::Simple->new(layers=> [ $ether, $ipv6, $icmp, $echo ] ); # Update IPv6 nextHeader $ipv6->nextHeader(NF_IPv6_PROTOCOL_IPv6FRAGMENT); $ipv6->pack; # Create fragment extension headers my @f; $f[0] = Net::Frame::Layer::IPv6::Fragment->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, mFlag => 1 ); for (1..($numFrags-1)) { push @f, Net::Frame::Layer::IPv6::Fragment->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, mFlag => 1, # payloadLength / num frags / 8-byte units, # plus additional 8-byte unit(s) for uppler layer header fragmentOffset => (($_ * $payloadSize / ($numFrags * 8)) + ($upperLayerLen / 8)) ); } # Last frag has mFlag set to 0 $f[$#f]->mFlag(0); $_->pack for (@f); # Update ICMPv6 checksum for frag packet from orignal packet $icmp->checksum($packet->ref->{ICMPv6}->checksum); $icmp->pack; # Create ICMPv6 Echo header my $echofrag = Net::Frame::Layer::ICMPv6::Echo->new( identifier => 1, sequenceNumber => 1 ); $echofrag->pack; # IPv6 payload length for packet frag 1 is: # 8 byte frag header # x byte upper layer header # x bytes data per packet $ipv6->payloadLength(Net::Frame::Layer::IPv6::Fragment->getLength + $upperLayerLen + ($payloadSize / $numFrags)); $ipv6->pack; my @frag; # Create first frag $frag[0] = $ether->raw . $ipv6->raw . $f[0]->raw . $icmp->raw . $echofrag->raw . substr $payload, 0, ($payloadSize / $numFrags); # IPv6 payload length for packet frag 2... is: # 8 byte frag header # x bytes data per packet $ipv6->payloadLength(Net::Frame::Layer::IPv6::Fragment->getLength + ($payloadSize / $numFrags)); $ipv6->pack; # Create remaining 7 frags for (1..($numFrags - 1)) { $frag[$_] = $ether->raw . $ipv6->raw . $f[$_]->raw . substr $payload, ($payloadSize / $numFrags) * $_, ($payloadSize / $numFrags); } # 8 raw packets are stored in @frag #if (!$ARGV[0]) { exit } #use Net::Pcap qw(:functions); #my %devinfo; #my $err; #my $fp= pcap_open($ARGV[0], 100, 0, 1000, \%devinfo, \$err); #if (!defined($fp)) { # printf "Unable to open adapter `%s'\n", $ARGV[0]; # exit 1 #} #for my $packet (@frag) { # if (pcap_sendpacket($fp, $packet) != 0) { # printf "Error sending packet: %s\n", pcap_geterr($fp); # exit 1 # } #} Net-Frame-Layer-IPv6-1.08/examples/hopbyhop.pl000444001750001750 312113103614513 20637 0ustar00gomorgomor000000000000#!/usr/bin/perl use strict; use warnings; use Net::Frame 1.09; use Net::Frame::Simple 1.05; use Net::Frame::Layer qw(:subs); use Net::Frame::Layer::ETH qw(:consts); use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::HopByHop; use Net::Frame::Layer::IPv6::Option; use Net::Frame::Layer::ICMPv6 qw(:consts); use Net::Frame::Layer::ICMPv6::Echo; # Get input print "What host to MLD query? "; my $dest = ; chomp $dest; print "\n"; # Validate $dest = $dest || 'fe80::1'; if (!($dest = getHostIpv6Addr($dest))) { return } # Create layers my $ether = Net::Frame::Layer::ETH->new( type => NF_ETH_TYPE_IPv6, ); my $ipv6 = Net::Frame::Layer::IPv6->new( src => 'fe80::2', dst => $dest, nextHeader => NF_IPv6_PROTOCOL_IPv6HOPBYHOP, hopLimit => 1, ); # Hop by Hop options my $option = Net::Frame::Layer::IPv6::Option->new( type => 5, value => pack "H*", '0000', ); my $PadN = Net::Frame::Layer::IPv6::Option->new; my $hop = Net::Frame::Layer::IPv6::HopByHop->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, options => [ $option, $PadN ], ); # MLD (ICMPv6) my $icmpv6 = Net::Frame::Layer::ICMPv6->new( type => 128, ); my $mld = Net::Frame::Layer::ICMPv6::Echo->new( identifier => 16, sequenceNumber => 0, payload => inet6Aton('::'), ); # Create packet my $packet = Net::Frame::Simple->new( layers => [ $ether, $ipv6, $hop, $icmpv6, $mld, ], ); print $packet->print."\n"; my $raw = $packet->pack; my $unpack = Net::Frame::Simple->new( firstLayer => 'ETH', raw => $raw, ); print $unpack->print."\n"; Net-Frame-Layer-IPv6-1.08/examples/routing.pl000444001750001750 265713103614513 20513 0ustar00gomorgomor000000000000#!/usr/bin/perl use strict; use warnings; use Net::Frame 1.09; use Net::Frame::Simple 1.05; use Net::Frame::Layer qw(:subs); use Net::Frame::Layer::ETH qw(:consts); use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Routing; use Net::Frame::Layer::ICMPv6 qw(:consts); use Net::Frame::Layer::ICMPv6::Echo; # Get input print "What destination [ENTER for default]? "; my $dest = ; chomp $dest; print "What hop1 [ENTER for default]? "; my $hop1 = ; chomp $hop1; print "What hop2 [ENTER for default]? "; my $hop2 = ; chomp $hop2; print "\n"; # Validate $dest = $dest || 'ipv6.google.com'; if (!($dest = getHostIpv6Addr($dest))) { return } $hop1 = $hop1 || '2001::1'; if (!($hop1 = getHostIpv6Addr($hop1))) { return } $hop2 = $hop2 || '2001::2'; if (!($hop2 = getHostIpv6Addr($hop2))) { return } # Create layers my $ether = Net::Frame::Layer::ETH->new( type=>NF_ETH_TYPE_IPv6 ); my $ipv6 = Net::Frame::Layer::IPv6->new( dst => $hop1, nextHeader => NF_IPv6_PROTOCOL_IPv6ROUTING ); my $route = Net::Frame::Layer::IPv6::Routing->new( nextHeader => NF_IPv6_PROTOCOL_ICMPv6, addresses => [ $hop2, $dest ], ); my $icmp = Net::Frame::Layer::ICMPv6->new; my $echo = Net::Frame::Layer::ICMPv6::Echo->new( payload=>'echo' ); # Create packet my $packet = Net::Frame::Simple->new(layers=> [ $ether, $ipv6, $route, $icmp, $echo ] ); print $packet->print . "\n"; Net-Frame-Layer-IPv6-1.08/lib000755001750001750 013103614513 15250 5ustar00gomorgomor000000000000Net-Frame-Layer-IPv6-1.08/lib/Net000755001750001750 013103614513 15776 5ustar00gomorgomor000000000000Net-Frame-Layer-IPv6-1.08/lib/Net/Frame000755001750001750 013103614513 17030 5ustar00gomorgomor000000000000Net-Frame-Layer-IPv6-1.08/lib/Net/Frame/Layer000755001750001750 013103614513 20104 5ustar00gomorgomor000000000000Net-Frame-Layer-IPv6-1.08/lib/Net/Frame/Layer/IPv6.pm000444001750001750 3564513103614513 21420 0ustar00gomorgomor000000000000# # $Id: IPv6.pm,v ee9a7f696b4d 2017/05/07 12:55:21 gomor $ # package Net::Frame::Layer::IPv6; use strict; use warnings; our $VERSION = '1.08'; use Net::Frame::Layer qw(:consts :subs); require Exporter; our @ISA = qw(Net::Frame::Layer Exporter); our %EXPORT_TAGS = ( consts => [qw( NF_IPv6_HDR_LEN NF_IPv6_PROTOCOL_ICMPv4 NF_IPv6_PROTOCOL_IGMP NF_IPv6_PROTOCOL_IPIP NF_IPv6_PROTOCOL_TCP NF_IPv6_PROTOCOL_EGP NF_IPv6_PROTOCOL_IGRP NF_IPv6_PROTOCOL_CHAOS NF_IPv6_PROTOCOL_UDP NF_IPv6_PROTOCOL_IDP NF_IPv6_PROTOCOL_DCCP NF_IPv6_PROTOCOL_IPv6 NF_IPv6_PROTOCOL_IPv6ROUTING NF_IPv6_PROTOCOL_IPv6FRAGMENT NF_IPv6_PROTOCOL_IDRP NF_IPv6_PROTOCOL_RSVP NF_IPv6_PROTOCOL_GRE NF_IPv6_PROTOCOL_ESP NF_IPv6_PROTOCOL_AH NF_IPv6_PROTOCOL_ICMPv6 NF_IPv6_PROTOCOL_EIGRP NF_IPv6_PROTOCOL_OSPF NF_IPv6_PROTOCOL_ETHERIP NF_IPv6_PROTOCOL_PIM NF_IPv6_PROTOCOL_VRRP NF_IPv6_PROTOCOL_STP NF_IPv6_PROTOCOL_SCTP NF_IPv6_PROTOCOL_UDPLITE NF_IPv6_PROTOCOL_IPv6HOPBYHOP NF_IPv6_PROTOCOL_GGP NF_IPv6_PROTOCOL_ST NF_IPv6_PROTOCOL_CBT NF_IPv6_PROTOCOL_PUP NF_IPv6_PROTOCOL_ARGUS NF_IPv6_PROTOCOL_EMCON NF_IPv6_PROTOCOL_XNET NF_IPv6_PROTOCOL_MUX NF_IPv6_PROTOCOL_DCNMEAS NF_IPv6_PROTOCOL_HMP NF_IPv6_PROTOCOL_PRM NF_IPv6_PROTOCOL_TRUNK1 NF_IPv6_PROTOCOL_TRUNK2 NF_IPv6_PROTOCOL_LEAF1 NF_IPv6_PROTOCOL_LEAF2 NF_IPv6_PROTOCOL_3PC NF_IPv6_PROTOCOL_IDPR NF_IPv6_PROTOCOL_XTP NF_IPv6_PROTOCOL_DDP NF_IPv6_PROTOCOL_IDPRCMTP NF_IPv6_PROTOCOL_TPPLUSPLUS NF_IPv6_PROTOCOL_IL NF_IPv6_PROTOCOL_SDRP NF_IPv6_PROTOCOL_IPv6NONEXT NF_IPv6_PROTOCOL_IPv6DESTINATION NF_IPv6_PROTOCOL_IPv6MOBILITY )], ); our @EXPORT_OK = ( @{$EXPORT_TAGS{consts}}, ); # # http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml # use constant NF_IPv6_HDR_LEN => 40; use constant NF_IPv6_PROTOCOL_IPv6HOPBYHOP => 0x00; use constant NF_IPv6_PROTOCOL_ICMPv4 => 0x01; use constant NF_IPv6_PROTOCOL_IGMP => 0x02; use constant NF_IPv6_PROTOCOL_GGP => 0x03; use constant NF_IPv6_PROTOCOL_IPIP => 0x04; use constant NF_IPv6_PROTOCOL_ST => 0x05; use constant NF_IPv6_PROTOCOL_TCP => 0x06; use constant NF_IPv6_PROTOCOL_CBT => 0x07; use constant NF_IPv6_PROTOCOL_EGP => 0x08; use constant NF_IPv6_PROTOCOL_IGRP => 0x09; use constant NF_IPv6_PROTOCOL_PUP => 0x0c; use constant NF_IPv6_PROTOCOL_ARGUS => 0x0d; use constant NF_IPv6_PROTOCOL_EMCON => 0x0e; use constant NF_IPv6_PROTOCOL_XNET => 0x0f; use constant NF_IPv6_PROTOCOL_CHAOS => 0x10; use constant NF_IPv6_PROTOCOL_UDP => 0x11; use constant NF_IPv6_PROTOCOL_MUX => 0x12; use constant NF_IPv6_PROTOCOL_DCNMEAS => 0x13; use constant NF_IPv6_PROTOCOL_HMP => 0x14; use constant NF_IPv6_PROTOCOL_PRM => 0x15; use constant NF_IPv6_PROTOCOL_IDP => 0x16; use constant NF_IPv6_PROTOCOL_TRUNK1 => 0x17; use constant NF_IPv6_PROTOCOL_TRUNK2 => 0x18; use constant NF_IPv6_PROTOCOL_LEAF1 => 0x19; use constant NF_IPv6_PROTOCOL_LEAF2 => 0x20; use constant NF_IPv6_PROTOCOL_DCCP => 0x21; use constant NF_IPv6_PROTOCOL_3PC => 0x22; use constant NF_IPv6_PROTOCOL_IDPR => 0x23; use constant NF_IPv6_PROTOCOL_XTP => 0x24; use constant NF_IPv6_PROTOCOL_DDP => 0x25; use constant NF_IPv6_PROTOCOL_IDPRCMTP => 0x26; use constant NF_IPv6_PROTOCOL_TPPLUSPLUS => 0x27; use constant NF_IPv6_PROTOCOL_IL => 0x28; use constant NF_IPv6_PROTOCOL_IPv6 => 0x29; use constant NF_IPv6_PROTOCOL_SDRP => 0x2a; use constant NF_IPv6_PROTOCOL_IPv6ROUTING => 0x2b; use constant NF_IPv6_PROTOCOL_IPv6FRAGMENT => 0x2c; use constant NF_IPv6_PROTOCOL_IDRP => 0x2d; use constant NF_IPv6_PROTOCOL_RSVP => 0x2e; use constant NF_IPv6_PROTOCOL_GRE => 0x2f; use constant NF_IPv6_PROTOCOL_ESP => 0x32; use constant NF_IPv6_PROTOCOL_AH => 0x33; use constant NF_IPv6_PROTOCOL_ICMPv6 => 0x3a; use constant NF_IPv6_PROTOCOL_IPv6NONEXT => 0x3b; use constant NF_IPv6_PROTOCOL_IPv6DESTINATION => 0x3c; use constant NF_IPv6_PROTOCOL_EIGRP => 0x58; use constant NF_IPv6_PROTOCOL_OSPF => 0x59; use constant NF_IPv6_PROTOCOL_ETHERIP => 0x61; use constant NF_IPv6_PROTOCOL_PIM => 0x67; use constant NF_IPv6_PROTOCOL_VRRP => 0x70; use constant NF_IPv6_PROTOCOL_STP => 0x76; use constant NF_IPv6_PROTOCOL_SCTP => 0x84; use constant NF_IPv6_PROTOCOL_IPv6MOBILITY => 0x87; use constant NF_IPv6_PROTOCOL_UDPLITE => 0x88; our @AS = qw( version trafficClass flowLabel nextHeader payloadLength hopLimit src dst ); __PACKAGE__->cgBuildIndices; __PACKAGE__->cgBuildAccessorsScalar(\@AS); BEGIN { *protocol = \&nextHeader; } no strict 'vars'; use Bit::Vector; sub new { shift->SUPER::new( version => 6, trafficClass => 0, flowLabel => 0, nextHeader => NF_IPv6_PROTOCOL_TCP, hopLimit => 0xff, src => '::1', dst => '::1', payloadLength => 0, @_, ); } sub getLength { NF_IPv6_HDR_LEN } sub computeLengths { my $self = shift; my ($layers) = @_; my $len = 0; my $last; my $start; for my $l (@$layers) { if (! $start) { $start++ if $l->layer eq 'IPv6'; next; } $len += $l->getLength; $last = $l; } if (defined($last->payload)) { $len += length($last->payload); } $self->payloadLength($len); return 1; } sub pack { my $self = shift; my $version = Bit::Vector->new_Dec(4, $self->[$__version]); my $trafficClass = Bit::Vector->new_Dec(8, $self->[$__trafficClass]); my $flowLabel = Bit::Vector->new_Dec(20, $self->[$__flowLabel]); my $v32 = $version->Concat_List($trafficClass, $flowLabel); $self->[$__raw] = $self->SUPER::pack('NnCCa*a*', $v32->to_Dec, $self->[$__payloadLength], $self->[$__nextHeader], $self->[$__hopLimit], inet6Aton($self->[$__src]), inet6Aton($self->[$__dst]), ) or return undef; $self->raw; } sub unpack { my $self = shift; my ($vTcFl, $pl, $nh, $hl, $sa, $da, $payload) = $self->SUPER::unpack('NnCCa16a16 a*', $self->[$__raw]) or return undef; my $v32 = Bit::Vector->new_Dec(32, $vTcFl); $self->[$__flowLabel] = $v32->Chunk_Read(20, 0); $self->[$__trafficClass] = $v32->Chunk_Read( 8, 20); $self->[$__version] = $v32->Chunk_Read( 4, 28); $self->[$__payloadLength] = $pl; $self->[$__nextHeader] = $nh; $self->[$__hopLimit] = $hl; $self->[$__src] = inet6Ntoa($sa); $self->[$__dst] = inet6Ntoa($da); $self->[$__payload] = $payload; $self; } sub encapsulate { my $self = shift; return $self->[$__nextLayer] if $self->[$__nextLayer]; my $types = { NF_IPv6_PROTOCOL_ICMPv4() => 'ICMPv4', NF_IPv6_PROTOCOL_IGMP() => 'IGMP', NF_IPv6_PROTOCOL_IPIP() => 'IPv4', NF_IPv6_PROTOCOL_TCP() => 'TCP', NF_IPv6_PROTOCOL_EGP() => 'EGP', NF_IPv6_PROTOCOL_IGRP() => 'IGRP', NF_IPv6_PROTOCOL_CHAOS() => 'CHAOS', NF_IPv6_PROTOCOL_UDP() => 'UDP', NF_IPv6_PROTOCOL_IDP() => 'IDP', NF_IPv6_PROTOCOL_DCCP() => 'DCCP', NF_IPv6_PROTOCOL_IPv6() => 'IPv6', NF_IPv6_PROTOCOL_IPv6ROUTING() => 'IPv6::Routing', NF_IPv6_PROTOCOL_IPv6FRAGMENT() => 'IPv6::Fragment', NF_IPv6_PROTOCOL_IDRP() => 'IDRP', NF_IPv6_PROTOCOL_RSVP() => 'RSVP', NF_IPv6_PROTOCOL_GRE() => 'GRE', NF_IPv6_PROTOCOL_ESP() => 'ESP', NF_IPv6_PROTOCOL_AH() => 'AH', NF_IPv6_PROTOCOL_ICMPv6() => 'ICMPv6', NF_IPv6_PROTOCOL_EIGRP() => 'EIGRP', NF_IPv6_PROTOCOL_OSPF() => 'OSPF', NF_IPv6_PROTOCOL_ETHERIP() => 'ETHERIP', NF_IPv6_PROTOCOL_PIM() => 'PIM', NF_IPv6_PROTOCOL_VRRP() => 'VRRP', NF_IPv6_PROTOCOL_STP() => 'STP', NF_IPv6_PROTOCOL_SCTP() => 'SCTP', NF_IPv6_PROTOCOL_UDPLITE() => 'UDPLite', NF_IPv6_PROTOCOL_IPv6DESTINATION() => 'IPv6::Destination', NF_IPv6_PROTOCOL_IPv6MOBILITY() => 'IPv6::Mobility', NF_IPv6_PROTOCOL_IPv6HOPBYHOP() => 'IPv6::HopByHop', NF_IPv6_PROTOCOL_GGP() => 'GGP', NF_IPv6_PROTOCOL_ST() => 'ST', NF_IPv6_PROTOCOL_CBT() => 'CBT', NF_IPv6_PROTOCOL_PUP() => 'PUP', NF_IPv6_PROTOCOL_ARGUS() => 'ARGUS', NF_IPv6_PROTOCOL_EMCON() => 'EMCON', NF_IPv6_PROTOCOL_XNET() => 'XNET', NF_IPv6_PROTOCOL_MUX() => 'MUX', NF_IPv6_PROTOCOL_DCNMEAS() => 'DCNMEAS', NF_IPv6_PROTOCOL_HMP() => 'HMP', NF_IPv6_PROTOCOL_PRM() => 'PRM', NF_IPv6_PROTOCOL_TRUNK1() => 'TRUNK1', NF_IPv6_PROTOCOL_TRUNK2() => 'TRUNK2', NF_IPv6_PROTOCOL_LEAF1() => 'LEAF1', NF_IPv6_PROTOCOL_LEAF2() => 'LEAF2', NF_IPv6_PROTOCOL_3PC() => '3PC', NF_IPv6_PROTOCOL_IDPR() => 'IDPR', NF_IPv6_PROTOCOL_XTP() => 'XTP', NF_IPv6_PROTOCOL_DDP() => 'DDP', NF_IPv6_PROTOCOL_IDPRCMTP() => 'IDPRCMTP', NF_IPv6_PROTOCOL_TPPLUSPLUS() => 'TPPlusPlus', NF_IPv6_PROTOCOL_IL() => 'IL', NF_IPv6_PROTOCOL_SDRP() => 'SDRP', NF_IPv6_PROTOCOL_IPv6NONEXT() => 'IPv6::NoNext', }; $types->{$self->[$__nextHeader]} || NF_LAYER_UNKNOWN; } sub print { my $self = shift; my $l = $self->layer; sprintf "$l: version:%d trafficClass:0x%02x flowLabel:0x%05x ". "nextHeader:0x%02x\n". "$l: payloadLength:%d hopLimit:%d\n". "$l: src:%s dst:%s", $self->[$__version], $self->[$__trafficClass], $self->[$__flowLabel], $self->[$__nextHeader], $self->[$__payloadLength], $self->[$__hopLimit], $self->[$__src], $self->[$__dst]; } 1; =head1 NAME Net::Frame::Layer::IPv6 - Internet Protocol v6 layer object =head1 SYNOPSIS use Net::Frame::Layer::IPv6 qw(:consts); # Build a layer my $layer = Net::Frame::Layer::IPv6->new( version => 6, trafficClass => 0, flowLabel => 0, nextHeader => NF_IPv6_PROTOCOL_TCP, hopLimit => 0xff, src => '::1', dst => '::1', payloadLength => 0, ); $layer->pack; print 'RAW: '.$layer->dump."\n"; # Read a raw layer my $layer = Net::Frame::Layer::IPv6->new(raw = $raw); print $layer->print."\n"; print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n" if $layer->payload; =head1 DESCRIPTION This modules implements the encoding and decoding of the IPv6 layer. RFC: ftp://ftp.rfc-editor.org/in-notes/rfc2460.txt See also B for other attributes and methods. =head1 ATTRIBUTES =over 4 =item B - 4 bits Version of Internet Protocol header. =item B - 8 bits Traffic class field. Was Type of Service in IPv4. =item B - 20 bits Flow label class field. Was IP ID in IPv4. =item B - 8 bits The type of next header. Was protocol in IPv4. =item B Is an alias for B. =item B - 16 bits Length in bytes of encapsulated layers (usually, that is layer 4 + layer 7). =item B - 8 bits Was TTL field in IPv4. =item B - 32 bits =item B - 32 bits Source and destination addresses. =back The following are inherited attributes. See B for more information. =over 4 =item B =item B =item B =back =head1 METHODS =over 4 =item B =item B (hash) Object constructor. You can pass attributes that will overwrite default ones. See B for default values. =item B ({ payloadLength => VALUE }) In order to compute lengths attributes within IPv6 header, you need to pass via a hashref the number of bytes contained in IPv6 payload (that is, the sum of all layers after the IPv6 one). =back The following are inherited methods. Some of them may be overridden in this layer, and some others may not be meaningful in this layer. See B for more information. =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =back =head1 CONSTANTS Load them: use Net::Frame::Layer::IPv6 qw(:consts); =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B Constants for B attribute. =back =head1 SEE ALSO L =head1 AUTHOR Patrice EGomoRE Auffret =head1 COPYRIGHT AND LICENSE Copyright (c) 2006-2017, Patrice EGomoRE Auffret You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. =cut Net-Frame-Layer-IPv6-1.08/lib/Net/Frame/Layer/IPv6000755001750001750 013103614513 20670 5ustar00gomorgomor000000000000Net-Frame-Layer-IPv6-1.08/lib/Net/Frame/Layer/IPv6/Destination.pm000444001750001750 1162513103614513 23671 0ustar00gomorgomor000000000000# # $Id: Destination.pm,v ee9a7f696b4d 2017/05/07 12:55:21 gomor $ # package Net::Frame::Layer::IPv6::Destination; use strict; use warnings; our $VERSION = '1.08'; use Net::Frame::Layer qw(:consts :subs); use Exporter; our @ISA = qw(Net::Frame::Layer Exporter); our @AS = qw( nextHeader hdrExtLen ); our @AA = qw( options ); __PACKAGE__->cgBuildIndices; __PACKAGE__->cgBuildAccessorsScalar(\@AS); __PACKAGE__->cgBuildAccessorsArray(\@AA); use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Option; sub new { shift->SUPER::new( nextHeader => NF_IPv6_PROTOCOL_TCP, hdrExtLen => 0, options => [], @_, ); } sub getOptionsLength { my $self = shift; my $len = 0; $len += $_->getLength for $self->options; return $len; } sub getLength { my $self = shift; return 2 + $self->getOptionsLength; } sub pack { my $self = shift; my $raw = $self->SUPER::pack('CC', $self->nextHeader, $self->hdrExtLen ) or return; for ($self->options) { $raw .= $_->pack; } return $self->raw($raw); } sub _unpackOptions { my $self = shift; my ($payload) = @_; my @options = (); while (defined($payload) && length($payload)) { my $opt = Net::Frame::Layer::IPv6::Option->new(raw => $payload)->unpack; push @options, $opt; $payload = $opt->payload; $opt->payload(undef); } $self->options(\@options); return $payload; } sub unpack { my $self = shift; my ($nextHeader, $hdrExtLen, $payload) = $self->SUPER::unpack('CC a*', $self->raw) or return; $self->nextHeader($nextHeader); $self->hdrExtLen($hdrExtLen); my $options; my $optionsLen = $hdrExtLen*8 + 6; # 8 - 2 bytes offset ($options, $payload) = $self->SUPER::unpack("a$optionsLen a*", $payload) or return; if (defined($options) && length($options)) { $self->_unpackOptions($options); } $self->payload($payload); return $self; } sub computeLengths { my $self = shift; my $hdrExtLen = int($self->getLength/8) - 1; if ($hdrExtLen < 0) { $hdrExtLen = 0; } $self->hdrExtLen($hdrExtLen); for my $option ($self->options) { $option->computeLengths; } return 1; } sub encapsulate { my $self = shift; return $self->nextLayer if $self->nextLayer; if ($self->payload) { my $next = $self->nextHeader; return Net::Frame::Layer::IPv6->new(nextHeader => $next)->encapsulate; } return NF_LAYER_NONE; } sub print { my $self = shift; my $l = $self->layer; my $buf = sprintf "$l: nextHeader:0x%02x hdrExtLen:%d", $self->nextHeader, $self->hdrExtLen; for ($self->options) { $buf .= "\n" . $_->print; } return $buf; } 1; __END__ =head1 NAME Net::Frame::Layer::IPv6::Destination - Internet Protocol v6 Destination Extension Header layer object =head1 SYNOPSIS use Net::Frame::Simple; use Net::Frame::Layer::IPv6::Destination; my $ipv6eh = Net::Frame::Layer::IPv6::Destination->new( nextHeader => NF_IPv6_PROTOCOL_TCP, hdrExtLen => 2, options => [] ); # # Read a raw layer # my $layer = Net::Frame::Layer::IPv6::Destination->new(raw => $raw); print $layer->print."\n"; print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n" if $layer->payload; =head1 DESCRIPTION This modules implements the encoding and decoding of the IPv6 Destination options Extension Header layer. RFC: ftp://ftp.rfc-editor.org/in-notes/rfc2460.txt See also B for other attributes and methods. =head1 ATTRIBUTES =over 4 =item B Protocol number of the next header after the Destination header. =item B The length of the Destination Options header in 8-byte units, not including the first 8 bytes of the header. =item B A number of B objects. =back The following are inherited attributes. See B for more information. =over 4 =item B =item B =item B =back =head1 METHODS =over 4 =item B =item B (hash) Object constructor. You can pass attributes that will overwrite default ones. See B for default values. =back The following are inherited methods. Some of them may be overridden in this layer, and some others may not be meaningful in this layer. See B for more information. =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back =head1 CONSTANTS No constants here. =head1 SEE ALSO L =head1 AUTHOR Michael Vincent =head1 COPYRIGHT AND LICENSE Copyright (c) 2012-2017, Michael Vincent You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. =cut Net-Frame-Layer-IPv6-1.08/lib/Net/Frame/Layer/IPv6/Fragment.pm000444001750001750 1223013103614513 23144 0ustar00gomorgomor000000000000# # $Id: Fragment.pm,v ee9a7f696b4d 2017/05/07 12:55:21 gomor $ # package Net::Frame::Layer::IPv6::Fragment; use strict; use warnings; our $VERSION = '1.08'; use Net::Frame::Layer qw(:consts :subs); use Exporter; our @ISA = qw(Net::Frame::Layer Exporter); our @AS = qw( nextHeader reserved fragmentOffset res mFlag identification ); __PACKAGE__->cgBuildIndices; __PACKAGE__->cgBuildAccessorsScalar(\@AS); use Net::Frame::Layer::IPv6 qw(:consts); sub new { shift->SUPER::new( nextHeader => NF_IPv6_PROTOCOL_TCP, reserved => 0, fragmentOffset => 0, res => 0, mFlag => 0, identification => 0, @_, ); } sub getLength { 8 } sub pack { my $self = shift; my $fragmentOffset = Bit::Vector->new_Dec(13, $self->fragmentOffset); my $res = Bit::Vector->new_Dec( 2, $self->res); my $mFlag = Bit::Vector->new_Dec( 1, $self->mFlag); my $v16 = $fragmentOffset->Concat_List($res, $mFlag); my $raw = $self->SUPER::pack('CCnN', $self->nextHeader, $self->reserved, $v16->to_Dec, $self->identification ) or return; return $self->raw($raw); } sub unpack { my $self = shift; my ($nextHeader, $reserved, $fragflags, $identification, $payload) = $self->SUPER::unpack('CCnN a*', $self->raw) or return; $self->nextHeader($nextHeader); $self->reserved($reserved); my $v16 = Bit::Vector->new_Dec(16, $fragflags); $self->fragmentOffset($v16->Chunk_Read(13, 3)); $self->res ($v16->Chunk_Read( 2, 1)); $self->mFlag ($v16->Chunk_Read( 1, 0)); $self->identification($identification); $self->payload($payload); return $self; } sub encapsulate { my $self = shift; return $self->nextLayer if $self->nextLayer; if ($self->payload) { my $next = $self->nextHeader; return Net::Frame::Layer::IPv6->new(nextHeader => $self->nextHeader)->encapsulate; } return NF_LAYER_NONE; } sub print { my $self = shift; my $l = $self->layer; my $buf = sprintf "$l: nextHeader:0x%02x reserved:%d fragmentOffset:0x%04x\n". "$l: res:%d mFlag:%d identification:%d", $self->nextHeader, $self->reserved, $self->fragmentOffset, $self->res, $self->mFlag, $self->identification; return $buf; } 1; __END__ =head1 NAME Net::Frame::Layer::IPv6::Fragment - Internet Protocol v6 Fragment Extension Header layer object =head1 SYNOPSIS use Net::Frame::Simple; use Net::Frame::Layer::IPv6::Fragment; my $icmp = Net::Frame::Layer::IPv6::Fragment->new( nextHeader => NF_IPv6_PROTOCOL_TCP, reserved => 0, fragmentOffset => 0, res => 0, mFlag => 0, identification => 0 ); # # Read a raw layer # my $layer = Net::Frame::Layer::IPv6::Fragment->new(raw => $raw); print $layer->print."\n"; print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n" if $layer->payload; =head1 DESCRIPTION This modules implements the encoding and decoding of the IPv6 Fragment Extension Header layer. RFC: ftp://ftp.rfc-editor.org/in-notes/rfc2460.txt See also B for other attributes and methods. =head1 ATTRIBUTES =over 4 =item B Protocol number of the next header after the Fragment header. =item B Not used; set to zeroes. =item B Specifies the offset, or position, in the overall message where the data in this fragment goes. It is specified in units of 8 bytes (64 bits) and used in a manner very similar to the field of the same name in the IPv4 header. =item B Not used; set to zeroes. =item B Same as the flag of the same name in the IPv4 header - when set to 0, indicates the last fragment in a message; when set to 1, indicates that more fragments are yet to come in the fragmented message. =item B Same as the field of the same name in the IPv4 header, but expanded to 32 bits. It contains a specific value that is common to each of the fragments belonging to a particular message, to ensure that pieces from different fragmented messages are not mixed together. =back The following are inherited attributes. See B for more information. =over 4 =item B =item B =item B =back =head1 METHODS =over 4 =item B =item B (hash) Object constructor. You can pass attributes that will overwrite default ones. See B for default values. =back The following are inherited methods. Some of them may be overridden in this layer, and some others may not be meaningful in this layer. See B for more information. =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back =head1 CONSTANTS No constants here. =head1 SEE ALSO L =head1 AUTHOR Michael Vincent =head1 COPYRIGHT AND LICENSE Copyright (c) 2012-2017, Michael Vincent You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. =cut Net-Frame-Layer-IPv6-1.08/lib/Net/Frame/Layer/IPv6/HopByHop.pm000444001750001750 1160513103614513 23076 0ustar00gomorgomor000000000000# # $Id: HopByHop.pm,v ee9a7f696b4d 2017/05/07 12:55:21 gomor $ # package Net::Frame::Layer::IPv6::HopByHop; use strict; use warnings; our $VERSION = '1.08'; use Net::Frame::Layer qw(:consts :subs); use Exporter; our @ISA = qw(Net::Frame::Layer Exporter); our @AS = qw( nextHeader hdrExtLen ); our @AA = qw( options ); __PACKAGE__->cgBuildIndices; __PACKAGE__->cgBuildAccessorsScalar(\@AS); __PACKAGE__->cgBuildAccessorsArray(\@AA); use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Option; sub new { shift->SUPER::new( nextHeader => NF_IPv6_PROTOCOL_TCP, hdrExtLen => 0, options => [], @_, ); } sub getOptionsLength { my $self = shift; my $len = 0; $len += $_->getLength for $self->options; return $len; } sub getLength { my $self = shift; return 2 + $self->getOptionsLength; } sub pack { my $self = shift; my $raw = $self->SUPER::pack('CC', $self->nextHeader, $self->hdrExtLen ) or return; for ($self->options) { $raw .= $_->pack; } return $self->raw($raw); } sub _unpackOptions { my $self = shift; my ($payload) = @_; my @options = (); while (defined($payload) && length($payload)) { my $opt = Net::Frame::Layer::IPv6::Option->new(raw => $payload)->unpack; push @options, $opt; $payload = $opt->payload; $opt->payload(undef); } $self->options(\@options); return $payload; } sub unpack { my $self = shift; my ($nextHeader, $hdrExtLen, $payload) = $self->SUPER::unpack('CC a*', $self->raw) or return; $self->nextHeader($nextHeader); $self->hdrExtLen($hdrExtLen); my $options = ''; my $optionsLen = $hdrExtLen*8 + 6; # 8 - 2 bytes offset ($options, $payload) = $self->SUPER::unpack("a$optionsLen a*", $payload) or return; if (defined($options) && length($options)) { $self->_unpackOptions($options); } $self->payload($payload); return $self; } sub computeLengths { my $self = shift; my $hdrExtLen = int($self->getLength/8) - 1; if ($hdrExtLen < 0) { $hdrExtLen = 0; } $self->hdrExtLen($hdrExtLen); for my $option ($self->options) { $option->computeLengths; } return 1; } sub encapsulate { my $self = shift; return $self->nextLayer if $self->nextLayer; if ($self->payload) { my $next = $self->nextHeader; return Net::Frame::Layer::IPv6->new(nextHeader => $next)->encapsulate; } return NF_LAYER_NONE; } sub print { my $self = shift; my $l = $self->layer; my $buf = sprintf "$l: nextHeader:0x%02x hdrExtLen:%d", $self->nextHeader, $self->hdrExtLen; for ($self->options) { $buf .= "\n" . $_->print; } return $buf; } 1; __END__ =head1 NAME Net::Frame::Layer::IPv6::HopByHop - Internet Protocol v6 Hop-By-Hop Extension Header layer object =head1 SYNOPSIS use Net::Frame::Simple; use Net::Frame::Layer::IPv6::HopByHop; my $ipv6eh = Net::Frame::Layer::IPv6::HopByHop->new( nextHeader => NF_IPv6_PROTOCOL_TCP, hdrExtLen => 2, options => [] ); # # Read a raw layer # my $layer = Net::Frame::Layer::IPv6::HopByHop->new(raw => $raw); print $layer->print."\n"; print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n" if $layer->payload; =head1 DESCRIPTION This modules implements the encoding and decoding of the IPv6 Hop-By-Hop options Extension Header layer. RFC: ftp://ftp.rfc-editor.org/in-notes/rfc2460.txt See also B for other attributes and methods. =head1 ATTRIBUTES =over 4 =item B Protocol number of the next header after the HopByHop header. =item B The length of the Hop-By-Hop Options header in 8-byte units, not including the first 8 bytes of the header. =item B A number of B objects. =back The following are inherited attributes. See B for more information. =over 4 =item B =item B =item B =back =head1 METHODS =over 4 =item B =item B (hash) Object constructor. You can pass attributes that will overwrite default ones. See B for default values. =back The following are inherited methods. Some of them may be overridden in this layer, and some others may not be meaningful in this layer. See B for more information. =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back =head1 CONSTANTS No constants here. =head1 SEE ALSO L =head1 AUTHOR Michael Vincent =head1 COPYRIGHT AND LICENSE Copyright (c) 2012-2017, Michael Vincent You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. =cut Net-Frame-Layer-IPv6-1.08/lib/Net/Frame/Layer/IPv6/Option.pm000444001750001750 765713103614513 22652 0ustar00gomorgomor000000000000# # $Id: Option.pm,v ee9a7f696b4d 2017/05/07 12:55:21 gomor $ # package Net::Frame::Layer::IPv6::Option; use strict; use warnings; use Net::Frame::Layer qw(:consts :subs); our @ISA = qw(Net::Frame::Layer); our @AS = qw( type length value ); __PACKAGE__->cgBuildIndices; __PACKAGE__->cgBuildAccessorsScalar(\@AS); sub new { shift->SUPER::new( type => 1, length => 0, value => '', @_, ); } sub getLength { my $self = shift; if ($self->type == 0) { # Pad1, only type is used return 1; } return length($self->value) + 2; } sub pack { my $self = shift; my $raw = $self->SUPER::pack('C', $self->type) or return; if ($self->type != 0) { # Not a Pad1 option $raw .= $self->SUPER::pack('Ca*', $self->length, $self->value) or return; } return $self->raw($raw); } sub unpack { my $self = shift; my ($type, $payload) = $self->SUPER::unpack('C a*', $self->raw) or return; $self->type($type); if ($self->type != 0) { # Not a Pad1 option my ($length, $tail) = $self->SUPER::unpack('C a*', $payload) or return; my $value = ''; ($value, $payload) = $self->SUPER::unpack("a$length a*", $tail) or return; $self->length($length); $self->value($value); } $self->payload($payload); return $self; } sub computeLengths { my $self = shift; my $length = 0; if ($self->type != 0) { # Not a Pad1 option $length = length($self->value); } $self->length($length); return 1; } sub print { my $self = shift; my $buf = ''; my $l = $self->layer; if ($self->type == 0x00) { # Pad1 specific type $buf .= sprintf "$l: type:0x%02x", $self->type; } else { $buf .= sprintf "$l: type:0x%02x length:%d value:%s", $self->type, $self->length, CORE::unpack('H*', $self->value); } return $buf; } 1; __END__ =head1 NAME Net::Frame::Layer::IPv6::Option - IPv6 Option object =head1 SYNOPSIS use Net::Frame::Layer::IPv6::Option; my $layer = Net::Frame::Layer::IPv6::Option->new( type => 1, length => 0, value => '', ); $layer->pack; print 'RAW: '.$layer->dump."\n"; # Read a raw layer my $layer = Net::Frame::Layer::IPv6::Option->new( raw => $raw, ); print $layer->print."\n"; print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n" if $layer->payload; =head1 DESCRIPTION This modules implements the encoding and decoding of IPv6 Options. See also B for other attributes and methods. =head1 ATTRIBUTES =over 4 =item B The type of IPv6 option. =item B The length of IPv6 option (a number of bytes), including B and B fields. =item B The value. =back The default B, B and B create the PadN option padding, where N=2. The following are inherited attributes. See B for more information. =over 4 =item B =item B =item B =back =head1 METHODS =over 4 =item B =item B (hash) Object constructor. You can pass attributes that will overwrite default ones. See B for default values. =back The following are inherited methods. Some of them may be overridden in this layer, and some others may not be meaningful in this layer. See B for more information. =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back =head1 CONSTANTS No constants here. =head1 SEE ALSO L, L =head1 AUTHOR Patrice EGomoRE Auffret =head1 COPYRIGHT AND LICENSE Copyright (c) 2006-2017, Patrice EGomoRE Auffret You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. =cut Net-Frame-Layer-IPv6-1.08/lib/Net/Frame/Layer/IPv6/Routing.pm000444001750001750 1407713103614513 23043 0ustar00gomorgomor000000000000# # $Id: Routing.pm,v ee9a7f696b4d 2017/05/07 12:55:21 gomor $ # package Net::Frame::Layer::IPv6::Routing; use strict; use warnings; our $VERSION = '1.08'; use Net::Frame::Layer qw(:consts :subs); use Exporter; our @ISA = qw(Net::Frame::Layer Exporter); our @AS = qw( nextHeader hdrExtLen routingType segmentsLeft reserved ); our @AA = qw( addresses ); __PACKAGE__->cgBuildIndices; __PACKAGE__->cgBuildAccessorsScalar(\@AS); __PACKAGE__->cgBuildAccessorsArray(\@AA); use Net::Frame::Layer::IPv6 qw(:consts); my $IPv6RoutingComputeSegmentsLeft = 1; sub new { shift->SUPER::new( nextHeader => NF_IPv6_PROTOCOL_TCP, hdrExtLen => 2, routingType => 0, segmentsLeft => 1, reserved => 0, addresses => ['::1'], @_, ); } sub _getAddressesLength { my $self = shift; my $len = 0; $len += 16 for $self->addresses; return $len; } sub getLength { my $self = shift; return 8 + $self->_getAddressesLength; } sub pack { my $self = shift; my $raw = $self->SUPER::pack('CCCCN', $self->nextHeader, $self->hdrExtLen, $self->routingType, $self->segmentsLeft, $self->reserved ) or return; for ($self->addresses) { $raw .= $self->SUPER::pack('a16', inet6Aton($_) ) or return; } return $self->raw($raw); } sub unpack { my $self = shift; my ($nextHeader, $hdrExtLen, $routingType, $segmentsLeft, $reserved, $rest) = $self->SUPER::unpack('CCCCN a*', $self->raw) or return; $self->nextHeader($nextHeader); $self->hdrExtLen($hdrExtLen); $self->routingType($routingType); $self->segmentsLeft($segmentsLeft); $self->reserved($reserved); my @addresses = (); for (1..$hdrExtLen/2) { my ($address) = $self->SUPER::unpack('a16', substr $rest, 16*($_-1)) or return; push @addresses, inet6Ntoa($address) } $self->addresses(\@addresses); $self->payload(substr $rest, 16*$hdrExtLen/2); return $self; } sub computeSegmentsLeft { my ($self, $arg) = @_; if (defined($arg)) { if (($arg =~ /^\d$/) && ($arg == 0)) { $IPv6RoutingComputeSegmentsLeft = 0 } else { $IPv6RoutingComputeSegmentsLeft = 1 } } return $IPv6RoutingComputeSegmentsLeft } sub computeLengths { my $self = shift; my $hdrExtLen = 0; $hdrExtLen += 2 for $self->addresses; $self->hdrExtLen($hdrExtLen); if ($IPv6RoutingComputeSegmentsLeft) { my $segmentsLeft = 0; $segmentsLeft += 1 for $self->addresses; $self->segmentsLeft($segmentsLeft); } return 1; } sub encapsulate { my $self = shift; return $self->nextLayer if $self->nextLayer; if ($self->payload) { my $next = $self->nextHeader; return Net::Frame::Layer::IPv6->new(nextHeader=>$self->nextHeader)->encapsulate } return NF_LAYER_NONE; } sub print { my $self = shift; my $l = $self->layer; my $buf = sprintf "$l: nextHeader:0x%02x hdrExtLen:%d routingType:%d\n". "$l: segmentsLeft:%d reserved:%d", $self->nextHeader, $self->hdrExtLen, $self->routingType, $self->segmentsLeft, $self->reserved; for ($self->addresses) { $buf .= sprintf "\n$l: address:%s", $_ } return $buf; } 1; __END__ =head1 NAME Net::Frame::Layer::IPv6::Routing - Internet Protocol v6 Routing Extension Header layer object =head1 SYNOPSIS use Net::Frame::Simple; use Net::Frame::Layer::IPv6::Routing; my $icmp = Net::Frame::Layer::IPv6::Routing->new( nextHeader => NF_IPv6_PROTOCOL_TCP hdrExtLen => 2 routingType => 0, segmentsLeft => 1, reserved => 0, addresses => ['::1'] ); # # Read a raw layer # my $layer = Net::Frame::Layer::IPv6::Routing->new(raw => $raw); print $layer->print."\n"; print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n" if $layer->payload; =head1 DESCRIPTION This modules implements the encoding and decoding of the IPv6 Routing Extension Header layer. RFC: ftp://ftp.rfc-editor.org/in-notes/rfc2460.txt See also B for other attributes and methods. =head1 ATTRIBUTES =over 4 =item B Protocol number of the next header after the Routing header. =item B The length of the Routing header in 8-byte units, not including the first 8 bytes of the header. For a Routing Type of 0, this value is thus two times the number addresses embedded in the header. =item B This field allows multiple routing types to be defined; at present, the only value used is 0. =item B Specifies the number of explicitly-named nodes remaining in the route until the destination. =item B Not used; set to zeroes. =item B A set of IPv6 addresses that specify the route to be used. =back The following are inherited attributes. See B for more information. =over 4 =item B =item B =item B =back =head1 METHODS =over 4 =item B =item B (hash) Object constructor. You can pass attributes that will overwrite default ones. See B for default values. =item B Computes B and B based on number of B. =item B (0 | 1) Disable (0) or enable (1) automatic computing of B by the B method. Default is enabled. =back The following are inherited methods. Some of them may be overridden in this layer, and some others may not be meaningful in this layer. See B for more information. =over 4 =item B =item B =item B =item B =item B =item B =item B =item B =item B =item B =back =head1 CONSTANTS No constants here. =head1 SEE ALSO L =head1 AUTHOR Michael Vincent =head1 COPYRIGHT AND LICENSE Copyright (c) 2012-2017, Michael Vincent You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. =cut Net-Frame-Layer-IPv6-1.08/t000755001750001750 013103614513 14745 5ustar00gomorgomor000000000000Net-Frame-Layer-IPv6-1.08/t/01-use.t000444001750001750 43213103614513 16260 0ustar00gomorgomor000000000000use Test; BEGIN { plan(tests => 1) } use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Fragment; use Net::Frame::Layer::IPv6::Routing; use Net::Frame::Layer::IPv6::HopByHop; use Net::Frame::Layer::IPv6::Option; use Net::Frame::Layer::IPv6::Destination; ok(1); Net-Frame-Layer-IPv6-1.08/t/02-pod-coverage.t000444001750001750 74313103614513 20045 0ustar00gomorgomor000000000000eval "use Test::Pod::Coverage tests => 6"; if ($@) { use Test; plan(tests => 1); skip("Test::Pod::Coverage required for testing"); } else { pod_coverage_ok("Net::Frame::Layer::IPv6"); pod_coverage_ok("Net::Frame::Layer::IPv6::Fragment"); pod_coverage_ok("Net::Frame::Layer::IPv6::Routing"); pod_coverage_ok("Net::Frame::Layer::IPv6::HopByHop"); pod_coverage_ok("Net::Frame::Layer::IPv6::Destination"); pod_coverage_ok("Net::Frame::Layer::IPv6::Option"); } Net-Frame-Layer-IPv6-1.08/t/03-test-pod.t000444001750001750 23113103614513 17222 0ustar00gomorgomor000000000000eval "use Test::Pod 1.00"; if ($@) { use Test; plan(tests => 1); skip("Test::Pod 1.00 required for testing"); } else { all_pod_files_ok(); } Net-Frame-Layer-IPv6-1.08/t/04-layer-create.t000444001750001750 103213103614513 20061 0ustar00gomorgomor000000000000use Test; BEGIN { plan(tests => 1) } use Net::Frame::Layer::IPv6 qw(:consts); use Net::Frame::Layer::IPv6::Fragment; use Net::Frame::Layer::IPv6::Routing; use Net::Frame::Layer::IPv6::HopByHop; use Net::Frame::Layer::IPv6::Option; use Net::Frame::Layer::IPv6::Destination; for my $m (qw( Net::Frame::Layer::IPv6::Fragment Net::Frame::Layer::IPv6::Routing Net::Frame::Layer::IPv6::HopByHop Net::Frame::Layer::IPv6::Option Net::Frame::Layer::IPv6::Destination )) { my $l = $m->new; $l->pack; $l->unpack; } ok(1);