Info/DocsisCM.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 49 CC 4 SCAR 14.3
CC
4
Cov
0%
vendor
6.0
model
6.0
os_ver
6.0
CRAP 4.2
1 # SNMP::Info::DocsisCM - SNMP Interface to DOCSIS Cable Modems
2 #
3 # Copyright (c) 2019 by The Netdisco Developer Team.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are met:
7 #
8 # * Redistributions of source code must retain the above copyright notice,
9 # this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # * Neither the name of the University of California, Santa Cruz nor the
14 # names of its contributors may be used to endorse or promote products
15 # derived from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 # LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 # POSSIBILITY OF SUCH DAMAGE.
28  
29 package SNMP::Info::DocsisCM;
30  
31 use strict;
32 use warnings;
33 use Exporter;
34  
35 use SNMP::Info::Layer2;
36  
37 @SNMP::Info::DocsisCM::ISA = qw/SNMP::Info::Layer2 Exporter/;
38 @SNMP::Info::DocsisCM::EXPORT_OK = qw//;
39  
40 our ($VERSION, %MIBS, %FUNCS, %GLOBALS, %MUNGE);
41  
42 $VERSION = '3.985003';
43
44 %MIBS = (
45 %SNMP::Info::Layer2::MIBS
46 );
47  
48 %GLOBALS = (
49 %SNMP::Info::Layer2::GLOBALS
50 );
51  
52 %FUNCS = (
53 %SNMP::Info::Layer2::FUNCS
54 );
55  
56 %MUNGE = (
57 %SNMP::Info::Layer2::MUNGE
58 );
59  
60 sub vendor {
61 my $cm = shift;
62 my $descr = $cm->description();
63 return $1 if $descr =~ /VENDOR: (.*?);/;
64 }
65  
66 sub model {
67 my $cm = shift;
68 my $descr = $cm->description();
69 return $1 if $descr =~ /MODEL: (.*?)>>/;
70 }
71  
72 sub os {
73 return "CM";
74 }
75  
76 sub os_ver {
77 my $cm = shift;
78 my $descr = $cm->description();
79 return $1 if $descr =~ /SW_REV: (.*?);/;
80 }
81  
82 1;
83 __END__