-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7eb709
commit 41c16a8
Showing
6 changed files
with
68 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
### Project dependent ### | ||
/capture.pcap | ||
.env | ||
results.csv | ||
|
||
### Linux ### | ||
*~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import csv | ||
import os | ||
|
||
csv_columns = ['sumDelta', 'averageDelta', 'ip', 'domain', | ||
'numberOfPackets', 'totalMbSize', 'startTime', 'endTime'] | ||
|
||
# Insert a row in the results csv file | ||
def save_element(element): | ||
if not os.path.exists('results.csv'): | ||
with open('results.csv', 'w') as csvfile: | ||
writer = csv.DictWriter(csvfile, fieldnames=csv_columns) | ||
writer.writeheader() | ||
writer.writerow(element) | ||
else: | ||
with open('results.csv', 'a') as csvfile: | ||
writer = csv.DictWriter(csvfile, fieldnames=csv_columns) | ||
writer.writerow(element) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters