Lines Matching refs:rule
30 static bool fib6_rule_matchall(const struct fib_rule *rule) in fib6_rule_matchall() argument
32 struct fib6_rule *r = container_of(rule, struct fib6_rule, common); in fib6_rule_matchall()
36 return fib_rule_matchall(rule); in fib6_rule_matchall()
39 bool fib6_rule_default(const struct fib_rule *rule) in fib6_rule_default() argument
41 if (!fib6_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL || in fib6_rule_default()
42 rule->l3mdev) in fib6_rule_default()
44 if (rule->table != RT6_TABLE_LOCAL && rule->table != RT6_TABLE_MAIN) in fib6_rule_default()
128 static int fib6_rule_saddr(struct net *net, struct fib_rule *rule, int flags, in fib6_rule_saddr() argument
131 struct fib6_rule *r = (struct fib6_rule *)rule; in fib6_rule_saddr()
136 if ((rule->flags & FIB_RULE_FIND_SADDR) && in fib6_rule_saddr()
153 static int fib6_rule_action_alt(struct fib_rule *rule, struct flowi *flp, in fib6_rule_action_alt() argument
158 struct net *net = rule->fr_net; in fib6_rule_action_alt()
163 switch (rule->action) { in fib6_rule_action_alt()
175 tb_id = fib_rule_get_table(rule, arg); in fib6_rule_action_alt()
183 err = fib6_rule_saddr(net, rule, flags, flp6, in fib6_rule_action_alt()
191 static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp, in __fib6_rule_action() argument
198 struct net *net = rule->fr_net; in __fib6_rule_action()
203 switch (rule->action) { in __fib6_rule_action()
221 tb_id = fib_rule_get_table(rule, arg); in __fib6_rule_action()
230 err = fib6_rule_saddr(net, rule, flags, flp6, in __fib6_rule_action()
254 static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp, in fib6_rule_action() argument
258 return fib6_rule_action_alt(rule, flp, flags, arg); in fib6_rule_action()
260 return __fib6_rule_action(rule, flp, flags, arg); in fib6_rule_action()
263 static bool fib6_rule_suppress(struct fib_rule *rule, int flags, struct fib_lookup_arg *arg) in fib6_rule_suppress() argument
278 if (rt->rt6i_dst.plen <= rule->suppress_prefixlen) in fib6_rule_suppress()
284 if (rule->suppress_ifgroup != -1 && dev && dev->group == rule->suppress_ifgroup) in fib6_rule_suppress()
294 static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) in fib6_rule_match() argument
296 struct fib6_rule *r = (struct fib6_rule *) rule; in fib6_rule_match()
320 if (rule->ip_proto && (rule->ip_proto != fl6->flowi6_proto)) in fib6_rule_match()
323 if (fib_rule_port_range_set(&rule->sport_range) && in fib6_rule_match()
324 !fib_rule_port_inrange(&rule->sport_range, fl6->fl6_sport)) in fib6_rule_match()
327 if (fib_rule_port_range_set(&rule->dport_range) && in fib6_rule_match()
328 !fib_rule_port_inrange(&rule->dport_range, fl6->fl6_dport)) in fib6_rule_match()
338 static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, in fib6_rule_configure() argument
345 struct fib6_rule *rule6 = (struct fib6_rule *) rule; in fib6_rule_configure()
347 if (rule->action == FR_ACT_TO_TBL && !rule->l3mdev) { in fib6_rule_configure()
348 if (rule->table == RT6_TABLE_UNSPEC) { in fib6_rule_configure()
353 if (fib6_new_table(net, rule->table) == NULL) { in fib6_rule_configure()
369 if (fib_rule_requires_fldissect(rule)) in fib6_rule_configure()
378 static int fib6_rule_delete(struct fib_rule *rule) in fib6_rule_delete() argument
380 struct net *net = rule->fr_net; in fib6_rule_delete()
383 fib_rule_requires_fldissect(rule)) in fib6_rule_delete()
389 static int fib6_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh, in fib6_rule_compare() argument
392 struct fib6_rule *rule6 = (struct fib6_rule *) rule; in fib6_rule_compare()
414 static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb, in fib6_rule_fill() argument
417 struct fib6_rule *rule6 = (struct fib6_rule *) rule; in fib6_rule_fill()
434 static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule) in fib6_rule_nlmsg_payload() argument