From dc48aa08ba0b35fa61352f6bb2771e978287776d Mon Sep 17 00:00:00 2001 From: Eric Miller <> Date: Tue, 15 Jul 2008 03:09:18 +0000 Subject: [PATCH] Move munge_e_type() to Info.pm --- Info.pm | 14 ++++++++++++++ Info/Entity.pm | 13 +++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Info.pm b/Info.pm index c52dd46b..0032d4f3 100644 --- a/Info.pm +++ b/Info.pm @@ -2605,6 +2605,20 @@ sub munge_null { return $text; } +=item munge_e_type() + +Takes an OID and return the object name if the right MIB is loaded. + +=cut + +sub munge_e_type { + my $oid = shift; + + my $name = &SNMP::translateObj($oid); + return $name if defined($name); + return $oid; +} + =back =head2 Internally Used Functions diff --git a/Info/Entity.pm b/Info/Entity.pm index 98a3b427..51e7f266 100644 --- a/Info/Entity.pm +++ b/Info/Entity.pm @@ -68,7 +68,7 @@ $VERSION = '1.09'; ); %MUNGE = ( - 'e_type' => \&munge_e_type, + 'e_type' => \&SNMP::Info::munge_e_type, ); # entPhysicalIndex is not-accessible. Create to facilitate emulation methods @@ -112,14 +112,6 @@ sub e_port { return \%e_port; } -sub munge_e_type { - my $oid = shift; - - my $name = &SNMP::translateObj($oid); - return $name if defined($name); - return $oid; -} - 1; __END__ @@ -156,7 +148,8 @@ See RFC 2737 for full details. Create or use a device subclass that inherit this class. Do not use directly. -For debugging purposes you can call this class directly as you would SNMP::Info +For debugging purposes you can call this class directly as you would +SNMP::Info my $entity = new SNMP::Info::Entity (...);