Check/Host.pm

filter: Statementstmt 8.5% 16 / 188 Branchbran 0.0% 0 / 78 Conditioncond 0.0% 0 / 56 MC/DCmcdc 0.0% 0 / 35 Subroutinesub 26.3% 5 / 19 Podpod 0.0% 0 / 10 totaltotal 5.4% 21 / 386 CC 63 SCAR 56.0
CC
63
Cov
5%
_decodePacket
650.0
new
240.0
_queryIP
110.0
CRAP 269.5
« Check.pm ↑ Summary Check/NSQuery.pm »
1 package Net::DNS::Check::Host;
2
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Net::DNS;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Net::DNS::Resolver::Recurse;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Net::DNS::Check::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9
10 0 ▶sub new {
Subroutine new: not called CC=15 SCAR=54.8
Pod undocumented
11 0 my ($class, %param) = @_;
12
13 0 my $self = {};
14  
15 0 $self->{class} = $class;
16  
17 # Hostname
18 0 $self->{host} = lc($param{host});
19
20 # Nameserver IP Address to query
21 0 ▶ $self->{ip} = $param{ip} || [];
Condition0%0/2
$param{'ip'} || []
l!l
00
MC/DC0%0/1
$param{'ip'} || []
$param{'ip'}
Truth table0%0/2
A
A= $param{'ip'}
Aresult
11
00
22  
23 # Original IP
24 0 ▶ $self->{ip_orig} = $param{ip_orig} || [];
Condition0%0/2
$param{'ip_orig'} || []
l!l
00
MC/DC0%0/1
$param{'ip_orig'} || []
$param{'ip_orig'}
Truth table0%0/2
A
A= $param{'ip_orig'}
Aresult
11
00
25  
26 # If there isn't a config we create a new one
27 0 ▶ $self->{config} = $param{config} || new Net::DNS::Check::Config;
Condition0%0/3
$param{'config'} || 'Net::DNS::Check::Config'->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$param{'config'} || 'Net::DNS::Check::Config'->new
$param{'config'} 'Net::DNS::Check::Config'->new
Truth table0%0/3
A || B
A= $param{'config'}B= 'Net::DNS::Check::Config'->new
ABresult
1X1
011
000
28  
29 0 ▶ if ( defined $param{debug} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $param{'debug'}) { } 0 0 0
30 0 $self->{debug} = $param{debug};
31 } else {
32 0 $self->{debug} = $self->{config}->debug_default();
33 }
34  
35 # True if we want to create a statc host without query
36 0 $self->{init_only} = $param{init_only};
37  
38 0 ▶ $self->{qtype} = uc($param{qtype}) || 'A';
Condition0%0/2
uc $param{'qtype'} || 'A'
l!l
00
MC/DC0%0/1
uc $param{'qtype'} || 'A'
uc $param{'qtype'}
Truth table0%0/2
A
A= uc $param{'qtype'}
Aresult
11
00
39 0 $self->{query_AAAA} = $self->{config}->query_AAAA();
40 0 ▶ $self->{query_AAAA} = 0 if ($self->{qtype} eq 'PTR');
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"qtype"} eq "PTR" 0 0 0
41  
42  
43 # max_depth for cname resolution (endless loop protection)
44 0 $self->{depth} = 0;
45 0 $self->{max_depth} = 10;
46  
47 # This is set to 1 if we found the IP address of $self->{host} with recursion
48 # or set to 2 if we found IP with init_only
49 0 $self->{recurse} = 0;
50  
51  
52 0 bless $self, $class;
53  
54  
55 0 ▶ if ($self->{debug} && 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} and 0) 0 0 0
Condition0%0/2
$self->{"debug"} and 0
!ll
00
MC/DC0%0/1
$self->{"debug"} and 0
$self->{"debug"}
Truth table0%0/2
A
A= $self->{"debug"}
Aresult
00
11
56 0 my ($ips) = '';
57 0 my ($init_only) = '';
58  
59 0 $ips = join(' ', @{ $self->{ip} });
60  
61 0 ▶ if ( $self->{init_only} )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"init_only"}) 0 0 0
62 {
63 0 $init_only = 'init_only';
64 }
65  
66  
67 0 print <<END_OF_TEXT;
68  
69  
70 ****************************************************
71 Location: $self->{class}::new $init_only
72 Looking for host: $self->{host}
73 IP to query: $ips
74 Query type: A
75 ****************************************************
76  
77 END_OF_TEXT
78 }
79  
80  
81 # init_only is used when we want to set an host object with predefined
82 # value
83 0 ▶ if ( ! $self->{init_only} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $self->{'init_only'}) { } 0 0 0
84  
85 0 ▶ if ( $self->{host} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'host'}) { } 0 0 0
86 # If we have an IP we use it to make a direct query using _queryIP function
87 0 ▶ if ( scalar @{$self->{ip}} > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$self->{'ip'};} > 0) { } 0 0 0
88  
89 $self->_queryIP(
90 host => $self->{host},
91 ip => $self->{ip},
92 qtype => $self->{qtype}
93 0 );
94  
95 # Check for AAAA records
96 0 ▶ if ($self->{query_AAAA}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"query_AAAA"}) 0 0 0
97 $self->_queryIP(
98 host => $self->{host},
99 ip => $self->{ip},
100 0 qtype => 'AAAA'
101 );
102 }
103 } else {
104 # If there isn't an IP we use recursion
105 $self->_queryIPrecurse(
106 host => $self->{host},
107 qtype => $self->{qtype}
108 0 );
109  
110 # Check for AAAA records
111 0 ▶ if ($self->{query_AAAA}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"query_AAAA"}) 0 0 0
112 $self->_queryIPrecurse(
113 host => $self->{host},
114 0 qtype => 'AAAA'
115 );
116 }
117 }
118 } else {
119 0 confess(<<"ERROR");
120  
121 FATAL ERROR
122 ===============
123 Wrong call of constructor: $class
124 host param not found!
125  
126 ERROR
127 }
128 } else {
129 0 $self->{ipfound} = $self->{ip};
130 0 $self->{type} = 'A';
131 0 $self->{recurse} = 2;
132 }
133
134 0 return $self;
135 }
136  
137  
138  
139 # Query for A RR for $self->{host}
140 # using $self->{ip} as resolver
141 0 ▶sub _queryIP() {
Subroutine _queryIP: not called CC=10 SCAR=47.0
142 0 my $self = shift;
143 0 my %param = @_;
144 0 ▶ my $host = $param{host} || $self->{host};
Condition0%0/3
$param{'host'} || $self->{'host'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$param{'host'} || $self->{'host'}
$param{'host'} $self->{'host'}
Truth table0%0/3
A || B
A= $param{'host'}B= $self->{'host'}
ABresult
1X1
011
000
145 0 ▶ my $ip = $param{ip} || $self->{ip};
Condition0%0/3
$param{'ip'} || $self->{'ip'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$param{'ip'} || $self->{'ip'}
$param{'ip'} $self->{'ip'}
Truth table0%0/3
A || B
A= $param{'ip'}B= $self->{'ip'}
ABresult
1X1
011
000
146 0 ▶ my $qtype = $param{qtype} || $self->{qtype};
Condition0%0/3
$param{'qtype'} || $self->{'qtype'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$param{'qtype'} || $self->{'qtype'}
$param{'qtype'} $self->{'qtype'}
Truth table0%0/3
A || B
A= $param{'qtype'}B= $self->{'qtype'}
ABresult
1X1
011
000
147  
148 0 ▶ return undef if (! $host || ! $ip);
Branch: 1 branch
BranchTrueFalseTotal
unless $host and $ip 0 0 0
Condition0%0/3
$host and $ip
!ll&&!rl&&r
000
MC/DC0%0/2
$host and $ip
$host $ip
Truth table0%0/3
A and B
A= $hostB= $ip
ABresult
0X0
100
111
149  
150 0 $self->{recurse} = 0;
151  
152 0 ▶ if ($self->{debug} > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} > 0) 0 0 0
153 0 my $ips = join(' ', @{ $ip });
154  
155 0 print <<END_OF_TEXT;
156 Trying to resolve $host using [ $ips ]
157 END_OF_TEXT
158
159 }
160  
161 my $res = Net::DNS::Resolver->new(
162 nameservers => $ip,
163 recurse => 0,
164 debug => ($self->{debug} > 2),
165 retrans => $self->{config}->query_retrans(),
166 retry => $self->{config}->query_retry(),
167 0 tcp_timeout => $self->{config}->query_tcp_timeout(),
168 );
169  
170 0 my $packet = $res->send($host, $qtype);
171  
172  
173 0 ▶ if ( ! $packet && $qtype ne 'AAAA') {
Branch: 1 branch
BranchTrueFalseTotal
if (not $packet and $qtype ne 'AAAA') { } 0 0 0
Condition0%0/3
not $packet and $qtype ne "AAAA"
!ll&&!rl&&r
000
MC/DC0%0/2
not $packet and $qtype ne "AAAA"
not $packet $qtype ne "AAAA"
Truth table0%0/3
not(A) and B
A= not $packetB= $qtype ne "AAAA"
ABresult
0X0
100
111
174  
175 0 ▶ if ($self->{debug} > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} > 0) 0 0 0
176 0 my $qerror = $res->errorstring;
177 0 print <<END_OF_TEXT;
178 Query Error: $qerror
179 END_OF_TEXT
180 }
181  
182 0 $self->{error} = 'NOANSWER';
183  
184 } else {
185 0 return $self->_decodePacket(
186 packet => $packet,
187 host => $host,
188 qtype => $qtype
189 );
190 }
191 }
192  
193  
194 #
195 # We use recursion
196 0 ▶sub _queryIPrecurse() {
Subroutine _queryIPrecurse: not called CC=8 SCAR=42.8
197 0 my $self = shift;
198 0 my %param = @_;
199 0 ▶ my $host = $param{host} || $self->{host};
Condition0%0/3
$param{'host'} || $self->{'host'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$param{'host'} || $self->{'host'}
$param{'host'} $self->{'host'}
Truth table0%0/3
A || B
A= $param{'host'}B= $self->{'host'}
ABresult
1X1
011
000
200 0 ▶ my $qtype = $param{qtype} || $self->{qtype};
Condition0%0/3
$param{'qtype'} || $self->{'qtype'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$param{'qtype'} || $self->{'qtype'}
$param{'qtype'} $self->{'qtype'}
Truth table0%0/3
A || B
A= $param{'qtype'}B= $self->{'qtype'}
ABresult
1X1
011
000
201  
202  
203 0 ▶ return undef if (!$host);
Branch: 1 branch
BranchTrueFalseTotal
unless $host 0 0 0
204  
205 0 $self->{recurse} = 1;
206  
207 0 ▶ if ($self->{debug} > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} > 0) 0 0 0
208 0 print <<END_OF_TEXT;
209 Trying to resolve $host using RECURSION
210 END_OF_TEXT
211  
212 }
213  
214 my $res = Net::DNS::Resolver::Recurse->new(
215 recurse => 1,
216 debug => ($self->{debug} > 2),
217 retrans => $self->{config}->query_retrans(),
218 retry => $self->{config}->query_retry(),
219 0 tcp_timeout => $self->{config}->query_tcp_timeout(),
220 );
221  
222 0 $res->hints( @{$self->{config}->rootservers()} );
223  
224 0 my $packet = $res->query_dorecursion( $host , $qtype);
225  
226 0 ▶ if ( ! $packet && $qtype ne 'AAAA') {
Branch: 1 branch
BranchTrueFalseTotal
if (not $packet and $qtype ne 'AAAA') { } 0 0 0
Condition0%0/3
not $packet and $qtype ne "AAAA"
!ll&&!rl&&r
000
MC/DC0%0/2
not $packet and $qtype ne "AAAA"
not $packet $qtype ne "AAAA"
Truth table0%0/3
not(A) and B
A= not $packetB= $qtype ne "AAAA"
ABresult
0X0
100
111
227 0 ▶ if ($self->{debug} > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} > 0) 0 0 0
228 0 my $qerror = $res->errorstring;
229 0 print <<END_OF_TEXT;
230 Query Error: $qerror
231 END_OF_TEXT
232 }
233 0 $self->{error} = 'NOANSWER';
234 } else {
235 0 return $self->_decodePacket(
236 packet => $packet,
237 host => $host,
238 qtype => $qtype
239 );
240 }
241 }
242  
243  
244  
245 0 ▶sub _decodePacket() {
Subroutine _decodePacket: not called CC=25 SCAR=64.8
246 0 my $self = shift;
247  
248 0 my %param = @_;
249 0 my $packet = $param{packet};
250 0 ▶ my $host = $param{host} || $self->{host};
Condition0%0/3
$param{'host'} || $self->{'host'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$param{'host'} || $self->{'host'}
$param{'host'} $self->{'host'}
Truth table0%0/3
A || B
A= $param{'host'}B= $self->{'host'}
ABresult
1X1
011
000
251 0 ▶ my $qtype = $param{qtype} || $self->{qtype};
Condition0%0/3
$param{'qtype'} || $self->{'qtype'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$param{'qtype'} || $self->{'qtype'}
$param{'qtype'} $self->{'qtype'}
Truth table0%0/3
A || B
A= $param{'qtype'}B= $self->{'qtype'}
ABresult
1X1
011
000
252  
253 0 ▶ return undef if (! $packet);
Branch: 1 branch
BranchTrueFalseTotal
unless $packet 0 0 0
254  
255 0 my $cname;
256 0 my $iscname = 0;
257 0 my $ip = [];
258  
259 0 foreach my $rr ( $packet->answer ) {
260 # Saltiamo risposte sulla base della cache
261 # ovvero risposte che non si riferiscono
262 # al record che stiamo chiedendo ($host)
263 # Attenzione nel caso di PTR questo non e' corretto
264 # 193.205.245.5 -> 5.245.205.193.in-addr.arpa
265 0 ▶ next if ($rr->name() ne $host);
Branch: 1 branch
BranchTrueFalseTotal
if $rr->name ne $host 0 0 0
266  
267 0 ▶ if ($rr->type() eq 'A') {
Branch: 1 branch
BranchTrueFalseTotal
if ($rr->type eq "A") 0 0 0
268 0 push(@{$ip}, $rr->address);
269 0 next;
270 }
271  
272 0 ▶ if ($rr->type() eq 'AAAA') {
Branch: 1 branch
BranchTrueFalseTotal
if ($rr->type eq "AAAA") 0 0 0
273 0 push(@{$ip}, $rr->address);
274 0 next;
275 }
276  
277 0 ▶ if ($rr->type() eq 'PTR') {
Branch: 1 branch
BranchTrueFalseTotal
if ($rr->type eq "PTR") 0 0 0
278 0 push(@{$ip}, $rr->ptrdname);
279 0 next;
280 }
281  
282 0 ▶ if ($rr->type() eq 'CNAME') {
Branch: 1 branch
BranchTrueFalseTotal
if ($rr->type eq "CNAME") 0 0 0
283 0 $cname = $rr->cname;
284 0 $iscname = 1;
285 0 next;
286 }
287 }
288  
289 # Se abbiamo un CNAME ma non IP
290 # bisogna fare la risoluzione del cname host trovato
291 # L'algoritmo e ricorsivo fintanto che non trovo un record A
292 # Viene fermata la ricerca dopo 'max_depth' ricorsioni
293 0 ▶ if ($cname && ! scalar @{$ip} && $self->{depth} <= $self->{max_depth}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cname and not scalar @{$ip;} and $self->{"depth"} <= $self->{"max_depth"}) 0 0 0
Condition0%0/6
$cname and not scalar @{$ip;} and $self->{"depth"} <= $self->{"max_depth"}
!ll&&!rl&&r
000
$cname and not scalar @{$ip;}
!ll&&!rl&&r
000
MC/DC0%0/3
$cname and not scalar @{$ip;} and $self->{"depth"} <= $self->{"max_depth"}
$cname not scalar @{$ip;} $self->{"depth"} <= $self->{"max_depth"}
Truth table0%0/4
A and not(B) and C
A= $cnameB= not scalar @{$ip;}C= $self->{"depth"} <= $self->{"max_depth"}
ABCresult
0XX0
10X0
1100
1111
294 0 $self->{depth}++;
295  
296 0 ▶ if ($self->{debug} > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} > 0) 0 0 0
297 0 print <<END_OF_TEXT;
298 Found RR CNAME: $cname
299  
300 END_OF_TEXT
301 }
302
303 # return undef;
304
305 # Se abbiamo un IP di nameserver da interrogare e se il cname host
306 # fa parte del dominio che stiamo analizzando facciamo
307 # un query diretta utilizzando _queryIP altrimenti andiamo
308 # per ricorsione partendo dai root nameservers
309 0 ▶ if ( scalar @{$self->{ip}} > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$self->{'ip'};} > 0) { } 0 0 0
310 $ip = $self->_queryIP(
311 host => $cname,
312 ip => $self->{ip}
313 0 );
314 } else {
315 0 $ip = $self->_queryIPrecurse( host => $cname );
316 }
317 0 ▶ $ip = [] if (!$ip); # Forziamo $ip ad essere almeno un puntatore vuoto
Branch: 1 branch
BranchTrueFalseTotal
unless $ip 0 0 0
318 }
319  
320  
321 0 ▶ if ($iscname) {
Branch: 1 branch
BranchTrueFalseTotal
if ($iscname) 0 0 0
322 0 $self->{type} = 'CNAME';
323 0 $self->{cname} = $cname;
324 }
325  
326 0 ▶ if ( scalar @{$ip} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$ip;}) { } 0 0 0
327  
328 0 $self->{type} = 'AAAA';
329  
330 0 my $ips = join(' ', @{ $ip });
331 0 ▶ if ($qtype eq "AAAA") {
Branch: 1 branch
BranchTrueFalseTotal
if ($qtype eq 'AAAA') { } 0 0 0
332  
333 0 $self->{ip6found} = $ip;
334  
335 0 ▶ if ($self->{debug} > 0 && !$iscname) { # added && !$iscname for better debug output
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} > 0 and not $iscname) 0 0 0
Condition0%0/3
$self->{"debug"} > 0 and not $iscname
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"debug"} > 0 and not $iscname
$self->{"debug"} > 0 not $iscname
Truth table0%0/3
A and not(B)
A= $self->{"debug"} > 0B= not $iscname
ABresult
0X0
100
111
336 0 print <<END_OF_TEXT;
337 Found RR AAAA: $ips
338  
339 END_OF_TEXT
340 }
341  
342 } else {
343  
344 0 $self->{type} = 'A';
345 0 $self->{ipfound} = $ip;
346  
347 0 ▶ if ($self->{debug} > 0 && !$iscname) { # added && !$iscname for better debug output
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} > 0 and not $iscname) 0 0 0
Condition0%0/3
$self->{"debug"} > 0 and not $iscname
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"debug"} > 0 and not $iscname
$self->{"debug"} > 0 not $iscname
Truth table0%0/3
A and not(B)
A= $self->{"debug"} > 0B= not $iscname
ABresult
0X0
100
111
348 0 print <<END_OF_TEXT;
349 Found RR A: $ips
350
351 END_OF_TEXT
352 }
353 }
354  
355 0 return $ip;
356  
357 } else {
358 # Nessun IP trovato
359 0 $self->{error} = 'NXDOMAIN';
360 # $self->{type} = '';
361 0 ▶ if ($self->{debug} > 0 && !$iscname) { # added && !$iscname for better debug output
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"debug"} > 0 and not $iscname) 0 0 0
Condition0%0/3
$self->{"debug"} > 0 and not $iscname
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"debug"} > 0 and not $iscname
$self->{"debug"} > 0 not $iscname
Truth table0%0/3
A and not(B)
A= $self->{"debug"} > 0B= not $iscname
ABresult
0X0
100
111
362 0 print <<END_OF_TEXT;
363 No Record Found
364  
365 END_OF_TEXT
366 }
367 0 return undef;
368 }
369 }
370  
371  
372 # Effettua la risoluzione inversa per il momento solo di IPv4
373 # il supporto del reverse IPv6 di Net::DNS e' limitato
374 0 ▶sub _queryReverse() {
Subroutine _queryReverse: not called CC=6 SCAR=37.4
375 0 my $self = shift;
376  
377 0 ▶ return undef if (! $self->{ipfound});
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"ipfound"} 0 0 0
378  
379 my $res = Net::DNS::Resolver::Recurse->new(
380 recurse => 1,
381 debug => ($self->{debug} > 2),
382 retrans => $self->{config}->query_retrans(),
383 retry => $self->{config}->query_retry(),
384 0 tcp_timeout => $self->{config}->query_tcp_timeout(),
385 );
386 0 $res->hints( @{$self->{config}->rootservers()} );
387  
388 0 foreach my $ip (@{$self->{ipfound}}) {
389 0 warn("Reverse di $ip\n");
390  
391 0 my $packet = $res->query_dorecursion( $ip , 'PTR' );
392  
393 0 ▶ if ($packet) {
Branch: 1 branch
BranchTrueFalseTotal
if ($packet) { } 0 0 0
394 0 foreach my $rr ( $packet->answer ) {
395 0 ▶ if ($rr->type() eq 'PTR') {
Branch: 1 branch
BranchTrueFalseTotal
if ($rr->type eq "PTR") 0 0 0
396 0 $self->{reverse}->{$ip} = $rr->ptrdname;
397 }
398 }
399 } else {
400 # Query error
401 }
402 }
403  
404 0 return 1;
405 }
406  
407  
408 # Ritorna il tipo di record trovato: A o CNAME
409 0 ▶sub get_type() {
Subroutine get_type: not called CC=2 SCAR=17.9
Pod undocumented
410 0 my $self = shift;
411  
412 0 ▶ return undef if (!$self->{type});
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"type"} 0 0 0
413
414 0 return $self->{type};
415 }
416  
417  
418 # Ritorna una array ref degli IP trovati (se ce ne sono)
419 0 ▶sub get_ip() {
Subroutine get_ip: not called CC=2 SCAR=17.9
Pod undocumented
420 0 my $self = shift;
421  
422 0 ▶ return [] if (!$self->{ipfound});
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"ipfound"} 0 0 0
423
424 0 return $self->{ipfound};
425 }
426  
427 # Ritorna una array ref degli IP trovati (se ce ne sono)
428 0 ▶sub get_ip_orig() {
Subroutine get_ip_orig: not called CC=1 SCAR=6.9
Pod undocumented
429 0 my $self = shift;
430  
431 0 return $self->{ip_orig};
432 }
433  
434  
435 # Ritorna una array ref degli IPV6 trovati (se ce ne sono)
436 0 ▶sub get_ip6() {
Subroutine get_ip6: not called CC=2 SCAR=17.9
Pod undocumented
437 0 my $self = shift;
438  
439 0 ▶ return [] if (!$self->{ip6found});
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"ip6found"} 0 0 0
440
441 0 return $self->{ip6found};
442 }
443  
444  
445
446 0 ▶sub get_cname() {
Subroutine get_cname: not called CC=1 SCAR=6.9
Pod undocumented
447 0 my $self = shift;
448  
449 0 return $self->{cname};
450 }
451  
452  
453 0 ▶sub found() {
Subroutine found: not called CC=1 SCAR=6.9
Pod undocumented
454 0 my $self = shift;
455  
456 0 return ( scalar @{$self->{ip}} );
457 }
458  
459 0 ▶sub error() {
Subroutine error: not called CC=1 SCAR=6.9
Pod undocumented
460 0 my $self = shift;
461  
462 0 return $self->{error};
463 }
464  
465  
466 0 ▶sub get_recurse() {
Subroutine get_recurse: not called CC=1 SCAR=6.9
Pod undocumented
467 0 my $self = shift;
468  
469 0 return $self->{recurse};
470 }
471  
472 0 ▶sub get_hostname() {
Subroutine get_hostname: not called CC=1 SCAR=6.9
Pod undocumented
473 0 my $self = shift;
474  
475 0 return $self->{host};
476 }
477  
478 1 1;
479  
480 __END__
« Check.pm ↑ Summary Check/NSQuery.pm »