增加Maat_rule_sort_by_exec_seq函数,可以按执行顺序对策略排序。

This commit is contained in:
zhengchao
2020-02-04 11:00:57 +08:00
parent 02b9914210
commit 017a2a3816
7 changed files with 253 additions and 15 deletions

View File

@@ -259,6 +259,12 @@ int Maat_rule_get_ex_new_index(Maat_feather_t feather, const char* compile_table
//returned data is duplicated by dup_func of Maat_rule_get_ex_new_index, caller is responsible to free the data.
MAAT_RULE_EX_DATA Maat_rule_get_ex_data(Maat_feather_t feather, const struct Maat_rule_t* rule, int idx);
//Sort rule by execute sequence.
//rule_array will be modified with sorted rule.
//Return sortted rule number, maybe less than n_rule if some rules are invalid.
size_t Maat_rule_sort_by_exec_seq(Maat_feather_t feather, struct Maat_rule_t* rule_array, size_t n_rule);
//Helper function for parsing space or tab seperated line.
//Nth_column: the Nth column is numberd from 1.
//Return 0 if success.