Lines Matching defs:rule
52 static bool fib4_rule_matchall(const struct fib_rule *rule)
54 struct fib4_rule *r = container_of(rule, struct fib4_rule, common);
58 return fib_rule_matchall(rule);
61 bool fib4_rule_default(const struct fib_rule *rule)
63 if (!fib4_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL ||
64 rule->l3mdev)
66 if (rule->table != RT_TABLE_LOCAL && rule->table != RT_TABLE_MAIN &&
67 rule->table != RT_TABLE_DEFAULT)
98 if (arg.rule)
99 res->tclassid = ((struct fib4_rule *)arg.rule)->tclassid;
111 INDIRECT_CALLABLE_SCOPE int fib4_rule_action(struct fib_rule *rule,
119 switch (rule->action) {
136 tb_id = fib_rule_get_table(rule, arg);
137 tbl = fib_get_table(rule->fr_net, tb_id);
147 INDIRECT_CALLABLE_SCOPE bool fib4_rule_suppress(struct fib_rule *rule,
163 if (result->prefixlen <= rule->suppress_prefixlen)
169 if (rule->suppress_ifgroup != -1 && dev && dev->group == rule->suppress_ifgroup)
180 INDIRECT_CALLABLE_SCOPE int fib4_rule_match(struct fib_rule *rule,
183 struct fib4_rule *r = (struct fib4_rule *) rule;
203 if (rule->ip_proto && (rule->ip_proto != fl4->flowi4_proto))
206 if (!fib_rule_port_match(&rule->sport_range, rule->sport_mask,
210 if (!fib_rule_port_match(&rule->dport_range, rule->dport_mask,
269 static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
274 struct fib4_rule *rule4 = (struct fib4_rule *)rule;
275 struct net *net = rule->fr_net;
309 if (rule->table == RT_TABLE_UNSPEC && !rule->l3mdev) {
310 if (rule->action == FR_ACT_TO_TBL) {
319 rule->table = table->tb_id;
337 if (fib_rule_requires_fldissect(rule))
352 static int fib4_rule_delete(struct fib_rule *rule)
354 struct net *net = rule->fr_net;
363 if (((struct fib4_rule *)rule)->tclassid)
369 fib_rule_requires_fldissect(rule))
375 static int fib4_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
378 struct fib4_rule *rule4 = (struct fib4_rule *) rule;
421 static int fib4_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
424 struct fib4_rule *rule4 = (struct fib4_rule *) rule;
456 static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule)