dot1dTpFdbEntry
)dot1dBasePortEntry
)dot1dStpPortTable
)dot1qPortVlanTable
)dot1qVlanCurrentTable
)dot1qVlanStaticTable
)dot1qFdbTable
)
SNMP::Info::Bridge - SNMP Interface to SNMP data available through the BRIDGE-MIB (RFC1493)
Max Baker
my $bridge = new SNMP::Info ( AutoSpecify => 1, Debug => 1, DestHost => 'switch', Community => 'public', Version => 2 );
my $class = $bridge->class(); print " Using device sub class : $class\n";
# Grab Forwarding Tables my $interfaces = $bridge->interfaces(); my $fw_mac = $bridge->fw_mac(); my $fw_port = $bridge->fw_port(); my $bp_index = $bridge->bp_index();
foreach my $fw_index (keys %$fw_mac){ my $mac = $fw_mac->{$fw_index}; my $bp_id = $fw_port->{$fw_index}; my $iid = $bp_index->{$bp_id}; my $port = $interfaces->{$iid};
print "Port:$port forwarding to $mac\n"; }
BRIDGE-MIB is used by most Layer 2 devices, and holds information like the MAC Forwarding Table and Spanning Tree Protocol info.
Q-BRIDGE-MIB holds 802.1q information -- VLANs and Trunking. Cisco tends
not to use this MIB, but some proprietary ones. HP and some nicer vendors use
this. This is from RFC2674_q
.
Create or use a subclass of SNMP::Info that inherits this class. Do not use directly.
For debugging you can call new()
directly as you would in SNMP::Info
my $bridge = new SNMP::Info::Bridge(...);
None.
BRIDGE-MIB needs to be extracted from ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz
These are methods that return scalar values from SNMP
b_mac()
Returns the MAC Address of the root bridge port
(dot1dBaseBridgeAddress
)
b_ports()
Returns the number of ports in device
(dot1dBaseNumPorts
)
b_type()
Returns the type of bridging this bridge can perform, transparent and/or source route.
(dot1dBaseType
)
stp_ver()
Returns what version of STP the device is running.
(dot1dStpProtocolSpecification
)
stp_time()
Returns time since last topology change detected. (100ths/second)
(dot1dStpTimeSinceTopologyChange
)
stp_root()
Returns root of STP.
(dot1dStpDesignatedRoot
)
qb_vlans_max()
Maximum number of VLANS supported on this device.
(dot1qMaxSupportedVlans
)
qb_vlans()
Current number of VLANs that are configured in this device.
(dot1qNumVlans
)
qb_next_vlan_index()
The next available value for dot1qVlanIndex
of a local VLAN entry in
dot1qVlanStaticTable
(dot1qNextFreeLocalVlanIndex
)
These are methods that return tables of information in the form of a reference to a hash.
i_vlan()
Returns a mapping between ifIndex
and the PVID or default VLAN.
i_vlan_membership()
Returns reference to hash of arrays: key = ifIndex
, value = array of VLAN
IDs. These are the VLANs which are members of the egress list for the port.
Example: my $interfaces = $bridge->interfaces(); my $vlans = $bridge->i_vlan_membership(); foreach my $iid (sort keys %$interfaces) { my $port = $interfaces->{$iid}; my $vlan = join(',', sort(@{$vlans->{$iid}})); print "Port: $port VLAN: $vlan\n"; }
qb_i_vlan_t()
Returns reference to hash: key = dot1dBasePort
, value = either 'trunk' for
tagged ports or the VLAN ID.
v_index()
Returns VLAN IDs
dot1dTpFdbEntry
)fw_mac()
Returns reference to hash of forwarding table MAC Addresses
(dot1dTpFdbAddress
)
fw_port()
Returns reference to hash of forwarding table entries port interface identifier (iid)
(dot1dTpFdbPort
)
fw_status()
Returns reference to hash of forwarding table entries status
(dot2dTpFdbStatus
)
dot1dBasePortEntry
)bp_index()
Returns reference to hash of bridge port table entries map back to interface identifier (iid)
(dot1dBasePortIfIndex
)
bp_port()
Returns reference to hash of bridge port table entries for a port which
(potentially) has the same value of dot1dBasePortIfIndex
as another port
on the same bridge, this object contains the name of an object instance unique
to this port.
(dot1dBasePortCircuit
)
dot1dStpPortTable
)Descriptions are straight from BRIDGE-MIB.my
stp_p_id()
``The port number of the port for which this entry contains Spanning Tree Protocol management information.''
(dot1dStpPort
)
stp_p_priority()
``The value of the priority field which is contained in the first
(in network byte order) octet of the (2 octet long) Port ID. The other octet
of the Port ID is given by the value of dot1dStpPort
.''
(dot1dStpPortPriority
)
stp_p_state()
``The port's current state as defined by application of the Spanning Tree
Protocol. This state controls what action a port takes on reception of a
frame. If the bridge has detected a port that is malfunctioning it will place
that port into the broken(6)
state. For ports which are disabled
(see dot1dStpPortEnable
), this object will have a value of disabled(1).''
disabled(1) blocking(2) listening(3) learning(4) forwarding(5) broken(6)
(dot1dStpPortState
)
stp_p_cost()
``The contribution of this port to the path cost of paths towards the spanning tree root which include this port. 802.1D-1990 recommends that the default value of this parameter be in inverse proportion to the speed of the attached LAN.''
(dot1dStpPortPathCost
)
stp_p_root()
``The unique Bridge Identifier of the Bridge recorded as the Root in the Configuration BPDUs transmitted by the Designated Bridge for the segment to which the port is attached.''
(dot1dStpPortDesignatedRoot
)
stp_p_bridge()
``The Bridge Identifier of the bridge which this port considers to be the Designated Bridge for this port's segment.''
(dot1dStpPortDesignatedBridge
)
stp_p_port()
(dot1dStpPortDesignatedPort
)
``The Port Identifier of the port on the Designated Bridge for this port's segment.''
i_stp_port()
Returns the mapping of (dot1dStpPortDesignatedPort
) to the interface
index (iid).
i_stp_state()
Returns the mapping of (dot1dStpPortState
) to the interface
index (iid).
i_stp_id()
Returns the mapping of (dot1dStpPort
) to the interface index (iid).
i_stp_bridge()
Returns the mapping of (dot1dStpPortDesignatedBridge
) to the interface
index (iid).
dot1qPortVlanTable
)qb_i_vlan()
The PVID, the VLAN ID assigned to untagged frames or Priority-Tagged frames received on this port.
(dot1qPvid
)
qb_i_vlan_type()
Either admitAll
or admitOnlyVlanTagged
. This is a good spot to find
trunk ports.
(dot1qPortAcceptableFrameTypes
)
qb_i_vlan_in_flt()
When this is true
the device will discard incoming frames for VLANs which
do not include this Port in its Member set. When false
, the port will
accept all incoming frames.
(dot1qPortIngressFiltering
)
dot1qVlanCurrentTable
)qb_cv_egress()
The set of ports which are assigned to the egress list for this VLAN.
(dot1qVlanCurrentEgressPorts
)
qb_cv_untagged()
The set of ports which should transmit egress packets for this VLAN as untagged.
(dot1qVlanCurrentUntaggedPorts
)
qb_cv_stat()
Status of the VLAN, other, permanent, or dynamicGvrp.
(dot1qVlanStatus
)
dot1qVlanStaticTable
)qb_v_name()
Human-entered name for vlans.
(dot1qVlanStaticName
)
qb_v_egress()
The set of ports which are assigned to the egress list for this VLAN.
(dot1qVlanStaticEgressPorts
)
qb_v_fbdn_egress()
The set of ports which are prohibited from being included in the egress list for this VLAN.
(dot1qVlanForbiddenEgressPorts
)
qb_v_untagged()
The set of ports which should transmit egress packets for this VLAN as untagged.
(dot1qVlanStaticUntaggedPorts
)
qb_v_stat()
active
!
(dot1qVlanStaticRowStatus
)
dot1qFdbTable
)qb_fw_mac()
Returns reference to hash of forwarding table MAC Addresses
(dot1qTpFdbAddress
)
qb_fw_port()
Returns reference to hash of forwarding table entries port interface identifier (iid)
(dot1qTpFdbPort
)
qb_fw_status()
Returns reference to hash of forwarding table entries status
(dot1qTpFdbStatus
)
=head1 SET METHODS
These are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations. See SETTING DATA VIA SNMP in the SNMP::Info manpage for general information on set operations.
Currently unsupported. Throws an error and returns.
Currently unsupported. Throws an error and returns.
Currently unsupported. Throws an error and returns.
Currently unsupported. Throws an error and returns.