Net::Packet::Layer2 - base class for all layer 2 modules


Net-Packet documentation Contained in the Net-Packet distribution.

Index


Code Index:

NAME

Top

Net::Packet::Layer2 - base class for all layer 2 modules

DESCRIPTION

Top

This is the base class for Net::Packet::Layer2 subclasses.

It just provides those layers with inheritable attributes and methods.

METHODS

Top

isEth
isNull
isRaw
isSll

Returns true if Layer2 is of specified type, false otherwise.

AUTHOR

Top

Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE

Top

RELATED MODULES

Top


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__