GSP
Quick Navigator

Search Site

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

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


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

.ds Aq ’

NAME

Net::Packet::Layer - base class for all layer modules

CONTENTS

DESCRIPTION

This is the base class for <B>Net::Packet::Layer2B>, <B>Net::Packet::Layer3B>, <B>Net::Packet::Layer4B> and <B>Net::Packet::Layer7B> modules.

It just provides those layers with inheritable attributes and methods.

ATTRIBUTES

<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.

METHODS

<B>isB> Returns the string describing the layer type (example: ’IPv4’).
<B>layerB> Returns the string describing the layer number (example: ’L3’ for IPv4).
<B>encapsulateB> Returns the next layer type (parsed from payload). This is the same string as returned by <B>isB> method.
<B>computeLengthsB>
<B>computeChecksumsB> Generally, when a layer is built, some attributes are not yet known until the full Net::Packet::Frame is assembled. Those methods computes various lengths and checksums attributes found in a specific layer. Return 1 on success, undef otherwise.
<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.
<B>getKeyB>
<B>getKeyReverseB> These methods are used to respectively store and retrieve analyzed frames respectively to and from a hashref. This is to make it quick to get possible responses from a probe.
<B>packB> Will pack all attributes into raw network format. This method MUST be implemented into each supported layers.
<B>unpackB> Will unpack raw network format to respective attributes. This method MUST be implemented into each supported layers.
<B>getLengthB> Returns the layer length in bytes.
<B>getPayloadLengthB> Returns the total length of remaining raw data in bytes (without calling layer length).
<B>isLayer2B>
<B>isLayer3B>
<B>isLayer4B>
<B>isLayer7B> Returns true if the calling object is, respectively, layer 2, 3, 4 or 7.

CONSTANTS

Load them: use Net::Packet::Consts qw(:layer);
<B>NP_LAYERB> Base layer string.
<B>NP_LAYER_ETHB>
<B>NP_LAYER_NULLB>
<B>NP_LAYER_RAWB>
<B>NP_LAYER_SLLB> Layer 2 strings.
<B>NP_LAYER_ARPB>
<B>NP_LAYER_IPv4B>
<B>NP_LAYER_IPv6B>
<B>NP_LAYER_VLANB>
<B>NP_LAYER_PPPoEB>
<B>NP_LAYER_PPPB>
<B>NP_LAYER_LLCB> Layer 3 strings.
<B>NP_LAYER_TCPB>
<B>NP_LAYER_UDPB>
<B>NP_LAYER_ICMPv4B>
<B>NP_LAYER_PPPLCPB>
<B>NP_LAYER_CDPB> Layer 4 strings.
<B>NP_LAYER_7B> Layer 7 string.
<B>NP_LAYER_NONEB>
<B>NP_LAYER_UNKNOWNB> Other strings.
<B>NP_LAYER_N_2B>
<B>NP_LAYER_N_3B>
<B>NP_LAYER_N_4B>
<B>NP_LAYER_N_7B>
<B>NP_LAYER_N_UNKNOWNB> Layer number N strings.

AUTHOR

Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE

Copyright (c) 2004-2009, Patrice <GomoR> Auffret

You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.

RELATED MODULES

NetPacket, Net::RawIP, Net::RawSock
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::PACKET::LAYER (3) 2009-11-09

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