From 5e86ac9e6d2eb7ff0f6f8461dcfc230e2d87c42c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Jan 2008 13:00:12 +0100 Subject: idl: Update DFS IDL from Samba 4. (This used to be commit a6677b2e186212f723b24775293682ce5b94952e) --- source3/librpc/gen_ndr/cli_dfs.c | 19 ++ source3/librpc/gen_ndr/cli_dfs.h | 8 + source3/librpc/gen_ndr/dfs.h | 33 ++- source3/librpc/gen_ndr/ndr_dfs.c | 436 ++++++++++++++++++++++++++++++++++++++- source3/librpc/gen_ndr/ndr_dfs.h | 2 + source3/librpc/gen_ndr/srv_dfs.c | 4 + source3/librpc/idl/dfs.idl | 34 ++- 7 files changed, 526 insertions(+), 10 deletions(-) (limited to 'source3/librpc') diff --git a/source3/librpc/gen_ndr/cli_dfs.c b/source3/librpc/gen_ndr/cli_dfs.c index 9078ce7bba..fc00128f3f 100644 --- a/source3/librpc/gen_ndr/cli_dfs.c +++ b/source3/librpc/gen_ndr/cli_dfs.c @@ -789,12 +789,20 @@ NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli, NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername, + const char **server_fullname, + uint8_t *is_root, + uint32_t *ttl, WERROR *werror) { struct dfs_GetDcAddress r; NTSTATUS status; /* In parameters */ + r.in.servername = servername; + r.in.server_fullname = server_fullname; + r.in.is_root = is_root; + r.in.ttl = ttl; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, &r); @@ -820,6 +828,9 @@ NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, } /* Return variables */ + *server_fullname = *r.out.server_fullname; + *is_root = *r.out.is_root; + *ttl = *r.out.ttl; /* Return result */ if (werror) { @@ -831,12 +842,20 @@ NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername, + const char *server_fullname, + uint32_t flags, + uint32_t ttl, WERROR *werror) { struct dfs_SetDcAddress r; NTSTATUS status; /* In parameters */ + r.in.servername = servername; + r.in.server_fullname = server_fullname; + r.in.flags = flags; + r.in.ttl = ttl; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(dfs_SetDcAddress, &r); diff --git a/source3/librpc/gen_ndr/cli_dfs.h b/source3/librpc/gen_ndr/cli_dfs.h index cdd0978bb4..d23bb90470 100644 --- a/source3/librpc/gen_ndr/cli_dfs.h +++ b/source3/librpc/gen_ndr/cli_dfs.h @@ -101,9 +101,17 @@ NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername, + const char **server_fullname, + uint8_t *is_root, + uint32_t *ttl, WERROR *werror); NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername, + const char *server_fullname, + uint32_t flags, + uint32_t ttl, WERROR *werror); NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, diff --git a/source3/librpc/gen_ndr/dfs.h b/source3/librpc/gen_ndr/dfs.h index 89f243b7dd..38e7f93950 100644 --- a/source3/librpc/gen_ndr/dfs.h +++ b/source3/librpc/gen_ndr/dfs.h @@ -32,8 +32,8 @@ struct dfs_Info1 { /* bitmap dfs_VolumeState */ #define DFS_VOLUME_STATE_OK ( 0x1 ) #define DFS_VOLUME_STATE_INCONSISTENT ( 0x2 ) -#define DFS_VOLUME_STATE_OFFLINE ( 0x4 ) -#define DFS_VOLUME_STATE_ONLINE ( 0x8 ) +#define DFS_VOLUME_STATE_OFFLINE ( 0x3 ) +#define DFS_VOLUME_STATE_ONLINE ( 0x4 ) #define DFS_VOLUME_STATE_STANDALONE ( DFS_VOLUME_FLAVOR_STANDALONE ) #define DFS_VOLUME_STATE_AD_BLOB ( DFS_VOLUME_FLAVOR_AD_BLOB ) @@ -238,6 +238,16 @@ struct dfs_EnumArray4 { struct dfs_Info4 *s;/* [unique,size_is(count)] */ }; +struct dfs_EnumArray5 { + uint32_t count; + struct dfs_Info5 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray6 { + uint32_t count; + struct dfs_Info6 *s;/* [unique,size_is(count)] */ +}; + struct dfs_EnumArray200 { uint32_t count; struct dfs_Info200 *s;/* [unique,size_is(count)] */ @@ -253,6 +263,8 @@ union dfs_EnumInfo { struct dfs_EnumArray2 *info2;/* [unique,case(2)] */ struct dfs_EnumArray3 *info3;/* [unique,case(3)] */ struct dfs_EnumArray4 *info4;/* [unique,case(4)] */ + struct dfs_EnumArray5 *info5;/* [unique,case(5)] */ + struct dfs_EnumArray6 *info6;/* [unique,case(6)] */ struct dfs_EnumArray200 *info200;/* [unique,case(200)] */ struct dfs_EnumArray300 *info300;/* [unique,case(300)] */ }; @@ -485,6 +497,16 @@ struct dfs_AddStdRootForced { struct dfs_GetDcAddress { struct { + const char *servername;/* [charset(UTF16)] */ + const char **server_fullname;/* [ref,charset(UTF16)] */ + uint8_t *is_root;/* [ref] */ + uint32_t *ttl;/* [ref] */ + } in; + + struct { + const char **server_fullname;/* [ref,charset(UTF16)] */ + uint8_t *is_root;/* [ref] */ + uint32_t *ttl;/* [ref] */ WERROR result; } out; @@ -492,6 +514,13 @@ struct dfs_GetDcAddress { struct dfs_SetDcAddress { + struct { + const char *servername;/* [charset(UTF16)] */ + const char *server_fullname;/* [charset(UTF16)] */ + uint32_t flags; + uint32_t ttl; + } in; + struct { WERROR result; } out; diff --git a/source3/librpc/gen_ndr/ndr_dfs.c b/source3/librpc/gen_ndr/ndr_dfs.c index 4b26487a0d..dee32485be 100644 --- a/source3/librpc/gen_ndr/ndr_dfs.c +++ b/source3/librpc/gen_ndr/ndr_dfs.c @@ -2544,6 +2544,180 @@ _PUBLIC_ void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, ndr->depth--; } +static enum ndr_err_code ndr_push_dfs_EnumArray5(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray5 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray5(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray5 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray5 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray5"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_s_1); + if (idx_1) { + ndr_print_dfs_Info5(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray6(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray6 *r) +{ + uint32_t cntr_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray6(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray6 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray6 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray6"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1count;cntr_s_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_s_1); + if (idx_1) { + ndr_print_dfs_Info6(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + static enum ndr_err_code ndr_push_dfs_EnumArray200(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray200 *r) { uint32_t cntr_s_1; @@ -2740,6 +2914,14 @@ static enum ndr_err_code ndr_push_dfs_EnumInfo(struct ndr_push *ndr, int ndr_fla NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); break; + case 5: + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info5)); + break; + + case 6: + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6)); + break; + case 200: NDR_CHECK(ndr_push_unique_ptr(ndr, r->info200)); break; @@ -2779,6 +2961,18 @@ static enum ndr_err_code ndr_push_dfs_EnumInfo(struct ndr_push *ndr, int ndr_fla } break; + case 5: + if (r->info5) { + NDR_CHECK(ndr_push_dfs_EnumArray5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); + } + break; + + case 6: + if (r->info6) { + NDR_CHECK(ndr_push_dfs_EnumArray6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); + } + break; + case 200: if (r->info200) { NDR_CHECK(ndr_push_dfs_EnumArray200(ndr, NDR_SCALARS|NDR_BUFFERS, r->info200)); @@ -2806,6 +3000,8 @@ static enum ndr_err_code ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_fla TALLOC_CTX *_mem_save_info2_0; TALLOC_CTX *_mem_save_info3_0; TALLOC_CTX *_mem_save_info4_0; + TALLOC_CTX *_mem_save_info5_0; + TALLOC_CTX *_mem_save_info6_0; TALLOC_CTX *_mem_save_info200_0; TALLOC_CTX *_mem_save_info300_0; level = ndr_pull_get_switch_value(ndr, r); @@ -2855,6 +3051,26 @@ static enum ndr_err_code ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_fla } break; } + case 5: { + uint32_t _ptr_info5; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info5)); + if (_ptr_info5) { + NDR_PULL_ALLOC(ndr, r->info5); + } else { + r->info5 = NULL; + } + break; } + + case 6: { + uint32_t _ptr_info6; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info6)); + if (_ptr_info6) { + NDR_PULL_ALLOC(ndr, r->info6); + } else { + r->info6 = NULL; + } + break; } + case 200: { uint32_t _ptr_info200; NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info200)); @@ -2917,6 +3133,24 @@ static enum ndr_err_code ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_fla } break; + case 5: + if (r->info5) { + _mem_save_info5_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info5, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info5_0, 0); + } + break; + + case 6: + if (r->info6) { + _mem_save_info6_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info6, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info6_0, 0); + } + break; + case 200: if (r->info200) { _mem_save_info200_0 = NDR_PULL_GET_MEM_CTX(ndr); @@ -2984,6 +3218,24 @@ _PUBLIC_ void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, co ndr->depth--; break; + case 5: + ndr_print_ptr(ndr, "info5", r->info5); + ndr->depth++; + if (r->info5) { + ndr_print_dfs_EnumArray5(ndr, "info5", r->info5); + } + ndr->depth--; + break; + + case 6: + ndr_print_ptr(ndr, "info6", r->info6); + ndr->depth++; + if (r->info6) { + ndr_print_dfs_EnumArray6(ndr, "info6", r->info6); + } + ndr->depth--; + break; + case 200: ndr_print_ptr(ndr, "info200", r->info200); ndr->depth++; @@ -4715,8 +4967,50 @@ _PUBLIC_ void ndr_print_dfs_AddStdRootForced(struct ndr_print *ndr, const char * static enum ndr_err_code ndr_push_dfs_GetDcAddress(struct ndr_push *ndr, int flags, const struct dfs_GetDcAddress *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + if (r->in.server_fullname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->in.server_fullname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_ref_ptr(ndr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->in.server_fullname, ndr_charset_length(*r->in.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + if (r->in.is_root == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.is_root)); + if (r->in.ttl == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.ttl)); } if (flags & NDR_OUT) { + if (r->out.server_fullname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + if (*r->out.server_fullname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_ref_ptr(ndr)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.server_fullname, ndr_charset_length(*r->out.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + if (r->out.is_root == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.is_root)); + if (r->out.ttl == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.ttl)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -4724,9 +5018,84 @@ static enum ndr_err_code ndr_push_dfs_GetDcAddress(struct ndr_push *ndr, int fla static enum ndr_err_code ndr_pull_dfs_GetDcAddress(struct ndr_pull *ndr, int flags, struct dfs_GetDcAddress *r) { + uint32_t _ptr_server_fullname; + TALLOC_CTX *_mem_save_server_fullname_0; + TALLOC_CTX *_mem_save_is_root_0; + TALLOC_CTX *_mem_save_ttl_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.server_fullname); + } + _mem_save_server_fullname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_fullname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_server_fullname)); + NDR_CHECK(ndr_pull_array_size(ndr, r->in.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->in.server_fullname)); + if (ndr_get_array_length(ndr, r->in.server_fullname) > ndr_get_array_size(ndr, r->in.server_fullname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->in.server_fullname), ndr_get_array_length(ndr, r->in.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->in.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->in.server_fullname, ndr_get_array_length(ndr, r->in.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.is_root); + } + _mem_save_is_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.is_root, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.is_root)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_is_root_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.ttl); + } + _mem_save_ttl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.ttl, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.ttl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ttl_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.server_fullname); + *r->out.server_fullname = *r->in.server_fullname; + NDR_PULL_ALLOC(ndr, r->out.is_root); + *r->out.is_root = *r->in.is_root; + NDR_PULL_ALLOC(ndr, r->out.ttl); + *r->out.ttl = *r->in.ttl; } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.server_fullname); + } + _mem_save_server_fullname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.server_fullname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_server_fullname)); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.server_fullname)); + if (ndr_get_array_length(ndr, r->out.server_fullname) > ndr_get_array_size(ndr, r->out.server_fullname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.server_fullname), ndr_get_array_length(ndr, r->out.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.server_fullname, ndr_get_array_length(ndr, r->out.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.is_root); + } + _mem_save_is_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.is_root, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.is_root)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_is_root_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ttl); + } + _mem_save_ttl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ttl, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.ttl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ttl_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -4742,11 +5111,42 @@ _PUBLIC_ void ndr_print_dfs_GetDcAddress(struct ndr_print *ndr, const char *name if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "dfs_GetDcAddress"); ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_ptr(ndr, "server_fullname", r->in.server_fullname); + ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", *r->in.server_fullname); + ndr->depth++; + ndr_print_string(ndr, "server_fullname", *r->in.server_fullname); + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "is_root", r->in.is_root); + ndr->depth++; + ndr_print_uint8(ndr, "is_root", *r->in.is_root); + ndr->depth--; + ndr_print_ptr(ndr, "ttl", r->in.ttl); + ndr->depth++; + ndr_print_uint32(ndr, "ttl", *r->in.ttl); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "dfs_GetDcAddress"); ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", r->out.server_fullname); + ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", *r->out.server_fullname); + ndr->depth++; + ndr_print_string(ndr, "server_fullname", *r->out.server_fullname); + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "is_root", r->out.is_root); + ndr->depth++; + ndr_print_uint8(ndr, "is_root", *r->out.is_root); + ndr->depth--; + ndr_print_ptr(ndr, "ttl", r->out.ttl); + ndr->depth++; + ndr_print_uint32(ndr, "ttl", *r->out.ttl); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -4756,6 +5156,16 @@ _PUBLIC_ void ndr_print_dfs_GetDcAddress(struct ndr_print *ndr, const char *name static enum ndr_err_code ndr_push_dfs_SetDcAddress(struct ndr_push *ndr, int flags, const struct dfs_SetDcAddress *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_fullname, ndr_charset_length(r->in.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.ttl)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -4766,6 +5176,22 @@ static enum ndr_err_code ndr_push_dfs_SetDcAddress(struct ndr_push *ndr, int fla static enum ndr_err_code ndr_pull_dfs_SetDcAddress(struct ndr_pull *ndr, int flags, struct dfs_SetDcAddress *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_fullname)); + if (ndr_get_array_length(ndr, &r->in.server_fullname) > ndr_get_array_size(ndr, &r->in.server_fullname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.server_fullname), ndr_get_array_length(ndr, &r->in.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_fullname, ndr_get_array_length(ndr, &r->in.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.ttl)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -4783,6 +5209,10 @@ _PUBLIC_ void ndr_print_dfs_SetDcAddress(struct ndr_print *ndr, const char *name if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "dfs_SetDcAddress"); ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "server_fullname", r->in.server_fullname); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr_print_uint32(ndr, "ttl", r->in.ttl); ndr->depth--; } if (flags & NDR_OUT) { @@ -5325,10 +5755,12 @@ static const struct ndr_interface_call netdfs_calls[] = { static const char * const netdfs_endpoint_strings[] = { "ncacn_np:[\\pipe\\netdfs]", + "ncacn_ip_tcp:", + "ncalrpc:", }; static const struct ndr_interface_string_array netdfs_endpoints = { - .count = 1, + .count = 3, .names = netdfs_endpoint_strings }; @@ -5337,7 +5769,7 @@ static const char * const netdfs_authservice_strings[] = { }; static const struct ndr_interface_string_array netdfs_authservices = { - .count = 1, + .count = 3, .names = netdfs_authservice_strings }; diff --git a/source3/librpc/gen_ndr/ndr_dfs.h b/source3/librpc/gen_ndr/ndr_dfs.h index e4b00f322a..a7c66f9693 100644 --- a/source3/librpc/gen_ndr/ndr_dfs.h +++ b/source3/librpc/gen_ndr/ndr_dfs.h @@ -95,6 +95,8 @@ void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, const str void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray2 *r); void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray3 *r); void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray4 *r); +void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray5 *r); +void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray6 *r); void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray200 *r); void ndr_print_dfs_EnumArray300(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray300 *r); void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, const union dfs_EnumInfo *r); diff --git a/source3/librpc/gen_ndr/srv_dfs.c b/source3/librpc/gen_ndr/srv_dfs.c index 384c2ba940..ad6e0af059 100644 --- a/source3/librpc/gen_ndr/srv_dfs.c +++ b/source3/librpc/gen_ndr/srv_dfs.c @@ -1233,6 +1233,10 @@ static bool api_dfs_GetDcAddress(pipes_struct *p) NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, r); } + ZERO_STRUCT(r->out); + r->out.server_fullname = r->in.server_fullname; + r->out.is_root = r->in.is_root; + r->out.ttl = r->in.ttl; r->out.result = _dfs_GetDcAddress(p, r); if (p->rng_fault_state) { diff --git a/source3/librpc/idl/dfs.idl b/source3/librpc/idl/dfs.idl index 2b519b15d5..d4c05f9936 100644 --- a/source3/librpc/idl/dfs.idl +++ b/source3/librpc/idl/dfs.idl @@ -5,7 +5,8 @@ [ uuid("4fc742e0-4a10-11cf-8273-00aa004ae673"), version(3.0), pointer_default(unique), - helpstring("Settings for Microsoft Distributed File System") + helpstring("Settings for Microsoft Distributed File System"), + endpoint("ncacn_np:[\\pipe\\netdfs]", "ncacn_ip_tcp:", "ncalrpc:") ] interface netdfs { /******************/ @@ -49,12 +50,11 @@ [string,charset(UTF16)] uint16 *path; } dfs_Info1; - /* first 4 bits unverified yet */ typedef [public,bitmap32bit] bitmap { DFS_VOLUME_STATE_OK = 0x1, DFS_VOLUME_STATE_INCONSISTENT = 0x2, - DFS_VOLUME_STATE_OFFLINE = 0x4, - DFS_VOLUME_STATE_ONLINE = 0x8, + DFS_VOLUME_STATE_OFFLINE = 0x3, + DFS_VOLUME_STATE_ONLINE = 0x4, DFS_VOLUME_STATE_STANDALONE = DFS_VOLUME_FLAVOR_STANDALONE, DFS_VOLUME_STATE_AD_BLOB = DFS_VOLUME_FLAVOR_AD_BLOB } dfs_VolumeState; @@ -261,6 +261,16 @@ [size_is(count)] dfs_Info4 *s; } dfs_EnumArray4; + typedef struct { + uint32 count; + [size_is(count)] dfs_Info5 *s; + } dfs_EnumArray5; + + typedef struct { + uint32 count; + [size_is(count)] dfs_Info6 *s; + } dfs_EnumArray6; + typedef struct { uint32 count; [size_is(count)] dfs_Info200 *s; @@ -277,6 +287,8 @@ [case(2)] dfs_EnumArray2 *info2; [case(3)] dfs_EnumArray3 *info3; [case(4)] dfs_EnumArray4 *info4; + [case(5)] dfs_EnumArray5 *info5; + [case(6)] dfs_EnumArray6 *info6; [case(200)] dfs_EnumArray200 *info200; [case(300)] dfs_EnumArray300 *info300; } dfs_EnumInfo; @@ -363,10 +375,20 @@ ); /* Function 0x10 */ - WERROR dfs_GetDcAddress(); + WERROR dfs_GetDcAddress( + [in] [string,charset(UTF16)] uint16 servername[], + [in,out,ref] [string,charset(UTF16)] uint16 **server_fullname, + [in,out,ref] boolean8 *is_root, + [in,out,ref] uint32 *ttl + ); /* Function 0x11 */ - WERROR dfs_SetDcAddress(); + WERROR dfs_SetDcAddress( + [in] [string,charset(UTF16)] uint16 servername[], + [in] [string,charset(UTF16)] uint16 server_fullname[], + [in] uint32 flags, + [in] uint32 ttl + ); /* Function 0x12 */ WERROR dfs_FlushFtTable( -- cgit