Commit 88954758 authored by Valentin Samir's avatar Valentin Samir
Browse files

[deconnexion] Lorsque que deux macs utilisent la même ipv6 sur un interval de...

[deconnexion] Lorsque que deux macs utilisent la même ipv6 sur un interval de trois jours, on affiche l'ipv6 et les deux macs
parent 37f753c2
......@@ -167,14 +167,15 @@ uploadeurs = curseur.fetchall()
# On regarde s'il y a deux ipv6 identiques avec des mac non identiques
collision_mac_ip_request = "SELECT DISTINCT (a.*) FROM mac_ip as a, mac_ip as b where a.ip=b.ip AND a.mac != b.mac AND a.date >= b.date AND a.date - b.date < interval '3 day' ORDER BY a.date;"
collision_mac_ip_request = "SELECT DISTINCT a.date as date1, a.mac as mac1, a.ip as ip1, b.date as date2, b.mac as mac2, b.ip as ip2 FROM mac_ip as a, mac_ip as b where a.ip=b.ip AND a.mac != b.mac AND a.date >= b.date AND a.date - b.date < interval '3 day' ORDER BY a.date;"
curseur.execute(collision_mac_ip_request)
collision_mac_ip = curseur.fetchall()
if collision_mac_ip != []:
print "Collision d'addresses ipv6 : "
for (date, mac, ip) in collision_mac_ip:
print "%s %s %s" % (date, ipt.mac_addr(mac), ip)
for (date1, mac1, ip1, date2, mac2, ip2) in collision_mac_ip:
print "%s %s %s" % (date1, ipt.mac_addr(mac1), ip1)
print "%s %s %s" % (date2, ipt.mac_addr(mac2), ip2)
# Table des avertis
###################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment