DNS/RR/ISDN.pm

filter: Statementstmt 100% 43 / 43 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 13 / 13 Podpod 100% 3 / 3 totaltotal 100% 63 / 63 CC 5 SCAR 5.3
CC
5
Cov
100%
address
3.0
sa
3.0
BEGIN
1.0
CRAP 1.7
« DNS/RR/MX.pm ↑ Summary DNS/RR/OPENPGPKEY.pm »
1 package Net::DNS::RR::ISDN;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 our $VERSION = (qw$Id: ISDN.pm 2002 2025-01-07 09:57:46Z willem $)[2];
6  
7 1 ▶use base qw(Net::DNS::RR);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9  
10 =head1 NAME
11  
12 Net::DNS::RR::ISDN - DNS ISDN resource record
13  
14 =cut
15  
16 1 ▶use integer;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use Net::DNS::Text;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20  
21 1 ▶sub _decode_rdata { ## decode rdata from wire-format octet string
Subroutine _decode_rdata: called CC=1 SCAR=0.0
22 1 my ( $self, $data, $offset ) = @_;
23  
24 1 ( $self->{address}, $offset ) = Net::DNS::Text->decode( $data, $offset );
25 1 ( $self->{sa}, $offset ) = Net::DNS::Text->decode( $data, $offset );
26 1 return;
27 }
28  
29  
30 5 ▶sub _encode_rdata { ## encode rdata as wire-format octet string
Subroutine _encode_rdata: called CC=1 SCAR=0.0
31 5 my $self = shift;
32  
33 5 my $address = $self->{address};
34 5 return join '', $address->encode, $self->{sa}->encode;
35 }
36  
37  
38 2 ▶sub _format_rdata { ## format rdata portion of RR string.
Subroutine _format_rdata: called CC=1 SCAR=0.0
39 2 my $self = shift;
40  
41 2 my $address = $self->{address};
42 2 return join ' ', $address->string, $self->{sa}->string;
43 }
44  
45  
46 1 ▶sub _parse_rdata { ## populate RR from rdata in argument list
Subroutine _parse_rdata: called CC=1 SCAR=0.0
47 1 my ( $self, @argument ) = @_;
48  
49 1 $self->address( shift @argument );
50 1 $self->sa(@argument);
51 1 return;
52 }
53  
54  
55 1 ▶sub _defaults { ## specify RR attribute default values
Subroutine _defaults: called CC=1 SCAR=0.0
56 1 my $self = shift;
57  
58 1 $self->sa('');
59 1 return;
60 }
61  
62  
63 6 ▶sub address {
Subroutine address: called CC=3 SCAR=11.0
Pod documented
64 6 my ( $self, @value ) = @_;
65 6 for (@value) { $self->{address} = Net::DNS::Text->new($_) }
66 6 ▶ return $self->{address} ? $self->{address}->value : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->{'address'} ? : 5 1 6
67 }
68  
69  
70 5 ▶sub sa {
Subroutine sa: called CC=3 SCAR=11.0
Pod documented
71 5 my ( $self, @value ) = @_;
72 5 for (@value) { $self->{sa} = Net::DNS::Text->new($_) }
73 5 ▶ return $self->{sa} ? $self->{sa}->value : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->{'sa'} ? : 4 1 5
74 }
75  
76  
77 2 ▶sub ISDNaddress { return &address; }
Subroutine ISDNaddress: called CC=1 SCAR=0.0
Pod documented
78  
79  
80 1 1;
81 __END__
« DNS/RR/MX.pm ↑ Summary DNS/RR/OPENPGPKEY.pm »