Packet/Layer3.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 46 CC 2 SCAR 9.8
CC
2
Cov
0%
_is
6.0
layer
2.0
isIp
2.0
CRAP 2.7
1 #
2 # $Id: Layer3.pm,v 1.2.2.2 2006/05/25 12:18:19 gomor Exp $
3 #
4 package Net::Packet::Layer3;
5 use strict;
6 use warnings;
7  
8 require Net::Packet::Layer;
9 our @ISA = qw(Net::Packet::Layer);
10 __PACKAGE__->cgBuildIndices;
11  
12 use Net::Packet::Consts qw(:layer);
13  
14 sub layer { NP_LAYER_N_3 }
15  
16 sub _is { (shift->is eq shift()) ? 1 : 0 }
17 sub isIp { my $self = shift; $self->isIpv4 || $self->isIpv6 }
18 sub isIpv4 { shift->_is(NP_LAYER_IPv4) }
19 sub isIpv6 { shift->_is(NP_LAYER_IPv6) }
20 sub isArp { shift->_is(NP_LAYER_ARP) }
21 sub isVlan { shift->_is(NP_LAYER_VLAN) }
22  
23 1;
24  
25 __END__