NAME

SNMP::Info::Layer3::H3C - SNMP Interface to L3 Devices, H3C & HP A-series

AUTHORS

Jeroen van Ingen

SYNOPSIS

# Let SNMP::Info determine the correct subclass for you.
my $h3c = new SNMP::Info(
                         AutoSpecify => 1,
                         Debug       => 1,
                         DestHost    => 'myrouter',
                         Community   => 'public',
                         Version     => 2
                       )
   or die "Can't connect to DestHost.\n";

my $class      = $h3c->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";

DESCRIPTION

Subclass for H3C & HP A-series devices

Inherited Classes

SNMP::Info::Layer3
SNMP::Info::IEEE802dot3ad

Required MIBs

HH3C-LswDEVM-MIB
HH3C-LswINF-MIB
HH3C-LSW-DEV-ADM-MIB
HH3C-PRODUCT-ID-MIB
HH3C-ENTITY-VENDORTYPE-OID-MIB
HH3C-LswMSTP-MIB
HH3C-IP-ADDRESS-MIB
Inherited Classes' MIBs

See "Required MIBs" in SNMP::Info::IEEE802dot3ad for its own MIB requirements.

See SNMP::Info::Layer3 for its own MIB requirements.

GLOBALS

These are methods that return scalar value from SNMP

$h3c->model()

Returns the model from sysObjectID or entPhysicalClass.

$h3c->vendor()

Returns value for entPhysicalMfgName.1.

$h3c->os()

Returns the OS extracted from sysDescr.

$h3c->os_ver()

Returns the software version. Either entPhysicalSoftwareRev.2 or extracted from sysDescr.

$h3c->qb_fdb_index()

overwritten to always return empty hash as implementation on h3c is broken.

$h3c->h3c_stp_version()

(hh3cdot1sStpForceVersion)

$h3c->hasSTP()

Returns 1 when hh3cdot1sStpForceVersion is stp(0), else 0.

$h3c->hasRSTP()

Returns 1 when hh3cdot1sStpForceVersion is rstp(2) and the tables do not show PVST, else 0. Also 0 when a walk of those tables was incomplete (see "Spanning Tree Trees").

$h3c->hasPVST()

Returns 1 when the tables show PVST (see "Spanning Tree Trees"), else 0.

$h3c->hasMSTP()

Returns 1 when hh3cdot1sStpForceVersion is mstp(3), else 0.

Globals imported from SNMP::Info::Layer3

See documentation in SNMP::Info::Layer3 for details.

TABLE ENTRIES

These are methods that return tables of information in the form of a reference to a hash.

Overrides

$h3c->i_ignore()

Returns reference to hash. Increments value of IID if port is to be ignored.

Ignores loopback

$h3c->i_stp_state()

Returns inherited STP states, omitting physical members of confirmed Bridge-Aggregation interfaces. STP applies to the logical aggregate; an omitted member state does not mean that the member or aggregate is forwarding. The aggregate and non-member states are retained. No MSTP instance states are combined into this single per-interface result. Under MSTP the inherited states are the CIST's. Under PVST on Comware 7 returns an empty hash, because dot1dStpPortState there matches no VLAN's tree.

$h3c->ad_port_attached_agg()

Returns the raw member ifIndex to attached aggregate ifIndex mapping from dot3adAggPortAttachedAggID. Zero means no attached aggregate.

agg_ports

Prefers validated dot3adAggPortAttachedAggID mappings for Bridge-Aggregation interfaces, falling back to the inherited port-list mapping when none are available.

Returns a HASH reference mapping from slave to master port for each member of a port bundle on the device. Keys are ifIndex of the slave ports, Values are ifIndex of the corresponding master ports.

Table Methods

$h3c->h3c_stp_i_id()

(hh3cdot1sInstanceID)

$h3c->h3c_stp_i_bridge()

(hh3cdot1sMstiBridgeID)

$h3c->h3c_stp_i_root()

(hh3cdot1sMstiDesignedRoot)

$h3c->h3c_stp_p_state()

(hh3cdot1sMstiState)

$h3c->h3c_stp_p_bridge()

(hh3cdot1sMstiDesignatedBridge)

$h3c->h3c_stp_p_port()

(hh3cdot1sMstiDesignatedPort)

$h3c->h3c_stp_vlan_mst()

(hh3cdot1sOperMstID)

$h3c->vrf_h3c_addr_mask()

Returns reference to hash of the IPv4 address masks of every routing instance, indexed by ifIndex, address type, length and address. vrf_addresses() reads it; see "VRF Instances".

(hh3cIpAddrSetMask)

VRF Instances

See "VRF Instances" in SNMP::Info::VRF for the readers. Comware 7 serves no ipAddressTable, and an ipAddrTable holding the default instance only. This class fills the gaps:

  • vrf_addresses() reads every instance's IPv4 addresses from hh3cIpAddrSetTable, and its IPv6 addresses, anycast ones included, from IPV6-MIB ipv6AddrTable. Each instance then lists its own addresses.

  • vrf_neighbors() adds host link-local neighbors from IPV6-MIB ipv6NetToMediaTable. Comware serves them in IP-MIB only with a zone, which ipv6_n2p_addr() does not return.

  • vrf_subnets() adds connected routes (see "Collapsed Subnets" in SNMP::Info::VRF).

Spanning Tree Trees

These override "Spanning Tree Trees" in SNMP::Info::Bridge, where the records are described. Only the default context is read.

The protocol comes from hh3cdot1sStpForceVersion, the protocol the device is set to run:

  • stp for stp(0), mstp for mstp(3).

  • For rstp(2), pvst when the HH3C-LswMSTP-MIB instance and port tables show PVST, else rstp. The object has no PVST value.

  • Unknown otherwise: when the object is not served, holds another value, or a walk of those tables was incomplete. No tree is then reported, not even the BRIDGE-MIB one, since its states are wrong under PVST.

The tree records:

Keys

cist.0 and msti.N under MSTP. cist.0 under RSTP and STP. vlan.N for each VLAN under PVST.

vlan

The VLAN id, on PVST trees.

protocol

As above.

measured

1 on Comware 7 under MSTP, RSTP and PVST. 0 otherwise.

ports_complete

0 on every PVST tree, since no port data is served for one. Under MSTP, 0 when a port row of the instance has no bp_index() entry. Under RSTP and STP, as in SNMP::Info::Bridge.

contexts

The default context. Empty on PVST trees.

bridge, root

Under MSTP, hh3cdot1sMstiBridgeID and hh3cdot1sMstiDesignedRoot, whose bridge IDs carry the instance number in the low 12 bits. Under RSTP and STP, from BRIDGE-MIB, whose values the instance tables only copy. Undef on PVST trees.

The port records:

Under MSTP

state, designated_bridge and designated_port from the HH3C-LswMSTP-MIB port table. enabled from dot1dStpPortEnable.

Under RSTP and STP

From BRIDGE-MIB.

Under PVST

None.

Any protocol

role and role_raw are undef: the MIBs serve no port role. Physical members of a Bridge-Aggregation interface are omitted, as in i_stp_state().

$h3c->stp_protocols()

Returns reference to an array holding the protocol, or nothing.

$h3c->stp_trees()

Returns reference to hash of tree records. The hash is empty when the protocol is unknown, or under rstp or stp when BRIDGE-MIB serves no tree.

$h3c->stp_tree_ports($tree_key)

Returns reference to hash of the tree's port records keyed by ifIndex. For a PVST tree it returns an empty hash.

$h3c->stp_trees_complete()

Returns 1 or 0, as "Spanning Tree Trees" in SNMP::Info::Bridge describes. Under PVST every VLAN tree is listed. 0 when no tree is listed, and under MSTP when the hh3cdot1sInstanceID walk was incomplete.

$h3c->stp_vlan_map()

Under MSTP returns reference to hash mapping VLAN id to tree key, from hh3cdot1sOperMstID. Otherwise nothing; RSTP still serves the unused region map.

Table Methods imported from SNMP::Info::Layer3

See documentation in SNMP::Info::Layer3 for details.

Table Methods imported from SNMP::Info::IEEE802dot3ad

See documentation in "METHODS" in SNMP::Info::IEEE802dot3ad and "TABLE METHODS" in SNMP::Info::IEEE802dot3ad for details.