aboutsummaryrefslogtreecommitdiff
path: root/lib/ofpbuf.c
AgeCommit message (Collapse)Author
2011-06-14openflow: Make stats replies more like other OpenFlow messages.Ben Pfaff
2011-03-30ofpbuf: Make ofpbufs initialized with ofpbuf_use_stack() not expandable.Ben Pfaff
My original intent for ofpbufs initialized with ofpbuf_use_stack() was that the caller was providing enough space on the stack for the common case, with dynamic allocation as a fallback. But in practice, none of the clients actually do this. Instead, all of them actually know that the stack-allocated buffer is big enough and, since they don't want to bother with having to call ofpbuf_delete(), they instead assert that the buffer wasn't reallocated. Since this is a bit of a pain, this commit changes the semantics of ofpbuf_use_stack() to be that the stack-allocated buffer cannot be reallocated at all. This is more convenient for the existing clients.
2011-03-18ofpbuf: New function ofpbuf_steal_data().Ben Pfaff
This will have its first use in an upcoming commit.
2011-01-27ofpbuf: New function ofpbuf_clone_data_with_headroom().Ben Pfaff
This new function is a simple helper that creates a new ofpbuf with some initial contents plus a caller-specified amount of headroom. This will be used in upcoming commits. Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27ofpbuf: Enable ofpbuf_push() to expand headroom.Ben Pfaff
Until now, ofpbuf_put() has been able to reallocate an ofpbuf to expand the tailroom, but ofpbuf_push() has not been able to expand the headroom in an analogous way. This omission is simply because it has never been useful to do this. However, an upcoming change will make the amount of headroom in an ofpbuf passed up from a dpif to ofproto harder to predict. It seems that we might as well simply implement expanding headroom, so this commit does that. Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27ofpbuf: New function ofpbuf_use_stack().Ben Pfaff
This new function is useful in a situation where a small stack-allocated buffer is usually appropriate but occasionally it must be expanded. Acked-by: Jesse Gross <jesse@nicira.com>
2010-12-09ofpbuf: New function ofpbuf_put_hex().Ben Pfaff
This commit converts nx_match_from_string() to use this new function. The new function will also have another user in an upcoming commit.
2010-12-07ofpbuf: New function ofpbuf_use_const().Ben Pfaff
This is a code cleanup. Suggested-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2010-12-06queue: Get rid of ovs_queue data structure.Ben Pfaff
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.
2010-09-01ofpbuf: Add ofpbuf_new_with_headroom(), ofpbuf_clone_with_headroom().Ben Pfaff
These new functions simplify an increasingly common usage pattern. Suggested-by: Jesse Gross <jesse@nicira.com>
2010-08-30treewide: Remove trailing whitespaceJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-07-14ofpbuf: Implement unsupported feature in ofpbuf_trim().Ben Pfaff
Until now, ofpbuf_trim() has not handled the case where the ofpbuf has nonzero headroom. This causes an assertion failure when pinsched_send() queues a packet to be sent later, because such packets have been guaranteed to have nonzero headroom since commit 43253595 "ofproto: Avoid buffer copy in OFPT_PACKET_IN path." This commit fixes the problem by implementing the until-now unsupported case. This commit factors code out of ofpbuf_prealloc_tailroom() into two new functions, ofpbuf_rebase__() and ofpbuf_resize_tailroom__(), and uses the latter to implement both ofpbuf_prealloc_tailroom() and ofpbuf_trim(). ofpbuf_rebase__() isn't used on its own at all, but it seems potentially useful so I made it an independent function. Reported-by: Tom Everman <teverman@google.com>
2010-04-26ofpbuf: New function ofpbuf_push_zeros().Ben Pfaff
2010-02-12ofpbuf: New function ofpbuf_to_string().Ben Pfaff
Useful for debugging. From Jean Tourrilhes <jt@hpl.hp.com>.
2010-02-12ofpbuf: Mark ofpbuf_headroom(), ofpbuf_tailroom() parameters const.Ben Pfaff
2010-02-01ofpbuf: Rename ofpbuf "private" member for C++ header compatibility.Ben Pfaff
From partner.
2009-06-15Update primary code license to Apache 2.0.Ben Pfaff
2009-07-08Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff