File: Huawei.pm

package info (click to toggle)
libsnmp-info-perl 3.65-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,052 kB
  • sloc: perl: 33,997; makefile: 2; sh: 1
file content (756 lines) | stat: -rw-r--r-- 19,919 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
# SNMP::Info::Layer3::Huawei
#
# Copyright (c) 2018 Jeroen van Ingen and Eric Miller
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#     * Redistributions of source code must retain the above copyright notice,
#       this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of the University of California, Santa Cruz nor the
#       names of its contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

package SNMP::Info::Layer3::Huawei;

use strict;
use Exporter;
use SNMP::Info::Layer3;
use SNMP::Info::IEEE802dot3ad;

@SNMP::Info::Layer3::Huawei::ISA = qw/
    SNMP::Info::IEEE802dot3ad
    SNMP::Info::Layer3
    Exporter
    /;
@SNMP::Info::Layer3::Huawei::EXPORT_OK = qw//;

use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;

$VERSION = '3.65';

%MIBS = (
    %SNMP::Info::Layer3::MIBS,
    %SNMP::Info::IEEE802dot3ad::MIBS,
    'HUAWEI-MIB'               => 'quidway',
    'HUAWEI-PORT-MIB'          => 'hwEthernetDuplex',
    'HUAWEI-IF-EXT-MIB'        => 'hwTrunkIfIndex',
    'HUAWEI-L2IF-MIB'          => 'hwL2IfPortIfIndex',
    'HUAWEI-POE-MIB'           => 'hwPoePower',
    'HUAWEI-ENTITY-EXTENT-MIB' => 'hwEntityFanState',
);

%GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, );

%FUNCS = (
    %SNMP::Info::Layer3::FUNCS,
    %SNMP::Info::IEEE802dot3ad::FUNCS,

    # HUAWEI-PORT-MIB::hwEthernetTable
    'hw_eth_speed_admin' => 'hwEthernetSpeedSet',
    'hw_eth_duplex'      => 'hwEthernetDuplex',
    'hw_eth_auto'        => 'hwEthernetNegotiation',
    'hw_eth_frame_len'   => 'hwEthernetJumboframeMaxLength',

    # HUAWEI-PORT-MIB::hwPhysicalPortTable
    'hw_phy_port_slot' => 'hwPhysicalPortInSlot',

    # HUAWEI-IF-EXT-MIB::hwTrunkIfTable
    'hw_trunk_if_idx' => 'hwTrunkIfIndex',
    'hw_trunk_entry'  => 'hwTrunkValidEntry',

    # HUAWEI-L2IF-MIB::hwL2IfTable
    'hw_l2if_port_idx' => 'hwL2IfPortIfIndex',

    # HUAWEI-POE-MIB::hwPoePortTable
    'hw_peth_port_admin'  => 'hwPoePortEnable',
    'hw_peth_port_status' => 'hwPoePortPowerStatus',
    'hw_peth_port_class'  => 'hwPoePortPdClass',
    'hw_peth_port_power'  => 'hwPoePortConsumingPower',

    # HUAWEI-POE-MIB::hwPoeSlotTable
    'peth_power_watts'       => 'hwPoeSlotMaximumPower',
    'peth_power_consumption' => 'hwPoeSlotConsumingPower',
    'peth_power_threshold'   => 'hwPoeSlotPowerUtilizationThreshold',

    # HUAWEI-ENTITY-EXTENT-MIB::hwFanStatusTable
    'hw_fan_state' => 'hwEntityFanState',
    'hw_fan_descr' => 'hwEntityFanDesc',

    # HUAWEI-ENTITY-EXTENT-MIB::hwPwrStatusTable
    'hw_pwr_state' => 'hwEntityPwrState',
    'hw_pwr_descr' => 'hwEntityPwrDesc',
);

%MUNGE = (
    %SNMP::Info::Layer3::MUNGE,
    %SNMP::Info::IEEE802dot3ad::MUNGE,
    'hw_peth_port_admin' => \&SNMP::Info::Layer3::Huawei::munge_hw_peth_admin,
    'peth_power_watts'   => \&SNMP::Info::Layer3::Huawei::munge_hw_peth_power,
    'peth_power_consumption' =>
        \&SNMP::Info::Layer3::Huawei::munge_hw_peth_power,
    'hw_peth_port_status' =>
        \&SNMP::Info::Layer3::Huawei::munge_hw_peth_status,
    'hw_peth_port_class' => \&SNMP::Info::Layer3::Huawei::munge_hw_peth_class,
);

sub vendor {
    return "Huawei";
}

sub os {
    my $huawei = shift;
    my $descr  = $huawei->description();

    if ( $descr =~ /\b(VRP)\b/ ) {
        return $1;
    }
    return "huawei";
}

sub os_ver {
    my $huawei = shift;

    my $entity_os = $huawei->entity_derived_os_ver();
    if ( defined $entity_os and $entity_os !~ /^\s*$/ ) {
        return $entity_os;
    }

    my $descr  = $huawei->description();
    my $os_ver = undef;

    if ($descr =~ /Version\s            # Start match on Version string
                   ([\d\.]+)            # Capture the primary version in 1
                   ,?                   # There may be a comma
                   \s                   # Always a space
                   (?:Release|Feature)? # Don't capture stanza if present
                   (?:\(\w+)?           # If paren & model don't capture
                   \s                   # Always a space
                   (\w+)                # If 2nd part of version capture in 2
                   /xi
        )
    {
        $os_ver = $2 ? "$1 $2" : $1;
    }

    return $os_ver;
}

sub mac {
    my $huawei  = shift;

    return $huawei->b_mac();
}

sub i_ignore {
    my $huawei  = shift;
    my $partial = shift;

    my $interfaces = $huawei->interfaces($partial) || {};

    my %i_ignore;
    foreach my $if ( keys %$interfaces ) {

        # lo0 etc
        if ( $interfaces->{$if} =~ /\b(inloopback|console)\d*\b/ix ) {
            $i_ignore{$if}++;
        }
    }
    return \%i_ignore;
}

sub bp_index {
    my $huawei = shift;

    my $hw_index = $huawei->hw_l2if_port_idx();
    return $hw_index
        if ( ref {} eq ref $hw_index and scalar keys %$hw_index );

    return $huawei->SUPER::bp_index();
}

sub i_duplex {
    my $huawei  = shift;
    my $partial = shift;

    my $hw_duplex = $huawei->hw_eth_duplex($partial);
    return $hw_duplex
        if ( ref {} eq ref $hw_duplex and scalar keys %$hw_duplex );

    return $huawei->SUPER::i_duplex($partial);
}

sub i_duplex_admin {
    my $huawei  = shift;
    my $partial = shift;

    my $hw_duplex_admin = $huawei->hw_eth_duplex($partial) || {};
    my $hw_auto         = $huawei->hw_eth_auto($partial)   || {};

    my %i_duplex_admin;
    foreach my $if ( keys %$hw_duplex_admin ) {
        my $duplex = $hw_duplex_admin->{$if};
        next unless defined $duplex;
        my $auto = $hw_auto->{$if} || 'disabled';

        my $string = 'other';
        $string = 'half' if ( $duplex =~ /half/i and $auto =~ /disabled/i );
        $string = 'full' if ( $duplex =~ /full/i and $auto =~ /disabled/i );
        $string = 'auto' if $auto =~ /enabled/i;

        $i_duplex_admin{$if} = $string;
    }
    return \%i_duplex_admin;
}

sub agg_ports {
    my $huawei = shift;

    # First use proprietary MIB for broader implementation across
    # devices type / os and no xref of hwL2IfPortIfIndex
    my $masters = $huawei->hw_trunk_if_idx();
    my $slaves  = $huawei->hw_trunk_entry();

    my $ret = {};

    if (    ref {} eq ref $masters
        and scalar keys %$masters
        and ref {} eq ref $slaves
        and scalar keys %$slaves )
    {
        foreach my $s ( keys %$slaves ) {
            next if $slaves->{$s} ne 'valid';
            my ( $trunk, $sl_idx ) = split( /\./, $s );
            foreach my $m ( keys %$masters ) {
                next unless $m == $trunk;
                next unless defined $masters->{$m};
                $ret->{$sl_idx} = $masters->{$m};
                last;
            }
        }
        return $ret;
    }

    # If for some reason we don't get the info, try IEEE8023-LAG-MIB
    return $huawei->agg_ports_lag();
}

# The standard IEEE 802.af POWER-ETHERNET-MIB has an index of module.port
# The HUAWEI-POE-MIB only indexes by ifIndex, we need to match the standard
# for so method calls across classes work the same
#
sub peth_port_ifindex {
    my $huawei = shift;

    my $peth_port_status = $huawei->hw_peth_port_status() || {};
    my $peth_port_slot   = $huawei->hw_phy_port_slot()    || {};
    my $i_descr          = $huawei->i_description()       || {};

    my $peth_port_ifindex = {};

    foreach my $i ( keys %$peth_port_status ) {
        my $slot = 0;
        if ( exists $peth_port_slot->{$i}
            && defined $peth_port_slot->{$i} )
        {
            $slot = $peth_port_slot->{$i};
        }
        elsif ( exists $i_descr->{$i}
            && $i_descr->{$i} =~ /(\d+)(?:\/\d+){2,3}$/x )
        {
            $slot = $1;
        }
        $peth_port_ifindex->{"$slot.$i"} = $i;
    }
    return $peth_port_ifindex;
}

sub peth_port_admin {
    my $huawei = shift;

    my $port_admin   = $huawei->hw_peth_port_admin() || {};
    my $port_ifindex = $huawei->peth_port_ifindex()  || {};

    my $peth_port_admin = {};

    foreach my $idx ( keys %$port_ifindex ) {
        my $ifindex = $port_ifindex->{$idx};
        my $admin   = $port_admin->{$ifindex};
        next unless $admin;

        $peth_port_admin->{$idx} = $admin;
    }
    return $peth_port_admin;
}

sub peth_port_status {
    my $huawei = shift;

    my $port_status  = $huawei->hw_peth_port_status() || {};
    my $port_ifindex = $huawei->peth_port_ifindex()   || {};

    my $peth_port_status = {};

    foreach my $idx ( keys %$port_ifindex ) {
        my $ifindex = $port_ifindex->{$idx};
        my $status  = $port_status->{$ifindex};
        next unless $status;

        $peth_port_status->{$idx} = $status;
    }
    return $peth_port_status;
}

sub peth_port_class {
    my $huawei = shift;

    my $port_class   = $huawei->hw_peth_port_class() || {};
    my $port_ifindex = $huawei->peth_port_ifindex()  || {};

    my $peth_port_class = {};

    foreach my $idx ( keys %$port_ifindex ) {
        my $ifindex = $port_ifindex->{$idx};
        my $class   = $port_class->{$ifindex};
        next unless $class;

        $peth_port_class->{$idx} = $class;
    }
    return $peth_port_class;
}

sub peth_port_power {
    my $huawei = shift;

    my $port_power   = $huawei->hw_peth_port_power() || {};
    my $port_ifindex = $huawei->peth_port_ifindex()  || {};

    my $peth_port_power = {};

    foreach my $idx ( keys %$port_ifindex ) {
        my $ifindex = $port_ifindex->{$idx};
        my $power   = $port_power->{$ifindex};
        next unless defined $power;

        $peth_port_power->{$idx} = $power;
    }
    return $peth_port_power;
}

sub peth_port_neg_power {
    my $huawei = shift;

    my $peth_port_status = $huawei->peth_port_status()  || {};
    my $peth_port_class  = $huawei->peth_port_class()   || {};
    my $port_ifindex     = $huawei->peth_port_ifindex() || {};

    my $huaweimax = {
        'class0' => 12950,
        'class1' => 3840,
        'class2' => 6490,
        'class3' => 12950,
        'class4' => 25500
    };

    my $peth_port_neg_power = {};

    foreach my $idx ( keys %$port_ifindex ) {
        if ( $peth_port_status->{$idx} eq 'deliveringPower' ) {
            $peth_port_neg_power->{$idx}
                = $huaweimax->{ $peth_port_class->{$idx} };
        }
    }
    return $peth_port_neg_power;
}

sub fan {
    my $huawei = shift;

    my $fan   = $huawei->hw_fan_descr() || {};
    my $state = $huawei->hw_fan_state() || {};

    if ( scalar keys %$state ) {
        my @messages = ();

        foreach my $k ( keys %$state ) {
            next if $state->{$k} and $state->{$k} eq 'normal';
            my ($slot, $num) = split(/\./, $k);
            my $descr = "Slot $slot,Fan $num";
            $descr = $fan->{$k} if ($fan->{$k});

            push @messages, "$descr: $state->{$k}";
        }

        push @messages, ( ( scalar keys %$state ) . " fans OK" )
            if scalar @messages == 0;

        return ( join ", ", @messages );
    }
    return;
}

sub ps1_status {
    my $huawei = shift;

    my $pwr_state = $huawei->hw_pwr_state() || {};
    my $pwr_descr = $huawei->hw_pwr_descr() || {};

    my $ret = "";
    my $s   = "";
    foreach my $i ( sort keys %$pwr_state ) {
        my ( $slot, $num ) = split( /\./, $i );
        next unless $num == 1;
        my $descr = "Slot $slot,PS $num";
        $descr = $pwr_descr->{$i} if ($pwr_descr->{$i});

        $ret .= $s . $descr . ": " . $pwr_state->{$i};
        $s = ", ";
    }
    return if ( $s eq "" );
    return $ret;
}

sub ps2_status {
    my $huawei = shift;

    my $pwr_state = $huawei->hw_pwr_state() || {};
    my $pwr_descr = $huawei->hw_pwr_descr() || {};

    my $ret = "";
    my $s   = "";
    foreach my $i ( sort keys %$pwr_state ) {
        my ( $slot, $num ) = split( /\./, $i );
        next unless $num == 2;
        my $descr = "Slot $slot,PS $num";
        $descr = $pwr_descr->{$i} if ($pwr_descr->{$i});

        $ret .= $s . $descr . ": " . $pwr_state->{$i};
        $s = ", ";
    }
    return if ( $s eq "" );
    return $ret;
}

sub i_mtu {
    my $huawei = shift;

    my $mtus   = $huawei->SUPER::i_mtu()     || {};
    my $frames = $huawei->hw_eth_frame_len() || {};

    foreach my $idx ( keys %$mtus ) {
        my $frame_sz = $frames->{$idx};
        next unless $frame_sz;

        $mtus->{$idx} = $frame_sz;
    }
    return $mtus;
}

sub munge_hw_peth_admin {
    my $admin = shift;

    $admin =~ s/enabled/true/;
    $admin =~ s/disabled/false/;
    return $admin;
}

sub munge_hw_peth_power {
    my $pwr = shift;

    $pwr = $pwr / 1000;
    return sprintf( "%.0f", $pwr );
}

sub munge_hw_peth_class {
    my $pwr = shift;

    return "class$pwr";
}

# The values are from the MIB reference guide
sub munge_hw_peth_status {
    my $pwr = shift;

    # The status is an octet string rather than enum
    # so use regex rather than hash lookup
    $pwr = 'disabled'        if $pwr =~ /Disabled/i;
    $pwr = 'searching'       if $pwr =~ /(Powering|Power-ready|Detecting)/ix;
    $pwr = 'deliveringPower' if $pwr =~ /Powered/i;
    $pwr = 'fault'           if $pwr =~ /fault/i;

    return $pwr;
}

1;

__END__

=head1 NAME

SNMP::Info::Layer3::Huawei - SNMP Interface to Huawei switches and routers.

=head1 AUTHORS

Jeroen van Ingen and Eric Miller

=head1 SYNOPSIS

 # Let SNMP::Info determine the correct subclass for you.
 my $huawei = new SNMP::Info(
                          AutoSpecify => 1,
                          Debug       => 1,
                          DestHost    => 'myrouter',
                          Community   => 'public',
                          Version     => 2
                        )
    or die "Can't connect to DestHost.\n";

 my $class      = $huawei->class();
 print "SNMP::Info determined this device to fall under subclass : $class\n";

=head1 DESCRIPTION

Subclass for Huawei switches

=head2 Inherited Classes

=over

=item SNMP::Info::Layer3

=item SNMP::Info::IEEE802dot3ad

=back

=head2 Required MIBs

=over

=item F<HUAWEI-MIB>

=item F<HUAWEI-PORT-MIB>

=item F<HUAWEI-IF-EXT-MIB>

=item F<HUAWEI-L2IF-MIB>

=item F<HUAWEI-POE-MIB>

=item F<HUAWEI-ENTITY-EXTENT-MIB>

=item Inherited Classes' MIBs

See L<SNMP::Info::Layer3> for its own MIB requirements.

See L<SNMP::Info::IEEE802dot3ad> for its own MIB requirements.

=back

=head1 GLOBALS

These are methods that return scalar value from SNMP

=over

=item $huawei->vendor()

Returns 'Huawei'.

=item $huawei->os()

Returns 'VRP' if contained in C<sysDescr>, 'huawei' otherwise.

=item $huawei->os_ver()

Returns the software version derived from the C<ENTITY-MIB> or
extracted from C<sysDescr>.

=item $huawei->mac()

Base MAC of the device.

(C<dot1dBaseBridgeAddress>)

=item $huawei->fan()

Return the status of all fans from the F<HUAWEI-ENTITY-EXTENT-MIB>. Returns
a string indicating the number of fans 'OK' or identification of any fan without
a 'normal' operating status

=item $huawei->ps1_status()

Return the status of the first power supply in each chassis or switch from
the F<HUAWEI-ENTITY-EXTENT-MIB>

=item $huawei->ps2_status()

Return the status of the second power supply in each chassis or switch from
the F<HUAWEI-ENTITY-EXTENT-MIB>

=back

=head2 Globals imported from SNMP::Info::Layer3

See documentation in L<SNMP::Info::Layer3> for details.

=head1 TABLE ENTRIES

These are methods that return tables of information in the form of a reference
to a hash.

=over

=item $huawei->i_duplex()

Returns reference to map of IIDs to current link duplex.

=item $huawei->i_duplex_admin()

Returns reference to hash of IIDs to admin duplex setting.

=back

=head2 POE Slot Table

=over

=item $huawei->peth_power_watts()

The slot's power supply's capacity, in watts.

C<hwPoeSlotMaximumPower>

=item $huawei->peth_power_consumption()

How much power, in watts, this power supply has been committed to
deliver.

C<hwPoeSlotConsumingPower>

=item $huawei->peth_power_threshold()

The threshold (in percent) of consumption required to raise an
alarm.

C<hwPoeSlotPowerUtilizationThreshold>

=back

=head2 Overrides

=over

=item $huawei->i_ignore()

Returns reference to hash.  Increments value of IID if port is to be ignored.

Ignores InLoopback and Console interfaces

=item $huawei->bp_index()

Returns a mapping between C<ifIndex> and the Bridge Table. Uses
C<hwL2IfPortIfIndex> for the most complete mapping and falls back to
C<dot1dBasePortIfIndex> if not available.

=item C<agg_ports>

Returns a HASH reference mapping from slave to master port for each member of
a port bundle on the device. Keys are ifIndex of the slave ports, Values are
ifIndex of the corresponding master ports. Attempts to use C<hwTrunkIfTable>
first and then C<dot3adAggPortListPorts> if that is unavailable.

=item C<i_mtu>

Interface MTU value. Overridden with corresponding frame size entry from
C<hwEthernetJumboframeMaxLength> if one exists.

=back

=head2 Power Port Table

The index of these methods have been normalized to slot.port and values
munged to provide compatibility with the IEEE 802.3af F<POWER-ETHERNET-MIB>
and equivalent L<SNMP::Info::PowerEthernet> methods.

=over

=item $huawei->peth_port_admin()

Administrative status: is this port permitted to deliver power?

=item $huawei->peth_port_status()

Current status: is this port delivering power, searching, disabled, etc?

=item $huawei->peth_port_class()

Device class: if status is delivering power, this represents the 802.3af
class of the device being powered.

=item $huawei->peth_port_power()

Power supplied the port, in milliwatts

=item $huawei->peth_port_ifindex()

Returns an index of slot.port to an C<ifIndex>. Slot defaults to zero
meaning chassis or box if there is no C<ifIndex> to slot mapping available in
C<hwPhysicalPortInSlot>. Mapping the index to slot.port is a normalization
function to provide compatibility with the IEEE 802.3af F<POWER-ETHERNET-MIB>.

=item $huawei->peth_port_neg_power()

The power, in milliwatts, that has been committed to this port.
This value is derived from the 802.3af class of the device being
powered.

=back

=head2 Table Methods imported from SNMP::Info::Layer3

See documentation in L<SNMP::Info::Layer3> for details.

=head2 Table Methods imported from SNMP::Info::IEEE802dot3ad

See documentation in L<SNMP::Info::IEEE802dot3ad> for details.

=head1 Data Munging Callback Subroutines

=over

=item $huawei->munge_hw_peth_admin()

Normalizes C<hwPoePortEnable> values to 'true' or 'false'.

=item $huawei->munge_hw_peth_class()

Normalizes C<hwPoePortPdClass> values by prepending 'class'.

=item $huawei->munge_hw_peth_power()

Converts and rounds to a whole number milliwatts to watts.

=item $huawei->munge_hw_peth_status()

Normalizes C<hwPoePortPowerStatus> values to those that would be returned by
the the IEEE 802.3af F<POWER-ETHERNET-MIB>.

=back

=cut