line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SyslogScan::Group; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = 0.20; |
4
|
0
|
|
|
0
|
|
|
sub Version { $VERSION }; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
528
|
use SyslogScan::Summary; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use SyslogScan::Usage; |
8
|
|
|
|
|
|
|
use strict; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
my $type = shift; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $self = { byAddress => {}, |
15
|
|
|
|
|
|
|
groupUsage => new SyslogScan::Usage() }; |
16
|
|
|
|
|
|
|
bless ($self,$type); |
17
|
|
|
|
|
|
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub registerUsage |
21
|
|
|
|
|
|
|
{ |
22
|
|
|
|
|
|
|
my $self = shift; |
23
|
|
|
|
|
|
|
my $address = shift; |
24
|
|
|
|
|
|
|
my $usage = shift; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $byAddress = $$self{byAddress}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$$self{groupUsage} -> addUsage($usage); |
29
|
|
|
|
|
|
|
$$byAddress{$address} = $usage -> deepCopy(); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub dump |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
my $self = shift; |
35
|
|
|
|
|
|
|
my $retString; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $byAddress = $$self{byAddress}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$retString .= $$self{groupUsage} -> dump(); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $address; |
42
|
|
|
|
|
|
|
foreach $address (sort keys %$byAddress) |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
$retString .= "$address:\n"; |
45
|
|
|
|
|
|
|
$retString .= $$byAddress{$address} -> dump(); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
return $retString; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |