classifier: Allow CLS_CURSOR_FOR_EACH to use a const-qualified iterator.
[cascardo/ovs.git] / lib / classifier.h
index 3f89196..ead087b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -86,6 +86,7 @@ void cls_rule_init(struct cls_rule *, const struct match *,
 void cls_rule_init_from_minimatch(struct cls_rule *, const struct minimatch *,
                                   unsigned int priority);
 void cls_rule_clone(struct cls_rule *, const struct cls_rule *);
+void cls_rule_move(struct cls_rule *dst, struct cls_rule *src);
 void cls_rule_destroy(struct cls_rule *);
 
 bool cls_rule_equal(const struct cls_rule *, const struct cls_rule *);
@@ -139,7 +140,7 @@ struct cls_cursor {
 void cls_cursor_init(struct cls_cursor *cursor, const struct classifier *cls,
                      const struct cls_rule *match) OVS_REQ_RDLOCK(cls->rwlock);
 struct cls_rule *cls_cursor_first(struct cls_cursor *cursor);
-struct cls_rule *cls_cursor_next(struct cls_cursor *cursor, struct cls_rule *);
+struct cls_rule *cls_cursor_next(struct cls_cursor *cursor, const struct cls_rule *);
 
 #define CLS_CURSOR_FOR_EACH(RULE, MEMBER, CURSOR)                       \
     for (ASSIGN_CONTAINER(RULE, cls_cursor_first(CURSOR), MEMBER);      \