From bbaf8eac816c6cae6d8458e0beebd4f483dc1365 Mon Sep 17 00:00:00 2001 From: 何勇 Date: Wed, 21 Aug 2024 07:56:53 +0000 Subject: 替换 PcapNGFormatAnalys.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PcapNGFormatAnalys.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'PcapNGFormatAnalys.py') diff --git a/PcapNGFormatAnalys.py b/PcapNGFormatAnalys.py index 21ee58b..ccb3837 100644 --- a/PcapNGFormatAnalys.py +++ b/PcapNGFormatAnalys.py @@ -124,7 +124,7 @@ def ExtractPacketsCommentStr(input_file_path, appsketch_api, pcap_file_id): else: proto = 'other' stream_id = '' - session_dict['session'] = appsketch_api + 'session/' + pcap_file_id + '/' + proto + '/' + stream_id + session_dict['session'] = appsketch_api + '/session/' + pcap_file_id + '/' + proto + '/' + stream_id comment_str_list.append(session_dict) return comment_str_list @@ -151,12 +151,8 @@ if __name__=="__main__": input_file_path = TransferPcapNG(sys.argv[1]) output_file_path = sys.argv[2] - appsketch_api = 'https://sg.appsketch.gdnt-cloud.com/' - - # Get the file name (including extension) - file_name_with_extension = os.path.basename(input_file_path) - # Remove the extension - pcap_file_id = os.path.splitext(file_name_with_extension)[0] + appsketch_api = sys.argv[3] + pcap_file_id = sys.argv[4] comment_str_list = ExtractPacketsCommentStr(input_file_path, appsketch_api, pcap_file_id) # for i, pkt in enumerate(comment_str_list): -- cgit v1.2.3