From bd65acc17d8077ffa97fa0adad7e5f947fc575da Mon Sep 17 00:00:00 2001 From: liuxueli Date: Thu, 14 Nov 2019 11:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=87=BD=E6=95=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BC=A0=E5=87=BA=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E5=B0=86=E9=83=A8=E5=88=86=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=B8=BA=E7=BB=93=E6=9E=84=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/tsg_rule.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/inc/tsg_rule.h b/inc/tsg_rule.h index 4210422..28f6cbb 100644 --- a/inc/tsg_rule.h +++ b/inc/tsg_rule.h @@ -9,6 +9,14 @@ extern "C" { #endif +#define MAX_DOAMIN_LEN 2048 + +struct _identify_info +{ + tsg_protocol_t proto; //enum _tsg_protocol (tsg_types.h) + int domain_len; + char domain[MAX_DOAMIN_LEN]; +}; typedef enum _PULL_RESULT_TYPE { @@ -23,13 +31,13 @@ int tsg_rule_init(const char *conffile); int tsg_scan_nesting_addr(Maat_feather_t maat_feather, const struct streaminfo *a_stream, tsg_protocol_t proto, scan_status_t *mid, Maat_rule_t*result, int result_num); //return 0 if failed, return >0 on success; -int tsg_pull_policy_result(struct streaminfo *a_stream, PULL_RESULT_TYPE pull_result_type, Maat_rule_t *result, int result_num, char *domain, int *domain_len); +int tsg_pull_policy_result(struct streaminfo *a_stream, PULL_RESULT_TYPE pull_result_type, Maat_rule_t *result, int result_num, struct _identify_info *identify_info); //return -1 if failed, return 0 on success; int tsg_shared_table_init(const char *conffile, Maat_feather_t maat_feather, void *logger); //return value: -1: failed, 0: not hit, >0: hit count -int tsg_scan_shared_policy(Maat_feather_t maat_feather, void *pkt, int pkt_len, Maat_rule_t *result, int result_num, char *domain, int *domain_len, scan_status_t *mid, void *logger, int thread_seq); +int tsg_scan_shared_policy(Maat_feather_t maat_feather, void *pkt, int pkt_len, Maat_rule_t *result, int result_num, struct _identify_info *identify_info, scan_status_t *mid, void *logger, int thread_seq); #ifdef __cplusplus