Lines Matching full:rule

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