From dcfe020285c79776af2c7f1d4d4244a6d1ed6f46 Mon Sep 17 00:00:00 2001 From: Luneji <61687883+Luneji@users.noreply.github.com> Date: Sat, 16 May 2020 10:09:26 +0200 Subject: Lisibilité des variables + TCP/UDP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analyse/insertpaq.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/analyse/insertpaq.py b/analyse/insertpaq.py index dee7571..31a3cb2 100755 --- a/analyse/insertpaq.py +++ b/analyse/insertpaq.py @@ -61,43 +61,43 @@ LirePortDSTUDP.close() #print "Heure TCP:" -a = str(DerniereLigneHeureTCP[-1]) +HeureTCP = str(DerniereLigneHeureTCP[-1]) #print "Protocole TCP:" -b = str(DerniereLigneProtocoleTCP[-1]) +ProtocoleTCP = str(DerniereLigneProtocoleTCP[-1]) #print "IP Source TCP:" -c = str(DerniereLigneIPSRCTCP[-1]) +IPsrcTCP = str(DerniereLigneIPSRCTCP[-1]) #print "Port Source TCP:" -d = str(DerniereLignePortSRCTCP[-1]) +PortsrcTCP = str(DerniereLignePortSRCTCP[-1]) #print "IP Destination TCP:" -e = str(DerniereLigneIPDSTTCP[-1]) +IPdstTCP = str(DerniereLigneIPDSTTCP[-1]) #print "Port Destination TCP:" -f = str(DerniereLignePortDSTTCP[-1]) +PortdstTCP = str(DerniereLignePortDSTTCP[-1]) #Re coucou #print "Heure UDP:" -z = str(DerniereLigneHeureUDP[-1]) +HeureUDP = str(DerniereLigneHeureUDP[-1]) #print "Protocole UDP:" -y = str(DerniereLigneProtocoleUDP[-1]) +ProtocoleUDP = str(DerniereLigneProtocoleUDP[-1]) #print "IP Source UDP:" -x = str(DerniereLigneIPSRCUDP[-1]) +IPsrcUDP = str(DerniereLigneIPSRCUDP[-1]) #print "Port Source UDP:" -w = str(DerniereLignePortSRCUDP[-1]) +PortsrcUDP = str(DerniereLignePortSRCUDP[-1]) #print "IP Destination UDP:" -v = str(DerniereLigneIPDSTUDP[-1]) +IPdstUDP = str(DerniereLigneIPDSTUDP[-1]) #print "Port Destination UDP:" -u = str(DerniereLignePortDSTUDP[-1]) +PortdstUDP = str(DerniereLignePortDSTUDP[-1]) def connexionBD(): @@ -113,9 +113,9 @@ cur=conn.cursor() #""".format(a,b,c,e,d,f,z,y,x,v,w,u) cur.execute("INSERT INTO paquet (heure,protocole,ip_source,ip_destination,port_source,port_destination) VALUES (%s, %s, %s, %s, %s, %s)", - (a, b, c, e, d, f)) + (HeureTCP, 'TCP', IPsrcTCP, IPdstTCP, PortsrcTCP, PortdstTCP)) cur.execute("INSERT INTO paquet (heure,protocole,ip_source,ip_destination,port_source,port_destination) VALUES (%s, %s, %s, %s, %s, %s)", - (z, y, x, v, w, u)) + (HeureUDP, 'UDP', IPsrcUDP, IPdstUDP, PortsrcUDP, PortdstUDP)) #cur.execute(sql) -- cgit v1.2.3