Create and use a duplex_munge to remove the string "Duplex" from the

return value of el_duplex().

Submitted by:	Justin Hunter (arcanez)
This commit is contained in:
Bill Fenner
2006-04-05 05:43:36 +00:00
parent 5cc00d443c
commit b71ba01d32

View File

@@ -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";
}