Keep libndr at 6.0.0, this has not been released yet.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
GUID_to_ndr_blob: NTSTATUS (const struct GUID *, TALLOC_CTX *, DATA_BLOB *)
GUID_to_ndr_buf: void (const struct GUID *, struct GUID_ndr_buf *)
GUID_zero: struct GUID (void)
+_ndr_deepcopy_struct: enum ndr_err_code (ndr_push_flags_fn_t, const void *, ndr_pull_flags_fn_t, TALLOC_CTX *, void *)
_ndr_pull_error: enum ndr_err_code (struct ndr_pull *, enum ndr_err_code, const char *, const char *, const char *, ...)
_ndr_push_error: enum ndr_err_code (struct ndr_push *, enum ndr_err_code, const char *, const char *, const char *, ...)
ndr_align_size: size_t (uint32_t, size_t)
enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
+enum ndr_err_code _ndr_deepcopy_struct(ndr_push_flags_fn_t push_fn,
+ const void *src,
+ ndr_pull_flags_fn_t pull_fn,
+ TALLOC_CTX *dst_mem, void *dst);
+#define ndr_deepcopy_struct(type, src, dst_mem, dst) \
+ _ndr_deepcopy_struct((ndr_push_flags_fn_t)ndr_push_ ## type, \
+ src, \
+ (ndr_pull_flags_fn_t)ndr_pull_ ## type, \
+ dst_mem, dst)
+
/* from libndr_basic.h */
#define NDR_SCALAR_PROTO(name, type) \
enum ndr_err_code ndr_push_ ## name(struct ndr_push *ndr, ndr_flags_type ndr_flags, type v); \
return NDR_ERR_SUCCESS;
}
+_PUBLIC_ enum ndr_err_code
+_ndr_deepcopy_struct(ndr_push_flags_fn_t push_fn,
+ const void *src,
+ ndr_pull_flags_fn_t pull_fn,
+ TALLOC_CTX *dst_mem, void *dst)
+{
+ TALLOC_CTX *frame = talloc_stackframe();
+ DATA_BLOB blob = { .length = 0, };
+ enum ndr_err_code ndr_err;
+
+ ndr_err = ndr_push_struct_blob(&blob, frame, src, push_fn);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ TALLOC_FREE(frame);
+ return ndr_err;
+ }
+
+ ndr_err = ndr_pull_struct_blob_all(&blob, dst_mem, dst, pull_fn);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ TALLOC_FREE(frame);
+ return ndr_err;
+ }
+
+ TALLOC_FREE(frame);
+ return NDR_ERR_SUCCESS;
+}
+
/*
* pull a struct from a blob using NDR
*
header_path= [('*gen_ndr*', 'gen_ndr')],
vnum='6.0.0',
abi_directory='ABI',
- abi_match='!ndr_table_* ndr_* GUID_* _ndr_pull_error* _ndr_push_error*',
+ abi_match='!ndr_table_* ndr_* GUID_* _ndr_pull_error* _ndr_push_error* _ndr_deepcopy_*',
)
bld.SAMBA_LIBRARY('dcerpc-binding',