Lines Matching refs:rule

47 static bool fib4_rule_matchall(const struct fib_rule *rule)  in fib4_rule_matchall()  argument
49 struct fib4_rule *r = container_of(rule, struct fib4_rule, common); in fib4_rule_matchall()
53 return fib_rule_matchall(rule); in fib4_rule_matchall()
56 bool fib4_rule_default(const struct fib_rule *rule) in fib4_rule_default() argument
58 if (!fib4_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL || in fib4_rule_default()
59 rule->l3mdev) in fib4_rule_default()
61 if (rule->table != RT_TABLE_LOCAL && rule->table != RT_TABLE_MAIN && in fib4_rule_default()
62 rule->table != RT_TABLE_DEFAULT) in fib4_rule_default()
92 if (arg.rule) in __fib_lookup()
93 res->tclassid = ((struct fib4_rule *)arg.rule)->tclassid; in __fib_lookup()
105 static int fib4_rule_action(struct fib_rule *rule, struct flowi *flp, in fib4_rule_action() argument
112 switch (rule->action) { in fib4_rule_action()
129 tb_id = fib_rule_get_table(rule, arg); in fib4_rule_action()
130 tbl = fib_get_table(rule->fr_net, tb_id); in fib4_rule_action()
140 static bool fib4_rule_suppress(struct fib_rule *rule, struct fib_lookup_arg *arg) in fib4_rule_suppress() argument
154 if (result->prefixlen <= rule->suppress_prefixlen) in fib4_rule_suppress()
160 if (rule->suppress_ifgroup != -1 && dev && dev->group == rule->suppress_ifgroup) in fib4_rule_suppress()
171 static int fib4_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) in fib4_rule_match() argument
173 struct fib4_rule *r = (struct fib4_rule *) rule; in fib4_rule_match()
185 if (rule->ip_proto && (rule->ip_proto != fl4->flowi4_proto)) in fib4_rule_match()
188 if (fib_rule_port_range_set(&rule->sport_range) && in fib4_rule_match()
189 !fib_rule_port_inrange(&rule->sport_range, fl4->fl4_sport)) in fib4_rule_match()
192 if (fib_rule_port_range_set(&rule->dport_range) && in fib4_rule_match()
193 !fib_rule_port_inrange(&rule->dport_range, fl4->fl4_dport)) in fib4_rule_match()
218 static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, in fib4_rule_configure() argument
225 struct fib4_rule *rule4 = (struct fib4_rule *) rule; in fib4_rule_configure()
237 if (rule->table == RT_TABLE_UNSPEC && !rule->l3mdev) { in fib4_rule_configure()
238 if (rule->action == FR_ACT_TO_TBL) { in fib4_rule_configure()
247 rule->table = table->tb_id; in fib4_rule_configure()
265 if (fib_rule_requires_fldissect(rule)) in fib4_rule_configure()
281 static int fib4_rule_delete(struct fib_rule *rule) in fib4_rule_delete() argument
283 struct net *net = rule->fr_net; in fib4_rule_delete()
292 if (((struct fib4_rule *)rule)->tclassid) in fib4_rule_delete()
298 fib_rule_requires_fldissect(rule)) in fib4_rule_delete()
304 static int fib4_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh, in fib4_rule_compare() argument
307 struct fib4_rule *rule4 = (struct fib4_rule *) rule; in fib4_rule_compare()
332 static int fib4_rule_fill(struct fib_rule *rule, struct sk_buff *skb, in fib4_rule_fill() argument
335 struct fib4_rule *rule4 = (struct fib4_rule *) rule; in fib4_rule_fill()
357 static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule) in fib4_rule_nlmsg_payload() argument