line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Host.pm 142 2009-10-16 19:13:45Z jabra $ |
2
|
|
|
|
|
|
|
package Nikto::Parser::Host; |
3
|
|
|
|
|
|
|
{ |
4
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
5
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
1525
|
use Object::InsideOut; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my @ip : Field : Arg(ip) : Get(ip); |
10
|
|
|
|
|
|
|
my @hostname : Field : Arg(hostname) : Get(hostname); |
11
|
|
|
|
|
|
|
my @ports : Field : All(ports) : Type(List(Nikto::Parser::Host::Port)); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# returns the port obj based on port number |
14
|
|
|
|
|
|
|
sub get_port { |
15
|
0
|
|
|
0
|
0
|
|
my ( $self, $port ) = @_; |
16
|
0
|
|
|
|
|
|
my @ports = grep( $_->port eq $port, @{ $self->ports } ); |
|
0
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
return $ports[0]; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# returns a ArrayRef containing a list of port objs |
21
|
|
|
|
|
|
|
sub get_all_ports { |
22
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
23
|
0
|
|
|
|
|
|
my @ports = @{ $self->ports }; |
|
0
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
return @ports; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
1; |