I’m trying to add support for Avaya ERS vlan discovery.
The ERS switches report VLAN port memebers using a long hex string, much like the Q-Bridge MIB, but longer.
Since you can have a stack of upto 8 50 port switches, the hex string is always 64 octets, even if you just have a single 24 port switch.
Example output for one VLAN on a 26 port switch: 7F FF FF E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
There is already a function in includes\functions.php that will take a bitmask like this and return an array of port ids, q_bridge_bits2indices()
But this does not return anything if I send the above mask to it.
I think this is likely to be down to the length.
That mask is really 8 x 8 octets, each set of 8 octets being a single switch in the stack
I don’t really know any PHP, so I’m looking for help in creating a new function to return an array of port indexes from the above bitmask.
The sticky bit is this, if I have 2 x 26 port switches in a stack with all ports in the VLAN, I will get this output: 7F FF FF E0 00 00 00 00 7F FF FF E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
And would need an array returning with ports 1-52 in it.
But if I had 1 x 50 port and 1 x 26 port switch I would get this output: 7F FF FF FF FF FF E0 00 7F FF FF E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
And would need an array returning with ports 1-76 in it.