| 1 | package QualysGuard::Response::MapReport2; | ||
| 2 | |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use base qw( QualysGuard::Response ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | our $VERSION = '0.02'; | ||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | # ============================================================= | ||
| 13 | # - new | ||
| 14 | # ============================================================= | ||
| 15 | sub new { | ||
| 16 | my ( $class, $xml ) = @_; | ||
| 17 | |||
| 18 | my $self = __PACKAGE__->SUPER::new( $xml ); | ||
| 19 | |||
| 20 | bless $self, $class; | ||
| 21 | |||
| 22 | # -- check for QualysGuard function error | ||
| 23 | |||
| 24 | if ( $self->exists('/MAP_REQUEST/ERROR') ) { | ||
| 25 | $self->{error_code} = $self->findvalue('/MAP_REQUEST/ERROR/@number'); | ||
| 26 | $self->{error_text} = $self->getNodeText('/MAP_REQUEST/ERROR'); | ||
| 27 | $self->{error_text} =~ s/^\s+(.*)\s+$/$1/m; | ||
| 28 | } | ||
| 29 | |||
| 30 | return $self; | ||
| 31 | } | ||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | # ============================================================= | ||
| 36 | # - get_ip_address_list | ||
| 37 | # ============================================================= | ||
| 38 | sub get_ip_address_list { | ||
| 39 | my $self = shift; | ||
| 40 | my @nodes = $self->findnodes('/MAP_REQUEST/MAP/IP'); | ||
| 41 | my @rv = (); | ||
| 42 | |||
| 43 | foreach my $node ( @nodes ) { | ||
| 44 | push( @rv, $node->getAttribute( 'value' ) ); | ||
| 45 | } | ||
| 46 | |||
| 47 | return \@rv; | ||
| 48 | } | ||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | 1; | ||
| 53 | |||
| 54 | __END__ | ||