lib/Net/SinFP3/Result/PortError.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 43 CC 1 SCAR 6.9
CC
1
Cov
0%
take
2.0
new
2.0
printSignature
2.0
CRAP 2.0
1 #
2 # $Id: PortError.pm,v 008243d3e89a 2018/07/21 14:54:07 gomor $
3 #
4 package Net::SinFP3::Result::PortError;
5 use strict;
6 use warnings;
7  
8 use base qw(Net::SinFP3::Result);
9 our @AS = qw(
10 ip
11 port
12 hostname
13 reverse
14 frame
15 p1Reason
16 p2Reason
17 );
18 __PACKAGE__->cgBuildIndices;
19 __PACKAGE__->cgBuildAccessorsScalar(\@AS);
20  
21 use Net::Frame::Layer::TCP qw(:consts);
22  
23 sub take {
24 return [
25 'Net::SinFP3::Search::Active',
26 ];
27 }
28  
29 sub new {
30 my $self = shift->SUPER::new(
31 ip => '127.0.0.1',
32 port => 0,
33 hostname => 'unknown',
34 reverse => 'unknown',
35 p1Reason => 'unknown',
36 p2Reason => 'unknown',
37 @_,
38 );
39  
40 return $self;
41 }
42  
43 sub printSignature {
44 my $self = shift;
45  
46 my $global = $self->global;
47 my $log = $global->log;
48  
49 my $buf = '';
50 $buf .= "Result for target [".$self->ip."]:".$self->port.":";
51  
52 return $buf;
53 }
54  
55 sub print {
56 my $self = shift;
57  
58 my $buf = "> Cannot fingerprint a closed or filtered port:\n";
59 $buf .= "> Error for P1 reply: ".$self->p1Reason."\n";
60 $buf .= "> Error for P2 reply: ".$self->p2Reason;
61  
62 return $buf;
63 }
64  
65 1;
66  
67 __END__