diff options
author | Ben Pfaff <blp@nicira.com> | 2010-10-14 10:13:51 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-10-29 09:53:51 -0700 |
commit | 48c3de13bee26106d8e708600904f2b20bd08818 (patch) | |
tree | 7aa761136559a8b85e24eaf698018723fd2b10c9 /lib/classifier.h | |
parent | fbb2ea0b5bebaae691ce6ac4b3a2eed65c775d9b (diff) |
classifier: Merge classifier_lookup_wild(), classifier_lookup_exact().
Merge these functions into classifier_lookup() and update its interface.
The new version of the classifier soon to be implemented naturally merges
these functions, so this commit updates the interface early.
Diffstat (limited to 'lib/classifier.h')
-rw-r--r-- | lib/classifier.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/classifier.h b/lib/classifier.h index 3ad69e00..28be2471 100644 --- a/lib/classifier.h +++ b/lib/classifier.h @@ -123,6 +123,12 @@ struct cls_rule { unsigned int table_idx; /* Index into struct classifier 'tables'. */ }; +enum { + CLS_INC_EXACT = 1 << 0, /* Include exact-match flows? */ + CLS_INC_WILD = 1 << 1, /* Include flows with wildcards? */ + CLS_INC_ALL = CLS_INC_EXACT | CLS_INC_WILD +}; + void cls_rule_from_flow(const struct flow *, uint32_t wildcards, unsigned int priority, struct cls_rule *); void cls_rule_from_match(const struct ofp_match *, unsigned int priority, @@ -140,21 +146,12 @@ struct cls_rule *classifier_insert(struct classifier *, struct cls_rule *); void classifier_insert_exact(struct classifier *, struct cls_rule *); void classifier_remove(struct classifier *, struct cls_rule *); struct cls_rule *classifier_lookup(const struct classifier *, - const struct flow *); -struct cls_rule *classifier_lookup_wild(const struct classifier *, - const struct flow *); -struct cls_rule *classifier_lookup_exact(const struct classifier *, - const struct flow *); + const struct flow *, int include); bool classifier_rule_overlaps(const struct classifier *, const struct flow *, uint32_t wildcards, unsigned int priority); 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_ALL = CLS_INC_EXACT | CLS_INC_WILD -}; void classifier_for_each(const struct classifier *, int include, cls_cb_func *, void *aux); void classifier_for_each_match(const struct classifier *, |