Lines Matching full:rule
36 static bool fib6_rule_matchall(const struct fib_rule *rule) in fib6_rule_matchall() argument
38 struct fib6_rule *r = container_of(rule, struct fib6_rule, common); in fib6_rule_matchall()
42 return fib_rule_matchall(rule); in fib6_rule_matchall()
45 bool fib6_rule_default(const struct fib_rule *rule) in fib6_rule_default() argument
47 if (!fib6_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL || in fib6_rule_default()
48 rule->l3mdev) in fib6_rule_default()
50 if (rule->table != RT6_TABLE_LOCAL && rule->table != RT6_TABLE_MAIN) in fib6_rule_default()
137 static int fib6_rule_saddr(struct net *net, struct fib_rule *rule, int flags, in fib6_rule_saddr() argument
140 struct fib6_rule *r = (struct fib6_rule *)rule; in fib6_rule_saddr()
143 * we check the result if it meets requirement of the rule. in fib6_rule_saddr()
145 if ((rule->flags & FIB_RULE_FIND_SADDR) && in fib6_rule_saddr()
162 static int fib6_rule_action_alt(struct fib_rule *rule, struct flowi *flp, in fib6_rule_action_alt() argument
167 struct net *net = rule->fr_net; in fib6_rule_action_alt()
172 switch (rule->action) { in fib6_rule_action_alt()
184 tb_id = fib_rule_get_table(rule, arg); in fib6_rule_action_alt()
192 err = fib6_rule_saddr(net, rule, flags, flp6, in fib6_rule_action_alt()
200 static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp, in __fib6_rule_action() argument
207 struct net *net = rule->fr_net; in __fib6_rule_action()
212 switch (rule->action) { in __fib6_rule_action()
230 tb_id = fib_rule_get_table(rule, arg); in __fib6_rule_action()
244 err = fib6_rule_saddr(net, rule, flags, flp6, in __fib6_rule_action()
268 INDIRECT_CALLABLE_SCOPE int fib6_rule_action(struct fib_rule *rule, in fib6_rule_action() argument
273 return fib6_rule_action_alt(rule, flp, flags, arg); in fib6_rule_action()
275 return __fib6_rule_action(rule, flp, flags, arg); in fib6_rule_action()
278 INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule, in fib6_rule_suppress() argument
295 if (rt->rt6i_dst.plen <= rule->suppress_prefixlen) in fib6_rule_suppress()
301 if (rule->suppress_ifgroup != -1 && dev && dev->group == rule->suppress_ifgroup) in fib6_rule_suppress()
311 INDIRECT_CALLABLE_SCOPE int fib6_rule_match(struct fib_rule *rule, in fib6_rule_match() argument
314 struct fib6_rule *r = (struct fib6_rule *) rule; in fib6_rule_match()
341 if (rule->ip_proto && (rule->ip_proto != fl6->flowi6_proto)) in fib6_rule_match()
344 if (!fib_rule_port_match(&rule->sport_range, rule->sport_mask, in fib6_rule_match()
348 if (!fib_rule_port_match(&rule->dport_range, rule->dport_mask, in fib6_rule_match()
422 static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, in fib6_rule_configure() argument
427 struct fib6_rule *rule6 = (struct fib6_rule *)rule; in fib6_rule_configure()
428 struct net *net = rule->fr_net; in fib6_rule_configure()
450 if (rule->action == FR_ACT_TO_TBL && !rule->l3mdev) { in fib6_rule_configure()
451 if (rule->table == RT6_TABLE_UNSPEC) { in fib6_rule_configure()
456 if (fib6_new_table(net, rule->table) == NULL) { in fib6_rule_configure()
471 if (fib_rule_requires_fldissect(rule)) in fib6_rule_configure()
480 static int fib6_rule_delete(struct fib_rule *rule) in fib6_rule_delete() argument
482 struct net *net = rule->fr_net; in fib6_rule_delete()
485 fib_rule_requires_fldissect(rule)) in fib6_rule_delete()
491 static int fib6_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh, in fib6_rule_compare() argument
494 struct fib6_rule *rule6 = (struct fib6_rule *) rule; in fib6_rule_compare()
542 static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb, in fib6_rule_fill() argument
545 struct fib6_rule *rule6 = (struct fib6_rule *) rule; in fib6_rule_fill()
577 static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule) in fib6_rule_nlmsg_payload() argument