File Coverage

blib/lib/Net/DNS/RR/ISDN.pm
Criterion Covered Total %
statement 41 41 100.0
branch 4 4 100.0
path n/a
condition n/a
subroutine 13 13 100.0
pod 3 3 100.0
total 61 61 100.0


line stmt bran path cond sub pod time code
1               package Net::DNS::RR::ISDN;
2                
3 1       1   5 use strict;
  1           1  
  1           55  
4 1       1   4 use warnings;
  1           2  
  1           73  
5               our $VERSION = (qw$Id: ISDN.pm 2002 2025-01-07 09:57:46Z willem $)[2];
6                
7 1       1   4 use base qw(Net::DNS::RR);
  1           1  
  1           78  
8                
9                
10               =head1 NAME
11                
12               Net::DNS::RR::ISDN - DNS ISDN resource record
13                
14               =cut
15                
16 1       1   3 use integer;
  1           2  
  1           5  
17                
18 1       1   432 use Net::DNS::Text;
  1           3  
  1           338  
19                
20                
21               sub _decode_rdata { ## decode rdata from wire-format octet string
22 1       1   2 my ( $self, $data, $offset ) = @_;
23                
24 1           3 ( $self->{address}, $offset ) = Net::DNS::Text->decode( $data, $offset );
25 1           2 ( $self->{sa}, $offset ) = Net::DNS::Text->decode( $data, $offset );
26 1           2 return;
27               }
28                
29                
30               sub _encode_rdata { ## encode rdata as wire-format octet string
31 5       5   6 my $self = shift;
32                
33 5           7 my $address = $self->{address};
34 5           8 return join '', $address->encode, $self->{sa}->encode;
35               }
36                
37                
38               sub _format_rdata { ## format rdata portion of RR string.
39 2       2   2 my $self = shift;
40                
41 2           2 my $address = $self->{address};
42 2           3 return join ' ', $address->string, $self->{sa}->string;
43               }
44                
45                
46               sub _parse_rdata { ## populate RR from rdata in argument list
47 1       1   2 my ( $self, @argument ) = @_;
48                
49 1           2 $self->address( shift @argument );
50 1           2 $self->sa(@argument);
51 1           2 return;
52               }
53                
54                
55               sub _defaults { ## specify RR attribute default values
56 1       1   2 my $self = shift;
57                
58 1           3 $self->sa('');
59 1           1 return;
60               }
61                
62                
63               sub address {
64 6       6 1 15 my ( $self, @value ) = @_;
65 6           7 for (@value) { $self->{address} = Net::DNS::Text->new($_) }
  2           5  
66 6 100         18 return $self->{address} ? $self->{address}->value : undef;
67               }
68                
69                
70               sub sa {
71 5       5 1 1110 my ( $self, @value ) = @_;
72 5           8 for (@value) { $self->{sa} = Net::DNS::Text->new($_) }
  3           5  
73 5 100         13 return $self->{sa} ? $self->{sa}->value : undef;
74               }
75                
76                
77 2       2 1 864 sub ISDNaddress { return &address; }
78                
79                
80               1;
81               __END__