|
@@ -36,6 +36,10 @@ class Controller:
|
|
|
self.statisticsDB = self.statistics.get_statistics_database()
|
|
|
self.attack_controller = atkCtrl.AttackController(self.pcap_file, self.statistics, self.label_manager)
|
|
|
|
|
|
+ # Set output directory and create it (if necessary)
|
|
|
+ Util.OUT_DIR = os.path.join(os.path.dirname(pcap_file_path), "ID2T_results") + os.sep
|
|
|
+ os.makedirs(Util.OUT_DIR, exist_ok=True)
|
|
|
+
|
|
|
def load_pcap_statistics(self, flag_write_file: bool, flag_recalculate_stats: bool, flag_print_statistics: bool):
|
|
|
"""
|
|
|
Loads the PCAP statistics either from the database, if the statistics were calculated earlier, or calculates
|
|
@@ -100,10 +104,8 @@ class Controller:
|
|
|
self.pcap_dest_path = self.pcap_file.merge_attack(attacks_pcap_path)
|
|
|
|
|
|
tmp_path_tuple = self.pcap_dest_path.rpartition("/")
|
|
|
- result_dir = tmp_path_tuple[0] + tmp_path_tuple[1] + "ID2T_results/"
|
|
|
- result_path = result_dir + tmp_path_tuple[2]
|
|
|
+ result_path = Util.OUT_DIR + tmp_path_tuple[2]
|
|
|
|
|
|
- os.makedirs(result_dir, exist_ok=True)
|
|
|
os.rename(self.pcap_dest_path, result_path)
|
|
|
self.pcap_dest_path = result_path
|
|
|
|