tsocket: add tstream_readv_pdu_send/recv()
[ira/wip.git] / lib / tsocket / tsocket.h
index 6583a5e7869b596820771a06ee56a58d0ac2a441..aef73ae8c5588f63cf25bb5c2eb422db80f98e9e 100644 (file)
@@ -190,7 +190,7 @@ int _tstream_bsd_existing_socket(TALLOC_CTX *mem_ctx,
                                     __location__)
 
 /*
- * Queue helpers
+ * Queue and PDU helpers
  */
 
 struct tevent_req *tdgram_sendto_queue_send(TALLOC_CTX *mem_ctx,
@@ -202,5 +202,17 @@ struct tevent_req *tdgram_sendto_queue_send(TALLOC_CTX *mem_ctx,
                                            struct tsocket_address *dst);
 ssize_t tdgram_sendto_queue_recv(struct tevent_req *req, int *perrno);
 
+typedef int (*tstream_readv_pdu_next_vector_t)(struct tstream_context *stream,
+                                              void *private_data,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct iovec **vector,
+                                              size_t *count);
+struct tevent_req *tstream_readv_pdu_send(TALLOC_CTX *mem_ctx,
+                               struct tevent_context *ev,
+                               struct tstream_context *stream,
+                               tstream_readv_pdu_next_vector_t next_vector_fn,
+                               void *next_vector_private);
+int tstream_readv_pdu_recv(struct tevent_req *req, int *perrno);
+
 #endif /* _TSOCKET_H */