diff options
author | Ben Pfaff <blp@nicira.com> | 2011-03-24 11:00:39 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-04-01 15:52:19 -0700 |
commit | 1e2e71109fc690cf2ab0c4093cf451989ef23c6d (patch) | |
tree | e0ceccca0a15bd715a172328415d1c8372655f04 | |
parent | dc1539ae02fcb9c22b98d587b790ce8bc3a68774 (diff) |
tag: New function tag_set_union().
-rw-r--r-- | lib/tag.c | 12 | ||||
-rw-r--r-- | lib/tag.h | 3 |
2 files changed, 13 insertions, 2 deletions
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,3 +105,13 @@ tag_set_add(struct tag_set *set, tag_type tag) } } +/* Adds all the tags in 'other' to 'set'. */ +void +tag_set_union(struct tag_set *set, const struct tag_set *other) +{ + size_t i; + + for (i = 0; i < TAG_SET_SIZE; i++) { + tag_set_add(set, other->tags[i]); + } +} @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008 Nicira Networks. + * Copyright (c) 2008, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,6 +107,7 @@ struct tag_set { void tag_set_init(struct tag_set *); void tag_set_add(struct tag_set *, tag_type); +void tag_set_union(struct tag_set *, const struct tag_set *); static inline bool tag_set_is_empty(const struct tag_set *); static inline bool tag_set_intersects(const struct tag_set *, tag_type); |