From 3633fbc44b4e148a617877596712f8837394dd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AD=A6=E5=88=A9?= Date: Tue, 27 Jul 2021 07:40:15 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DTSG-7104:=20=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=93=BE=E6=8E=A5=E8=AE=A1=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/tsg_log_field.conf | 4 ++-- src/tsg_entry.cpp | 27 +++++++++++++-------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/bin/tsg_log_field.conf b/bin/tsg_log_field.conf index 6086a7b..ac55efe 100644 --- a/bin/tsg_log_field.conf +++ b/bin/tsg_log_field.conf @@ -82,8 +82,8 @@ STRING s2c_source_mac 68 STRING s2c_destination_mac 69 STRING client_ip 70 STRING server_ip 71 -STRING c2s_id 72 -STRING s2c_id 73 +STRING pptp_uplink_tunnel_id 72 +STRING pptp_downlink_tunnel_id 73 STRING common_service_category 74 STRING common_apn 75 STRING common_imsi 76 diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index 77a9d8f..b681d4a 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -91,7 +91,7 @@ id2field_t g_tsg_proto_name2id[PROTO_MAX]={{PROTO_UNKONWN, 0, "unknown"}, {PROTO_IMAP, 0, "IMAP"}, {PROTO_POP3, 0, "POP3"}, {PROTO_RTP, 0, "RTP"}, - {PROTO_APP, 0,"APP"} + {PROTO_APP, 0, "APP"} }; #define DECCRYPTION_EXCLUSION_ALLOW_POLICY_ID 1 @@ -512,9 +512,9 @@ static void copy_result_to_project(const struct streaminfo *a_stream, struct mas else { MESA_handle_runtime_log(g_tsg_para.logger, - RLOG_LV_FATAL, - "DUP_HIT_INTERCEPT", - "Hit intercept policy, domain: %s policy_id: %d action: %d addr: %s", + RLOG_LV_DEBUG, + "DUP_HIT_POLICY", + "Hit policy, domain: %s policy_id: %d action: %d addr: %s", (domain!=NULL ? domain : ""), p_result->config_id, (unsigned char)p_result->action, @@ -1454,6 +1454,15 @@ static unsigned char tsg_master_entry(const struct streaminfo *a_stream, void ** switch(a_stream->opstate) { case OP_STATE_PENDING: + if(a_stream->type==STREAM_TYPE_TCP) + { + FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_TCP_LINKS], 0, FS_OP_ADD, 1); + } + else + { + FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_UDP_LINKS], 0, FS_OP_ADD, 1); + } + hit_num+=master_deal_pending_state(a_stream, context, scan_result+hit_num, MAX_RESULT_NUM-hit_num, a_packet); p_result=tsg_policy_decision_criteria(scan_result, hit_num); if(g_tsg_para.default_compile_switch==1 && p_result==NULL) @@ -1523,21 +1532,11 @@ static unsigned char tsg_master_entry(const struct streaminfo *a_stream, void ** extern "C" unsigned char TSG_MASTER_TCP_ENTRY(const struct streaminfo *a_tcp, void **pme, int thread_seq,void *a_packet) { - if(a_tcp->type==STREAM_TYPE_TCP) - { - FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_TCP_LINKS], 0, FS_OP_ADD, 1); - } - return tsg_master_entry(a_tcp, pme, thread_seq, a_packet); } extern "C" unsigned char TSG_MASTER_UDP_ENTRY(const struct streaminfo *a_udp, void **pme, int thread_seq,void *a_packet) { - if(a_udp->type==STREAM_TYPE_UDP) - { - FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_UDP_LINKS], 0, FS_OP_ADD, 1); - } - return tsg_master_entry(a_udp, pme, thread_seq, a_packet); }