Permalink
Browse files

API cleanup regarding NasPortToIfIndex

Got rid of _NasPortToIfIndex, put default implementation in NasPortToIfIndex and stopped warning logging.

We kept forgetting that we needed to overload NasPortToIfIndex all the time so let's embrace the default. People having problems shall trace.
  • Loading branch information...
obilodeau committed Mar 20, 2012
1 parent 3f2af00 commit 5c9ca565af94909e57a114f22746455cc0815fff
Showing with 5 additions and 30 deletions.
  1. +5 −17 lib/pf/SNMP.pm
  2. +0 −13 lib/pf/SNMP/LG.pm
View
@@ -2397,27 +2397,15 @@ sub _dot1xPortReauthenticate {
Translate RADIUS NAS-Port into the physical port ifIndex
+Default fallback implementation: we just return the NAS-Port as ifIndex.
+
=cut
sub NasPortToIfIndex {
- my ($this, $NAS_port) = @_;
+ my ($this, $nas_port) = @_;
my $logger = Log::Log4perl::get_logger(ref($this));
- $logger->warn(
- "This switch model doesn't seem to implement 802.1X or a degraded variant "
- . "like MAC Authentication. Please let us know what hardware you are using"
- );
- return $this->_NasPortToIfIndex($NAS_port);
-}
-
-=item _NasPortToIfIndex
-
-Default fallback implementation of NasPortToIfIndex, we just return the NAS-Port as ifIndex.
-
-=cut
-sub _NasPortToIfIndex {
- my ($this, $NAS_port) = @_;
-
- return $NAS_port;
+ $logger->trace("Fallback implementation. Returning NAS-Port as ifIndex: $nas_port");
+ return $nas_port;
}
=item handleReAssignVlanTrapForWiredMacAuth
View
@@ -505,19 +505,6 @@ sub getDot1dBasePortForThisIfIndex {
return $dot1dBasePort;
}
-=item NasPortToIfIndex
-
-Translate RADIUS NAS-Port into the physical port ifIndex.
-Relies on default implmementation.
-
-=cut
-sub NasPortToIfIndex {
- my ($this, $NAS_port) = @_;
-
- return $this->_NasPortToIfIndex($NAS_port);
-}
-
-
=back
=head1 AUTHOR

0 comments on commit 5c9ca56

Please sign in to comment.