Insight/MIB/Utils.pm

filter: Statementstmt 94.1% 16 / 17 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 88.4% 23 / 26 CC 3 SCAR 8.1
CC
3
Cov
86%
sysObjectID2vendor
3.5
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« Insight/Moose/MIB.pm ↑ Summary Insight/Abstraction.pm »
1 package SNMP::Insight::MIB::Utils;
2  
3 #ABSTRACT: Functions for dealing with MIB data
4  
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 our $VERSION = '0.002'; #TRIAL VERSION:
9  
10 3 ▶use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 our @EXPORT_OK = qw( sysObjectID2vendor );
12  
13 3 my %ID_VENDOR_MAP = (
14 9 => 'Cisco',
15 11 => 'HP',
16 18 => 'BayRS',
17 42 => 'Sun',
18 43 => '3Com',
19 45 => 'Baystack',
20 171 => 'Dell',
21 207 => 'Allied',
22 244 => 'Lantronix',
23 311 => 'Microsoft',
24 318 => 'APC',
25 674 => 'Dell',
26 1872 => 'AlteonAD',
27 1916 => 'Extreme',
28 1991 => 'Foundry',
29 2021 => 'NetSNMP',
30 2272 => 'Passport',
31 2636 => 'Juniper',
32 2925 => 'Cyclades',
33 3076 => 'Altiga',
34 3224 => 'Netscreen',
35 3375 => 'F5',
36 3417 => 'BlueCoatSG',
37 4526 => 'Netgear',
38 5624 => 'Enterasys',
39 5951 => 'Netscaler',
40 6027 => 'Force10',
41 6486 => 'AlcatelLucent',
42 6527 => 'Timetra',
43 8072 => 'NetSNMP',
44 9303 => 'PacketFront',
45 10002 => 'Ubiquiti',
46 11898 => 'Orinoco',
47 12325 => 'Pf',
48 12356 => 'Fortinet',
49 12532 => 'Neoteris',
50 14179 => 'Airespace',
51 14525 => 'Trapeze',
52 14823 => 'Aruba',
53 14988 => 'Mikrotik',
54 17163 => 'Steelhead',
55 25506 => 'H3C',
56 26543 => 'IBMGbTor',
57 30065 => 'Arista',
58 35098 => 'Pica8',
59 );
60  
61 3 ▶sub sysObjectID2vendor {
Subroutine sysObjectID2vendor: called CC=3 SCAR=12.5
Pod documented
62 3 my ($id) = @_;
63 3 ▶ defined $id or return "NO VENDOR";
Branch: 1 branch
BranchTrueFalseTotal
defined $id or return "NO VENDOR" 3 0 3
64  
65 3 ▶ $id =~ /^\.?1\.3\.6\.1\.4\.1\.(\d+)/ and return $ID_VENDOR_MAP{$1};
Branch: 1 branch
BranchTrueFalseTotal
$id =~ /^\.?1\.3\.6\.1\.4\.1\.(\d+)/ and return $ID_VENDOR_MAP{$1} 3 0 3
66 0 return "UNKNOWN";
67 }
68  
69 3 1;
70  
71 # Local Variables:
72 # mode: cperl
73 # indent-tabs-mode: nil
74 # cperl-indent-level: 4
75 # cperl-indent-parens-as-block: t
76 # End:
77  
78 __END__
« Insight/Moose/MIB.pm ↑ Summary Insight/Abstraction.pm »