line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::L64; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: L64.pm 1896 2023-01-30 12:59:25Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base qw(Net::DNS::RR); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
89
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::L64 - DNS L64 resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
7
|
use integer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
20
|
1
|
|
|
1
|
|
2
|
my ( $self, $data, $offset ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
6
|
@{$self}{qw(preference locator64)} = unpack "\@$offset n a8", $$data; |
|
1
|
|
|
|
|
3
|
|
23
|
1
|
|
|
|
|
2
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
28
|
5
|
|
|
5
|
|
8
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
5
|
|
|
|
|
23
|
return pack 'n a8', $self->{preference}, $self->{locator64}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
35
|
2
|
|
|
2
|
|
3
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
5
|
return join ' ', $self->preference, $self->locator64; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
42
|
1
|
|
|
1
|
|
2
|
my ( $self, @argument ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
3
|
for (qw(preference locator64)) { $self->$_( shift @argument ) } |
|
2
|
|
|
|
|
6
|
|
45
|
1
|
|
|
|
|
3
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub preference { |
50
|
6
|
|
|
6
|
1
|
18
|
my ( $self, @value ) = @_; |
51
|
6
|
|
|
|
|
12
|
for (@value) { $self->{preference} = 0 + $_ } |
|
2
|
|
|
|
|
8
|
|
52
|
6
|
|
100
|
|
|
34
|
return $self->{preference} || 0; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub locator64 { |
57
|
6
|
|
|
6
|
1
|
1105
|
my $self = shift; |
58
|
6
|
|
|
|
|
8
|
my $prfx = shift; |
59
|
|
|
|
|
|
|
|
60
|
6
|
100
|
|
|
|
19
|
$self->{locator64} = pack 'n4', map { hex($_) } split /:/, $prfx if defined $prfx; |
|
8
|
|
|
|
|
24
|
|
61
|
|
|
|
|
|
|
|
62
|
6
|
100
|
|
|
|
50
|
return $self->{locator64} ? sprintf( '%x:%x:%x:%x', unpack 'n4', $self->{locator64} ) : undef; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my $function = sub { ## sort RRs in numerically ascending order. |
67
|
|
|
|
|
|
|
return $Net::DNS::a->{'preference'} <=> $Net::DNS::b->{'preference'}; |
68
|
|
|
|
|
|
|
}; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__PACKAGE__->set_rrsort_func( 'preference', $function ); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__PACKAGE__->set_rrsort_func( 'default_sort', $function ); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
__END__ |