Lines Matching refs:rule
49 static bool fib4_rule_matchall(const struct fib_rule *rule)
51 struct fib4_rule *r = container_of(rule, struct fib4_rule, common);
55 return fib_rule_matchall(rule);
58 bool fib4_rule_default(const struct fib_rule *rule)
60 if (!fib4_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL ||
61 rule->l3mdev)
63 if (rule->table != RT_TABLE_LOCAL && rule->table != RT_TABLE_MAIN &&
64 rule->table != RT_TABLE_DEFAULT)
95 if (arg.rule)
96 res->tclassid = ((struct fib4_rule *)arg.rule)->tclassid;
108 INDIRECT_CALLABLE_SCOPE int fib4_rule_action(struct fib_rule *rule,
116 switch (rule->action) {
133 tb_id = fib_rule_get_table(rule, arg);
134 tbl = fib_get_table(rule->fr_net, tb_id);
144 INDIRECT_CALLABLE_SCOPE bool fib4_rule_suppress(struct fib_rule *rule,
160 if (result->prefixlen <= rule->suppress_prefixlen)
166 if (rule->suppress_ifgroup != -1 && dev && dev->group == rule->suppress_ifgroup)
177 INDIRECT_CALLABLE_SCOPE int fib4_rule_match(struct fib_rule *rule,
180 struct fib4_rule *r = (struct fib4_rule *) rule;
192 if (rule->ip_proto && (rule->ip_proto != fl4->flowi4_proto))
195 if (fib_rule_port_range_set(&rule->sport_range) &&
196 !fib_rule_port_inrange(&rule->sport_range, fl4->fl4_sport))
199 if (fib_rule_port_range_set(&rule->dport_range) &&
200 !fib_rule_port_inrange(&rule->dport_range, fl4->fl4_dport))
220 static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
227 struct fib4_rule *rule4 = (struct fib4_rule *) rule;
246 if (rule->table == RT_TABLE_UNSPEC && !rule->l3mdev) {
247 if (rule->action == FR_ACT_TO_TBL) {
256 rule->table = table->tb_id;
274 if (fib_rule_requires_fldissect(rule))
289 static int fib4_rule_delete(struct fib_rule *rule)
291 struct net *net = rule->fr_net;
300 if (((struct fib4_rule *)rule)->tclassid)
306 fib_rule_requires_fldissect(rule))
312 static int fib4_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
315 struct fib4_rule *rule4 = (struct fib4_rule *) rule;
340 static int fib4_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
343 struct fib4_rule *rule4 = (struct fib4_rule *) rule;
365 static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule)