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
Net::Packet::Layer(3) User Contributed Perl Documentation Net::Packet::Layer(3)

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

This is the base class for Net::Packet::Layer2, Net::Packet::Layer3, Net::Packet::Layer4 and Net::Packet::Layer7 modules.

It just provides those layers with inheritable attributes and methods.

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.

is
Returns the string describing the layer type (example: 'IPv4').
layer
Returns the string describing the layer number (example: 'L3' for IPv4).
encapsulate
Returns the next layer type (parsed from payload). This is the same string as returned by is method.
computeLengths
computeChecksums
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.
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.
getKey
getKeyReverse
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.
pack
Will pack all attributes into raw network format. This method MUST be implemented into each supported layers.
unpack
Will unpack raw network format to respective attributes. This method MUST be implemented into each supported layers.
getLength
Returns the layer length in bytes.
getPayloadLength
Returns the total length of remaining raw data in bytes (without calling layer length).
isLayer2
isLayer3
isLayer4
isLayer7
Returns true if the calling object is, respectively, layer 2, 3, 4 or 7.

Load them: use Net::Packet::Consts qw(:layer);
NP_LAYER
Base layer string.
NP_LAYER_ETH
NP_LAYER_NULL
NP_LAYER_RAW
NP_LAYER_SLL
Layer 2 strings.
NP_LAYER_ARP
NP_LAYER_IPv4
NP_LAYER_IPv6
NP_LAYER_VLAN
NP_LAYER_PPPoE
NP_LAYER_PPP
NP_LAYER_LLC
Layer 3 strings.
NP_LAYER_TCP
NP_LAYER_UDP
NP_LAYER_ICMPv4
NP_LAYER_PPPLCP
NP_LAYER_CDP
Layer 4 strings.
NP_LAYER_7
Layer 7 string.
NP_LAYER_NONE
NP_LAYER_UNKNOWN
Other strings.
NP_LAYER_N_2
NP_LAYER_N_3
NP_LAYER_N_4
NP_LAYER_N_7
NP_LAYER_N_UNKNOWN
Layer number N strings.

Patrice <GomoR> Auffret

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.

NetPacket, Net::RawIP, Net::RawSock
2009-11-09 perl v5.32.1

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

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