ofproto: Drop ofproto_rule_lookup().
authorBen Pfaff <blp@nicira.com>
Tue, 26 Apr 2011 21:25:00 +0000 (14:25 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 11 May 2011 21:06:49 +0000 (14:06 -0700)
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?).

ofproto/ofproto-dpif.c
ofproto/ofproto.c
ofproto/private.h

index 7779cf5..3d91984 100644 (file)
@@ -2427,7 +2427,8 @@ flow_push_stats(const struct rule_dpif *rule,
 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 *
index a9f3704..c58b448 100644 (file)
@@ -1297,12 +1297,6 @@ rule_has_out_port(const struct rule *rule, ovs_be16 out_port)
     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.
index e74d4ad..6489791 100644 (file)
@@ -96,7 +96,6 @@ rule_from_cls_rule(const struct cls_rule *cls_rule)
     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 *);