diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-01-25 05:35:21 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-01-25 05:35:21 +0100 |
commit | 5baac15781779a3ebfa3807299e5329809835370 (patch) | |
tree | 0ea19612d064f02a8bd9fc62df1bef63da276e67 /source3/include/client.h | |
parent | c9d193eb08b036c5196d63c22790f3cd3583ba82 (diff) | |
parent | 8b804077128cd981bf238b2506c589dff3bf8ff4 (diff) | |
download | samba-5baac15781779a3ebfa3807299e5329809835370.tar.gz samba-5baac15781779a3ebfa3807299e5329809835370.tar.bz2 samba-5baac15781779a3ebfa3807299e5329809835370.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/include/client.h')
-rw-r--r-- | source3/include/client.h | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/source3/include/client.h b/source3/include/client.h index 09fdb81462..d62d1c05d2 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -61,21 +61,60 @@ struct cli_pipe_auth_data { } a_u; }; +/** + * rpc_cli_transport defines a transport mechanism to ship rpc requests + * asynchronously to a server and receive replies + */ + +struct rpc_cli_transport { + + /** + * Trigger an async read from the server. May return a short read. + */ + struct async_req *(*read_send)(TALLOC_CTX *mem_ctx, + struct event_context *ev, + uint8_t *data, size_t size, + void *priv); + /** + * Get the result from the read_send operation. + */ + NTSTATUS (*read_recv)(struct async_req *req, ssize_t *preceived); + + /** + * Trigger an async write to the server. May return a short write. + */ + struct async_req *(*write_send)(TALLOC_CTX *mem_ctx, + struct event_context *ev, + const uint8_t *data, size_t size, + void *priv); + /** + * Get the result from the read_send operation. + */ + NTSTATUS (*write_recv)(struct async_req *req, ssize_t *psent); + + /** + * This is an optimization for the SMB transport. It models the + * TransactNamedPipe API call: Send and receive data in one round + * trip. The transport implementation is free to set this to NULL, + * cli_pipe.c will fall back to the explicit write/read routines. + */ + struct async_req *(*trans_send)(TALLOC_CTX *mem_ctx, + struct event_context *ev, + uint8_t *data, size_t data_len, + uint32_t max_rdata_len, + void *priv); + /** + * Get the result from the read_send operation. + */ + NTSTATUS (*trans_recv)(struct async_req *req, TALLOC_CTX *mem_ctx, + uint8_t **prdata, uint32_t *prdata_len); + void *priv; +}; + struct rpc_pipe_client { struct rpc_pipe_client *prev, *next; - enum dcerpc_transport_t transport_type; - - union { - struct { - struct cli_state *cli; - const char *pipe_name; - uint16 fnum; - } np; - struct { - int fd; - } sock; - } trans ; + struct rpc_cli_transport *transport; struct ndr_syntax_id abstract_syntax; struct ndr_syntax_id transfer_syntax; |