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.
- raw
- Stores the raw layer (as captured from the network, or packed to send to
network).
- payload
- Stores what is not part of the layer, that is the encapsulated part to be
decoded by upper layers.
- nextLayer
- User definable next layer. It may be used to define custom protocols.
- new
- new (hash)
- Object constructor.
- layer
- Returns the string describing the layer (example: 'IPv4' for a
Net::Frame::Layer::IPv4 object).
- computeLengths
- computeChecksums
- 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.
- pack
- 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.
- unpack
- Unpacks raw data from network and stores attributes into the object.
Returns $self on success,
undef otherwise.
- encapsulate
- Returns the next layer type (parsed from payload). This is the same string
as returned by layer method.
- getLength
- Returns the layer length in bytes.
- getPayloadLength
- Returns the length of layer's payload in bytes.
- print
- Just returns a string in a human readable format describing attributes
found in the layer.
- dump
- Just returns a string in hexadecimal format which is how the layer appears
on the network.
Copyright (c) 2006-2019, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic
license. See LICENSE.Artistic file in the source distribution archive.