Info/Layer3/ExtremeWing.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 44 CC 2 SCAR 10.6
CC
2
Cov
0%
model
6.0
vendor
2.0
os_ver
2.0
CRAP 2.9
1 package SNMP::Info::Layer3::ExtremeWing;
2 #
3 # Copyright (c) 2019 Netdisco Contributors
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 #
9 # * Redistributions of source code must retain the above copyright notice,
10 # this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # * Neither the name of the University of California, Santa Cruz nor the
15 # names of its contributors may be used to endorse or promote products
16 # derived from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 # LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 # POSSIBILITY OF SUCH DAMAGE.
29  
30 use strict;
31 use warnings;
32  
33 use Exporter;
34 use SNMP::Info::Layer3;
35  
36 @SNMP::Info::Layer3::ExtremeWing::ISA = qw/
37 SNMP::Info::Layer3
38 Exporter
39 /;
40 @SNMP::Info::Layer3::ExtremeWing::EXPORT_OK = qw//;
41  
42 our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE);
43  
44 $VERSION = '3.985003';
45  
46 %MIBS = (
47 %SNMP::Info::Layer3::MIBS,
48 'WING-MIB' => 'wingCfgMgmtName',
49 'WS-SMI' => 'ws2000',
50 );
51  
52 %GLOBALS = (
53 %SNMP::Info::Layer3::GLOBALS,
54  
55 # WiNG APs have a full entity mib, on all the models we tested in 2024 there is a single chassis entry at index 4000.
56 # The entPhysicalModelName seems to be a better representation of the model than the systemOID (e.g.wingSysoidAP310),
57 # so we use the former if available.
58 # Sample data:
59 # .1.3.6.1.2.1.47.1.1.1.1.2.4000 = STRING: "Extreme Networks, Inc. AP7532"
60 # .1.3.6.1.2.1.47.1.1.1.1.2.4000 = STRING: "Extreme Networks, Inc. AP310"
61 # .1.3.6.1.2.1.47.1.1.1.1.2.4000 = STRING: "Extreme Networks, Inc. AP360"
62 # .1.3.6.1.2.1.47.1.1.1.1.2.4000 = STRING: "Extreme Networks, Inc. AP310-1"
63 # .1.3.6.1.2.1.47.1.1.1.1.2.4000 = STRING: "Extreme Networks, Inc. NX5500"
64 # .1.3.6.1.2.1.47.1.1.1.1.13.4000 = STRING: "AP310i-WR"
65 # .1.3.6.1.2.1.47.1.1.1.1.13.4000 = STRING: "AP360i-WR"
66 # .1.3.6.1.2.1.47.1.1.1.1.13.4000 = STRING: "AP310i-1-WR"
67 # .1.3.6.1.2.1.47.1.1.1.1.13.4000 = STRING: "NX-5500-100R0-WR"
68 # .1.3.6.1.2.1.47.1.1.1.1.13.4000 = STRING: "AP-7532-67030-WR"
69  
70 'wing_os_ver' => 'entPhysicalSoftwareRev.4000',
71 'wing_mfg' => 'entPhysicalMfgName.4000',
72 'wing_model' => 'entPhysicalModelName.4000'
73 );
74  
75 %FUNCS = (
76 %SNMP::Info::Layer3::FUNCS,
77 );
78  
79 %MUNGE = (
80 %SNMP::Info::Layer3::MUNGE,
81 );
82  
83 sub vendor {
84 my $self = shift;
85 return $self->wing_mfg();
86 }
87  
88 sub os_ver {
89 my $self = shift;
90 return $self->wing_os_ver();
91 }
92  
93 sub os {
94 return 'WiNG';
95 }
96  
97 sub model {
98 my $self = shift;
99 # the super model is the resolved systemOid, use as fallback
100 my $pm = $self->SUPER::model();
101 my $wm = $self->wing_model();
102 return $wm ? $wm : $pm;
103 }
104  
105  
106  
107 1;
108  
109 __END__