From 1dc1ac00512a28bdc025b00fbfa676b0f5b15751 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 4 Aug 2009 16:07:01 -0400 Subject: s3:winbind: Add async wb_lookupusergroups --- source3/librpc/gen_ndr/ndr_wbint.c | 87 +++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) (limited to 'source3/librpc/gen_ndr/ndr_wbint.c') diff --git a/source3/librpc/gen_ndr/ndr_wbint.c b/source3/librpc/gen_ndr/ndr_wbint.c index 87e675edaf..5a8c1c33d7 100644 --- a/source3/librpc/gen_ndr/ndr_wbint.c +++ b/source3/librpc/gen_ndr/ndr_wbint.c @@ -1210,6 +1210,83 @@ _PUBLIC_ void ndr_print_wbint_LookupUserAliases(struct ndr_print *ndr, const cha ndr->depth--; } +static enum ndr_err_code ndr_push_wbint_LookupUserGroups(struct ndr_push *ndr, int flags, const struct wbint_LookupUserGroups *r) +{ + if (flags & NDR_IN) { + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + } + if (flags & NDR_OUT) { + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_LookupUserGroups(struct ndr_pull *ndr, int flags, struct wbint_LookupUserGroups *r) +{ + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.sids); + ZERO_STRUCTP(r->out.sids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_LookupUserGroups(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserGroups *r) +{ + ndr_print_struct(ndr, name, "wbint_LookupUserGroups"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_LookupUserGroups"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_LookupUserGroups"); + ndr->depth++; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_wbint_SidArray(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + static const struct ndr_interface_call wbint_calls[] = { { "wbint_Ping", @@ -1283,6 +1360,14 @@ static const struct ndr_interface_call wbint_calls[] = { (ndr_print_function_t) ndr_print_wbint_LookupUserAliases, false, }, + { + "wbint_LookupUserGroups", + sizeof(struct wbint_LookupUserGroups), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserGroups, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserGroups, + (ndr_print_function_t) ndr_print_wbint_LookupUserGroups, + false, + }, { NULL, 0, NULL, NULL, NULL, false } }; @@ -1312,7 +1397,7 @@ const struct ndr_interface_table ndr_table_wbint = { NDR_WBINT_VERSION }, .helpstring = NDR_WBINT_HELPSTRING, - .num_calls = 9, + .num_calls = 10, .calls = wbint_calls, .endpoints = &wbint_endpoints, .authservices = &wbint_authservices -- cgit