| 1 | # | ||||||||||
| 2 | # $Id: Layer7.pm 2002 2015-02-15 16:50:35Z gomor $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::Packet::Layer7; | ||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | require Net::Packet::Layer; | |||||||||
| 9 | 1 | our @ISA = qw(Net::Packet::Layer); | |||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | use Net::Packet::Consts qw(:layer); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 1 | our @AS = qw( | |||||||||
| 14 | data | ||||||||||
| 15 | ); | ||||||||||
| 16 | 1 | __PACKAGE__->cgBuildIndices; | |||||||||
| 17 | 1 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||
| 18 | |||||||||||
| 19 | 1 | ▶ | no strict 'vars'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub new { shift->SUPER::new(@_) } | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub getLength { | ||||||||
|
Subroutine
getLength: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 24 | 0 | my $self = shift; | |||||||||
| 25 | 0 | ▶ | $self->data ? length($self->data) : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub layer { NP_LAYER_N_7 } | ||||||||
|
Subroutine
layer: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | sub pack { | ||||||||
|
Subroutine
pack: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 31 | 0 | my $self = shift; | |||||||||
| 32 | 0 | ▶ | $self->raw($self->SUPER::pack('a*', $self->data)) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | or return undef; | ||||||||||
| 34 | 0 | 1; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub unpack { | ||||||||
|
Subroutine
unpack: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 38 | 0 | my $self = shift; | |||||||||
| 39 | 0 | ▶ | $self->data($self->SUPER::unpack('a*', $self->raw)) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | or return undef; | ||||||||||
| 41 | 0 | 1; | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 0 | ▶ | sub dump { | ||||||||
|
Subroutine
dump: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 45 | 0 | my $self = shift; | |||||||||
| 46 | |||||||||||
| 47 | 0 | my $l = $self->layer; | |||||||||
| 48 | 0 | my $i = $self->is; | |||||||||
| 49 | 0 | ▶ | sprintf "$l:+$i: %s", $self->SUPER::unpack('H*', $self->data) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | or return undef; | ||||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 0 | ▶ | sub print { | ||||||||
|
Subroutine
print: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 54 | 0 | my $self = shift; | |||||||||
| 55 | |||||||||||
| 56 | 0 | my $l = $self->layer; | |||||||||
| 57 | 0 | my $i = $self->is; | |||||||||
| 58 | 0 | ▶ | sprintf "$l:+$i: dataLength:%d\n". | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | "$l: $i: data: %s", | ||||||||||
| 60 | $self->getLength, $self->SUPER::unpack('H*', $self->data) | ||||||||||
| 61 | or return undef; | ||||||||||
| 62 | } | ||||||||||
| 63 | |||||||||||
| 64 | 1 | 1; | |||||||||
| 65 | |||||||||||
| 66 | __END__ | ||||||||||