Move munge_e_type() to Info.pm

This commit is contained in:
Eric Miller
2008-07-15 03:09:18 +00:00
parent 53f9cc8c3d
commit dc48aa08ba
2 changed files with 17 additions and 10 deletions

14
Info.pm
View File

@@ -2605,6 +2605,20 @@ sub munge_null {
return $text; 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 =back
=head2 Internally Used Functions =head2 Internally Used Functions

View File

@@ -68,7 +68,7 @@ $VERSION = '1.09';
); );
%MUNGE = ( %MUNGE = (
'e_type' => \&munge_e_type, 'e_type' => \&SNMP::Info::munge_e_type,
); );
# entPhysicalIndex is not-accessible. Create to facilitate emulation methods # entPhysicalIndex is not-accessible. Create to facilitate emulation methods
@@ -112,14 +112,6 @@ sub e_port {
return \%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; 1;
__END__ __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. 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 (...); my $entity = new SNMP::Info::Entity (...);