Net::Packet::Layer4 - base class for all layer 4 modules


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

Index


Code Index:

NAME

Top

Net::Packet::Layer4 - base class for all layer 4 modules

DESCRIPTION

Top

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

It just provides those layers with inheritable attributes and methods.

METHODS

Top

isTcp
isUdp
isIcmpv4

Returns true if Layer4 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: Layer4.pm 1640 2009-11-09 17:58:27Z gomor $
#
package Net::Packet::Layer4;
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_4 }

sub _is      { (shift->is eq shift()) ? 1 : 0 }
sub isTcp    { shift->_is(NP_LAYER_TCP)       }
sub isUdp    { shift->_is(NP_LAYER_UDP)       }
sub isIcmpv4 { shift->_is(NP_LAYER_ICMPv4)    }

1;

__END__