← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Sun Nov 5 02:36:06 2017
Reported on Sun Nov 5 02:56:23 2017

Filename/usr/local/lib/perl5/site_perl/Net/DNS/RR/OPT.pm
StatementsExecuted 55136 statements in 354ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
196811148ms267msNet::DNS::RR::OPT::::encode Net::DNS::RR::OPT::encode
39362262.3ms62.3msNet::DNS::RR::OPT::::size Net::DNS::RR::OPT::size
19681138.2ms38.2msNet::DNS::RR::OPT::::_encode_rdata Net::DNS::RR::OPT::_encode_rdata
19681126.5ms26.5msNet::DNS::RR::OPT::::_specified Net::DNS::RR::OPT::_specified
19681115.3ms15.3msNet::DNS::RR::OPT::::rcode Net::DNS::RR::OPT::rcode
19681114.9ms14.9msNet::DNS::RR::OPT::::flags Net::DNS::RR::OPT::flags
19681114.3ms14.3msNet::DNS::RR::OPT::::version Net::DNS::RR::OPT::version
1969216.62ms6.62msNet::DNS::RR::OPT::::CORE:pack Net::DNS::RR::OPT::CORE:pack (opcode)
1111.46ms1.87msNet::DNS::RR::OPT::CLIENT_SUBNET::::BEGIN@241Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@241
111934µs1.39msNet::DNS::RR::OPT::CLIENT_SUBNET::::BEGIN@240Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240
11150µs63µsNet::DNS::RR::OPT::::BEGIN@9 Net::DNS::RR::OPT::BEGIN@9
11136µs221µsNet::DNS::RR::OPT::::BEGIN@25 Net::DNS::RR::OPT::BEGIN@25
11131µs208µsNet::DNS::RR::OPT::::BEGIN@27 Net::DNS::RR::OPT::BEGIN@27
11131µs553µsNet::DNS::RR::OPT::DHU::::BEGIN@233 Net::DNS::RR::OPT::DHU::BEGIN@233
11128µs424µsNet::DNS::RR::OPT::N3U::::BEGIN@236 Net::DNS::RR::OPT::N3U::BEGIN@236
11126µs33µsNet::DNS::RR::OPT::::BEGIN@20 Net::DNS::RR::OPT::BEGIN@20
11126µs230µsNet::DNS::RR::OPT::::BEGIN@22 Net::DNS::RR::OPT::BEGIN@22
11125µs264µsNet::DNS::RR::OPT::::BEGIN@11 Net::DNS::RR::OPT::BEGIN@11
11124µs63µsNet::DNS::RR::OPT::::BEGIN@10 Net::DNS::RR::OPT::BEGIN@10
11123µs742µsNet::DNS::RR::OPT::::BEGIN@23 Net::DNS::RR::OPT::BEGIN@23
11116µs16µsNet::DNS::RR::OPT::CHAIN::::BEGIN@325 Net::DNS::RR::OPT::CHAIN::BEGIN@325
0000s0sNet::DNS::RR::OPT::CHAIN::::_compose Net::DNS::RR::OPT::CHAIN::_compose
0000s0sNet::DNS::RR::OPT::CHAIN::::_decompose Net::DNS::RR::OPT::CHAIN::_decompose
0000s0sNet::DNS::RR::OPT::CHAIN::::_image Net::DNS::RR::OPT::CHAIN::_image
0000s0sNet::DNS::RR::OPT::CLIENT_SUBNET::::_composeNet::DNS::RR::OPT::CLIENT_SUBNET::_compose
0000s0sNet::DNS::RR::OPT::CLIENT_SUBNET::::_decomposeNet::DNS::RR::OPT::CLIENT_SUBNET::_decompose
0000s0sNet::DNS::RR::OPT::CLIENT_SUBNET::::_imageNet::DNS::RR::OPT::CLIENT_SUBNET::_image
0000s0sNet::DNS::RR::OPT::COOKIE::::_compose Net::DNS::RR::OPT::COOKIE::_compose
0000s0sNet::DNS::RR::OPT::COOKIE::::_decompose Net::DNS::RR::OPT::COOKIE::_decompose
0000s0sNet::DNS::RR::OPT::DAU::::_compose Net::DNS::RR::OPT::DAU::_compose
0000s0sNet::DNS::RR::OPT::DAU::::_decompose Net::DNS::RR::OPT::DAU::_decompose
0000s0sNet::DNS::RR::OPT::DAU::::_image Net::DNS::RR::OPT::DAU::_image
0000s0sNet::DNS::RR::OPT::EXPIRE::::_compose Net::DNS::RR::OPT::EXPIRE::_compose
0000s0sNet::DNS::RR::OPT::EXPIRE::::_decompose Net::DNS::RR::OPT::EXPIRE::_decompose
0000s0sNet::DNS::RR::OPT::EXPIRE::::_image Net::DNS::RR::OPT::EXPIRE::_image
0000s0sNet::DNS::RR::OPT::KEY_TAG::::_compose Net::DNS::RR::OPT::KEY_TAG::_compose
0000s0sNet::DNS::RR::OPT::KEY_TAG::::_decompose Net::DNS::RR::OPT::KEY_TAG::_decompose
0000s0sNet::DNS::RR::OPT::KEY_TAG::::_image Net::DNS::RR::OPT::KEY_TAG::_image
0000s0sNet::DNS::RR::OPT::PADDING::::_compose Net::DNS::RR::OPT::PADDING::_compose
0000s0sNet::DNS::RR::OPT::PADDING::::_decompose Net::DNS::RR::OPT::PADDING::_decompose
0000s0sNet::DNS::RR::OPT::PADDING::::_image Net::DNS::RR::OPT::PADDING::_image
0000s0sNet::DNS::RR::OPT::TCP_KEEPALIVE::::_composeNet::DNS::RR::OPT::TCP_KEEPALIVE::_compose
0000s0sNet::DNS::RR::OPT::TCP_KEEPALIVE::::_decomposeNet::DNS::RR::OPT::TCP_KEEPALIVE::_decompose
0000s0sNet::DNS::RR::OPT::TCP_KEEPALIVE::::_imageNet::DNS::RR::OPT::TCP_KEEPALIVE::_image
0000s0sNet::DNS::RR::OPT::::_decode_rdata Net::DNS::RR::OPT::_decode_rdata
0000s0sNet::DNS::RR::OPT::::_format_option Net::DNS::RR::OPT::_format_option
0000s0sNet::DNS::RR::OPT::::_get_option Net::DNS::RR::OPT::_get_option
0000s0sNet::DNS::RR::OPT::::_set_option Net::DNS::RR::OPT::_set_option
0000s0sNet::DNS::RR::OPT::::class Net::DNS::RR::OPT::class
0000s0sNet::DNS::RR::OPT::::option Net::DNS::RR::OPT::option
0000s0sNet::DNS::RR::OPT::::options Net::DNS::RR::OPT::options
0000s0sNet::DNS::RR::OPT::::string Net::DNS::RR::OPT::string
0000s0sNet::DNS::RR::OPT::::ttl Net::DNS::RR::OPT::ttl
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Net::DNS::RR::OPT;
2
3#
4# $Id: OPT.pm 1578 2017-06-20 12:49:23Z willem $
5#
612µsour $VERSION = (qw$LastChangedRevision: 1578 $)[1];
7
8
9268µs275µs
# spent 63µs (50+12) within Net::DNS::RR::OPT::BEGIN@9 which was called: # once (50µs+12µs) by Net::DNS::RR::_subclass at line 9
use strict;
# spent 63µs making 1 call to Net::DNS::RR::OPT::BEGIN@9 # spent 12µs making 1 call to strict::import
10273µs2102µs
# spent 63µs (24+39) within Net::DNS::RR::OPT::BEGIN@10 which was called: # once (24µs+39µs) by Net::DNS::RR::_subclass at line 10
use warnings;
# spent 63µs making 1 call to Net::DNS::RR::OPT::BEGIN@10 # spent 39µs making 1 call to warnings::import
11289µs2504µs
# spent 264µs (25+239) within Net::DNS::RR::OPT::BEGIN@11 which was called: # once (25µs+239µs) by Net::DNS::RR::_subclass at line 11
use base qw(Net::DNS::RR);
# spent 264µs making 1 call to Net::DNS::RR::OPT::BEGIN@11 # spent 239µs making 1 call to base::import
12
13=head1 NAME
14
15Net::DNS::RR::OPT - DNS OPT resource record
16
17=cut
18
19
20274µs240µs
# spent 33µs (26+7) within Net::DNS::RR::OPT::BEGIN@20 which was called: # once (26µs+7µs) by Net::DNS::RR::_subclass at line 20
use integer;
# spent 33µs making 1 call to Net::DNS::RR::OPT::BEGIN@20 # spent 7µs making 1 call to integer::import
21
22262µs2435µs
# spent 230µs (26+204) within Net::DNS::RR::OPT::BEGIN@22 which was called: # once (26µs+204µs) by Net::DNS::RR::_subclass at line 22
use Carp;
# spent 230µs making 1 call to Net::DNS::RR::OPT::BEGIN@22 # spent 204µs making 1 call to Exporter::import
232115µs21.46ms
# spent 742µs (23+719) within Net::DNS::RR::OPT::BEGIN@23 which was called: # once (23µs+719µs) by Net::DNS::RR::_subclass at line 23
use Net::DNS::Parameters;
# spent 742µs making 1 call to Net::DNS::RR::OPT::BEGIN@23 # spent 719µs making 1 call to Exporter::import
24
252110µs3406µs
# spent 221µs (36+185) within Net::DNS::RR::OPT::BEGIN@25 which was called: # once (36µs+185µs) by Net::DNS::RR::_subclass at line 25
use constant CLASS_TTL_RDLENGTH => length pack 'n N n', (0) x 3;
# spent 221µs making 1 call to Net::DNS::RR::OPT::BEGIN@25 # spent 176µs making 1 call to constant::import # spent 9µs making 1 call to Net::DNS::RR::OPT::CORE:pack
26
2722.74ms3384µs
# spent 208µs (31+177) within Net::DNS::RR::OPT::BEGIN@27 which was called: # once (31µs+177µs) by Net::DNS::RR::_subclass at line 27
use constant OPT => typebyname qw(OPT);
# spent 208µs making 1 call to Net::DNS::RR::OPT::BEGIN@27 # spent 169µs making 1 call to constant::import # spent 8µs making 1 call to Net::DNS::Parameters::typebyname
28
29
30sub _decode_rdata { ## decode rdata from wire-format octet string
31 my $self = shift;
32 my ( $data, $offset ) = @_;
33
34 my $index = $offset - CLASS_TTL_RDLENGTH; # OPT redefines class and TTL fields
35 @{$self}{qw(size rcode version flags)} = unpack "\@$index n C2 n", $$data;
36 @{$self}{rcode} = @{$self}{rcode} << 4;
37 delete @{$self}{qw(class ttl)};
38
39 my $limit = $offset + $self->{rdlength} - 4;
40
41 while ( $offset <= $limit ) {
42 my ( $code, $length ) = unpack "\@$offset nn", $$data;
43 my $value = unpack "\@$offset x4 a$length", $$data;
44 $self->{option}{$code} = $value;
45 $offset += $length + 4;
46 }
47}
48
49
50
# spent 38.2ms within Net::DNS::RR::OPT::_encode_rdata which was called 1968 times, avg 19µs/call: # 1968 times (38.2ms+0s) by Net::DNS::RR::OPT::encode at line 61, avg 19µs/call
sub _encode_rdata { ## encode rdata as wire-format octet string
5119683.68ms my $self = shift;
52
5319689.25ms my $option = $self->{option} || {};
54196830.9ms join '', map pack( 'nna*', $_, length $option->{$_}, $option->{$_} ), keys %$option;
55}
56
57
58
# spent 267ms (148+120) within Net::DNS::RR::OPT::encode which was called 1968 times, avg 136µs/call: # 1968 times (148ms+120ms) by Net::DNS::Packet::encode at line 205 of Net/DNS/Packet.pm, avg 136µs/call
sub encode { ## overide RR method
5919683.91ms my $self = shift;
60
61196814.3ms196838.2ms my $data = $self->_encode_rdata;
# spent 38.2ms making 1968 calls to Net::DNS::RR::OPT::_encode_rdata, avg 19µs/call
62196813.2ms196830.5ms my $size = $self->size;
# spent 30.5ms making 1968 calls to Net::DNS::RR::OPT::size, avg 15µs/call
63196839.4ms590444.5ms my @xttl = ( $self->rcode >> 4, $self->version, $self->flags );
# spent 15.3ms making 1968 calls to Net::DNS::RR::OPT::rcode, avg 8µs/call # spent 14.9ms making 1968 calls to Net::DNS::RR::OPT::flags, avg 8µs/call # spent 14.3ms making 1968 calls to Net::DNS::RR::OPT::version, avg 7µs/call
64196842.1ms19686.61ms pack 'C n n C2n n a*', 0, OPT, $size, @xttl, length($data), $data;
# spent 6.61ms making 1968 calls to Net::DNS::RR::OPT::CORE:pack, avg 3µs/call
65}
66
67
68sub string { ## overide RR method
69 my $self = shift;
70
71 my $edns = $self->version;
72 my $flags = sprintf '%04x', $self->flags;
73 my $rcode = $self->rcode;
74 my $size = $self->size;
75 my @option = sort { $a <=> $b } $self->options;
76 my @lines = map $self->_format_option($_), @option;
77 my @format = join "\n;;\t\t", @lines;
78
79 $rcode = 0 if $rcode < 16; # weird: 1 .. 15 not EDNS codes!!
80
81 my $rc = exists( $self->{rdlength} ) && $rcode ? "$rcode + [4-bits]" : rcodebyval($rcode);
82
83 $rc = 'BADVERS' if $rcode == 16; # code 16 unambiguous here
84
85 return <<"QQ";
86;; EDNS version $edns
87;; flags: $flags
88;; rcode: $rc
89;; size: $size
90;; option: @format
91QQ
92}
93
94
9512µsmy ( $class, $ttl );
96
97sub class { ## overide RR method
98 carp qq[Usage: OPT has no "class" attribute, please use "size()"] unless $class++;
99 &size;
100}
101
102sub ttl { ## overide RR method
103 my $self = shift;
104 carp qq[Usage: OPT has no "ttl" attribute, please use "flags()" or "rcode()"] unless $ttl++;
105 my @rcode = map unpack( 'C', pack 'N', $_ ), @_;
106 my @flags = map unpack( 'x2n', pack 'N', $_ ), @_;
107 pack 'C2n', $self->rcode(@rcode), $self->version, $self->flags(@flags);
108}
109
110
111
# spent 14.3ms within Net::DNS::RR::OPT::version which was called 1968 times, avg 7µs/call: # 1968 times (14.3ms+0s) by Net::DNS::RR::OPT::encode at line 63, avg 7µs/call
sub version {
11219684.35ms my $version = shift->{version};
113196815.7ms return defined($version) ? $version : 0;
114}
115
116
117
# spent 62.3ms within Net::DNS::RR::OPT::size which was called 3936 times, avg 16µs/call: # 1968 times (31.9ms+0s) by Mail::SpamAssassin::DnsResolver::new_dns_packet at line 603 of Mail/SpamAssassin/DnsResolver.pm, avg 16µs/call # 1968 times (30.5ms+0s) by Net::DNS::RR::OPT::encode at line 62, avg 15µs/call
sub size {
11839367.33ms my $self = shift;
119393610.5ms for ( $self->{size} ) {
12039366.98ms my $UDP_size = 0;
12139368.01ms ( $UDP_size, $_ ) = ( shift || 0 ) if scalar @_;
122393622.8ms return $UDP_size < 512 ? 512 : ( $_ = $UDP_size ) unless $_;
123196819.0ms return $_ > 512 ? $_ : 512;
124 }
125}
126
127
128
# spent 15.3ms within Net::DNS::RR::OPT::rcode which was called 1968 times, avg 8µs/call: # 1968 times (15.3ms+0s) by Net::DNS::RR::OPT::encode at line 63, avg 8µs/call
sub rcode {
12919683.59ms my $self = shift;
130196817.0ms return $self->{rcode} || 0 unless scalar @_;
131 delete $self->{rdlength}; # (ab)used to signal incomplete value
132 my $val = shift || 0;
133 $self->{rcode} = $val < 16 ? 0 : $val; # discard non-EDNS rcodes 1 .. 15
134}
135
136
137
# spent 14.9ms within Net::DNS::RR::OPT::flags which was called 1968 times, avg 8µs/call: # 1968 times (14.9ms+0s) by Net::DNS::RR::OPT::encode at line 63, avg 8µs/call
sub flags {
13819683.81ms my $self = shift;
139196829.2ms return $self->{flags} || 0 unless scalar @_;
140 $self->{flags} = shift;
141}
142
143
144sub options {
145 my ($self) = @_;
146 my $options = $self->{option} || {};
147 return keys %$options;
148}
149
150sub option {
151 my $self = shift;
152 my $number = ednsoptionbyname(shift);
153 return $self->_get_option($number) unless scalar @_;
154 $self->_set_option( $number, @_ );
155}
156
157
158sub _format_option {
159 my ( $self, $number ) = @_;
160 my $option = ednsoptionbyval($number);
161 my $options = $self->{option} || {};
162 my $payload = $options->{$number};
163 return () unless defined $payload;
164 my $package = join '::', __PACKAGE__, $option;
165 $package =~ s/-/_/g;
166 my $defined = length($payload) && $package->can('_image');
167 my @payload = $defined ? eval { $package->_image($payload) } : unpack 'H*', $payload;
168 Net::DNS::RR::_wrap( "$option\t=> (", @payload, ')' );
169}
170
171
172sub _get_option {
173 my ( $self, $number ) = @_;
174
175 my $options = $self->{option} || {};
176 my $payload = $options->{$number};
177 return $payload unless wantarray;
178 return () unless $payload;
179 my $package = join '::', __PACKAGE__, ednsoptionbyval($number);
180 $package =~ s/-/_/g;
181 return ( 'OPTION-DATA' => $payload ) unless $package->can('_decompose');
182 my @payload = eval { $package->_decompose($payload) };
183}
184
185
186sub _set_option {
187 my ( $self, $number, $value, @etc ) = @_;
188
189 my $options = $self->{option} ||= {};
190 delete $options->{$number};
191 if ( ref($value) || scalar(@etc) ) {
192 my $option = ednsoptionbyval($number);
193 my @arg = ( $value, @etc );
194 @arg = @$value if ref($value) eq 'ARRAY';
195 @arg = %$value if ref($value) eq 'HASH';
196 if ( $arg[0] eq 'OPTION-DATA' ) {
197 $value = $arg[1];
198 } else {
199 my $package = join '::', __PACKAGE__, $option;
200 $package =~ s/-/_/g;
201 croak "unable to compose option $option" unless $package->can('_compose');
202 $value = $package->_compose(@arg);
203 }
204 }
205 $options->{$number} = $value if defined $value;
206}
207
208
209
# spent 26.5ms within Net::DNS::RR::OPT::_specified which was called 1968 times, avg 13µs/call: # 1968 times (26.5ms+0s) by Net::DNS::Packet::encode at line 194 of Net/DNS/Packet.pm, avg 13µs/call
sub _specified {
21019683.72ms my $self = shift;
211196812.3ms my @spec = grep $self->{$_}, qw(size flags rcode option);
212196827.5ms scalar @spec;
213}
214
215
216########################################
217
218package Net::DNS::RR::OPT::DAU; # RFC6975
219
220sub _compose {
221 my ( $class, @argument ) = @_;
222 pack 'C*', @argument;
223}
224
225sub _decompose {
226 my @payload = unpack 'C*', $_[1];
227}
228
229sub _image { &_decompose; }
230
231
232package Net::DNS::RR::OPT::DHU; # RFC6975
2332123µs21.07ms
# spent 553µs (31+522) within Net::DNS::RR::OPT::DHU::BEGIN@233 which was called: # once (31µs+522µs) by Net::DNS::RR::_subclass at line 233
use base qw(Net::DNS::RR::OPT::DAU);
# spent 553µs making 1 call to Net::DNS::RR::OPT::DHU::BEGIN@233 # spent 522µs making 1 call to base::import
234
235package Net::DNS::RR::OPT::N3U; # RFC6975
236296µs2821µs
# spent 424µs (28+396) within Net::DNS::RR::OPT::N3U::BEGIN@236 which was called: # once (28µs+396µs) by Net::DNS::RR::_subclass at line 236
use base qw(Net::DNS::RR::OPT::DAU);
# spent 424µs making 1 call to Net::DNS::RR::OPT::N3U::BEGIN@236 # spent 396µs making 1 call to base::import
237
238
239package Net::DNS::RR::OPT::CLIENT_SUBNET; # RFC7871
2402343µs11.39ms
# spent 1.39ms (934µs+458µs) within Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240 which was called: # once (934µs+458µs) by Net::DNS::RR::_subclass at line 240
use Net::DNS::RR::A;
# spent 1.39ms making 1 call to Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240
24121.42ms11.87ms
# spent 1.87ms (1.46+407µs) within Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@241 which was called: # once (1.46ms+407µs) by Net::DNS::RR::_subclass at line 241
use Net::DNS::RR::AAAA;
# spent 1.87ms making 1 call to Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@241
242
24316µsmy %family = qw(1 Net::DNS::RR::A 2 Net::DNS::RR::AAAA);
24413µsmy @field = qw(FAMILY SOURCE-PREFIX-LENGTH SCOPE-PREFIX-LENGTH ADDRESS);
245
246sub _compose {
247 my ( $class, %argument ) = @_;
248 my $address = bless( {}, $family{$argument{FAMILY}} )->address( $argument{ADDRESS} );
249 my $preamble = pack 'nC2', map $_ ||= 0, @argument{@field};
250 my $bitmask = $argument{'SOURCE-PREFIX-LENGTH'};
251 pack "a* B$bitmask", $preamble, unpack 'B*', $address;
252}
253
254sub _decompose {
255 my %hash;
256 @hash{@field} = unpack 'nC2a*', $_[1];
257 $hash{ADDRESS} = bless( {address => $hash{ADDRESS}}, $family{$hash{FAMILY}} )->address;
258 my @payload = map { ( $_ => $hash{$_} ) } @field;
259}
260
261sub _image { &_decompose; }
262
263
264package Net::DNS::RR::OPT::EXPIRE; # RFC7314
265
266sub _compose {
267 my ( $class, %argument ) = @_;
268 pack 'N', values %argument;
269}
270
271sub _decompose {
272 my @payload = ( 'EXPIRE-TIMER' => unpack 'N', $_[1] );
273}
274
275sub _image { &_decompose; }
276
277
278package Net::DNS::RR::OPT::COOKIE; # RFC7873
279
28012µsmy @key = qw(CLIENT-COOKIE SERVER-COOKIE);
281
282sub _compose {
283 my ( $class, %argument ) = @_;
284 pack 'a8 a*', map $_ || '', @argument{@key};
285}
286
287sub _decompose {
288 my %hash;
289 my $template = ( length( $_[1] ) < 16 ) ? 'a8' : 'a8 a*';
290 @hash{@key} = unpack $template, $_[1];
291 my @payload = map { ( $_ => $hash{$_} ) } @key;
292}
293
294
295package Net::DNS::RR::OPT::TCP_KEEPALIVE; # RFC7828
296
297sub _compose {
298 my ( $class, %argument ) = @_;
299 pack 'n', values %argument;
300}
301
302sub _decompose {
303 my @payload = ( TIMEOUT => unpack 'n', $_[1] );
304}
305
306sub _image { &_decompose; }
307
308
309package Net::DNS::RR::OPT::PADDING; # RFC7830
310
311sub _compose {
312 my ( $class, %argument ) = @_;
313 my ($size) = values %argument;
314 pack "x$size";
315}
316
317sub _decompose {
318 my @payload = ( 'OPTION-LENGTH' => length( $_[1] ) );
319}
320
321sub _image { &_decompose; }
322
323
324package Net::DNS::RR::OPT::CHAIN; # RFC7901
3252454µs116µs
# spent 16µs within Net::DNS::RR::OPT::CHAIN::BEGIN@325 which was called: # once (16µs+0s) by Net::DNS::RR::_subclass at line 325
use Net::DNS::DomainName;
# spent 16µs making 1 call to Net::DNS::RR::OPT::CHAIN::BEGIN@325
326
327sub _compose {
328 my ( $class, %argument ) = @_;
329 my ($trust_point) = values %argument;
330 Net::DNS::DomainName->new( $trust_point || return '' )->encode;
331}
332
333sub _decompose {
334 my ( $class, $payload ) = @_;
335 my $fqdn = Net::DNS::DomainName->decode( \$payload )->string;
336 my @payload = ( 'CLOSEST-TRUST-POINT' => $fqdn );
337}
338
339sub _image { &_decompose; }
340
341
342package Net::DNS::RR::OPT::KEY_TAG; # RFC8145
343
344sub _compose {
345 my ( $class, @argument ) = @_;
346 pack 'n*', @argument;
347}
348
349sub _decompose {
350 my @payload = unpack 'n*', $_[1];
351}
352
353sub _image { &_decompose; }
354
355
356125µs1;
357__END__
 
# spent 6.62ms within Net::DNS::RR::OPT::CORE:pack which was called 1969 times, avg 3µs/call: # 1968 times (6.61ms+0s) by Net::DNS::RR::OPT::encode at line 64, avg 3µs/call # once (9µs+0s) by Net::DNS::RR::OPT::BEGIN@25 at line 25
sub Net::DNS::RR::OPT::CORE:pack; # opcode