| 1 | # | ||||||||||
| 2 | # $Id: Information.pm 56 2015-01-20 18:55:33Z gomor $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::Frame::Layer::ICMPv4::Information; | ||||||||||
| 5 | 4 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 4 | ▶ | use Net::Frame::Layer qw(:consts :subs); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 4 | our @ISA = qw(Net::Frame::Layer); | |||||||||
| 9 | |||||||||||
| 10 | 4 | our @AS = qw( | |||||||||
| 11 | identifier | ||||||||||
| 12 | sequenceNumber | ||||||||||
| 13 | ); | ||||||||||
| 14 | 4 | __PACKAGE__->cgBuildIndices; | |||||||||
| 15 | 4 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 18 | shift->SUPER::new( | ||||||||||
| 19 | 1 | identifier => getRandom16bitsInt(), | |||||||||
| 20 | sequenceNumber => getRandom16bitsInt(), | ||||||||||
| 21 | @_, | ||||||||||
| 22 | ); | ||||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub getLength { 4 } | ||||||||
|
Subroutine
getLength: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | |||||||||||
| 27 | 1 | ▶ | sub pack { | ||||||||
|
Subroutine
pack: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 28 | 1 | my $self = shift; | |||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | $self->raw($self->SUPER::pack('nn', | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | $self->identifier, $self->sequenceNumber, | ||||||||||
| 32 | )) or return; | ||||||||||
| 33 | |||||||||||
| 34 | 1 | return $self->raw; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 1 | ▶ | sub unpack { | ||||||||
|
Subroutine
unpack: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 38 | 1 | my $self = shift; | |||||||||
| 39 | |||||||||||
| 40 | 1 | ▶ | my ($identifier, $sequenceNumber, $payload) = | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | $self->SUPER::unpack('nn a*', $self->raw) | ||||||||||
| 42 | or return; | ||||||||||
| 43 | |||||||||||
| 44 | 1 | $self->identifier($identifier); | |||||||||
| 45 | 1 | $self->sequenceNumber($sequenceNumber); | |||||||||
| 46 | 1 | $self->payload($payload); | |||||||||
| 47 | |||||||||||
| 48 | 1 | return $self; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 1 | ▶ | sub print { | ||||||||
|
Subroutine
print: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 52 | 1 | my $self = shift; | |||||||||
| 53 | |||||||||||
| 54 | 1 | my $l = $self->layer; | |||||||||
| 55 | 1 | sprintf "$l: identifier:%d sequenceNumber:%d", | |||||||||
| 56 | $self->identifier, $self->sequenceNumber; | ||||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 4 | 1; | |||||||||
| 60 | |||||||||||
| 61 | __END__ | ||||||||||