callback(prev_rule, aux);
}
}
-
-void
-classifier_for_each_with_wildcards(const struct classifier *cls,
- uint32_t wildcards,
- cls_cb_func *callback, void *aux)
-{
- struct cls_rule *prev_rule = NULL;
-
- assert(!(wildcards & ~OFPFW_ALL));
- if (wildcards) {
- int table_idx = table_idx_from_wildcards(wildcards);
- const struct hmap *tbl = &cls->tables[table_idx];
- struct cls_bucket *bucket, *next_bucket;
- struct cls_rule *rule;
-
- HMAP_FOR_EACH_SAFE (bucket, next_bucket,
- struct cls_bucket, hmap_node, tbl) {
- LIST_FOR_EACH (rule, struct cls_rule, node.list, &bucket->rules) {
- if (rule->wc.wildcards == wildcards) {
- if (prev_rule) {
- callback(prev_rule, aux);
- }
- prev_rule = rule;
- }
- }
- }
- } else {
- struct cls_rule *rule, *next_rule;
- HMAP_FOR_EACH_SAFE (rule, next_rule,
- struct cls_rule, node.hmap, &cls->exact_table) {
- if (prev_rule) {
- callback(prev_rule, aux);
- }
- prev_rule = rule;
- }
- }
- if (prev_rule) {
- callback(prev_rule, aux);
- }
-}
\f
static struct cls_bucket *create_bucket(struct hmap *, size_t hash,
const flow_t *fixed);
};
void classifier_for_each(const struct classifier *, int include,
cls_cb_func *, void *aux);
-void classifier_for_each_with_wildcards(const struct classifier *,
- uint32_t wildcards,
- cls_cb_func *, void *aux);
-
void classifier_for_each_match(const struct classifier *,
const struct cls_rule *,
int include, cls_cb_func *, void *aux);
-
struct cls_rule *classifier_find_rule_exactly(const struct classifier *,
const flow_t *target,
uint32_t wildcards,