Commentaire

This commit is contained in:
chirac 2018-07-12 16:55:15 +02:00
parent 827220a50a
commit fae56e6fa6

View file

@ -70,6 +70,7 @@ class Switch:
for vlan in port['get_port_profil']['vlan_tagged']: for vlan in port['get_port_profil']['vlan_tagged']:
add_to_vlans(vlans, vlan, port) add_to_vlans(vlans, vlan, port)
#Trie les ip par vlan, et les ajoute ainsi que les subnet
for ip, subnet in self.switch["interfaces_subnet"].items(): for ip, subnet in self.switch["interfaces_subnet"].items():
vlans[subnet[0]["vlan_id"]].setdefault("ipv4", {}) vlans[subnet[0]["vlan_id"]].setdefault("ipv4", {})
vlans[subnet[0]["vlan_id"]]["ipv4"][ip] = subnet vlans[subnet[0]["vlan_id"]]["ipv4"][ip] = subnet
@ -77,6 +78,7 @@ class Switch:
vlans[subnet["vlan_id"]].setdefault("ipv6", {}) vlans[subnet["vlan_id"]].setdefault("ipv6", {})
vlans[subnet["vlan_id"]]["ipv6"][ipv6] = subnet vlans[subnet["vlan_id"]]["ipv6"][ipv6] = subnet
#Regroupement des options par vlans : dhcp_soop,arp, et dhcpv6, ainsi que igmp, mld , ra-guard et loop_protect
arp_protect_vlans = [vlan["vlan_id"] for vlan in self.all_vlans if vlan["arp_protect"]] arp_protect_vlans = [vlan["vlan_id"] for vlan in self.all_vlans if vlan["arp_protect"]]
dhcp_snooping_vlans = [vlan["vlan_id"] for vlan in self.all_vlans if vlan["dhcp_snooping"]] dhcp_snooping_vlans = [vlan["vlan_id"] for vlan in self.all_vlans if vlan["dhcp_snooping"]]
dhcpv6_snooping_vlans = [vlan["vlan_id"] for vlan in self.all_vlans if vlan["dhcpv6_snooping"]] dhcpv6_snooping_vlans = [vlan["vlan_id"] for vlan in self.all_vlans if vlan["dhcpv6_snooping"]]