Net::Frame::Layer::IPv6 - Internet Protocol v6 layer object
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;
This modules implements the encoding and decoding of the IPv6 layer.
RFC: ftp://ftp.rfc-editor.org/in-notes/rfc2460.txt
See also Net::Frame::Layer for other attributes and
methods.
- version - 4 bits
- Version of Internet Protocol header.
- trafficClass - 8 bits
- Traffic class field. Was Type of Service in IPv4.
- flowLabel - 20 bits
- Flow label class field. Was IP ID in IPv4.
- nextHeader - 8 bits
- The type of next header. Was protocol in IPv4.
- protocol
- Is an alias for nextHeader.
- payloadLength - 16 bits
- Length in bytes of encapsulated layers (usually, that is layer 4 + layer
7).
- hopLimit - 8 bits
- Was TTL field in IPv4.
- src - 32 bits
- dst - 32 bits
- Source and destination addresses.
The following are inherited attributes. See
Net::Frame::Layer for more information.
- raw
- payload
- nextLayer
- new
- new (hash)
- Object constructor. You can pass attributes that will overwrite default
ones. See SYNOPSIS for default values.
- computeLengths ({ 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).
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 Net::Frame::Layer for more information.
- layer
- computeLengths
- pack
- unpack
- encapsulate
- getLength
- print
- dump
Load them: use Net::Frame::Layer::IPv6 qw(:consts);
- NF_IPv6_PROTOCOL_ICMPv4
- NF_IPv6_PROTOCOL_IGMP
- NF_IPv6_PROTOCOL_IPIP
- NF_IPv6_PROTOCOL_TCP
- NF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TOCOL_IL
- NF_IPv6_PROTOCOL_SDRP
- NF_IPv6_PROTOCOL_IPv6NONEXT
- NF_IPv6_PROTOCOL_IPv6DESTINATION
- NF_IPv6_PROTOCOL_IPv6MOBILITY
- Constants for nextHeader attribute.
Copyright (c) 2006-2015, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic
license. See LICENSE.Artistic file in the source distribution archive.