Lines Matching refs:rule

31 static bool fib6_rule_matchall(const struct fib_rule *rule)
33 struct fib6_rule *r = container_of(rule, struct fib6_rule, common);
37 return fib_rule_matchall(rule);
40 bool fib6_rule_default(const struct fib_rule *rule)
42 if (!fib6_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL ||
43 rule->l3mdev)
45 if (rule->table != RT6_TABLE_LOCAL && rule->table != RT6_TABLE_MAIN)
132 static int fib6_rule_saddr(struct net *net, struct fib_rule *rule, int flags,
135 struct fib6_rule *r = (struct fib6_rule *)rule;
138 * we check the result if it meets requirement of the rule.
140 if ((rule->flags & FIB_RULE_FIND_SADDR) &&
157 static int fib6_rule_action_alt(struct fib_rule *rule, struct flowi *flp,
162 struct net *net = rule->fr_net;
167 switch (rule->action) {
179 tb_id = fib_rule_get_table(rule, arg);
187 err = fib6_rule_saddr(net, rule, flags, flp6,
195 static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
202 struct net *net = rule->fr_net;
207 switch (rule->action) {
225 tb_id = fib_rule_get_table(rule, arg);
239 err = fib6_rule_saddr(net, rule, flags, flp6,
263 INDIRECT_CALLABLE_SCOPE int fib6_rule_action(struct fib_rule *rule,
268 return fib6_rule_action_alt(rule, flp, flags, arg);
270 return __fib6_rule_action(rule, flp, flags, arg);
273 INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule,
290 if (rt->rt6i_dst.plen <= rule->suppress_prefixlen)
296 if (rule->suppress_ifgroup != -1 && dev && dev->group == rule->suppress_ifgroup)
306 INDIRECT_CALLABLE_SCOPE int fib6_rule_match(struct fib_rule *rule,
309 struct fib6_rule *r = (struct fib6_rule *) rule;
333 if (rule->ip_proto && (rule->ip_proto != fl6->flowi6_proto))
336 if (fib_rule_port_range_set(&rule->sport_range) &&
337 !fib_rule_port_inrange(&rule->sport_range, fl6->fl6_sport))
340 if (fib_rule_port_range_set(&rule->dport_range) &&
341 !fib_rule_port_inrange(&rule->dport_range, fl6->fl6_dport))
351 static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
358 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) {
382 if (fib_rule_requires_fldissect(rule))
391 static int fib6_rule_delete(struct fib_rule *rule)
393 struct net *net = rule->fr_net;
396 fib_rule_requires_fldissect(rule))
402 static int fib6_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
405 struct fib6_rule *rule6 = (struct fib6_rule *) rule;
427 static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
430 struct fib6_rule *rule6 = (struct fib6_rule *) rule;
447 static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule)