2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

classifier: Constify RCU pointers.

Returning const struct cls_rule pointers from the classifier API helps
callers to remember that they should not modify the rules returned.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jarno Rajahalme
2014-11-06 14:55:29 -08:00
parent 059def1e2f
commit dfea28b3b4
4 changed files with 75 additions and 65 deletions

View File

@@ -288,21 +288,22 @@ bool classifier_set_prefix_fields(struct classifier *,
bool classifier_is_empty(const struct classifier *);
int classifier_count(const struct classifier *);
void classifier_insert(struct classifier *, struct cls_rule *);
struct cls_rule *classifier_replace(struct classifier *, struct cls_rule *);
struct cls_rule *classifier_remove(struct classifier *, struct cls_rule *);
struct cls_rule *classifier_lookup(const struct classifier *,
const struct flow *,
struct flow_wildcards *);
const struct cls_rule *classifier_replace(struct classifier *,
struct cls_rule *);
const struct cls_rule *classifier_remove(struct classifier *,
const struct cls_rule *);
const struct cls_rule *classifier_lookup(const struct classifier *,
const struct flow *,
struct flow_wildcards *);
bool classifier_rule_overlaps(const struct classifier *,
const struct cls_rule *);
struct cls_rule *classifier_find_rule_exactly(const struct classifier *,
const struct cls_rule *);
const struct cls_rule *classifier_find_rule_exactly(const struct classifier *,
const struct cls_rule *);
struct cls_rule *classifier_find_match_exactly(const struct classifier *,
const struct match *,
int priority);
const struct cls_rule *classifier_find_match_exactly(const struct classifier *,
const struct match *,
int priority);
/* Iteration. */
@@ -312,7 +313,7 @@ struct cls_cursor {
const struct cls_rule *target;
struct cmap_cursor subtables;
struct cmap_cursor rules;
struct cls_rule *rule;
const struct cls_rule *rule;
bool safe;
};