summaryrefslogtreecommitdiff
path: root/lib/vconn.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-11-23 13:19:50 -0800
committerBen Pfaff <blp@nicira.com>2010-12-06 10:03:32 -0800
commit7f009380f61edda538c4c4d6333a14014258ca8f (patch)
tree6c09930b29fc22aa54d4848d1b5a5798c8c87b5e /lib/vconn.c
parentb3907fbc6c74ddad7507d0f7abb1f5a2528cd2be (diff)
downloadopenvswitch-7f009380f61edda538c4c4d6333a14014258ca8f.tar.gz
vconn: New function vconn_transact_multiple_noreply().
This will be useful for sending a bunch of flow_mod messages all at once.
Diffstat (limited to 'lib/vconn.c')
-rw-r--r--lib/vconn.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/vconn.c b/lib/vconn.c
index d6d2bf42e..2df7a27ac 100644
--- a/lib/vconn.c
+++ b/lib/vconn.c
@@ -775,6 +775,31 @@ vconn_transact_noreply(struct vconn *vconn, struct ofpbuf *request,
}
}
+/* vconn_transact_noreply() for a list of "struct ofpbuf"s, sent one by one.
+ * All of the requests on 'requests' are always destroyed, regardless of the
+ * return value. */
+int
+vconn_transact_multiple_noreply(struct vconn *vconn, struct list *requests,
+ struct ofpbuf **replyp)
+{
+ struct ofpbuf *request, *next;
+
+ LIST_FOR_EACH_SAFE (request, next, list_node, requests) {
+ int error;
+
+ list_remove(&request->list_node);
+
+ error = vconn_transact_noreply(vconn, request, replyp);
+ if (error || *replyp) {
+ ofpbuf_list_delete(requests);
+ return error;
+ }
+ }
+
+ *replyp = NULL;
+ return 0;
+}
+
void
vconn_wait(struct vconn *vconn, enum vconn_wait_type wait)
{