summaryrefslogtreecommitdiff
path: root/source3/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-08-06 11:30:51 +0200
committerStefan Metzmacher <metze@samba.org>2010-08-12 14:31:21 +0200
commit2c0e296dd74c1b064d836f6807a808231f8998d4 (patch)
treecc8f164c74a5d73b4eef4456cb368048162058fd /source3/librpc
parentb34209006fd75533b22e77c77d8fde3e4cb1506a (diff)
downloadsamba-2c0e296dd74c1b064d836f6807a808231f8998d4.tar.gz
samba-2c0e296dd74c1b064d836f6807a808231f8998d4.tar.bz2
samba-2c0e296dd74c1b064d836f6807a808231f8998d4.zip
s3:rpc_client: add dcerpc_binding_handle backend
metze
Diffstat (limited to 'source3/librpc')
-rw-r--r--source3/librpc/rpc/dcerpc.h128
1 files changed, 128 insertions, 0 deletions
diff --git a/source3/librpc/rpc/dcerpc.h b/source3/librpc/rpc/dcerpc.h
index f07403ae44..117d860199 100644
--- a/source3/librpc/rpc/dcerpc.h
+++ b/source3/librpc/rpc/dcerpc.h
@@ -153,4 +153,132 @@ NTSTATUS dcerpc_check_auth(struct pipe_auth_data *auth,
DATA_BLOB *raw_pkt,
size_t *pad_len);
+struct dcerpc_binding_handle;
+struct GUID;
+struct ndr_interface_table;
+struct ndr_interface_call;
+struct ndr_push;
+struct ndr_pull;
+struct tevent_context;
+
+/*
+ * This is just a hack this should never be used in code,
+ * but it's needed to build the compat stubs for now
+ */
+struct __do_not_use_dcerpc_pipe {
+ struct dcerpc_binding_handle *binding_handle;
+};
+#define dcerpc_pipe __do_not_use_dcerpc_pipe
+
+
+struct dcerpc_binding_handle_ops {
+ const char *name;
+
+ bool (*is_connected)(struct dcerpc_binding_handle *h);
+
+ struct tevent_req *(*raw_call_send)(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h,
+ const struct GUID *object,
+ uint32_t opnum,
+ uint32_t in_flags,
+ const uint8_t *in_data,
+ size_t in_length);
+ NTSTATUS (*raw_call_recv)(struct tevent_req *req,
+ TALLOC_CTX *mem_ctx,
+ uint8_t **out_data,
+ size_t *out_length,
+ uint32_t *out_flags);
+
+ struct tevent_req *(*disconnect_send)(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h);
+ NTSTATUS (*disconnect_recv)(struct tevent_req *req);
+
+ /* TODO: remove the following functions */
+ bool (*push_bigendian)(struct dcerpc_binding_handle *h);
+ bool (*ref_alloc)(struct dcerpc_binding_handle *h);
+ bool (*use_ndr64)(struct dcerpc_binding_handle *h);
+ void (*do_ndr_print)(struct dcerpc_binding_handle *h,
+ int ndr_flags,
+ const void *struct_ptr,
+ const struct ndr_interface_call *call);
+ void (*ndr_push_failed)(struct dcerpc_binding_handle *h,
+ NTSTATUS error,
+ const void *struct_ptr,
+ const struct ndr_interface_call *call);
+ void (*ndr_pull_failed)(struct dcerpc_binding_handle *h,
+ NTSTATUS error,
+ const DATA_BLOB *blob,
+ const struct ndr_interface_call *call);
+ NTSTATUS (*ndr_validate_in)(struct dcerpc_binding_handle *h,
+ TALLOC_CTX *mem_ctx,
+ const DATA_BLOB *blob,
+ const struct ndr_interface_call *call);
+ NTSTATUS (*ndr_validate_out)(struct dcerpc_binding_handle *h,
+ struct ndr_pull *pull_in,
+ const void *struct_ptr,
+ const struct ndr_interface_call *call);
+};
+
+struct dcerpc_binding_handle *_dcerpc_binding_handle_create(TALLOC_CTX *mem_ctx,
+ const struct dcerpc_binding_handle_ops *ops,
+ const struct GUID *object,
+ const struct ndr_interface_table *table,
+ void *pstate,
+ size_t psize,
+ const char *type,
+ const char *location);
+#define dcerpc_binding_handle_create(mem_ctx, ops, object, table, \
+ state, type, location) \
+ _dcerpc_binding_handle_create(mem_ctx, ops, object, table, \
+ state, sizeof(type), #type, location)
+
+void *_dcerpc_binding_handle_data(struct dcerpc_binding_handle *h);
+#define dcerpc_binding_handle_data(_h, _type) \
+ talloc_get_type_abort(_dcerpc_binding_handle_data(_h), _type)
+
+_DEPRECATED_ void dcerpc_binding_handle_set_ref_alloc(struct dcerpc_binding_handle *h,
+ bool ref_alloc);
+
+_DEPRECATED_ void dcerpc_binding_handle_set_sync_ev(struct dcerpc_binding_handle *h,
+ struct tevent_context *ev);
+
+bool dcerpc_binding_handle_is_connected(struct dcerpc_binding_handle *h);
+
+struct tevent_req *dcerpc_binding_handle_raw_call_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h,
+ const struct GUID *object,
+ uint32_t opnum,
+ uint32_t in_flags,
+ const uint8_t *in_data,
+ size_t in_length);
+NTSTATUS dcerpc_binding_handle_raw_call_recv(struct tevent_req *req,
+ TALLOC_CTX *mem_ctx,
+ uint8_t **out_data,
+ size_t *out_length,
+ uint32_t *out_flags);
+
+struct tevent_req *dcerpc_binding_handle_disconnect_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h);
+NTSTATUS dcerpc_binding_handle_disconnect_recv(struct tevent_req *req);
+
+struct tevent_req *dcerpc_binding_handle_call_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *h,
+ const struct GUID *object,
+ const struct ndr_interface_table *table,
+ uint32_t opnum,
+ TALLOC_CTX *r_mem,
+ void *r_ptr);
+NTSTATUS dcerpc_binding_handle_call_recv(struct tevent_req *req);
+NTSTATUS dcerpc_binding_handle_call(struct dcerpc_binding_handle *h,
+ const struct GUID *object,
+ const struct ndr_interface_table *table,
+ uint32_t opnum,
+ TALLOC_CTX *r_mem,
+ void *r_ptr);
+
#endif /* __DCERPC_H__ */