Net::Frame::Layer - base class for all layer objects
This is the base class for all other layer modules. It provides those layers with inheritable attributes, methods, constants and useful subroutines.
Stores the raw layer (as captured from the network, or packed to send to network).
Stores what is not part of the layer, that is the encapsulated part to be decoded by upper layers.
User definable next layer. It may be used to define custom protocols.
Returns the string describing the layer (example: 'IPv4' for a Net::Frame::Layer::IPv4 object).
Generally, when a layer is built, some attributes are not yet known until all layers that will be assembled are known. Those methods computes various lengths and checksums attributes found in a specific layer. Return 1 on success, undef otherwise. The usage depends from layer to layer, so see related documentation.
Also note that in most cases, you will need to call computeLength before computeChecksums, because checksums may depend upon lengths.
Packs all attributes into a raw format, in order to inject to network. Returns the raw packed string on success, undef otherwise. Result is stored into raw attribute.
Unpacks raw data from network and stores attributes into the object. Returns $self on success, undef otherwise.
Returns the next layer type (parsed from payload). This is the same string as returned by layer method.
Returns the layer length in bytes.
Returns the length of layer's payload in bytes.
Just returns a string in a human readable format describing attributes found in the layer.
Just returns a string in hexadecimal format which is how the layer appears on the network.
Load them: use Net::Frame::Layer qw(:subs);
Resolves IPv4 address of specified hostname.
Same as above, but returns an array of IPv4 addresses.
Resolves IPv6 address of specified hostname.
Takes IPv6 address and returns the network form.
Takes IPv6 address in network format, and returns the IPv6 human form.
Same as for IPv6, but for IPv4 addresses.
Takes a MAC address from network form, and returns the human form.
Returns respectively a random 16 bits integer, and a random 32 bits integer.
Returns a random high port (> 1024).
Will take a frame in pseudo header format, and compute the INET checksum.
Load them: use Net::Frame::Layer qw(:consts);
Patrice <GomoR> Auffret
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.