From 9f65a3c1d7a7adff6da40a82d1202848b2da538d Mon Sep 17 00:00:00 2001 From: Tom Sealey Date: Tue, 1 Aug 2017 10:08:49 +0100 Subject: [PATCH] created avaya-ers.inc.php Avaya do not use the Q-Bridge MIB for Vlans. They also store untagged vlan info in 2 seperate ways: rcVlanPortDefaultVlanId stores the actual native VLAN or PVID per switch port. rcVlanPortPerformTagging tells us the ports tagging mode, this can be true (all tagged or trunk), false (no tagging or access), 3 (only tag the PVID) or 4 (untag the PVID and tag everything else). Due to how these bits of information are presented, for each VLAN ID we then need to loop through all the ports checking if their PVID matches the VLAN ID and if the tagging mode is false or 4. If both are true we add that port to the list of untagged ports for that VLAN. --- includes/discovery/vlans/avaya-ers.inc.php | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 includes/discovery/vlans/avaya-ers.inc.php diff --git a/includes/discovery/vlans/avaya-ers.inc.php b/includes/discovery/vlans/avaya-ers.inc.php new file mode 100644 index 0000000000..16c008da9e --- /dev/null +++ b/includes/discovery/vlans/avaya-ers.inc.php @@ -0,0 +1,40 @@ + $vlan) { + d_echo(" $vlan_id"); + if (is_array($vlans_db[$vtpdomain_id][$vlan_id])) { + echo '.'; + } else { + dbInsert(array( + 'device_id' => $device['device_id'], + 'vlan_domain' => $vtpdomain_id, + 'vlan_vlan' => $vlan_id, + 'vlan_name' => $vlan['rcVlanName'], + 'vlan_type' => array('NULL') + ), 'vlans'); + echo '+'; + } + $device['vlans'][$vtpdomain_id][$vlan_id] = $vlan_id; + $egress_ids = q_bridge_bits2indices($tagoruntag[$vlan_id]['rcVlanPortMembers']); + $untagged_ids = array(); + + foreach ($port_pvids as $port => $port_num) { + if ($port_num['rcVlanPortDefaultVlanId'] == $vlan_id && + ($port_mode[$port]['rcVlanPortPerformTagging'] == 'false' || $port_mode[$port]['rcVlanPortPerformTagging'] == 4 )) { + array_push($untagged_ids, $port); + } + } + foreach ($egress_ids as $port_id) { + $ifIndex = $base_to_index[$port_id]; + $per_vlan_data[$vlan_id][$ifIndex]['untagged'] = (in_array($port_id, $untagged_ids) ? 1 : 0); + } + } +}