NAME
BridgeQuery - Perl extension for retrieving bridge tables.
SYNOPSIS
use BridgeQuery;
use BridgeQuery qw(querymacs queryports);
$fdb = queryfdb(host => $address,
comm => $community);
unless (exists $fdb->{error}) {
($fdb->{$mac} = "n/a") unless (exists $fdb->{$mac});
print "This MAC address was found on port: ".$fdb->{$mac}."\n";
}
DESCRIPTION
BridgeQuery polls a device which respond to SNMP Bridge Table queries and generates a hash reference with each polled MAC address as the key and the associated port as the value. The specific MIBs that are polled are described in RFC1493.
SNMP::BridgeQuery requires Net::SNMP in order to function.
Devices can be switches, bridges, or most anything that responds as a OSI Layer 2 component. Layer 3 devices do not generally respond and will cause an error. If an error is generated, it will return a hash reference with a single element ('error') which can be tested for.
Two other functions (querymacs & queryports) can be explicitly exported. They work the same way as queryfdb, but they return MAC addresses or ports (respectively) with the SNMP MIB as the hash key.
ACKNOLEDGEMENTS
David M. Town - Author of Net::SNMP
AUTHOR
John D. Shearer <jds@jkshearer.com>
SEE ALSO
perl(1), perldoc(1) Net::SNMP.
COPYRIGHT
Copyright (c) 2001 John D. Shearer. All rights reverved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.