From f8b4b3b633d824be53593eb53ca3dd1aa3fcc660 Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Fri, 15 May 2020 09:28:16 +0200 Subject: Update index et analyse --- www/html/analyse.py | 38 +++++++++++++++++++++++++++++--------- www/html/fonctions.pyc | Bin 1200 -> 1318 bytes www/html/index.py | 2 +- 3 files changed, 30 insertions(+), 10 deletions(-) mode change 100644 => 100755 www/html/analyse.py diff --git a/www/html/analyse.py b/www/html/analyse.py old mode 100644 new mode 100755 index 57c0892..df72cae --- a/www/html/analyse.py +++ b/www/html/analyse.py @@ -9,20 +9,40 @@ def index(req): content=str() #sql part -# conn=connexionBD() -# cur=conn.cursor() -# sql="select * from paquet;" -# cur.execute(sql) -# conn.commit() -# data=cur.fetchall() -# conn.close() -#sql part + conn=connexionBD() + cur=conn.cursor() + + cur.execute("SELECT COUNT(*) FROM paquet") + conn.commit() + total=str(cur.fetchone()[0]) + + cur.execute("SELECT COUNT(DISTINCT ip_source) FROM paquet") + conn.commit() + total_ip_src=str(cur.fetchone()[0]) + + cur.execute("SELECT COUNT(DISTINCT ip_destination) FROM paquet") + conn.commit() + total_ip_dst=str(cur.fetchone()[0]) + + cur.execute("SELECT COUNT(DISTINCT port_source) FROM paquet") + conn.commit() + total_port_src=str(cur.fetchone()[0]) + cur.execute("SELECT COUNT(DISTINCT port_destination) FROM paquet") + conn.commit() + total_port_dst=str(cur.fetchone()[0]) + + conn.close() +#sql part #write the html page req.write(baseHTML("ATS-Project","""

Analyse

+

Nombre total de paquets : """+total+"""

+

Nombre total d'adresses IP source differentes : """+total_ip_src+"""

+

Nombre total d'adresses IP destination differentes : """+total_ip_dst+"""

+

Nombre total de ports source differents : """+total_port_src+"""

+

Nombre total de ports destination differents : """+total_port_dst+"""

""" -+ content )) diff --git a/www/html/fonctions.pyc b/www/html/fonctions.pyc index e644083..a5f563a 100644 Binary files a/www/html/fonctions.pyc and b/www/html/fonctions.pyc differ diff --git a/www/html/index.py b/www/html/index.py index 5563d13..b709c3a 100755 --- a/www/html/index.py +++ b/www/html/index.py @@ -43,7 +43,7 @@ def index(req):

ATS-Project

Pour voir le nombre de paquets en destination d'une adresse IP, cliquez sur cette dernière dans le tableau.
OK
-

Nombre totale de paquets : """+ count +"""

+

Nombre total de paquets : """+ count +"""

Pour afficher toute la table, cliquez sur ce texte.

-- cgit v1.2.3