DNS/RR/DSYNC.pm

filter: Statementstmt 100% 54 / 54 Branchbran 100% 4 / 4 Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 14 / 14 Podpod 100% 4 / 4 totaltotal 100% 82 / 82 CC 10 SCAR 7.6
CC
10
Cov
100%
rrtype
3.0
scheme
3.0
port
3.0
CRAP 2.1
« DNS/RR/SRV.pm ↑ Summary DNS/RR/SMIMEA.pm »
1 package Net::DNS::RR::DSYNC;
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: DSYNC.pm 2003 2025-01-21 12:06:06Z 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::DSYNC - DNS DSYNC resource record
13  
14 =cut
15  
16 1 ▶use integer;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use Net::DNS::Parameters qw(:type);
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Net::DNS::DomainName;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21  
22 1 ▶sub _decode_rdata { ## decode rdata from wire-format octet string
Subroutine _decode_rdata: called CC=1 SCAR=0.0
23 1 my ( $self, $data, $offset, @opaque ) = @_;
24  
25 1 @{$self}{qw(rrtype scheme port)} = unpack "\@$offset nCn", $$data;
26 1 $self->{target} = Net::DNS::DomainName->decode( $data, $offset + 5, @opaque );
27 1 return;
28 }
29  
30  
31 5 ▶sub _encode_rdata { ## encode rdata as wire-format octet string
Subroutine _encode_rdata: called CC=1 SCAR=0.0
32 5 my $self = shift;
33  
34 5 my $target = $self->{target};
35 5 return pack 'nCn a*', @{$self}{qw(rrtype scheme port)}, $target->encode;
36 }
37  
38  
39 3 ▶sub _format_rdata { ## format rdata portion of RR string.
Subroutine _format_rdata: called CC=1 SCAR=0.0
40 3 my $self = shift;
41  
42 3 my @params = map { $self->$_ } qw(rrtype scheme port);
43 3 my $target = $self->{target};
44 3 return ( @params, $target->string );
45 }
46  
47  
48 2 ▶sub _parse_rdata { ## populate RR from rdata in argument list
Subroutine _parse_rdata: called CC=2 SCAR=6.9
49 2 my ( $self, @argument ) = @_;
50  
51 2 $self->$_( shift @argument ) foreach qw(rrtype scheme port target);
52 2 return;
53 }
54  
55  
56 8 ▶sub rrtype {
Subroutine rrtype: called CC=3 SCAR=11.0
Pod documented
57 8 my ( $self, @value ) = @_;
58 8 for (@value) { $self->{rrtype} = typebyname($_) }
59 8 my $typecode = $self->{rrtype};
60 8 ▶ return defined $typecode ? typebyval($typecode) : undef;
Branch: 1 branch
BranchTrueFalseTotal
defined $typecode ? : 7 1 8
61 }
62  
63  
64 8 ▶sub scheme {
Subroutine scheme: called CC=3 SCAR=11.0
Pod documented
65 8 my ( $self, @value ) = @_;
66 8 for (@value) { $self->{scheme} = 0 + $_ }
67 8 ▶ return $self->{scheme} || 0;
Condition100%2/2
$self->{'scheme'} || 0
l!l
71
MC/DC100%1/1
$self->{'scheme'} || 0
$self->{'scheme'}
Truth table100%2/2
A
A= $self->{'scheme'}
Aresult
11
00
68 }
69  
70  
71 8 ▶sub port {
Subroutine port: called CC=3 SCAR=11.0
Pod documented
72 8 my ( $self, @value ) = @_;
73 8 for (@value) { $self->{port} = 0 + $_ }
74 8 ▶ return $self->{port} || 0;
Condition100%2/2
$self->{'port'} || 0
l!l
71
MC/DC100%1/1
$self->{'port'} || 0
$self->{'port'}
Truth table100%2/2
A
A= $self->{'port'}
Aresult
11
00
75 }
76  
77  
78 5 ▶sub target {
Subroutine target: called CC=3 SCAR=11.0
Pod documented
79 5 my ( $self, @value ) = @_;
80 5 for (@value) { $self->{target} = Net::DNS::DomainName->new($_) }
81 5 ▶ return $self->{target} ? $self->{target}->name : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->{'target'} ? : 4 1 5
82 }
83  
84  
85 1 1;
86 __END__
« DNS/RR/SRV.pm ↑ Summary DNS/RR/SMIMEA.pm »