There's no reason not to implement this trivial function in ofproto-dpif,
especially since it makes less sense once multiple table support is
implemented (which table should be searched?).
static struct rule_dpif *
rule_dpif_lookup(struct ofproto_dpif *ofproto, const struct flow *flow)
{
- return rule_dpif_cast(ofproto_rule_lookup(&ofproto->up, flow));
+ return rule_dpif_cast(rule_from_cls_rule(
+ classifier_lookup(&ofproto->up.cls, flow)));
}
static struct rule *
return false;
}
-struct rule *
-ofproto_rule_lookup(struct ofproto *ofproto, const struct flow *flow)
-{
- return rule_from_cls_rule(classifier_lookup(&ofproto->cls, flow));
-}
-
/* Executes the actions indicated by 'rule' on 'packet' and credits 'rule''s
* statistics appropriately. 'packet' must have at least sizeof(struct
* ofp_packet_in) bytes of headroom.
return cls_rule ? CONTAINER_OF(cls_rule, struct rule, cr) : NULL;
}
-struct rule *ofproto_rule_lookup(struct ofproto *, const struct flow *);
void ofproto_rule_expire(struct rule *, uint8_t reason);
void ofproto_rule_destroy(struct rule *);