2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

classifier: New function cls_rule_move().

This function will acquire its first user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ben Pfaff
2013-08-27 12:25:48 -07:00
parent 1828ae5140
commit b2c1f00b73
6 changed files with 49 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ cls_rule_init_from_minimatch(struct cls_rule *rule,
/* Initializes 'dst' as a copy of 'src'.
*
* The caller must eventually destroy 'rule' with cls_rule_destroy(). */
* The caller must eventually destroy 'dst' with cls_rule_destroy(). */
void
cls_rule_clone(struct cls_rule *dst, const struct cls_rule *src)
{
@@ -97,6 +97,16 @@ cls_rule_clone(struct cls_rule *dst, const struct cls_rule *src)
dst->priority = src->priority;
}
/* Initializes 'dst' with the data in 'src', destroying 'src'.
*
* The caller must eventually destroy 'dst' with cls_rule_destroy(). */
void
cls_rule_move(struct cls_rule *dst, struct cls_rule *src)
{
minimatch_move(&dst->match, &src->match);
dst->priority = src->priority;
}
/* Frees memory referenced by 'rule'. Doesn't free 'rule' itself (it's
* normally embedded into a larger structure).
*