← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Tue Nov 7 05:38:10 2017
Reported on Tue Nov 7 06:16:06 2017

Filename/usr/local/lib/perl5/site_perl/Net/DNS/RR/OPT.pm
StatementsExecuted 55136 statements in 418ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
196811191ms311msNet::DNS::RR::OPT::::encode Net::DNS::RR::OPT::encode
39362265.6ms65.6msNet::DNS::RR::OPT::::size Net::DNS::RR::OPT::size
19681138.4ms38.4msNet::DNS::RR::OPT::::_encode_rdata Net::DNS::RR::OPT::_encode_rdata
19681126.0ms26.0msNet::DNS::RR::OPT::::_specified Net::DNS::RR::OPT::_specified
19681115.2ms15.2msNet::DNS::RR::OPT::::rcode Net::DNS::RR::OPT::rcode
19681114.8ms14.8msNet::DNS::RR::OPT::::flags Net::DNS::RR::OPT::flags
19681114.4ms14.4msNet::DNS::RR::OPT::::version Net::DNS::RR::OPT::version
1969216.79ms6.79msNet::DNS::RR::OPT::::CORE:pack Net::DNS::RR::OPT::CORE:pack (opcode)
1111.37ms1.83msNet::DNS::RR::OPT::CLIENT_SUBNET::::BEGIN@241Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@241
111944µs1.38msNet::DNS::RR::OPT::CLIENT_SUBNET::::BEGIN@240Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240
11154µs69µsNet::DNS::RR::OPT::::BEGIN@9 Net::DNS::RR::OPT::BEGIN@9
11146µs224µsNet::DNS::RR::OPT::::BEGIN@27 Net::DNS::RR::OPT::BEGIN@27
11137µs244µsNet::DNS::RR::OPT::::BEGIN@25 Net::DNS::RR::OPT::BEGIN@25
11136µs767µsNet::DNS::RR::OPT::::BEGIN@23 Net::DNS::RR::OPT::BEGIN@23
11135µs277µsNet::DNS::RR::OPT::::BEGIN@11 Net::DNS::RR::OPT::BEGIN@11
11126µs561µsNet::DNS::RR::OPT::DHU::::BEGIN@233 Net::DNS::RR::OPT::DHU::BEGIN@233
11125µs237µsNet::DNS::RR::OPT::::BEGIN@22 Net::DNS::RR::OPT::BEGIN@22
11125µs66µsNet::DNS::RR::OPT::::BEGIN@10 Net::DNS::RR::OPT::BEGIN@10
11124µs31µsNet::DNS::RR::OPT::::BEGIN@20 Net::DNS::RR::OPT::BEGIN@20
11122µs395µsNet::DNS::RR::OPT::N3U::::BEGIN@236 Net::DNS::RR::OPT::N3U::BEGIN@236
11117µs17µ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#
614µsour $VERSION = (qw$LastChangedRevision: 1578 $)[1];
7
8
9281µs284µs
# spent 69µs (54+15) within Net::DNS::RR::OPT::BEGIN@9 which was called: # once (54µs+15µs) by Net::DNS::RR::_subclass at line 9
use strict;
# spent 69µs making 1 call to Net::DNS::RR::OPT::BEGIN@9 # spent 15µs making 1 call to strict::import
10281µs2106µs
# spent 66µs (25+41) within Net::DNS::RR::OPT::BEGIN@10 which was called: # once (25µs+41µs) by Net::DNS::RR::_subclass at line 10
use warnings;
# spent 66µs making 1 call to Net::DNS::RR::OPT::BEGIN@10 # spent 41µs making 1 call to warnings::import
11287µs2519µs
# spent 277µs (35+242) within Net::DNS::RR::OPT::BEGIN@11 which was called: # once (35µs+242µs) by Net::DNS::RR::_subclass at line 11
use base qw(Net::DNS::RR);
# spent 277µs making 1 call to Net::DNS::RR::OPT::BEGIN@11 # spent 242µ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
20280µs239µs
# spent 31µs (24+7) within Net::DNS::RR::OPT::BEGIN@20 which was called: # once (24µs+7µs) by Net::DNS::RR::_subclass at line 20
use integer;
# spent 31µs making 1 call to Net::DNS::RR::OPT::BEGIN@20 # spent 7µs making 1 call to integer::import
21
22276µs2448µs
# spent 237µs (25+211) within Net::DNS::RR::OPT::BEGIN@22 which was called: # once (25µs+211µs) by Net::DNS::RR::_subclass at line 22
use Carp;
# spent 237µs making 1 call to Net::DNS::RR::OPT::BEGIN@22 # spent 211µs making 1 call to Exporter::import
232118µs21.50ms
# spent 767µs (36+731) within Net::DNS::RR::OPT::BEGIN@23 which was called: # once (36µs+731µs) by Net::DNS::RR::_subclass at line 23
use Net::DNS::Parameters;
# spent 767µs making 1 call to Net::DNS::RR::OPT::BEGIN@23 # spent 731µs making 1 call to Exporter::import
24
252119µs3452µs
# spent 244µs (37+207) within Net::DNS::RR::OPT::BEGIN@25 which was called: # once (37µs+207µs) by Net::DNS::RR::_subclass at line 25
use constant CLASS_TTL_RDLENGTH => length pack 'n N n', (0) x 3;
# spent 244µs making 1 call to Net::DNS::RR::OPT::BEGIN@25 # spent 199µs making 1 call to constant::import # spent 8µs making 1 call to Net::DNS::RR::OPT::CORE:pack
26
2722.75ms3402µs
# spent 224µs (46+178) within Net::DNS::RR::OPT::BEGIN@27 which was called: # once (46µs+178µs) by Net::DNS::RR::_subclass at line 27
use constant OPT => typebyname qw(OPT);
# spent 224µs making 1 call to Net::DNS::RR::OPT::BEGIN@27 # spent 170µ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.4ms within Net::DNS::RR::OPT::_encode_rdata which was called 1968 times, avg 19µs/call: # 1968 times (38.4ms+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.66ms my $self = shift;
52
5319689.18ms my $option = $self->{option} || {};
54196832.0ms join '', map pack( 'nna*', $_, length $option->{$_}, $option->{$_} ), keys %$option;
55}
56
57
58
# spent 311ms (191+120) within Net::DNS::RR::OPT::encode which was called 1968 times, avg 158µs/call: # 1968 times (191ms+120ms) by Net::DNS::Packet::encode at line 205 of Net/DNS/Packet.pm, avg 158µs/call
sub encode { ## overide RR method
5919683.85ms my $self = shift;
60
61196814.4ms196838.4ms my $data = $self->_encode_rdata;
# spent 38.4ms making 1968 calls to Net::DNS::RR::OPT::_encode_rdata, avg 19µs/call
62196813.3ms196830.5ms my $size = $self->size;
# spent 30.5ms making 1968 calls to Net::DNS::RR::OPT::size, avg 15µs/call
63196841.2ms590444.4ms my @xttl = ( $self->rcode >> 4, $self->version, $self->flags );
# spent 15.2ms making 1968 calls to Net::DNS::RR::OPT::rcode, avg 8µs/call # spent 14.8ms making 1968 calls to Net::DNS::RR::OPT::flags, avg 8µs/call # spent 14.4ms making 1968 calls to Net::DNS::RR::OPT::version, avg 7µs/call
64196870.1ms19686.78ms pack 'C n n C2n n a*', 0, OPT, $size, @xttl, length($data), $data;
# spent 6.78ms 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.4ms within Net::DNS::RR::OPT::version which was called 1968 times, avg 7µs/call: # 1968 times (14.4ms+0s) by Net::DNS::RR::OPT::encode at line 63, avg 7µs/call
sub version {
11219684.52ms my $version = shift->{version};
113196826.8ms return defined($version) ? $version : 0;
114}
115
116
117
# spent 65.6ms within Net::DNS::RR::OPT::size which was called 3936 times, avg 17µs/call: # 1968 times (35.1ms+0s) by Mail::SpamAssassin::DnsResolver::new_dns_packet at line 603 of Mail/SpamAssassin/DnsResolver.pm, avg 18µs/call # 1968 times (30.5ms+0s) by Net::DNS::RR::OPT::encode at line 62, avg 15µs/call
sub size {
11839367.43ms my $self = shift;
119393612.2ms for ( $self->{size} ) {
12039367.12ms my $UDP_size = 0;
12139368.56ms ( $UDP_size, $_ ) = ( shift || 0 ) if scalar @_;
122393643.1ms return $UDP_size < 512 ? 512 : ( $_ = $UDP_size ) unless $_;
123196829.1ms return $_ > 512 ? $_ : 512;
124 }
125}
126
127
128
# spent 15.2ms within Net::DNS::RR::OPT::rcode which was called 1968 times, avg 8µs/call: # 1968 times (15.2ms+0s) by Net::DNS::RR::OPT::encode at line 63, avg 8µs/call
sub rcode {
12919683.73ms my $self = shift;
130196829.4ms 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.8ms within Net::DNS::RR::OPT::flags which was called 1968 times, avg 8µs/call: # 1968 times (14.8ms+0s) by Net::DNS::RR::OPT::encode at line 63, avg 8µs/call
sub flags {
13819683.83ms my $self = shift;
139196817.3ms 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.0ms within Net::DNS::RR::OPT::_specified which was called 1968 times, avg 13µs/call: # 1968 times (26.0ms+0s) by Net::DNS::Packet::encode at line 194 of Net/DNS/Packet.pm, avg 13µs/call
sub _specified {
21019683.64ms my $self = shift;
211196812.0ms my @spec = grep $self->{$_}, qw(size flags rcode option);
212196815.3ms 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
2332101µs21.10ms
# spent 561µs (26+535) within Net::DNS::RR::OPT::DHU::BEGIN@233 which was called: # once (26µs+535µs) by Net::DNS::RR::_subclass at line 233
use base qw(Net::DNS::RR::OPT::DAU);
# spent 561µs making 1 call to Net::DNS::RR::OPT::DHU::BEGIN@233 # spent 535µs making 1 call to base::import
234
235package Net::DNS::RR::OPT::N3U; # RFC6975
236296µs2767µs
# spent 395µs (22+372) within Net::DNS::RR::OPT::N3U::BEGIN@236 which was called: # once (22µs+372µs) by Net::DNS::RR::_subclass at line 236
use base qw(Net::DNS::RR::OPT::DAU);
# spent 395µs making 1 call to Net::DNS::RR::OPT::N3U::BEGIN@236 # spent 372µs making 1 call to base::import
237
238
239package Net::DNS::RR::OPT::CLIENT_SUBNET; # RFC7871
2402335µs11.38ms
# spent 1.38ms (944µs+439µs) within Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240 which was called: # once (944µs+439µs) by Net::DNS::RR::_subclass at line 240
use Net::DNS::RR::A;
# spent 1.38ms making 1 call to Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240
24121.37ms11.83ms
# spent 1.83ms (1.37+453µs) within Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@241 which was called: # once (1.37ms+453µs) by Net::DNS::RR::_subclass at line 241
use Net::DNS::RR::AAAA;
# spent 1.83ms 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);
24417µ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
3252420µs117µs
# spent 17µs within Net::DNS::RR::OPT::CHAIN::BEGIN@325 which was called: # once (17µs+0s) by Net::DNS::RR::_subclass at line 325
use Net::DNS::DomainName;
# spent 17µ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
356119µs1;
357__END__
 
# spent 6.79ms within Net::DNS::RR::OPT::CORE:pack which was called 1969 times, avg 3µs/call: # 1968 times (6.78ms+0s) by Net::DNS::RR::OPT::encode at line 64, avg 3µs/call # once (8µs+0s) by Net::DNS::RR::OPT::BEGIN@25 at line 25
sub Net::DNS::RR::OPT::CORE:pack; # opcode