Insight/MIB/QBridge.pm

filter: Statementstmt 81.8% 18 / 22 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 64.7% 22 / 34 CC 3 SCAR 18.7
CC
3
Cov
67%
munge_vlan_static_row_status
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« Insight.pm ↑ Summary Insight/MIB.pm »
1 package SNMP::Insight::MIB::QBridge;
2  
3 #ABSTRACT: Support for data in Q-BRIDGE-MIB
4  
5 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = '0.002'; #TRIAL VERSION:
8  
9 1 ▶use SNMP::Insight::Moose::MIB;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 with 'SNMP::Insight::MIB', 'SNMP::Insight::MIB::Bridge';
13  
14 1 mib_oid "1.3.6.1.2.1.17.7";
15 1 mib_name "Q-BRIDGE-MIB";
16  
17 1 warn "QBridge stub: to be implemented";
18  
19 # Q-BRIDGE-MIB is a subtree of BRIDGE-MIB
20  
21 # split Dot1qTpFdbEntry index into FDB ID and MAC Address.
22 #sub munge_qtpfdb_index {
23 # my $idx = shift;
24 # my @values = split( /\./, $idx );
25 # my $fdb_id = shift(@values);
26 # return ( $fdb_id, join( ':', map { sprintf "%02x", $_ } @values ) );
27 #}
28  
29 1 has_table "dot1qVlanCurrentTable" => (
30 oid => "1.4.2",
31  
32 # should be a complex index, use this just for syntax check
33 index => 'dot1qVlanCurrentEgressPorts',
34 columns => {
35 dot1qVlanCurrentEgressPorts => [ 4, 'munge_port_list' ],
36 dot1qVlanCurrentUntaggedPorts => [ 5, 'munge_port_list' ],
37 dot1qVlanStatus => 6,
38 }
39 );
40  
41 0 ▶sub munge_vlan_static_row_status {
Subroutine munge_vlan_static_row_status: not called CC=3 SCAR=24.8
Pod documented
42 0 my $val = shift;
43 0 ▶ $val or return;
Branch: 1 branch
BranchTrueFalseTotal
$val or return 0 0 0
44  
45 0 my %row_status = (
46 1 => 'active',
47 2 => 'notInService',
48 3 => 'notReady',
49 4 => 'createAndGo',
50 5 => 'createAndWait',
51 6 => 'destroy'
52 );
53  
54 0 ▶ return $row_status{$val} || $val;
Condition0%0/3
$row_status{$val} || $val
l!l&&r!l&&!r
000
MC/DC0%0/2
$row_status{$val} || $val
$row_status{$val} $val
Truth table0%0/3
A || B
A= $row_status{$val}B= $val
ABresult
1X1
011
000
55 }
56  
57 1 has_table "dot1qVlanStaticTable" => (
58 oid => "1.4.3",
59 index => 'dot1qVlanStaticName',
60 columns => {
61 dot1qVlanStaticName => 1,
62 dot1qVlanStaticEgressPorts => [ 2, 'munge_port_list' ],
63 dot1qVlanForbiddenEgressPorts => [ 3, 'munge_port_list' ],
64 dot1qVlanStaticUntaggedPorts => [ 4, 'munge_port_list' ],
65 dot1qVlanStaticRowStatus => [ 5, 'munge_vlan_static_row_status' ],
66 }
67 );
68  
69 1 has_table "dot1qPortVlanTable" => (
70 oid => "1.4.5",
71  
72 # for syntax check
73 index => 'dot1dBasePort',
74 columns => {
75 dot1qPvid => 1,
76 dot1qPortAcceptableFrameTypes => 2,
77 dot1qPortIngressFiltering => 3,
78 },
79 );
80  
81 1 1;
82  
83 # Local Variables:
84 # mode: cperl
85 # indent-tabs-mode: nil
86 # cperl-indent-level: 4
87 # cperl-indent-parens-as-block: t
88 # End:
89  
90 __END__
« Insight.pm ↑ Summary Insight/MIB.pm »