line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Farly::Transport::PortRange;
|
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
863
|
use 5.008008;
|
|
17
|
|
|
|
|
54
|
|
|
17
|
|
|
|
|
796
|
|
4
|
17
|
|
|
17
|
|
93
|
use strict;
|
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
580
|
|
5
|
17
|
|
|
17
|
|
102
|
use warnings;
|
|
17
|
|
|
|
|
59
|
|
|
17
|
|
|
|
|
517
|
|
6
|
17
|
|
|
17
|
|
83
|
use Carp;
|
|
17
|
|
|
|
|
40
|
|
|
17
|
|
|
|
|
1538
|
|
7
|
17
|
|
|
17
|
|
107
|
use Farly::Transport::Port;
|
|
17
|
|
|
|
|
33
|
|
|
17
|
|
|
|
|
370
|
|
8
|
17
|
|
|
17
|
|
92
|
use Farly::Transport::Object;
|
|
17
|
|
|
|
|
30
|
|
|
17
|
|
|
|
|
10134
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.26';
|
11
|
|
|
|
|
|
|
our @ISA = qw(Farly::Transport::Object);
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new {
|
14
|
112
|
|
|
112
|
1
|
601
|
my ( $class, $first, $last ) = @_;
|
15
|
|
|
|
|
|
|
|
16
|
112
|
|
|
|
|
478
|
my $self = {
|
17
|
|
|
|
|
|
|
LOW => undef,
|
18
|
|
|
|
|
|
|
HIGH => undef,
|
19
|
|
|
|
|
|
|
};
|
20
|
112
|
|
|
|
|
338
|
bless( $self, $class );
|
21
|
|
|
|
|
|
|
|
22
|
112
|
100
|
|
|
|
415
|
if ( defined $last ) {
|
|
|
50
|
|
|
|
|
|
23
|
24
|
|
|
|
|
124
|
$self->{LOW} = Farly::Transport::Port->new($first);
|
24
|
24
|
|
|
|
|
88
|
$self->{HIGH} = Farly::Transport::Port->new($last);
|
25
|
|
|
|
|
|
|
}
|
26
|
|
|
|
|
|
|
elsif ( defined $first ) {
|
27
|
88
|
|
|
|
|
618
|
my ( $low, $high ) = split( /-|\s+/, $first );
|
28
|
88
|
|
|
|
|
525
|
$self->{LOW} = Farly::Transport::Port->new($low);
|
29
|
88
|
|
|
|
|
347
|
$self->{HIGH} = Farly::Transport::Port->new($high);
|
30
|
|
|
|
|
|
|
}
|
31
|
|
|
|
|
|
|
|
32
|
112
|
50
|
|
|
|
385
|
confess "invalid port range"
|
33
|
|
|
|
|
|
|
if ( $self->first() > $self->last() );
|
34
|
|
|
|
|
|
|
|
35
|
112
|
|
|
|
|
440
|
return $self;
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub low {
|
39
|
17
|
|
|
17
|
0
|
94
|
return $_[0]->{LOW};
|
40
|
|
|
|
|
|
|
}
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub high {
|
43
|
17
|
|
|
17
|
0
|
104
|
return $_[0]->{HIGH};
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub first {
|
47
|
270
|
|
|
270
|
1
|
840
|
return $_[0]->{LOW}->port();
|
48
|
|
|
|
|
|
|
}
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub last {
|
51
|
191
|
|
|
191
|
1
|
569
|
return $_[0]->{HIGH}->port();
|
52
|
|
|
|
|
|
|
}
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub as_string {
|
55
|
17
|
|
|
17
|
1
|
38
|
my ($self) = @_;
|
56
|
17
|
|
|
|
|
72
|
return join( " ", $self->low()->as_string(), $self->high()->as_string() );
|
57
|
|
|
|
|
|
|
}
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub iter {
|
60
|
0
|
|
|
0
|
1
|
|
my ($self) = @_;
|
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my @list;
|
63
|
0
|
|
|
|
|
|
my $i = $self->first();
|
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
do {
|
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
push @list, Farly::Transport::Port->new($i);
|
68
|
0
|
|
|
|
|
|
$i++;
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
} while ( $i < $self->last() );
|
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
return @list;
|
73
|
|
|
|
|
|
|
}
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1;
|
76
|
|
|
|
|
|
|
__END__
|