295b72f1cf855c32cd62a3a55055bb02bab39691
[metze/samba/wip.git] / source3 / librpc / gen_ndr / ndr_wbint.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_wbint.h"
5
6 #include "librpc/gen_ndr/ndr_lsa.h"
7 _PUBLIC_ enum ndr_err_code ndr_push_wbint_userinfo(struct ndr_push *ndr, int ndr_flags, const struct wbint_userinfo *r)
8 {
9         if (ndr_flags & NDR_SCALARS) {
10                 NDR_CHECK(ndr_push_align(ndr, 8));
11                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->acct_name));
12                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->full_name));
13                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->homedir));
14                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->shell));
15                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->primary_gid));
16                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->user_sid));
17                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->group_sid));
18         }
19         if (ndr_flags & NDR_BUFFERS) {
20                 if (r->acct_name) {
21                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->acct_name, CH_UTF8)));
22                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
23                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->acct_name, CH_UTF8)));
24                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->acct_name, ndr_charset_length(r->acct_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
25                 }
26                 if (r->full_name) {
27                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->full_name, CH_UTF8)));
28                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
29                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->full_name, CH_UTF8)));
30                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->full_name, ndr_charset_length(r->full_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
31                 }
32                 if (r->homedir) {
33                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
34                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
35                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
36                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->homedir, ndr_charset_length(r->homedir, CH_UTF8), sizeof(uint8_t), CH_UTF8));
37                 }
38                 if (r->shell) {
39                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
40                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
41                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
42                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->shell, ndr_charset_length(r->shell, CH_UTF8), sizeof(uint8_t), CH_UTF8));
43                 }
44         }
45         return NDR_ERR_SUCCESS;
46 }
47
48 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_userinfo(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfo *r)
49 {
50         uint32_t _ptr_acct_name;
51         TALLOC_CTX *_mem_save_acct_name_0;
52         uint32_t _ptr_full_name;
53         TALLOC_CTX *_mem_save_full_name_0;
54         uint32_t _ptr_homedir;
55         TALLOC_CTX *_mem_save_homedir_0;
56         uint32_t _ptr_shell;
57         TALLOC_CTX *_mem_save_shell_0;
58         if (ndr_flags & NDR_SCALARS) {
59                 NDR_CHECK(ndr_pull_align(ndr, 8));
60                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_acct_name));
61                 if (_ptr_acct_name) {
62                         NDR_PULL_ALLOC(ndr, r->acct_name);
63                 } else {
64                         r->acct_name = NULL;
65                 }
66                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_full_name));
67                 if (_ptr_full_name) {
68                         NDR_PULL_ALLOC(ndr, r->full_name);
69                 } else {
70                         r->full_name = NULL;
71                 }
72                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_homedir));
73                 if (_ptr_homedir) {
74                         NDR_PULL_ALLOC(ndr, r->homedir);
75                 } else {
76                         r->homedir = NULL;
77                 }
78                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_shell));
79                 if (_ptr_shell) {
80                         NDR_PULL_ALLOC(ndr, r->shell);
81                 } else {
82                         r->shell = NULL;
83                 }
84                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->primary_gid));
85                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->user_sid));
86                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->group_sid));
87         }
88         if (ndr_flags & NDR_BUFFERS) {
89                 if (r->acct_name) {
90                         _mem_save_acct_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
91                         NDR_PULL_SET_MEM_CTX(ndr, r->acct_name, 0);
92                         NDR_CHECK(ndr_pull_array_size(ndr, &r->acct_name));
93                         NDR_CHECK(ndr_pull_array_length(ndr, &r->acct_name));
94                         if (ndr_get_array_length(ndr, &r->acct_name) > ndr_get_array_size(ndr, &r->acct_name)) {
95                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->acct_name), ndr_get_array_length(ndr, &r->acct_name));
96                         }
97                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->acct_name), sizeof(uint8_t)));
98                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->acct_name, ndr_get_array_length(ndr, &r->acct_name), sizeof(uint8_t), CH_UTF8));
99                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_name_0, 0);
100                 }
101                 if (r->full_name) {
102                         _mem_save_full_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
103                         NDR_PULL_SET_MEM_CTX(ndr, r->full_name, 0);
104                         NDR_CHECK(ndr_pull_array_size(ndr, &r->full_name));
105                         NDR_CHECK(ndr_pull_array_length(ndr, &r->full_name));
106                         if (ndr_get_array_length(ndr, &r->full_name) > ndr_get_array_size(ndr, &r->full_name)) {
107                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->full_name), ndr_get_array_length(ndr, &r->full_name));
108                         }
109                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->full_name), sizeof(uint8_t)));
110                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->full_name, ndr_get_array_length(ndr, &r->full_name), sizeof(uint8_t), CH_UTF8));
111                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_full_name_0, 0);
112                 }
113                 if (r->homedir) {
114                         _mem_save_homedir_0 = NDR_PULL_GET_MEM_CTX(ndr);
115                         NDR_PULL_SET_MEM_CTX(ndr, r->homedir, 0);
116                         NDR_CHECK(ndr_pull_array_size(ndr, &r->homedir));
117                         NDR_CHECK(ndr_pull_array_length(ndr, &r->homedir));
118                         if (ndr_get_array_length(ndr, &r->homedir) > ndr_get_array_size(ndr, &r->homedir)) {
119                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->homedir), ndr_get_array_length(ndr, &r->homedir));
120                         }
121                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t)));
122                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->homedir, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t), CH_UTF8));
123                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_homedir_0, 0);
124                 }
125                 if (r->shell) {
126                         _mem_save_shell_0 = NDR_PULL_GET_MEM_CTX(ndr);
127                         NDR_PULL_SET_MEM_CTX(ndr, r->shell, 0);
128                         NDR_CHECK(ndr_pull_array_size(ndr, &r->shell));
129                         NDR_CHECK(ndr_pull_array_length(ndr, &r->shell));
130                         if (ndr_get_array_length(ndr, &r->shell) > ndr_get_array_size(ndr, &r->shell)) {
131                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->shell), ndr_get_array_length(ndr, &r->shell));
132                         }
133                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t)));
134                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->shell, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t), CH_UTF8));
135                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_shell_0, 0);
136                 }
137         }
138         return NDR_ERR_SUCCESS;
139 }
140
141 _PUBLIC_ void ndr_print_wbint_userinfo(struct ndr_print *ndr, const char *name, const struct wbint_userinfo *r)
142 {
143         ndr_print_struct(ndr, name, "wbint_userinfo");
144         ndr->depth++;
145         ndr_print_ptr(ndr, "acct_name", r->acct_name);
146         ndr->depth++;
147         if (r->acct_name) {
148                 ndr_print_string(ndr, "acct_name", r->acct_name);
149         }
150         ndr->depth--;
151         ndr_print_ptr(ndr, "full_name", r->full_name);
152         ndr->depth++;
153         if (r->full_name) {
154                 ndr_print_string(ndr, "full_name", r->full_name);
155         }
156         ndr->depth--;
157         ndr_print_ptr(ndr, "homedir", r->homedir);
158         ndr->depth++;
159         if (r->homedir) {
160                 ndr_print_string(ndr, "homedir", r->homedir);
161         }
162         ndr->depth--;
163         ndr_print_ptr(ndr, "shell", r->shell);
164         ndr->depth++;
165         if (r->shell) {
166                 ndr_print_string(ndr, "shell", r->shell);
167         }
168         ndr->depth--;
169         ndr_print_hyper(ndr, "primary_gid", r->primary_gid);
170         ndr_print_dom_sid(ndr, "user_sid", &r->user_sid);
171         ndr_print_dom_sid(ndr, "group_sid", &r->group_sid);
172         ndr->depth--;
173 }
174
175 _PUBLIC_ enum ndr_err_code ndr_push_wbint_SidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_SidArray *r)
176 {
177         uint32_t cntr_sids_0;
178         if (ndr_flags & NDR_SCALARS) {
179                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
180                 NDR_CHECK(ndr_push_align(ndr, 4));
181                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
182                 for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) {
183                         NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sids[cntr_sids_0]));
184                 }
185         }
186         if (ndr_flags & NDR_BUFFERS) {
187         }
188         return NDR_ERR_SUCCESS;
189 }
190
191 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_SidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_SidArray *r)
192 {
193         uint32_t cntr_sids_0;
194         TALLOC_CTX *_mem_save_sids_0;
195         if (ndr_flags & NDR_SCALARS) {
196                 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
197                 NDR_CHECK(ndr_pull_align(ndr, 4));
198                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids));
199                 NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
200                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
201                 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
202                 for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) {
203                         NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->sids[cntr_sids_0]));
204                 }
205                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
206                 if (r->sids) {
207                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids));
208                 }
209         }
210         if (ndr_flags & NDR_BUFFERS) {
211         }
212         return NDR_ERR_SUCCESS;
213 }
214
215 _PUBLIC_ void ndr_print_wbint_SidArray(struct ndr_print *ndr, const char *name, const struct wbint_SidArray *r)
216 {
217         uint32_t cntr_sids_0;
218         ndr_print_struct(ndr, name, "wbint_SidArray");
219         ndr->depth++;
220         ndr_print_uint32(ndr, "num_sids", r->num_sids);
221         ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids);
222         ndr->depth++;
223         for (cntr_sids_0=0;cntr_sids_0<r->num_sids;cntr_sids_0++) {
224                 char *idx_0=NULL;
225                 if (asprintf(&idx_0, "[%d]", cntr_sids_0) != -1) {
226                         ndr_print_dom_sid(ndr, "sids", &r->sids[cntr_sids_0]);
227                         free(idx_0);
228                 }
229         }
230         ndr->depth--;
231         ndr->depth--;
232 }
233
234 _PUBLIC_ enum ndr_err_code ndr_push_wbint_RidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_RidArray *r)
235 {
236         uint32_t cntr_rids_0;
237         if (ndr_flags & NDR_SCALARS) {
238                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
239                 NDR_CHECK(ndr_push_align(ndr, 4));
240                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
241                 for (cntr_rids_0 = 0; cntr_rids_0 < r->num_rids; cntr_rids_0++) {
242                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_0]));
243                 }
244         }
245         if (ndr_flags & NDR_BUFFERS) {
246         }
247         return NDR_ERR_SUCCESS;
248 }
249
250 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_RidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_RidArray *r)
251 {
252         uint32_t cntr_rids_0;
253         TALLOC_CTX *_mem_save_rids_0;
254         if (ndr_flags & NDR_SCALARS) {
255                 NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
256                 NDR_CHECK(ndr_pull_align(ndr, 4));
257                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids));
258                 NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids));
259                 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
260                 NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
261                 for (cntr_rids_0 = 0; cntr_rids_0 < r->num_rids; cntr_rids_0++) {
262                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_0]));
263                 }
264                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
265                 if (r->rids) {
266                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids));
267                 }
268         }
269         if (ndr_flags & NDR_BUFFERS) {
270         }
271         return NDR_ERR_SUCCESS;
272 }
273
274 _PUBLIC_ void ndr_print_wbint_RidArray(struct ndr_print *ndr, const char *name, const struct wbint_RidArray *r)
275 {
276         uint32_t cntr_rids_0;
277         ndr_print_struct(ndr, name, "wbint_RidArray");
278         ndr->depth++;
279         ndr_print_uint32(ndr, "num_rids", r->num_rids);
280         ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids);
281         ndr->depth++;
282         for (cntr_rids_0=0;cntr_rids_0<r->num_rids;cntr_rids_0++) {
283                 char *idx_0=NULL;
284                 if (asprintf(&idx_0, "[%d]", cntr_rids_0) != -1) {
285                         ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_0]);
286                         free(idx_0);
287                 }
288         }
289         ndr->depth--;
290         ndr->depth--;
291 }
292
293 static enum ndr_err_code ndr_push_wbint_Ping(struct ndr_push *ndr, int flags, const struct wbint_Ping *r)
294 {
295         if (flags & NDR_IN) {
296                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data));
297         }
298         if (flags & NDR_OUT) {
299                 if (r->out.out_data == NULL) {
300                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
301                 }
302                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data));
303         }
304         return NDR_ERR_SUCCESS;
305 }
306
307 static enum ndr_err_code ndr_pull_wbint_Ping(struct ndr_pull *ndr, int flags, struct wbint_Ping *r)
308 {
309         TALLOC_CTX *_mem_save_out_data_0;
310         if (flags & NDR_IN) {
311                 ZERO_STRUCT(r->out);
312
313                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data));
314                 NDR_PULL_ALLOC(ndr, r->out.out_data);
315                 ZERO_STRUCTP(r->out.out_data);
316         }
317         if (flags & NDR_OUT) {
318                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
319                         NDR_PULL_ALLOC(ndr, r->out.out_data);
320                 }
321                 _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
322                 NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC);
323                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data));
324                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC);
325         }
326         return NDR_ERR_SUCCESS;
327 }
328
329 _PUBLIC_ void ndr_print_wbint_Ping(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Ping *r)
330 {
331         ndr_print_struct(ndr, name, "wbint_Ping");
332         ndr->depth++;
333         if (flags & NDR_SET_VALUES) {
334                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
335         }
336         if (flags & NDR_IN) {
337                 ndr_print_struct(ndr, "in", "wbint_Ping");
338                 ndr->depth++;
339                 ndr_print_uint32(ndr, "in_data", r->in.in_data);
340                 ndr->depth--;
341         }
342         if (flags & NDR_OUT) {
343                 ndr_print_struct(ndr, "out", "wbint_Ping");
344                 ndr->depth++;
345                 ndr_print_ptr(ndr, "out_data", r->out.out_data);
346                 ndr->depth++;
347                 ndr_print_uint32(ndr, "out_data", *r->out.out_data);
348                 ndr->depth--;
349                 ndr->depth--;
350         }
351         ndr->depth--;
352 }
353
354 static enum ndr_err_code ndr_push_wbint_LookupSid(struct ndr_push *ndr, int flags, const struct wbint_LookupSid *r)
355 {
356         if (flags & NDR_IN) {
357                 if (r->in.sid == NULL) {
358                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
359                 }
360                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
361         }
362         if (flags & NDR_OUT) {
363                 if (r->out.type == NULL) {
364                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
365                 }
366                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type));
367                 if (r->out.domain == NULL) {
368                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
369                 }
370                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domain));
371                 if (*r->out.domain) {
372                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8)));
373                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
374                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8)));
375                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.domain, ndr_charset_length(*r->out.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8));
376                 }
377                 if (r->out.name == NULL) {
378                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
379                 }
380                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name));
381                 if (*r->out.name) {
382                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8)));
383                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
384                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8)));
385                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name, ndr_charset_length(*r->out.name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
386                 }
387                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
388         }
389         return NDR_ERR_SUCCESS;
390 }
391
392 static enum ndr_err_code ndr_pull_wbint_LookupSid(struct ndr_pull *ndr, int flags, struct wbint_LookupSid *r)
393 {
394         uint32_t _ptr_domain;
395         uint32_t _ptr_name;
396         TALLOC_CTX *_mem_save_sid_0;
397         TALLOC_CTX *_mem_save_type_0;
398         TALLOC_CTX *_mem_save_domain_0;
399         TALLOC_CTX *_mem_save_domain_1;
400         TALLOC_CTX *_mem_save_name_0;
401         TALLOC_CTX *_mem_save_name_1;
402         if (flags & NDR_IN) {
403                 ZERO_STRUCT(r->out);
404
405                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
406                         NDR_PULL_ALLOC(ndr, r->in.sid);
407                 }
408                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
409                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
410                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
411                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
412                 NDR_PULL_ALLOC(ndr, r->out.type);
413                 ZERO_STRUCTP(r->out.type);
414                 NDR_PULL_ALLOC(ndr, r->out.domain);
415                 ZERO_STRUCTP(r->out.domain);
416                 NDR_PULL_ALLOC(ndr, r->out.name);
417                 ZERO_STRUCTP(r->out.name);
418         }
419         if (flags & NDR_OUT) {
420                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
421                         NDR_PULL_ALLOC(ndr, r->out.type);
422                 }
423                 _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
424                 NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
425                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type));
426                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
427                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
428                         NDR_PULL_ALLOC(ndr, r->out.domain);
429                 }
430                 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
431                 NDR_PULL_SET_MEM_CTX(ndr, r->out.domain, LIBNDR_FLAG_REF_ALLOC);
432                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
433                 if (_ptr_domain) {
434                         NDR_PULL_ALLOC(ndr, *r->out.domain);
435                 } else {
436                         *r->out.domain = NULL;
437                 }
438                 if (*r->out.domain) {
439                         _mem_save_domain_1 = NDR_PULL_GET_MEM_CTX(ndr);
440                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.domain, 0);
441                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.domain));
442                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.domain));
443                         if (ndr_get_array_length(ndr, r->out.domain) > ndr_get_array_size(ndr, r->out.domain)) {
444                                 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.domain), ndr_get_array_length(ndr, r->out.domain));
445                         }
446                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.domain), sizeof(uint8_t)));
447                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.domain, ndr_get_array_length(ndr, r->out.domain), sizeof(uint8_t), CH_UTF8));
448                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_1, 0);
449                 }
450                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, LIBNDR_FLAG_REF_ALLOC);
451                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
452                         NDR_PULL_ALLOC(ndr, r->out.name);
453                 }
454                 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
455                 NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
456                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
457                 if (_ptr_name) {
458                         NDR_PULL_ALLOC(ndr, *r->out.name);
459                 } else {
460                         *r->out.name = NULL;
461                 }
462                 if (*r->out.name) {
463                         _mem_save_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
464                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.name, 0);
465                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.name));
466                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.name));
467                         if (ndr_get_array_length(ndr, r->out.name) > ndr_get_array_size(ndr, r->out.name)) {
468                                 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.name), ndr_get_array_length(ndr, r->out.name));
469                         }
470                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.name), sizeof(uint8_t)));
471                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name, ndr_get_array_length(ndr, r->out.name), sizeof(uint8_t), CH_UTF8));
472                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_1, 0);
473                 }
474                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
475                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
476         }
477         return NDR_ERR_SUCCESS;
478 }
479
480 _PUBLIC_ void ndr_print_wbint_LookupSid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupSid *r)
481 {
482         ndr_print_struct(ndr, name, "wbint_LookupSid");
483         ndr->depth++;
484         if (flags & NDR_SET_VALUES) {
485                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
486         }
487         if (flags & NDR_IN) {
488                 ndr_print_struct(ndr, "in", "wbint_LookupSid");
489                 ndr->depth++;
490                 ndr_print_ptr(ndr, "sid", r->in.sid);
491                 ndr->depth++;
492                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
493                 ndr->depth--;
494                 ndr->depth--;
495         }
496         if (flags & NDR_OUT) {
497                 ndr_print_struct(ndr, "out", "wbint_LookupSid");
498                 ndr->depth++;
499                 ndr_print_ptr(ndr, "type", r->out.type);
500                 ndr->depth++;
501                 ndr_print_lsa_SidType(ndr, "type", *r->out.type);
502                 ndr->depth--;
503                 ndr_print_ptr(ndr, "domain", r->out.domain);
504                 ndr->depth++;
505                 ndr_print_ptr(ndr, "domain", *r->out.domain);
506                 ndr->depth++;
507                 if (*r->out.domain) {
508                         ndr_print_string(ndr, "domain", *r->out.domain);
509                 }
510                 ndr->depth--;
511                 ndr->depth--;
512                 ndr_print_ptr(ndr, "name", r->out.name);
513                 ndr->depth++;
514                 ndr_print_ptr(ndr, "name", *r->out.name);
515                 ndr->depth++;
516                 if (*r->out.name) {
517                         ndr_print_string(ndr, "name", *r->out.name);
518                 }
519                 ndr->depth--;
520                 ndr->depth--;
521                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
522                 ndr->depth--;
523         }
524         ndr->depth--;
525 }
526
527 static enum ndr_err_code ndr_push_wbint_LookupName(struct ndr_push *ndr, int flags, const struct wbint_LookupName *r)
528 {
529         if (flags & NDR_IN) {
530                 if (r->in.domain == NULL) {
531                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
532                 }
533                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8)));
534                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
535                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8)));
536                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8));
537                 if (r->in.name == NULL) {
538                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
539                 }
540                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8)));
541                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
542                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8)));
543                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
544                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
545         }
546         if (flags & NDR_OUT) {
547                 if (r->out.type == NULL) {
548                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
549                 }
550                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type));
551                 if (r->out.sid == NULL) {
552                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
553                 }
554                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
555                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
556         }
557         return NDR_ERR_SUCCESS;
558 }
559
560 static enum ndr_err_code ndr_pull_wbint_LookupName(struct ndr_pull *ndr, int flags, struct wbint_LookupName *r)
561 {
562         TALLOC_CTX *_mem_save_type_0;
563         TALLOC_CTX *_mem_save_sid_0;
564         if (flags & NDR_IN) {
565                 ZERO_STRUCT(r->out);
566
567                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain));
568                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain));
569                 if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) {
570                         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.domain), ndr_get_array_length(ndr, &r->in.domain));
571                 }
572                 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint8_t)));
573                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint8_t), CH_UTF8));
574                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name));
575                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name));
576                 if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) {
577                         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.name), ndr_get_array_length(ndr, &r->in.name));
578                 }
579                 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint8_t)));
580                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint8_t), CH_UTF8));
581                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
582                 NDR_PULL_ALLOC(ndr, r->out.type);
583                 ZERO_STRUCTP(r->out.type);
584                 NDR_PULL_ALLOC(ndr, r->out.sid);
585                 ZERO_STRUCTP(r->out.sid);
586         }
587         if (flags & NDR_OUT) {
588                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
589                         NDR_PULL_ALLOC(ndr, r->out.type);
590                 }
591                 _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
592                 NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
593                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type));
594                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
595                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
596                         NDR_PULL_ALLOC(ndr, r->out.sid);
597                 }
598                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
599                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
600                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
601                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
602                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
603         }
604         return NDR_ERR_SUCCESS;
605 }
606
607 _PUBLIC_ void ndr_print_wbint_LookupName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupName *r)
608 {
609         ndr_print_struct(ndr, name, "wbint_LookupName");
610         ndr->depth++;
611         if (flags & NDR_SET_VALUES) {
612                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
613         }
614         if (flags & NDR_IN) {
615                 ndr_print_struct(ndr, "in", "wbint_LookupName");
616                 ndr->depth++;
617                 ndr_print_ptr(ndr, "domain", r->in.domain);
618                 ndr->depth++;
619                 ndr_print_string(ndr, "domain", r->in.domain);
620                 ndr->depth--;
621                 ndr_print_ptr(ndr, "name", r->in.name);
622                 ndr->depth++;
623                 ndr_print_string(ndr, "name", r->in.name);
624                 ndr->depth--;
625                 ndr_print_uint32(ndr, "flags", r->in.flags);
626                 ndr->depth--;
627         }
628         if (flags & NDR_OUT) {
629                 ndr_print_struct(ndr, "out", "wbint_LookupName");
630                 ndr->depth++;
631                 ndr_print_ptr(ndr, "type", r->out.type);
632                 ndr->depth++;
633                 ndr_print_lsa_SidType(ndr, "type", *r->out.type);
634                 ndr->depth--;
635                 ndr_print_ptr(ndr, "sid", r->out.sid);
636                 ndr->depth++;
637                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
638                 ndr->depth--;
639                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
640                 ndr->depth--;
641         }
642         ndr->depth--;
643 }
644
645 static enum ndr_err_code ndr_push_wbint_Sid2Uid(struct ndr_push *ndr, int flags, const struct wbint_Sid2Uid *r)
646 {
647         if (flags & NDR_IN) {
648                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
649                 if (r->in.dom_name) {
650                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
651                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
652                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
653                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
654                 }
655                 if (r->in.sid == NULL) {
656                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
657                 }
658                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
659         }
660         if (flags & NDR_OUT) {
661                 if (r->out.uid == NULL) {
662                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
663                 }
664                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
665                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
666         }
667         return NDR_ERR_SUCCESS;
668 }
669
670 static enum ndr_err_code ndr_pull_wbint_Sid2Uid(struct ndr_pull *ndr, int flags, struct wbint_Sid2Uid *r)
671 {
672         uint32_t _ptr_dom_name;
673         TALLOC_CTX *_mem_save_dom_name_0;
674         TALLOC_CTX *_mem_save_sid_0;
675         TALLOC_CTX *_mem_save_uid_0;
676         if (flags & NDR_IN) {
677                 ZERO_STRUCT(r->out);
678
679                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
680                 if (_ptr_dom_name) {
681                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
682                 } else {
683                         r->in.dom_name = NULL;
684                 }
685                 if (r->in.dom_name) {
686                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
687                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
688                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
689                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
690                         if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
691                                 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.dom_name), ndr_get_array_length(ndr, &r->in.dom_name));
692                         }
693                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
694                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8));
695                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
696                 }
697                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
698                         NDR_PULL_ALLOC(ndr, r->in.sid);
699                 }
700                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
701                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
702                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
703                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
704                 NDR_PULL_ALLOC(ndr, r->out.uid);
705                 ZERO_STRUCTP(r->out.uid);
706         }
707         if (flags & NDR_OUT) {
708                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
709                         NDR_PULL_ALLOC(ndr, r->out.uid);
710                 }
711                 _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
712                 NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
713                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
714                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
715                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
716         }
717         return NDR_ERR_SUCCESS;
718 }
719
720 _PUBLIC_ void ndr_print_wbint_Sid2Uid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Uid *r)
721 {
722         ndr_print_struct(ndr, name, "wbint_Sid2Uid");
723         ndr->depth++;
724         if (flags & NDR_SET_VALUES) {
725                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
726         }
727         if (flags & NDR_IN) {
728                 ndr_print_struct(ndr, "in", "wbint_Sid2Uid");
729                 ndr->depth++;
730                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
731                 ndr->depth++;
732                 if (r->in.dom_name) {
733                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
734                 }
735                 ndr->depth--;
736                 ndr_print_ptr(ndr, "sid", r->in.sid);
737                 ndr->depth++;
738                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
739                 ndr->depth--;
740                 ndr->depth--;
741         }
742         if (flags & NDR_OUT) {
743                 ndr_print_struct(ndr, "out", "wbint_Sid2Uid");
744                 ndr->depth++;
745                 ndr_print_ptr(ndr, "uid", r->out.uid);
746                 ndr->depth++;
747                 ndr_print_hyper(ndr, "uid", *r->out.uid);
748                 ndr->depth--;
749                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
750                 ndr->depth--;
751         }
752         ndr->depth--;
753 }
754
755 static enum ndr_err_code ndr_push_wbint_Sid2Gid(struct ndr_push *ndr, int flags, const struct wbint_Sid2Gid *r)
756 {
757         if (flags & NDR_IN) {
758                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
759                 if (r->in.dom_name) {
760                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
761                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
762                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
763                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
764                 }
765                 if (r->in.sid == NULL) {
766                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
767                 }
768                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
769         }
770         if (flags & NDR_OUT) {
771                 if (r->out.gid == NULL) {
772                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
773                 }
774                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
775                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
776         }
777         return NDR_ERR_SUCCESS;
778 }
779
780 static enum ndr_err_code ndr_pull_wbint_Sid2Gid(struct ndr_pull *ndr, int flags, struct wbint_Sid2Gid *r)
781 {
782         uint32_t _ptr_dom_name;
783         TALLOC_CTX *_mem_save_dom_name_0;
784         TALLOC_CTX *_mem_save_sid_0;
785         TALLOC_CTX *_mem_save_gid_0;
786         if (flags & NDR_IN) {
787                 ZERO_STRUCT(r->out);
788
789                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
790                 if (_ptr_dom_name) {
791                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
792                 } else {
793                         r->in.dom_name = NULL;
794                 }
795                 if (r->in.dom_name) {
796                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
797                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
798                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
799                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
800                         if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
801                                 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.dom_name), ndr_get_array_length(ndr, &r->in.dom_name));
802                         }
803                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
804                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8));
805                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
806                 }
807                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
808                         NDR_PULL_ALLOC(ndr, r->in.sid);
809                 }
810                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
811                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
812                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
813                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
814                 NDR_PULL_ALLOC(ndr, r->out.gid);
815                 ZERO_STRUCTP(r->out.gid);
816         }
817         if (flags & NDR_OUT) {
818                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
819                         NDR_PULL_ALLOC(ndr, r->out.gid);
820                 }
821                 _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
822                 NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
823                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
824                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
825                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
826         }
827         return NDR_ERR_SUCCESS;
828 }
829
830 _PUBLIC_ void ndr_print_wbint_Sid2Gid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Gid *r)
831 {
832         ndr_print_struct(ndr, name, "wbint_Sid2Gid");
833         ndr->depth++;
834         if (flags & NDR_SET_VALUES) {
835                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
836         }
837         if (flags & NDR_IN) {
838                 ndr_print_struct(ndr, "in", "wbint_Sid2Gid");
839                 ndr->depth++;
840                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
841                 ndr->depth++;
842                 if (r->in.dom_name) {
843                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
844                 }
845                 ndr->depth--;
846                 ndr_print_ptr(ndr, "sid", r->in.sid);
847                 ndr->depth++;
848                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
849                 ndr->depth--;
850                 ndr->depth--;
851         }
852         if (flags & NDR_OUT) {
853                 ndr_print_struct(ndr, "out", "wbint_Sid2Gid");
854                 ndr->depth++;
855                 ndr_print_ptr(ndr, "gid", r->out.gid);
856                 ndr->depth++;
857                 ndr_print_hyper(ndr, "gid", *r->out.gid);
858                 ndr->depth--;
859                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
860                 ndr->depth--;
861         }
862         ndr->depth--;
863 }
864
865 static enum ndr_err_code ndr_push_wbint_Uid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Uid2Sid *r)
866 {
867         if (flags & NDR_IN) {
868                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
869                 if (r->in.dom_name) {
870                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
871                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
872                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
873                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
874                 }
875                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
876         }
877         if (flags & NDR_OUT) {
878                 if (r->out.sid == NULL) {
879                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
880                 }
881                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
882                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
883         }
884         return NDR_ERR_SUCCESS;
885 }
886
887 static enum ndr_err_code ndr_pull_wbint_Uid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Uid2Sid *r)
888 {
889         uint32_t _ptr_dom_name;
890         TALLOC_CTX *_mem_save_dom_name_0;
891         TALLOC_CTX *_mem_save_sid_0;
892         if (flags & NDR_IN) {
893                 ZERO_STRUCT(r->out);
894
895                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
896                 if (_ptr_dom_name) {
897                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
898                 } else {
899                         r->in.dom_name = NULL;
900                 }
901                 if (r->in.dom_name) {
902                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
903                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
904                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
905                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
906                         if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
907                                 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.dom_name), ndr_get_array_length(ndr, &r->in.dom_name));
908                         }
909                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
910                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8));
911                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
912                 }
913                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
914                 NDR_PULL_ALLOC(ndr, r->out.sid);
915                 ZERO_STRUCTP(r->out.sid);
916         }
917         if (flags & NDR_OUT) {
918                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
919                         NDR_PULL_ALLOC(ndr, r->out.sid);
920                 }
921                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
922                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
923                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
924                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
925                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
926         }
927         return NDR_ERR_SUCCESS;
928 }
929
930 _PUBLIC_ void ndr_print_wbint_Uid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Uid2Sid *r)
931 {
932         ndr_print_struct(ndr, name, "wbint_Uid2Sid");
933         ndr->depth++;
934         if (flags & NDR_SET_VALUES) {
935                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
936         }
937         if (flags & NDR_IN) {
938                 ndr_print_struct(ndr, "in", "wbint_Uid2Sid");
939                 ndr->depth++;
940                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
941                 ndr->depth++;
942                 if (r->in.dom_name) {
943                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
944                 }
945                 ndr->depth--;
946                 ndr_print_hyper(ndr, "uid", r->in.uid);
947                 ndr->depth--;
948         }
949         if (flags & NDR_OUT) {
950                 ndr_print_struct(ndr, "out", "wbint_Uid2Sid");
951                 ndr->depth++;
952                 ndr_print_ptr(ndr, "sid", r->out.sid);
953                 ndr->depth++;
954                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
955                 ndr->depth--;
956                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
957                 ndr->depth--;
958         }
959         ndr->depth--;
960 }
961
962 static enum ndr_err_code ndr_push_wbint_Gid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Gid2Sid *r)
963 {
964         if (flags & NDR_IN) {
965                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
966                 if (r->in.dom_name) {
967                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
968                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
969                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
970                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
971                 }
972                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
973         }
974         if (flags & NDR_OUT) {
975                 if (r->out.sid == NULL) {
976                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
977                 }
978                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
979                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
980         }
981         return NDR_ERR_SUCCESS;
982 }
983
984 static enum ndr_err_code ndr_pull_wbint_Gid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Gid2Sid *r)
985 {
986         uint32_t _ptr_dom_name;
987         TALLOC_CTX *_mem_save_dom_name_0;
988         TALLOC_CTX *_mem_save_sid_0;
989         if (flags & NDR_IN) {
990                 ZERO_STRUCT(r->out);
991
992                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
993                 if (_ptr_dom_name) {
994                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
995                 } else {
996                         r->in.dom_name = NULL;
997                 }
998                 if (r->in.dom_name) {
999                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1000                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1001                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1002                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1003                         if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
1004                                 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.dom_name), ndr_get_array_length(ndr, &r->in.dom_name));
1005                         }
1006                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
1007                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8));
1008                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1009                 }
1010                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
1011                 NDR_PULL_ALLOC(ndr, r->out.sid);
1012                 ZERO_STRUCTP(r->out.sid);
1013         }
1014         if (flags & NDR_OUT) {
1015                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1016                         NDR_PULL_ALLOC(ndr, r->out.sid);
1017                 }
1018                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1019                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
1020                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1021                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1022                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1023         }
1024         return NDR_ERR_SUCCESS;
1025 }
1026
1027 _PUBLIC_ void ndr_print_wbint_Gid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Gid2Sid *r)
1028 {
1029         ndr_print_struct(ndr, name, "wbint_Gid2Sid");
1030         ndr->depth++;
1031         if (flags & NDR_SET_VALUES) {
1032                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1033         }
1034         if (flags & NDR_IN) {
1035                 ndr_print_struct(ndr, "in", "wbint_Gid2Sid");
1036                 ndr->depth++;
1037                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1038                 ndr->depth++;
1039                 if (r->in.dom_name) {
1040                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
1041                 }
1042                 ndr->depth--;
1043                 ndr_print_hyper(ndr, "gid", r->in.gid);
1044                 ndr->depth--;
1045         }
1046         if (flags & NDR_OUT) {
1047                 ndr_print_struct(ndr, "out", "wbint_Gid2Sid");
1048                 ndr->depth++;
1049                 ndr_print_ptr(ndr, "sid", r->out.sid);
1050                 ndr->depth++;
1051                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
1052                 ndr->depth--;
1053                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1054                 ndr->depth--;
1055         }
1056         ndr->depth--;
1057 }
1058
1059 static enum ndr_err_code ndr_push_wbint_QueryUser(struct ndr_push *ndr, int flags, const struct wbint_QueryUser *r)
1060 {
1061         if (flags & NDR_IN) {
1062                 if (r->in.sid == NULL) {
1063                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1064                 }
1065                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1066         }
1067         if (flags & NDR_OUT) {
1068                 if (r->out.info == NULL) {
1069                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1070                 }
1071                 NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
1072                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1073         }
1074         return NDR_ERR_SUCCESS;
1075 }
1076
1077 static enum ndr_err_code ndr_pull_wbint_QueryUser(struct ndr_pull *ndr, int flags, struct wbint_QueryUser *r)
1078 {
1079         TALLOC_CTX *_mem_save_sid_0;
1080         TALLOC_CTX *_mem_save_info_0;
1081         if (flags & NDR_IN) {
1082                 ZERO_STRUCT(r->out);
1083
1084                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1085                         NDR_PULL_ALLOC(ndr, r->in.sid);
1086                 }
1087                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1088                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1089                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1090                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1091                 NDR_PULL_ALLOC(ndr, r->out.info);
1092                 ZERO_STRUCTP(r->out.info);
1093         }
1094         if (flags & NDR_OUT) {
1095                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1096                         NDR_PULL_ALLOC(ndr, r->out.info);
1097                 }
1098                 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1099                 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
1100                 NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
1101                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
1102                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1103         }
1104         return NDR_ERR_SUCCESS;
1105 }
1106
1107 _PUBLIC_ void ndr_print_wbint_QueryUser(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUser *r)
1108 {
1109         ndr_print_struct(ndr, name, "wbint_QueryUser");
1110         ndr->depth++;
1111         if (flags & NDR_SET_VALUES) {
1112                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1113         }
1114         if (flags & NDR_IN) {
1115                 ndr_print_struct(ndr, "in", "wbint_QueryUser");
1116                 ndr->depth++;
1117                 ndr_print_ptr(ndr, "sid", r->in.sid);
1118                 ndr->depth++;
1119                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1120                 ndr->depth--;
1121                 ndr->depth--;
1122         }
1123         if (flags & NDR_OUT) {
1124                 ndr_print_struct(ndr, "out", "wbint_QueryUser");
1125                 ndr->depth++;
1126                 ndr_print_ptr(ndr, "info", r->out.info);
1127                 ndr->depth++;
1128                 ndr_print_wbint_userinfo(ndr, "info", r->out.info);
1129                 ndr->depth--;
1130                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1131                 ndr->depth--;
1132         }
1133         ndr->depth--;
1134 }
1135
1136 static enum ndr_err_code ndr_push_wbint_LookupUserAliases(struct ndr_push *ndr, int flags, const struct wbint_LookupUserAliases *r)
1137 {
1138         if (flags & NDR_IN) {
1139                 if (r->in.sids == NULL) {
1140                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1141                 }
1142                 NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids));
1143         }
1144         if (flags & NDR_OUT) {
1145                 if (r->out.rids == NULL) {
1146                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1147                 }
1148                 NDR_CHECK(ndr_push_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids));
1149                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1150         }
1151         return NDR_ERR_SUCCESS;
1152 }
1153
1154 static enum ndr_err_code ndr_pull_wbint_LookupUserAliases(struct ndr_pull *ndr, int flags, struct wbint_LookupUserAliases *r)
1155 {
1156         TALLOC_CTX *_mem_save_sids_0;
1157         TALLOC_CTX *_mem_save_rids_0;
1158         if (flags & NDR_IN) {
1159                 ZERO_STRUCT(r->out);
1160
1161                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1162                         NDR_PULL_ALLOC(ndr, r->in.sids);
1163                 }
1164                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1165                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC);
1166                 NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids));
1167                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
1168                 NDR_PULL_ALLOC(ndr, r->out.rids);
1169                 ZERO_STRUCTP(r->out.rids);
1170         }
1171         if (flags & NDR_OUT) {
1172                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1173                         NDR_PULL_ALLOC(ndr, r->out.rids);
1174                 }
1175                 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1176                 NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC);
1177                 NDR_CHECK(ndr_pull_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids));
1178                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC);
1179                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1180         }
1181         return NDR_ERR_SUCCESS;
1182 }
1183
1184 _PUBLIC_ void ndr_print_wbint_LookupUserAliases(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserAliases *r)
1185 {
1186         ndr_print_struct(ndr, name, "wbint_LookupUserAliases");
1187         ndr->depth++;
1188         if (flags & NDR_SET_VALUES) {
1189                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1190         }
1191         if (flags & NDR_IN) {
1192                 ndr_print_struct(ndr, "in", "wbint_LookupUserAliases");
1193                 ndr->depth++;
1194                 ndr_print_ptr(ndr, "sids", r->in.sids);
1195                 ndr->depth++;
1196                 ndr_print_wbint_SidArray(ndr, "sids", r->in.sids);
1197                 ndr->depth--;
1198                 ndr->depth--;
1199         }
1200         if (flags & NDR_OUT) {
1201                 ndr_print_struct(ndr, "out", "wbint_LookupUserAliases");
1202                 ndr->depth++;
1203                 ndr_print_ptr(ndr, "rids", r->out.rids);
1204                 ndr->depth++;
1205                 ndr_print_wbint_RidArray(ndr, "rids", r->out.rids);
1206                 ndr->depth--;
1207                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1208                 ndr->depth--;
1209         }
1210         ndr->depth--;
1211 }
1212
1213 static enum ndr_err_code ndr_push_wbint_LookupUserGroups(struct ndr_push *ndr, int flags, const struct wbint_LookupUserGroups *r)
1214 {
1215         if (flags & NDR_IN) {
1216                 if (r->in.sid == NULL) {
1217                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1218                 }
1219                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1220         }
1221         if (flags & NDR_OUT) {
1222                 if (r->out.sids == NULL) {
1223                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1224                 }
1225                 NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids));
1226                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1227         }
1228         return NDR_ERR_SUCCESS;
1229 }
1230
1231 static enum ndr_err_code ndr_pull_wbint_LookupUserGroups(struct ndr_pull *ndr, int flags, struct wbint_LookupUserGroups *r)
1232 {
1233         TALLOC_CTX *_mem_save_sid_0;
1234         TALLOC_CTX *_mem_save_sids_0;
1235         if (flags & NDR_IN) {
1236                 ZERO_STRUCT(r->out);
1237
1238                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1239                         NDR_PULL_ALLOC(ndr, r->in.sid);
1240                 }
1241                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1242                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1243                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1244                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1245                 NDR_PULL_ALLOC(ndr, r->out.sids);
1246                 ZERO_STRUCTP(r->out.sids);
1247         }
1248         if (flags & NDR_OUT) {
1249                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1250                         NDR_PULL_ALLOC(ndr, r->out.sids);
1251                 }
1252                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1253                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC);
1254                 NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids));
1255                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
1256                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1257         }
1258         return NDR_ERR_SUCCESS;
1259 }
1260
1261 _PUBLIC_ void ndr_print_wbint_LookupUserGroups(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserGroups *r)
1262 {
1263         ndr_print_struct(ndr, name, "wbint_LookupUserGroups");
1264         ndr->depth++;
1265         if (flags & NDR_SET_VALUES) {
1266                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1267         }
1268         if (flags & NDR_IN) {
1269                 ndr_print_struct(ndr, "in", "wbint_LookupUserGroups");
1270                 ndr->depth++;
1271                 ndr_print_ptr(ndr, "sid", r->in.sid);
1272                 ndr->depth++;
1273                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1274                 ndr->depth--;
1275                 ndr->depth--;
1276         }
1277         if (flags & NDR_OUT) {
1278                 ndr_print_struct(ndr, "out", "wbint_LookupUserGroups");
1279                 ndr->depth++;
1280                 ndr_print_ptr(ndr, "sids", r->out.sids);
1281                 ndr->depth++;
1282                 ndr_print_wbint_SidArray(ndr, "sids", r->out.sids);
1283                 ndr->depth--;
1284                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1285                 ndr->depth--;
1286         }
1287         ndr->depth--;
1288 }
1289
1290 static enum ndr_err_code ndr_push_wbint_QuerySequenceNumber(struct ndr_push *ndr, int flags, const struct wbint_QuerySequenceNumber *r)
1291 {
1292         if (flags & NDR_IN) {
1293         }
1294         if (flags & NDR_OUT) {
1295                 if (r->out.sequence == NULL) {
1296                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1297                 }
1298                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sequence));
1299                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1300         }
1301         return NDR_ERR_SUCCESS;
1302 }
1303
1304 static enum ndr_err_code ndr_pull_wbint_QuerySequenceNumber(struct ndr_pull *ndr, int flags, struct wbint_QuerySequenceNumber *r)
1305 {
1306         TALLOC_CTX *_mem_save_sequence_0;
1307         if (flags & NDR_IN) {
1308                 ZERO_STRUCT(r->out);
1309
1310                 NDR_PULL_ALLOC(ndr, r->out.sequence);
1311                 ZERO_STRUCTP(r->out.sequence);
1312         }
1313         if (flags & NDR_OUT) {
1314                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1315                         NDR_PULL_ALLOC(ndr, r->out.sequence);
1316                 }
1317                 _mem_save_sequence_0 = NDR_PULL_GET_MEM_CTX(ndr);
1318                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence, LIBNDR_FLAG_REF_ALLOC);
1319                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sequence));
1320                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_0, LIBNDR_FLAG_REF_ALLOC);
1321                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1322         }
1323         return NDR_ERR_SUCCESS;
1324 }
1325
1326 _PUBLIC_ void ndr_print_wbint_QuerySequenceNumber(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QuerySequenceNumber *r)
1327 {
1328         ndr_print_struct(ndr, name, "wbint_QuerySequenceNumber");
1329         ndr->depth++;
1330         if (flags & NDR_SET_VALUES) {
1331                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1332         }
1333         if (flags & NDR_IN) {
1334                 ndr_print_struct(ndr, "in", "wbint_QuerySequenceNumber");
1335                 ndr->depth++;
1336                 ndr->depth--;
1337         }
1338         if (flags & NDR_OUT) {
1339                 ndr_print_struct(ndr, "out", "wbint_QuerySequenceNumber");
1340                 ndr->depth++;
1341                 ndr_print_ptr(ndr, "sequence", r->out.sequence);
1342                 ndr->depth++;
1343                 ndr_print_uint32(ndr, "sequence", *r->out.sequence);
1344                 ndr->depth--;
1345                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1346                 ndr->depth--;
1347         }
1348         ndr->depth--;
1349 }
1350
1351 static const struct ndr_interface_call wbint_calls[] = {
1352         {
1353                 "wbint_Ping",
1354                 sizeof(struct wbint_Ping),
1355                 (ndr_push_flags_fn_t) ndr_push_wbint_Ping,
1356                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Ping,
1357                 (ndr_print_function_t) ndr_print_wbint_Ping,
1358                 false,
1359         },
1360         {
1361                 "wbint_LookupSid",
1362                 sizeof(struct wbint_LookupSid),
1363                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupSid,
1364                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupSid,
1365                 (ndr_print_function_t) ndr_print_wbint_LookupSid,
1366                 false,
1367         },
1368         {
1369                 "wbint_LookupName",
1370                 sizeof(struct wbint_LookupName),
1371                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupName,
1372                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupName,
1373                 (ndr_print_function_t) ndr_print_wbint_LookupName,
1374                 false,
1375         },
1376         {
1377                 "wbint_Sid2Uid",
1378                 sizeof(struct wbint_Sid2Uid),
1379                 (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Uid,
1380                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Uid,
1381                 (ndr_print_function_t) ndr_print_wbint_Sid2Uid,
1382                 false,
1383         },
1384         {
1385                 "wbint_Sid2Gid",
1386                 sizeof(struct wbint_Sid2Gid),
1387                 (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Gid,
1388                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Gid,
1389                 (ndr_print_function_t) ndr_print_wbint_Sid2Gid,
1390                 false,
1391         },
1392         {
1393                 "wbint_Uid2Sid",
1394                 sizeof(struct wbint_Uid2Sid),
1395                 (ndr_push_flags_fn_t) ndr_push_wbint_Uid2Sid,
1396                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Uid2Sid,
1397                 (ndr_print_function_t) ndr_print_wbint_Uid2Sid,
1398                 false,
1399         },
1400         {
1401                 "wbint_Gid2Sid",
1402                 sizeof(struct wbint_Gid2Sid),
1403                 (ndr_push_flags_fn_t) ndr_push_wbint_Gid2Sid,
1404                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Gid2Sid,
1405                 (ndr_print_function_t) ndr_print_wbint_Gid2Sid,
1406                 false,
1407         },
1408         {
1409                 "wbint_QueryUser",
1410                 sizeof(struct wbint_QueryUser),
1411                 (ndr_push_flags_fn_t) ndr_push_wbint_QueryUser,
1412                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUser,
1413                 (ndr_print_function_t) ndr_print_wbint_QueryUser,
1414                 false,
1415         },
1416         {
1417                 "wbint_LookupUserAliases",
1418                 sizeof(struct wbint_LookupUserAliases),
1419                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserAliases,
1420                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserAliases,
1421                 (ndr_print_function_t) ndr_print_wbint_LookupUserAliases,
1422                 false,
1423         },
1424         {
1425                 "wbint_LookupUserGroups",
1426                 sizeof(struct wbint_LookupUserGroups),
1427                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserGroups,
1428                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserGroups,
1429                 (ndr_print_function_t) ndr_print_wbint_LookupUserGroups,
1430                 false,
1431         },
1432         {
1433                 "wbint_QuerySequenceNumber",
1434                 sizeof(struct wbint_QuerySequenceNumber),
1435                 (ndr_push_flags_fn_t) ndr_push_wbint_QuerySequenceNumber,
1436                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QuerySequenceNumber,
1437                 (ndr_print_function_t) ndr_print_wbint_QuerySequenceNumber,
1438                 false,
1439         },
1440         { NULL, 0, NULL, NULL, NULL, false }
1441 };
1442
1443 static const char * const wbint_endpoint_strings[] = {
1444         "ncalrpc:",
1445 };
1446
1447 static const struct ndr_interface_string_array wbint_endpoints = {
1448         .count  = 1,
1449         .names  = wbint_endpoint_strings
1450 };
1451
1452 static const char * const wbint_authservice_strings[] = {
1453         "host",
1454 };
1455
1456 static const struct ndr_interface_string_array wbint_authservices = {
1457         .count  = 1,
1458         .names  = wbint_authservice_strings
1459 };
1460
1461
1462 const struct ndr_interface_table ndr_table_wbint = {
1463         .name           = "wbint",
1464         .syntax_id      = {
1465                 {0xbf09192c,0xed60,0x4928,{0x9d,0xff},{0xd0,0xd7,0xbc,0xb0,0x3e,0xd8}},
1466                 NDR_WBINT_VERSION
1467         },
1468         .helpstring     = NDR_WBINT_HELPSTRING,
1469         .num_calls      = 11,
1470         .calls          = wbint_calls,
1471         .endpoints      = &wbint_endpoints,
1472         .authservices   = &wbint_authservices
1473 };
1474