Filename | /usr/local/lib/perl5/site_perl/Net/DNS/RR/A.pm |
Statements | Executed 11 statements in 748µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 58µs | 70µs | BEGIN@9 | Net::DNS::RR::A::
1 | 1 | 1 | 32µs | 39µs | BEGIN@20 | Net::DNS::RR::A::
1 | 1 | 1 | 26µs | 66µs | BEGIN@10 | Net::DNS::RR::A::
1 | 1 | 1 | 19µs | 209µs | BEGIN@11 | Net::DNS::RR::A::
0 | 0 | 0 | 0s | 0s | _decode_rdata | Net::DNS::RR::A::
0 | 0 | 0 | 0s | 0s | _encode_rdata | Net::DNS::RR::A::
0 | 0 | 0 | 0s | 0s | _format_rdata | Net::DNS::RR::A::
0 | 0 | 0 | 0s | 0s | _parse_rdata | Net::DNS::RR::A::
0 | 0 | 0 | 0s | 0s | address | Net::DNS::RR::A::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Net::DNS::RR::A; | ||||
2 | |||||
3 | # | ||||
4 | # $Id: A.pm 1597 2017-09-22 08:04:02Z willem $ | ||||
5 | # | ||||
6 | 1 | 3µs | our $VERSION = (qw$LastChangedRevision: 1597 $)[1]; | ||
7 | |||||
8 | |||||
9 | 2 | 59µs | 2 | 82µs | # spent 70µs (58+12) within Net::DNS::RR::A::BEGIN@9 which was called:
# once (58µs+12µs) by Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240 at line 9 # spent 70µs making 1 call to Net::DNS::RR::A::BEGIN@9
# spent 12µs making 1 call to strict::import |
10 | 2 | 59µs | 2 | 106µs | # spent 66µs (26+40) within Net::DNS::RR::A::BEGIN@10 which was called:
# once (26µs+40µs) by Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240 at line 10 # spent 66µs making 1 call to Net::DNS::RR::A::BEGIN@10
# spent 40µs making 1 call to warnings::import |
11 | 2 | 68µs | 2 | 399µs | # spent 209µs (19+190) within Net::DNS::RR::A::BEGIN@11 which was called:
# once (19µs+190µs) by Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240 at line 11 # spent 209µs making 1 call to Net::DNS::RR::A::BEGIN@11
# spent 190µs making 1 call to base::import |
12 | |||||
13 | =head1 NAME | ||||
14 | |||||
15 | Net::DNS::RR::A - DNS A resource record | ||||
16 | |||||
17 | =cut | ||||
18 | |||||
19 | |||||
20 | 2 | 545µs | 2 | 46µs | # spent 39µs (32+7) within Net::DNS::RR::A::BEGIN@20 which was called:
# once (32µs+7µs) by Net::DNS::RR::OPT::CLIENT_SUBNET::BEGIN@240 at line 20 # spent 39µs making 1 call to Net::DNS::RR::A::BEGIN@20
# spent 7µs making 1 call to integer::import |
21 | |||||
22 | |||||
23 | sub _decode_rdata { ## decode rdata from wire-format octet string | ||||
24 | my $self = shift; | ||||
25 | my ( $data, $offset ) = @_; | ||||
26 | |||||
27 | $self->{address} = unpack "\@$offset a4", $$data; | ||||
28 | } | ||||
29 | |||||
30 | |||||
31 | sub _encode_rdata { ## encode rdata as wire-format octet string | ||||
32 | my $self = shift; | ||||
33 | |||||
34 | pack 'a4', $self->{address}; | ||||
35 | } | ||||
36 | |||||
37 | |||||
38 | sub _format_rdata { ## format rdata portion of RR string. | ||||
39 | my $self = shift; | ||||
40 | |||||
41 | $self->address; | ||||
42 | } | ||||
43 | |||||
44 | |||||
45 | sub _parse_rdata { ## populate RR from rdata in argument list | ||||
46 | my $self = shift; | ||||
47 | |||||
48 | $self->address(shift); | ||||
49 | } | ||||
50 | |||||
51 | |||||
52 | 1 | 2µs | 1 | 7µs | my $pad = pack 'x4'; # spent 7µs making 1 call to main::CORE:pack |
53 | |||||
54 | sub address { | ||||
55 | my $self = shift; | ||||
56 | my $addr = shift; | ||||
57 | |||||
58 | return join '.', unpack 'C4', $self->{address} . $pad unless defined $addr; | ||||
59 | |||||
60 | # Note: pack masks overlarge values, mostly without warning | ||||
61 | my @part = split /\./, $addr; | ||||
62 | my $last = pop(@part); | ||||
63 | $self->{address} = pack 'C4', @part, (0) x ( 3 - @part ), $last; | ||||
64 | } | ||||
65 | |||||
66 | |||||
67 | 1 | 12µs | 1; | ||
68 | __END__ |