From b71ba01d32c17e118c06e9fb738748384f33654b Mon Sep 17 00:00:00 2001 From: Bill Fenner <> Date: Wed, 5 Apr 2006 05:43:36 +0000 Subject: [PATCH] Create and use a duplex_munge to remove the string "Duplex" from the return value of el_duplex(). Submitted by: Justin Hunter (arcanez) --- Info/EtherLike.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Info/EtherLike.pm b/Info/EtherLike.pm index 8e603c93..a7f66472 100644 --- a/Info/EtherLike.pm +++ b/Info/EtherLike.pm @@ -69,7 +69,18 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/; 'el_coll_freq' => 'dot3CollFrequencies' ); -%MUNGE = ( %SNMP::Info::MUNGE ); +%MUNGE = ( %SNMP::Info::MUNGE, + 'el_duplex' => \&munge_el_duplex, + ); + +sub munge_el_duplex { + my $duplex = shift; + return unless defined $duplex; + + $duplex =~ s/Duplex$//; + return $duplex; +} + 1; __END__ @@ -106,10 +117,6 @@ Max Baker my $iid = $el_index->{$el_port}; my $port = $interfaces->{$iid}; - $duplex = 'half' if $duplex =~/half/i; - $duplex = 'full' if $duplex =~/full/i; - $duplex = 'auto' if $duplex =~/auto/i; - print "PORT:$port set to duplex:$duplex\n"; }