| 1 | # | ||||||||||
| 2 | # $Id: AAAA.pm 49 2009-05-31 13:15:34Z VinsWorldcom $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::Frame::Layer::DNS::RR::AAAA; | ||||||||||
| 5 | 7 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 7 | ▶ | use Net::Frame::Layer qw(:consts :subs); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 7 | our @ISA = qw(Net::Frame::Layer Exporter); | |||||||||
| 9 | |||||||||||
| 10 | 7 | our @AS = qw( | |||||||||
| 11 | address | ||||||||||
| 12 | ); | ||||||||||
| 13 | 7 | __PACKAGE__->cgBuildIndices; | |||||||||
| 14 | 7 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||
| 15 | |||||||||||
| 16 | 7 | ▶ | use Net::Frame::Layer::DNS; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 19 | shift->SUPER::new( | ||||||||||
| 20 | 1 | address => '::1', | |||||||||
| 21 | @_, | ||||||||||
| 22 | ); | ||||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub getLength { 16 } | ||||||||
|
Subroutine
getLength: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | |||||||||||
| 27 | 2 | ▶ | sub pack { | ||||||||
|
Subroutine
pack: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 28 | 2 | my $self = shift; | |||||||||
| 29 | |||||||||||
| 30 | 2 | ▶ | $self->raw($self->SUPER::pack('a*', | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | inet6Aton($self->address) | ||||||||||
| 32 | )) or return; | ||||||||||
| 33 | |||||||||||
| 34 | 2 | return $self->raw; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub unpack { | ||||||||
|
Subroutine
unpack: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 38 | 0 | my $self = shift; | |||||||||
| 39 | |||||||||||
| 40 | 0 | $self->address(inet6Ntoa(substr $self->raw, 0, 16)); | |||||||||
| 41 | |||||||||||
| 42 | 0 | $self->payload(substr $self->raw, 16); | |||||||||
| 43 | |||||||||||
| 44 | 0 | return $self; | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | sub encapsulate { | ||||||||
|
Subroutine
encapsulate: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 48 | 0 | my $self = shift; | |||||||||
| 49 | |||||||||||
| 50 | 0 | ▶ | return $self->nextLayer if $self->nextLayer; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | if ($self->payload) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 0 | return 'DNS::RR'; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 0 | NF_LAYER_NONE; | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 2 | ▶ | sub print { | ||||||||
|
Subroutine
print: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 60 | 2 | my $self = shift; | |||||||||
| 61 | |||||||||||
| 62 | 2 | my $l = $self->layer; | |||||||||
| 63 | 2 | my $buf = sprintf | |||||||||
| 64 | "$l: address:%s", | ||||||||||
| 65 | $self->address; | ||||||||||
| 66 | |||||||||||
| 67 | 2 | return $buf; | |||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 7 | 1; | |||||||||
| 71 | |||||||||||
| 72 | __END__ | ||||||||||