diff options
| author | Ben Pfaff <blp@nicira.com> | 2010-12-06 10:03:31 -0800 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2010-12-06 10:03:31 -0800 |
| commit | b3907fbc6c74ddad7507d0f7abb1f5a2528cd2be (patch) | |
| tree | af13c768d24cd4d670d8ef19e5793042e9311705 /lib/ofpbuf.h | |
| parent | 772ec52b896380f23b587bea4a5bf18edd22449d (diff) | |
| download | openvswitch-b3907fbc6c74ddad7507d0f7abb1f5a2528cd2be.tar.gz | |
queue: Get rid of ovs_queue data structure.
ovs_queue doesn't seem very useful; it's just a singly-linked list. It's
more generally useful to use a general-purpose "struct list" for lists of
packets, so this commit adds such a member to "struct ofpbuf" and shifts
the existing users to use it.
Diffstat (limited to 'lib/ofpbuf.h')
| -rw-r--r-- | lib/ofpbuf.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h index 5e20aab0b..7d106d888 100644 --- a/lib/ofpbuf.h +++ b/lib/ofpbuf.h @@ -18,6 +18,7 @@ #define OFPBUF_H 1 #include <stddef.h> +#include "list.h" #ifdef __cplusplus extern "C" { @@ -37,7 +38,7 @@ struct ofpbuf { void *l4; /* Transport-level header. */ void *l7; /* Application data. */ - struct ofpbuf *next; /* Next in a list of ofpbufs. */ + struct list list_node; /* Private list element for use by owner. */ void *private_p; /* Private pointer for use by owner. */ }; @@ -80,6 +81,12 @@ void *ofpbuf_try_pull(struct ofpbuf *, size_t); char *ofpbuf_to_string(const struct ofpbuf *, size_t maxbytes); +static inline struct ofpbuf *ofpbuf_from_list(const struct list *list) +{ + return CONTAINER_OF(list, struct ofpbuf, list_node); +} +void ofpbuf_list_delete(struct list *); + #ifdef __cplusplus } #endif |
