diff options
author | Luneji <61687883+Luneji@users.noreply.github.com> | 2020-05-16 10:09:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-16 10:09:26 +0200 |
commit | dcfe020285c79776af2c7f1d4d4244a6d1ed6f46 (patch) | |
tree | 89ed19e73ef54d87032363ae15b160c17b45c0c1 /analyse | |
parent | 3c2758e5d55cd5139eab5dbb65ae06d3c472f693 (diff) |
Lisibilité des variables + TCP/UDP
Diffstat (limited to 'analyse')
-rwxr-xr-x | analyse/insertpaq.py | 28 |
1 files 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) |