| 1 | # | ||||||||||
| 2 | # $Id: rdata.pm 49 2009-05-31 13:15:34Z VinsWorldcom $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::Frame::Layer::DNS::RR::rdata; | ||||||||||
| 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 | rdata | ||||||||||
| 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 | 0 | ▶ | sub unpack { | ||||||||
|
Subroutine
unpack: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 19 | 0 | my $self = shift; | |||||||||
| 20 | |||||||||||
| 21 | # must include rdlength on calls to DNS::RR::rdata | ||||||||||
| 22 | 0 | ▶ | my ($rdlength, $rdata) = | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | $self->SUPER::unpack('n a*', $self->raw) | ||||||||||
| 24 | or return; | ||||||||||
| 25 | |||||||||||
| 26 | 0 | $self->rdata(CORE::unpack "H*", (substr $rdata, 0, $rdlength)); | |||||||||
| 27 | |||||||||||
| 28 | 0 | $self->payload(substr $self->raw, $rdlength+2); | |||||||||
| 29 | |||||||||||
| 30 | 0 | return $self; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub encapsulate { | ||||||||
|
Subroutine
encapsulate: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 34 | 0 | my $self = shift; | |||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | return $self->nextLayer if $self->nextLayer; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | |||||||||||
| 38 | 0 | ▶ | if ($self->payload) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 0 | return 'DNS::RR'; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 0 | NF_LAYER_NONE; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 0 | ▶ | sub print { | ||||||||
|
Subroutine
print: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 46 | 0 | my $self = shift; | |||||||||
| 47 | |||||||||||
| 48 | 0 | my $l = $self->layer; | |||||||||
| 49 | 0 | my $buf = sprintf | |||||||||
| 50 | "$l: rdata:%s", | ||||||||||
| 51 | $self->rdata; | ||||||||||
| 52 | |||||||||||
| 53 | 0 | return $buf; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 7 | 1; | |||||||||
| 57 | |||||||||||
| 58 | __END__ | ||||||||||