Lines Matching refs:rule

74 static void hbac_rule_debug_print(struct hbac_rule *rule);
106 bool hbac_rule_is_complete(struct hbac_rule *rule, uint32_t *missing_attrs)
112 if (rule == NULL) {
113 /* No rule passed in? */
118 if (!hbac_rule_element_is_complete(rule->users)) {
123 if (!hbac_rule_element_is_complete(rule->services)) {
128 if (!hbac_rule_element_is_complete(rule->targethosts)) {
133 if (!hbac_rule_element_is_complete(rule->srchosts)) {
141 enum hbac_eval_result_int hbac_evaluate_rule(struct hbac_rule *rule,
172 /* This rule did not match at all. Skip it */
173 HBAC_DEBUG(HBAC_DBG_INFO, "The rule [%s] did not match.\n",
177 HBAC_DEBUG(HBAC_DBG_INFO, "ALLOWED by rule [%s].\n", rules[i]->name);
190 /* An error occurred processing this rule */
192 "Error %d occurred during evaluating of rule [%s].\n",
219 enum hbac_eval_result_int hbac_evaluate_rule(struct hbac_rule *rule,
226 if (!rule->enabled) {
227 HBAC_DEBUG(HBAC_DBG_INFO, "Rule [%s] is not enabled\n", rule->name);
232 if (!rule->users
233 || !rule->services
234 || !rule->targethosts
235 || !rule->srchosts) {
238 rule->name);
244 ret = hbac_evaluate_element(rule->users,
249 "Cannot parse user elements of rule [%s]\n", rule->name);
257 ret = hbac_evaluate_element(rule->services,
262 "Cannot parse service elements of rule [%s]\n", rule->name);
270 ret = hbac_evaluate_element(rule->targethosts,
275 "Cannot parse targethost elements of rule [%s]\n",
276 rule->name);
284 ret = hbac_evaluate_element(rule->srchosts,
289 "Cannot parse srchost elements of rule [%s]\n",
290 rule->name);
487 static void hbac_rule_debug_print(struct hbac_rule *rule)
489 if (rule) {
491 rule->name, (rule->enabled) ? "ENABLED" : "DISABLED");
492 if (rule->services) {
494 hbac_rule_element_debug_print(rule->services, "services");
499 if (rule->users) {
501 hbac_rule_element_debug_print(rule->users, "users");
506 if (rule->targethosts) {
508 hbac_rule_element_debug_print(rule->targethosts, "targethosts");
513 if (rule->srchosts) {
515 hbac_rule_element_debug_print(rule->srchosts, "srchosts");