classifier: New enum CLS_INC_ALL, for convenience.
authorBen Pfaff <blp@nicira.com>
Tue, 10 Mar 2009 17:12:40 +0000 (10:12 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 10 Mar 2009 21:00:34 +0000 (14:00 -0700)
lib/classifier.h
secchan/ofproto.c
tests/test-classifier.c

index f660483f00d8475a8a9501b09851e982ed1e282d..1afebede4530645e579f02c7f898c76c491d9840 100644 (file)
@@ -149,7 +149,8 @@ typedef void cls_cb_func(struct cls_rule *, void *aux);
 
 enum {
     CLS_INC_EXACT = 1 << 0,     /* Include exact-match flows? */
-    CLS_INC_WILD = 1 << 1       /* Include flows with wildcards? */
+    CLS_INC_WILD = 1 << 1,      /* Include flows with wildcards? */
+    CLS_INC_ALL = CLS_INC_EXACT | CLS_INC_WILD
 };
 void classifier_for_each(const struct classifier *, int include,
                          cls_cb_func *, void *aux);
index c30e6874286c394b38a0be5ff76771646a243233..0ee8346ee88f221667e0df2b38b87d582b863a17 100644 (file)
@@ -1916,7 +1916,7 @@ table_id_to_include(uint8_t table_id)
 {
     return (table_id == TABLEID_HASH ? CLS_INC_EXACT
             : table_id == TABLEID_CLASSIFIER ? CLS_INC_WILD
-            : CLS_INC_EXACT | CLS_INC_WILD);
+            : CLS_INC_ALL);
 }
 
 static int
@@ -2280,7 +2280,7 @@ modify_flows_loose(struct ofproto *p, const struct ofp_flow_mod *ofm,
     cbdata.command = command;
 
     cls_rule_from_match(&target, &ofm->match, 0);
-    classifier_for_each_match(&p->cls, &target, CLS_INC_WILD | CLS_INC_EXACT,
+    classifier_for_each_match(&p->cls, &target, CLS_INC_ALL,
                               modify_flows_cb, &cbdata);
     return 0;
 }
index a43217d61ef122031b92ef8b1d521af8fe43d96f..9df259f3cc433b24c178df483a45d2756a317657 100644 (file)
@@ -405,7 +405,7 @@ free_rule(struct cls_rule *cls_rule, void *cls)
 static void
 destroy_classifier(struct classifier *cls)
 {
-    classifier_for_each(cls, CLS_INC_WILD | CLS_INC_EXACT, free_rule, cls);
+    classifier_for_each(cls, CLS_INC_ALL, free_rule, cls);
     classifier_destroy(cls);
 }