line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::L32; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: L32.pm 1896 2023-01-30 12:59:25Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base qw(Net::DNS::RR); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
90
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::L32 - DNS L32 resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
7
|
use integer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
20
|
1
|
|
|
1
|
|
2
|
my ( $self, $data, $offset ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
5
|
@{$self}{qw(preference locator32)} = unpack "\@$offset n a4", $$data; |
|
1
|
|
|
|
|
3
|
|
23
|
1
|
|
|
|
|
2
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
28
|
5
|
|
|
5
|
|
37
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
5
|
|
|
|
|
22
|
return pack 'n a4', $self->{preference}, $self->{locator32}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
35
|
2
|
|
|
2
|
|
4
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
5
|
return join ' ', $self->preference, $self->locator32; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
42
|
1
|
|
|
1
|
|
3
|
my ( $self, @argument ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
3
|
for (qw(preference locator32)) { $self->$_( shift @argument ) } |
|
2
|
|
|
|
|
6
|
|
45
|
1
|
|
|
|
|
3
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub preference { |
50
|
6
|
|
|
6
|
1
|
17
|
my ( $self, @value ) = @_; |
51
|
6
|
|
|
|
|
12
|
for (@value) { $self->{preference} = 0 + $_ } |
|
2
|
|
|
|
|
7
|
|
52
|
6
|
|
100
|
|
|
31
|
return $self->{preference} || 0; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub locator32 { |
57
|
6
|
|
|
6
|
1
|
804
|
my $self = shift; |
58
|
6
|
|
|
|
|
10
|
my $prfx = shift; |
59
|
|
|
|
|
|
|
|
60
|
6
|
100
|
|
|
|
22
|
$self->{locator32} = pack 'C* @4', split /\./, $prfx if defined $prfx; |
61
|
|
|
|
|
|
|
|
62
|
6
|
100
|
|
|
|
62
|
return $self->{locator32} ? join( '.', unpack 'C4', $self->{locator32} ) : 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__ |