| 1 | # | ||||||||||
| 2 | # $Id: Report.pm 49 2009-05-31 13:15:34Z VinsWorldcom $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::Frame::Layer::ICMPv6::MLD::Report; | ||||||||||
| 5 | 5 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 5 | ▶ | use Net::Frame::Layer qw(:consts :subs); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 5 | our @ISA = qw(Net::Frame::Layer); | |||||||||
| 9 | |||||||||||
| 10 | 5 | our @AS = qw( | |||||||||
| 11 | reserved | ||||||||||
| 12 | numGroupRecs | ||||||||||
| 13 | ); | ||||||||||
| 14 | 5 | __PACKAGE__->cgBuildIndices; | |||||||||
| 15 | 5 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||
| 16 | |||||||||||
| 17 | 2 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 18 | shift->SUPER::new( | ||||||||||
| 19 | 2 | reserved => 0, | |||||||||
| 20 | numGroupRecs => 0, | ||||||||||
| 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 | ▶ | my $raw = $self->SUPER::pack('nn', | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | $self->reserved, | ||||||||||
| 32 | $self->numGroupRecs | ||||||||||
| 33 | ) or return; | ||||||||||
| 34 | |||||||||||
| 35 | 1 | return $self->raw($raw); | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 1 | ▶ | sub unpack { | ||||||||
|
Subroutine
unpack: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 39 | 1 | my $self = shift; | |||||||||
| 40 | |||||||||||
| 41 | 1 | ▶ | my ($reserved, $numGroupRecs, $payload) = | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | $self->SUPER::unpack('nn a*', $self->raw) | ||||||||||
| 43 | or return; | ||||||||||
| 44 | |||||||||||
| 45 | 1 | $self->reserved($reserved); | |||||||||
| 46 | 1 | $self->numGroupRecs($numGroupRecs); | |||||||||
| 47 | |||||||||||
| 48 | 1 | $self->payload($payload); | |||||||||
| 49 | |||||||||||
| 50 | 1 | return $self; | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 1 | ▶ | sub encapsulate { | ||||||||
|
Subroutine
encapsulate: called CC=3 SCAR=12.0
Pod
documented
| |||||||||||
| 54 | 1 | my $self = shift; | |||||||||
| 55 | |||||||||||
| 56 | 1 | ▶ | return $self->nextLayer if $self->nextLayer; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | |||||||||||
| 58 | 1 | ▶ | if ($self->payload) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 0 | return 'ICMPv6::MLD::Report::Record'; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | 1 | NF_LAYER_NONE; | |||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 3 | ▶ | sub print { | ||||||||
|
Subroutine
print: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 66 | 3 | my $self = shift; | |||||||||
| 67 | |||||||||||
| 68 | 3 | my $l = $self->layer; | |||||||||
| 69 | 3 | my $buf .= sprintf | |||||||||
| 70 | "$l: reserved:%d numGroupRecs:%d", | ||||||||||
| 71 | $self->reserved, $self->numGroupRecs; | ||||||||||
| 72 | |||||||||||
| 73 | 3 | return $buf; | |||||||||
| 74 | } | ||||||||||
| 75 | |||||||||||
| 76 | 5 | 1; | |||||||||
| 77 | |||||||||||
| 78 | __END__ | ||||||||||