Lines Matching refs:rule

32 static bool fib6_rule_matchall(const struct fib_rule *rule)
34 struct fib6_rule *r = container_of(rule, struct fib6_rule, common);
38 return fib_rule_matchall(rule);
41 bool fib6_rule_default(const struct fib_rule *rule)
43 if (!fib6_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL ||
44 rule->l3mdev)
46 if (rule->table != RT6_TABLE_LOCAL && rule->table != RT6_TABLE_MAIN)
133 static int fib6_rule_saddr(struct net *net, struct fib_rule *rule, int flags,
136 struct fib6_rule *r = (struct fib6_rule *)rule;
139 * we check the result if it meets requirement of the rule.
141 if ((rule->flags & FIB_RULE_FIND_SADDR) &&
158 static int fib6_rule_action_alt(struct fib_rule *rule, struct flowi *flp,
163 struct net *net = rule->fr_net;
168 switch (rule->action) {
180 tb_id = fib_rule_get_table(rule, arg);
188 err = fib6_rule_saddr(net, rule, flags, flp6,
196 static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
203 struct net *net = rule->fr_net;
208 switch (rule->action) {
226 tb_id = fib_rule_get_table(rule, arg);
236 err = fib6_rule_saddr(net, rule, flags, flp6,
260 INDIRECT_CALLABLE_SCOPE int fib6_rule_action(struct fib_rule *rule,
265 return fib6_rule_action_alt(rule, flp, flags, arg);
267 return __fib6_rule_action(rule, flp, flags, arg);
270 INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule,
287 if (rt->rt6i_dst.plen <= rule->suppress_prefixlen)
293 if (rule->suppress_ifgroup != -1 && dev && dev->group == rule->suppress_ifgroup)
303 INDIRECT_CALLABLE_SCOPE int fib6_rule_match(struct fib_rule *rule,
306 struct fib6_rule *r = (struct fib6_rule *) rule;
330 if (rule->ip_proto && (rule->ip_proto != fl6->flowi6_proto))
333 if (fib_rule_port_range_set(&rule->sport_range) &&
334 !fib_rule_port_inrange(&rule->sport_range, fl6->fl6_sport))
337 if (fib_rule_port_range_set(&rule->dport_range) &&
338 !fib_rule_port_inrange(&rule->dport_range, fl6->fl6_dport))
344 static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
351 struct fib6_rule *rule6 = (struct fib6_rule *) rule;
360 if (rule->action == FR_ACT_TO_TBL && !rule->l3mdev) {
361 if (rule->table == RT6_TABLE_UNSPEC) {
366 if (fib6_new_table(net, rule->table) == NULL) {
381 if (fib_rule_requires_fldissect(rule))
390 static int fib6_rule_delete(struct fib_rule *rule)
392 struct net *net = rule->fr_net;
395 fib_rule_requires_fldissect(rule))
401 static int fib6_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
404 struct fib6_rule *rule6 = (struct fib6_rule *) rule;
426 static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
429 struct fib6_rule *rule6 = (struct fib6_rule *) rule;
446 static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule)