Info/EtherLike.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 33 CC 2 SCAR 12.0
CC
2
Cov
0%
munge_el_duplex
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 # SNMP::Info::EtherLike
2 #
3 # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond.
4 #
5 # Copyright (c) 2002,2003 Regents of the University of California
6 # All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions are met:
10 #
11 # * Redistributions of source code must retain the above copyright notice,
12 # this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
16 # * Neither the name of the University of California, Santa Cruz nor the
17 # names of its contributors may be used to endorse or promote products
18 # derived from this software without specific prior written permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 # LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 # POSSIBILITY OF SUCH DAMAGE.
31  
32 package SNMP::Info::EtherLike;
33  
34 use strict;
35 use warnings;
36 use Exporter;
37 use SNMP::Info;
38  
39 @SNMP::Info::EtherLike::ISA = qw/SNMP::Info Exporter/;
40 @SNMP::Info::EtherLike::EXPORT_OK = qw//;
41  
42 our ($VERSION, %MIBS, %FUNCS, %GLOBALS, %MUNGE);
43  
44 $VERSION = '3.985003';
45  
46 %MIBS = ( 'EtherLike-MIB' => 'etherMIB' );
47  
48 %GLOBALS = ();
49  
50 %FUNCS = (
51  
52 # EtherLike StatsTable
53 'el_chipset' => 'dot3StatsEtherChipSet',
54 'el_coll_excess' => 'dot3StatsExcessiveCollisions',
55 'el_coll_late' => 'dot3StatsLateCollisions',
56 'el_coll_mult' => 'dot3StatsMultipleCollisionFrames',
57 'el_coll_single' => 'dot3StatsSingleCollisionFrames',
58 'el_duplex' => 'dot3StatsDuplexStatus',
59 'el_error_alignment' => 'dot3StatsAlignmentErrors',
60 'el_error_fcs' => 'dot3StatsFCSErrors',
61 'el_error_cs' => 'dot3StatsCarrierSenseErrors',
62 'el_error_frame' => 'dot3StatsFrameTooLongs',
63 'el_error_mac_rec' => 'dot3StatsInternalMacReceiveErrors',
64 'el_error_mac_xmit' => 'dot3StatsInternalMacTransmitErrors',
65 'el_error_sqe' => 'dot3StatsSQETestErrors',
66 'el_error_symbol' => 'dot3StatsSymbolErrors',
67 'el_index' => 'dot3StatsIndex',
68 'el_xmit_defer' => 'dot3StatsDeferredTransmissions',
69  
70 # Ethernet-like Collision Statistics Group
71 'el_coll_freq' => 'dot3CollFrequencies',
72 );
73  
74 %MUNGE = ( %SNMP::Info::MUNGE, 'el_duplex' => \&munge_el_duplex, );
75  
76 sub munge_el_duplex {
77 my $duplex = shift;
78 return unless defined $duplex;
79  
80 $duplex =~ s/Duplex$//;
81 return $duplex;
82 }
83  
84 1;
85 __END__