| Net-Packet documentation | Contained in the Net-Packet distribution. |
Net::Packet::Layer2 - base class for all layer 2 modules
This is the base class for Net::Packet::Layer2 subclasses.
It just provides those layers with inheritable attributes and methods.
Returns true if Layer2 is of specified type, false otherwise.
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
| Net-Packet documentation | Contained in the Net-Packet distribution. |
# # $Id: Layer2.pm 1640 2009-11-09 17:58:27Z gomor $ # package Net::Packet::Layer2; use strict; use warnings; require Net::Packet::Layer; our @ISA = qw(Net::Packet::Layer); __PACKAGE__->cgBuildIndices; use Net::Packet::Consts qw(:layer); sub layer { NP_LAYER_N_2 } sub _is { (shift->is eq shift()) ? 1 : 0 } sub isEth { shift->_is(NP_LAYER_ETH) } sub isNull { shift->_is(NP_LAYER_NULL) } sub isRaw { shift->_is(NP_LAYER_RAW) } sub isSll { shift->_is(NP_LAYER_SLL) } 1; __END__