NAME

Net::Frame::Layer::GRE - Generic Route Encapsulation layer object

SYNOPSIS

use Net::Frame::Layer::GRE qw(:consts);

# Build a layer
my $layer = Net::Frame::Layer::GRE->new(
   flags    => 0,
   protocol => NF_GRE_TYPE_IPv4,
);
$layer->pack;

print 'RAW: '.$layer->dump."\n";

# Read a raw layer
my $layer = Net::Frame::Layer::GRE->new(raw => $raw);
$layer->unpack;

print $layer->print."\n";
print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
   if $layer->payload;

DESCRIPTION

This modules implements the encoding and decoding of the Generic Route Encapsulation layer.

See also Net::Frame::Layer for other attributes and methods.

ATTRIBUTES

flags - 16 bits

GRE header flags.

protocol - 16 bits

Encapsulated protocol.

The following are inherited attributes. See Net::Frame::Layer for more information.

raw
payload
nextLayer

METHODS

new
new (hash)

Object constructor. You can pass attributes that will overwrite default ones. See SYNOPSIS for default values.

The following are inherited methods. Some of them may be overriden in this layer, and some others may not be meaningful in this layer. See Net::Frame::Layer for more information.

layer
computeLengths
computeChecksums
pack
unpack
encapsulate
getLength
getPayloadLength
print
dump

CONSTANTS

Load them: use Net::Frame::Layer::GRE qw(:consts);

NF_GRE_TYPE_IPv4
NF_GRE_TYPE_X25
NF_GRE_TYPE_ARP
NF_GRE_TYPE_CGMP
NF_GRE_TYPE_80211
NF_GRE_TYPE_PPPIPCP
NF_GRE_TYPE_RARP
NF_GRE_TYPE_DDP
NF_GRE_TYPE_AARP
NF_GRE_TYPE_PPPCCP
NF_GRE_TYPE_WCP
NF_GRE_TYPE_8021Q
NF_GRE_TYPE_IPX
NF_GRE_TYPE_STP
NF_GRE_TYPE_IPv6
NF_GRE_TYPE_WLCCP
NF_GRE_TYPE_MPLS
NF_GRE_TYPE_PPPoED
NF_GRE_TYPE_PPPoES
NF_GRE_TYPE_8021X
NF_GRE_TYPE_AoE
NF_GRE_TYPE_80211I
NF_GRE_TYPE_LLDP
NF_GRE_TYPE_LLTD
NF_GRE_TYPE_LOOP
NF_GRE_TYPE_VLAN
NF_GRE_TYPE_PPPPAP
NF_GRE_TYPE_PPPCHAP

Various supported encapsulated layer types.

SEE ALSO

Net::Frame::Layer

AUTHOR

Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE

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.