| 1 | # | ||||||||||||
| 2 | # $Id: Whois.pm,v 58d7ce835577 2023/03/25 10:34:10 gomor $ | ||||||||||||
| 3 | # | ||||||||||||
| 4 | package OPP::Proc::Whois; | ||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use base qw(OPP::Proc); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 1 | __PACKAGE__->cgBuildIndices; | |||||||||||
| 10 | |||||||||||||
| 11 | 1 | our $VERSION = '1.00'; | |||||||||||
| 12 | |||||||||||||
| 13 | # | ||||||||||||
| 14 | # | whois ip | ||||||||||||
| 15 | # | whois domain | ||||||||||||
| 16 | # | ||||||||||||
| 17 | sub process { | ||||||||||||
| 18 | 0 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
process: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||
| 19 | 0 | my ($input) = @_; | |||||||||||
| 20 | |||||||||||||
| 21 | 0 | ▶ | my $field = $self->options->{0} || 'domain'; | ||||||||||
|
Condition0%0/2
$self->options->{'0'} || 'domain'
MC/DC0%0/1
$self->options->{'0'} || 'domain'
$self->options->{'0'}
Truth table0%0/2
A
A= $self->options->{'0'}
| |||||||||||||
| 22 | 0 | ▶ | return unless defined($field); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | |||||||||||||
| 24 | 0 | my $values = $self->value($input, $field); | |||||||||||
| 25 | 0 | ▶ | return 1 unless defined($values); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | |||||||||||||
| 27 | 0 | for my $this (@$values) { | |||||||||||
| 28 | 0 | ▶ | next if $self->state->exists($this, $self->idx); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 0 | $self->state->incr($this, $self->idx); | |||||||||||
| 30 | |||||||||||||
| 31 | 0 | my $cmd = "timeout --kill-after=20s --signal=QUIT 15s whois $this"; | |||||||||||
| 32 | |||||||||||||
| 33 | 0 | my $new = { $field => $this }; | |||||||||||
| 34 | 0 | $new->{data} = `$cmd 2> /dev/null`; | |||||||||||
| 35 | 0 | $self->output->add($new); | |||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | 0 | return 1; | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | 1 | 1; | |||||||||||
| 42 | |||||||||||||
| 43 | __END__ | ||||||||||||