[ovs-dev] [bondlib 06/19] tag: New function tag_set_union().
Ethan Jackson
ethan at nicira.com
Mon Mar 28 20:59:34 UTC 2011
Looks Good.
As a side note, I finally took a moment to read how we actually
implemented tags. Very cool, reminds me of a very specialized version
of bloom filters.
Ethan
On Fri, Mar 25, 2011 at 10:35 AM, Ben Pfaff <blp at nicira.com> wrote:
> ---
> lib/tag.c | 12 +++++++++++-
> lib/tag.h | 3 ++-
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/lib/tag.c b/lib/tag.c
> index 0fd0de1..bf2c9a5 100644
> --- a/lib/tag.c
> +++ b/lib/tag.c
> @@ -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]);
> + }
> +}
> diff --git a/lib/tag.h b/lib/tag.h
> index f645dc9..5885e15 100644
> --- a/lib/tag.h
> +++ b/lib/tag.h
> @@ -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);
>
> --
> 1.7.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
More information about the dev
mailing list