增加读取do_log字段, 修改fs2统计

This commit is contained in:
崔一鸣
2019-06-19 16:15:11 +08:00
parent 455612fd03
commit 5b38353c61
4 changed files with 91 additions and 66 deletions

View File

@@ -197,7 +197,8 @@ static int index_of_enforce_policy(struct Maat_rule_t* result, size_t size)
return ret_intercept_idx;
}
enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipaddr *addr, char *domain, int domain_len, int thread_seq, int *policy_id, int *is_hit_policy){
enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipaddr *addr, char *domain, int domain_len,
int thread_seq, int *policy_id, int *do_log, int *is_hit_policy){
//return KNI_ACTION_INTERCEPT;
Maat_feather_t maat_feather=handle->feather;
int table_intercept_ip=handle->tableid_intercept_ip;
@@ -225,7 +226,8 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa
if(hit_policy_cnt>0)
{
enforced_policy_idx=index_of_enforce_policy(result, hit_policy_cnt);
*policy_id=result[enforced_policy_idx].config_id;
*policy_id = result[enforced_policy_idx].config_id;
*do_log = result[enforced_policy_idx].do_log;
*is_hit_policy=1;
unsigned char action = (unsigned char)result[enforced_policy_idx].action;
return (enum kni_action)action;