line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::PCI::Modems; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
118723127
|
use strict; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
80
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
466
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
174
|
|
7
|
1
|
|
|
1
|
|
494
|
use FusionInventory::Agent::Tools::Generic; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
211
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{modem}; |
12
|
0
|
|
|
|
|
|
return 1; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub doInventory { |
16
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
19
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
foreach my $modem (_getModems(logger => $logger)) { |
22
|
0
|
|
|
|
|
|
$inventory->addEntry( |
23
|
|
|
|
|
|
|
section => 'MODEMS', |
24
|
|
|
|
|
|
|
entry => $modem |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _getModems { |
30
|
0
|
|
|
0
|
|
|
my @modems; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
foreach my $device (getPCIDevices(@_)) { |
33
|
0
|
0
|
|
|
|
|
next unless $device->{NAME} =~ /modem/i; |
34
|
0
|
|
|
|
|
|
push @modems, { |
35
|
|
|
|
|
|
|
DESCRIPTION => $device->{NAME}, |
36
|
|
|
|
|
|
|
NAME => $device->{MANUFACTURER}, |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return @modems; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |