src/MIBS/Cisco/SMST.php
public function vlansMapped( $instanceID = false )
    {
        $vlansMapped = [];

        $instances1k2k = $this->getSNMP()->walk1d( self::OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K );
        $instances3k4k = $this->getSNMP()->walk1d( self::OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K );

        if( $instanceID )
        {
            foreach( $instances1k2k as $id => $instances )
                if( $id != $instanceID )
                    unset( $instances1k2k[ $id ] );

            foreach( $instances3k4k as $id => $instances )
                if( $id != $instanceID )
                    unset( $instances3k4k[ $id ] );
        }

        foreach( [ -1 => $instances1k2k, 2047 => $instances3k4k ] as $offset => $instances )
        {
            foreach( $instances as $instanceId => $mapped )
            {
                $mapped = $this->getSNMP()->ppHexStringFlags( $mapped );
                foreach( $mapped as $vlanid => $flag )
                {
                    // Cisco seems to be returning some crud. Strip it out:
                    if( $vlanid + $offset <= 0 || $vlanid + $offset > 4094 )
                        continue;

                    $vlansMapped[ $instanceId ][ $vlanid + $offset ] = $flag;
                }
            }
        }

        if( $instanceID )
            $vlansMapped = $vlansMapped[ $instanceID ];

        return $vlansMapped;
    }
public function vlansMapped( $instanceID = false )
    {
        $vlansMapped = [];

        $instances1k2k = $this->getSNMP()->walk1d( self::OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K );
        $instances3k4k = $this->getSNMP()->walk1d( self::OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K );

        if( $instanceID )
        {
            foreach( $instances1k2k as $id => $instances )
                if( $id != $instanceID )
                    unset( $instances1k2k[ $id ] );

            foreach( $instances3k4k as $id => $instances )
                if( $id != $instanceID )
                    unset( $instances3k4k[ $id ] );
        }

        foreach( [ -1 => $instances1k2k, 2047 => $instances3k4k ] as $offset => $instances )
        {
            foreach( $instances as $instanceId => $mapped )
            {
                $mapped = $this->getSNMP()->ppHexStringFlags( $mapped );
                foreach( $mapped as $vlanid => $flag )
                {
                    // Cisco seems to be returning some crud. Strip it out:
                    if( $vlanid + $offset <= 0 || $vlanid + $offset > 4094 )
                        continue;

                    $vlansMapped[ $instanceId ][ $vlanid + $offset ] = $flag;
                }
            }
        }

        if( $instanceID )
            $vlansMapped = $vlansMapped[ $instanceID ];

        return $vlansMapped;
    }
public function vlansMapped ( $ instanceID = false ) { $ vlansMapped = [ ] ; $ instances1k2k = $ this -> getSNMP ( ) -> walk1d ( self :: OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K ) ; $ instances3k4k = $ this -> getSNMP ( ) -> walk1d ( self :: OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K ) ; if ( $ instanceID ) { foreach ( $ instances1k2k as $ id => $ instances ) if ( $ id != $ instanceID ) unset ( $ instances1k2k [ $ id ] ) ; foreach ( $ instances3k4k as $ id => $ instances ) if ( $ id != $ instanceID ) unset ( $ instances3k4k [ $ id ] ) ; } foreach ( [ - 1 => $ instances1k2k , 2047 => $ instances3k4k ] as $ offset => $ instances ) { foreach ( $ instances as $ instanceId => $ mapped ) { $ mapped = $ this -> getSNMP ( ) -> ppHexStringFlags ( $ mapped ) ; foreach ( $ mapped as $ vlanid => $ flag ) { // Cisco seems to be returning some crud. Strip it out: if ( $ vlanid + $ offset <= 0 || $ vlanid + $ offset > 4094 ) continue ; $ vlansMapped [ $ instanceId ] [ $ vlanid + $ offset ] = $ flag ; } } } if ( $ instanceID ) $ vlansMapped = $ vlansMapped [ $ instanceID ] ; return $ vlansMapped ; }
Return array of MST instances containing an array of mapped VLANs

The form of the returned array is:

[
$mstInstanceId => [
$vlanTag => true / false,
$vlanTag => true / false,
...
],
...
]

If a VLAN tag is not present in the array of VLANs, then it is not a member of that MST instance.

@see vlansMappedAsRanges()
@param int $instanceId Limit results to a single instance ID (returned array is just vlans)
@return Array as described above.
Return array of MST instances containing an array of mapped VLANs