summaryrefslogtreecommitdiff
path: root/src/tsg_rule.cpp
diff options
context:
space:
mode:
author刘学利 <[email protected]>2023-03-01 05:09:34 +0000
committer刘学利 <[email protected]>2023-03-01 05:09:34 +0000
commitbbc31c8d10eca128528be14666ea1dba2c118818 (patch)
tree24bbc2c99153456501c946302a9eff3af3bae8f1 /src/tsg_rule.cpp
parentdf8fe8fb1352231d8044eaa71c9a9d9b3a67fb6a (diff)
TSG-13777: 支持同步流状态及命中策略IDv5.10.7
Diffstat (limited to 'src/tsg_rule.cpp')
-rw-r--r--src/tsg_rule.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp
index 416082f..fe502d5 100644
--- a/src/tsg_rule.cpp
+++ b/src/tsg_rule.cpp
@@ -3464,7 +3464,7 @@ int tsg_fetch_hited_security_result(struct Maat_rule_t *hited_result, int hited_
int result_cnt=0;
for(int i=0; i<hited_result_num; i++)
{
- if(hited_result[i].action==TSG_ACTION_SHAPING)
+ if(hited_result[i].action==TSG_ACTION_SHAPING || hited_result[i].action==TSG_ACTION_S_CHAINING)
{
continue;
}
@@ -3479,3 +3479,30 @@ int tsg_fetch_hited_security_result(struct Maat_rule_t *hited_result, int hited_
return result_cnt;
}
+
+int tsg_fetch_hited_s_chaining_result(struct Maat_rule_t *hited_result, int hited_result_num, struct Maat_rule_t *s_chaining_result, int s_chaining_result_num)
+{
+ if(hited_result==NULL || hited_result_num<=0 || s_chaining_result==NULL || s_chaining_result_num<=0)
+ {
+ return 0;
+ }
+
+ int result_cnt=0;
+ for(int i=0; i<hited_result_num; i++)
+ {
+ if(hited_result[i].action!=TSG_ACTION_S_CHAINING)
+ {
+ continue;
+ }
+
+ if(result_cnt>=s_chaining_result_num)
+ {
+ break;
+ }
+
+ memcpy(&(s_chaining_result[result_cnt++]), &(hited_result[i]), sizeof(struct Maat_rule_t));
+ }
+
+ return result_cnt;
+}
+