Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  NET::FRAME::LAYER (3)

.ds Aq ’


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.


<B>rawB> Stores the raw layer (as captured from the network, or packed to send to network).
<B>payloadB> Stores what is not part of the layer, that is the encapsulated part to be decoded by upper layers.
<B>nextLayerB> User definable next layer. It may be used to define custom protocols.


<B>newB> (hash) Object constructor.
<B>layerB> Returns the string describing the layer (example: ’IPv4’ for a <B>Net::Frame::Layer::IPv4B> object).
<B>computeChecksumsB> 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 <B>computeLengthB> before <B>computeChecksumsB>, because checksums may depend upon lengths.

<B>packB> 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 <B>rawB> attribute.
<B>unpackB> Unpacks raw data from network and stores attributes into the object. Returns <B>B>$self<B>B> on success, undef otherwise.
<B>encapsulateB> Returns the next layer type (parsed from payload). This is the same string as returned by <B>layerB> method.
<B>getLengthB> Returns the layer length in bytes.
<B>getPayloadLengthB> Returns the length of layer’s payload in bytes.
<B>printB> Just returns a string in a human readable format describing attributes found in the layer.
<B>dumpB> Just returns a string in hexadecimal format which is how the layer appears on the network.


Load them: use Net::Frame::Layer qw(:subs);
<B>getHostIpv4AddrB> (hostname) Resolves IPv4 address of specified hostname.
<B>getHostIpv4AddrsB> (hostname) Same as above, but returns an array of IPv4 addresses.
<B>getHostIpv6AddrB> (hostname) Resolves IPv6 address of specified hostname.
<B>inet6AtonB> (IPv6 address) Takes IPv6 address and returns the network form.
<B>inet6NtoaB> (IPv6 network form) Takes IPv6 address in network format, and returns the IPv6 human form.
<B>inetAtonB> (IPv4 address)
<B>inetNtoaB> (IPv4 network form) Same as for IPv6, but for IPv4 addresses.
<B>convertMacB> (MAC network form) Takes a MAC address from network form, and returns the human form.
<B>getRandom32bitsIntB> Returns respectively a random 16 bits integer, and a random 32 bits integer.
<B>getRandomHighPortB> Returns a random high port (> 1024).
<B>inetChecksumB> (pseudo header format) 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.

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 NET::FRAME::LAYER (3) 2015-11-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.