[Netpass-users] lib/NetPass.pm patch
Brought to you by:
jeffmurphy
From: Robert V. <re...@no...> - 2005-09-07 15:44:45
|
We've been applying the following patch to NetPass.pm to enable the tree search functionality in the Cisco.pm module. The reason for this is roughly as follows. NP given a mac address will look at the address cache (via SNMP) of the switch to find if that mac is there and what port is it on. The problem with the cisco's is that the address table community string is indexed by the vlan number. So there seems to be to two choices: 1) To make a "direct" snmp call we need the network or IP address of the host so we can determine the vlan numbers we need. Unfortunately the network is not passed to the Cisco module. To pass it we need to pass it down from a couple of layers above. Not a big deal but it does change a couple modules (adding one parameter to a procedure call). This is what we did for np1 last year. 2) We can do this without changing anything external to the cisco module but it will be less efficient. Basically what we have to do without having the network is walk the address tables for all the netpass vlans on the switch. And if we can't find out the particular netpass vlans for a switch, we'll need to walk all vlans on the switch until we find the mac address. So if a given switch has 30 vlans, we may need to make up to 30 snmp calls to go through the complete mac address table of the switch. This seems potentially less efficient than linear searching and so should not be used. [rev@npw1 ~]$ diff /opt/netpass/lib/NetPass.pm /opt/netpass-src/NetPass/lib/NetPass.pm 527d526 < my $myNW = shift; 548c547 < my $ifIndex = $snmp->get_mac_port($mac, $myNW); --- > my $ifIndex = $snmp->get_mac_port($mac); 569c568 < $mac, $loopctl, $myNW); --- > $mac, $loopctl); 620c619 < $mac, {}, $myNW); --- > $mac, {}); Jeff, if this doesn't break anything of yours can this be added to the NP source tree? rev |