125542d14a9a97a208b5dab7899ec3050c86c9c4
[sfrench/samba-autobuild/.git] / librpc / gen_ndr / ndr_srvsvc.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_srvsvc.h"
5
6 #include "librpc/gen_ndr/ndr_security.h"
7 #include "librpc/gen_ndr/ndr_svcctl.h"
8 static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfo0 *r)
9 {
10         if (ndr_flags & NDR_SCALARS) {
11                 NDR_CHECK(ndr_push_align(ndr, 4));
12                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->device));
13         }
14         if (ndr_flags & NDR_BUFFERS) {
15                 if (r->device) {
16                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16)));
17                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
18                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16)));
19                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16));
20                 }
21         }
22         return NDR_ERR_SUCCESS;
23 }
24
25 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfo0 *r)
26 {
27         uint32_t _ptr_device;
28         TALLOC_CTX *_mem_save_device_0;
29         if (ndr_flags & NDR_SCALARS) {
30                 NDR_CHECK(ndr_pull_align(ndr, 4));
31                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device));
32                 if (_ptr_device) {
33                         NDR_PULL_ALLOC(ndr, r->device);
34                 } else {
35                         r->device = NULL;
36                 }
37         }
38         if (ndr_flags & NDR_BUFFERS) {
39                 if (r->device) {
40                         _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr);
41                         NDR_PULL_SET_MEM_CTX(ndr, r->device, 0);
42                         NDR_CHECK(ndr_pull_array_size(ndr, &r->device));
43                         NDR_CHECK(ndr_pull_array_length(ndr, &r->device));
44                         if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) {
45                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device));
46                         }
47                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t)));
48                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16));
49                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0);
50                 }
51         }
52         return NDR_ERR_SUCCESS;
53 }
54
55 _PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo0 *r)
56 {
57         ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfo0");
58         ndr->depth++;
59         ndr_print_ptr(ndr, "device", r->device);
60         ndr->depth++;
61         if (r->device) {
62                 ndr_print_string(ndr, "device", r->device);
63         }
64         ndr->depth--;
65         ndr->depth--;
66 }
67
68 static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevCtr0 *r)
69 {
70         uint32_t cntr_array_1;
71         if (ndr_flags & NDR_SCALARS) {
72                 NDR_CHECK(ndr_push_align(ndr, 4));
73                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
74                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
75         }
76         if (ndr_flags & NDR_BUFFERS) {
77                 if (r->array) {
78                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
79                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
80                                 NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
81                         }
82                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
83                                 NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
84                         }
85                 }
86         }
87         return NDR_ERR_SUCCESS;
88 }
89
90 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevCtr0 *r)
91 {
92         uint32_t _ptr_array;
93         uint32_t cntr_array_1;
94         TALLOC_CTX *_mem_save_array_0;
95         TALLOC_CTX *_mem_save_array_1;
96         if (ndr_flags & NDR_SCALARS) {
97                 NDR_CHECK(ndr_pull_align(ndr, 4));
98                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
99                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
100                 if (_ptr_array) {
101                         NDR_PULL_ALLOC(ndr, r->array);
102                 } else {
103                         r->array = NULL;
104                 }
105         }
106         if (ndr_flags & NDR_BUFFERS) {
107                 if (r->array) {
108                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
109                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
110                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
111                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
112                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
113                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
114                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
115                                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
116                         }
117                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
118                                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
119                         }
120                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
121                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
122                 }
123                 if (r->array) {
124                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
125                 }
126         }
127         return NDR_ERR_SUCCESS;
128 }
129
130 _PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr0 *r)
131 {
132         uint32_t cntr_array_1;
133         ndr_print_struct(ndr, name, "srvsvc_NetCharDevCtr0");
134         ndr->depth++;
135         ndr_print_uint32(ndr, "count", r->count);
136         ndr_print_ptr(ndr, "array", r->array);
137         ndr->depth++;
138         if (r->array) {
139                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
140                 ndr->depth++;
141                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
142                         char *idx_1=NULL;
143                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
144                                 ndr_print_srvsvc_NetCharDevInfo0(ndr, "array", &r->array[cntr_array_1]);
145                                 free(idx_1);
146                         }
147                 }
148                 ndr->depth--;
149         }
150         ndr->depth--;
151         ndr->depth--;
152 }
153
154 static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfo1 *r)
155 {
156         if (ndr_flags & NDR_SCALARS) {
157                 NDR_CHECK(ndr_push_align(ndr, 4));
158                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->device));
159                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status));
160                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
161                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
162         }
163         if (ndr_flags & NDR_BUFFERS) {
164                 if (r->device) {
165                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16)));
166                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
167                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16)));
168                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16));
169                 }
170                 if (r->user) {
171                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
172                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
173                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
174                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
175                 }
176         }
177         return NDR_ERR_SUCCESS;
178 }
179
180 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfo1 *r)
181 {
182         uint32_t _ptr_device;
183         TALLOC_CTX *_mem_save_device_0;
184         uint32_t _ptr_user;
185         TALLOC_CTX *_mem_save_user_0;
186         if (ndr_flags & NDR_SCALARS) {
187                 NDR_CHECK(ndr_pull_align(ndr, 4));
188                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device));
189                 if (_ptr_device) {
190                         NDR_PULL_ALLOC(ndr, r->device);
191                 } else {
192                         r->device = NULL;
193                 }
194                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status));
195                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
196                 if (_ptr_user) {
197                         NDR_PULL_ALLOC(ndr, r->user);
198                 } else {
199                         r->user = NULL;
200                 }
201                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time));
202         }
203         if (ndr_flags & NDR_BUFFERS) {
204                 if (r->device) {
205                         _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr);
206                         NDR_PULL_SET_MEM_CTX(ndr, r->device, 0);
207                         NDR_CHECK(ndr_pull_array_size(ndr, &r->device));
208                         NDR_CHECK(ndr_pull_array_length(ndr, &r->device));
209                         if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) {
210                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device));
211                         }
212                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t)));
213                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16));
214                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0);
215                 }
216                 if (r->user) {
217                         _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
218                         NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
219                         NDR_CHECK(ndr_pull_array_size(ndr, &r->user));
220                         NDR_CHECK(ndr_pull_array_length(ndr, &r->user));
221                         if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) {
222                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user));
223                         }
224                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t)));
225                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16));
226                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
227                 }
228         }
229         return NDR_ERR_SUCCESS;
230 }
231
232 _PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfo1 *r)
233 {
234         ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfo1");
235         ndr->depth++;
236         ndr_print_ptr(ndr, "device", r->device);
237         ndr->depth++;
238         if (r->device) {
239                 ndr_print_string(ndr, "device", r->device);
240         }
241         ndr->depth--;
242         ndr_print_uint32(ndr, "status", r->status);
243         ndr_print_ptr(ndr, "user", r->user);
244         ndr->depth++;
245         if (r->user) {
246                 ndr_print_string(ndr, "user", r->user);
247         }
248         ndr->depth--;
249         ndr_print_uint32(ndr, "time", r->time);
250         ndr->depth--;
251 }
252
253 static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevCtr1 *r)
254 {
255         uint32_t cntr_array_1;
256         if (ndr_flags & NDR_SCALARS) {
257                 NDR_CHECK(ndr_push_align(ndr, 4));
258                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
259                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
260         }
261         if (ndr_flags & NDR_BUFFERS) {
262                 if (r->array) {
263                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
264                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
265                                 NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
266                         }
267                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
268                                 NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
269                         }
270                 }
271         }
272         return NDR_ERR_SUCCESS;
273 }
274
275 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevCtr1 *r)
276 {
277         uint32_t _ptr_array;
278         uint32_t cntr_array_1;
279         TALLOC_CTX *_mem_save_array_0;
280         TALLOC_CTX *_mem_save_array_1;
281         if (ndr_flags & NDR_SCALARS) {
282                 NDR_CHECK(ndr_pull_align(ndr, 4));
283                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
284                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
285                 if (_ptr_array) {
286                         NDR_PULL_ALLOC(ndr, r->array);
287                 } else {
288                         r->array = NULL;
289                 }
290         }
291         if (ndr_flags & NDR_BUFFERS) {
292                 if (r->array) {
293                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
294                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
295                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
296                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
297                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
298                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
299                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
300                                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
301                         }
302                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
303                                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
304                         }
305                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
306                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
307                 }
308                 if (r->array) {
309                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
310                 }
311         }
312         return NDR_ERR_SUCCESS;
313 }
314
315 _PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevCtr1 *r)
316 {
317         uint32_t cntr_array_1;
318         ndr_print_struct(ndr, name, "srvsvc_NetCharDevCtr1");
319         ndr->depth++;
320         ndr_print_uint32(ndr, "count", r->count);
321         ndr_print_ptr(ndr, "array", r->array);
322         ndr->depth++;
323         if (r->array) {
324                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
325                 ndr->depth++;
326                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
327                         char *idx_1=NULL;
328                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
329                                 ndr_print_srvsvc_NetCharDevInfo1(ndr, "array", &r->array[cntr_array_1]);
330                                 free(idx_1);
331                         }
332                 }
333                 ndr->depth--;
334         }
335         ndr->depth--;
336         ndr->depth--;
337 }
338
339 static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevInfo *r)
340 {
341         if (ndr_flags & NDR_SCALARS) {
342                 int level = ndr_push_get_switch_value(ndr, r);
343                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
344                 switch (level) {
345                         case 0: {
346                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0));
347                         break; }
348
349                         case 1: {
350                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
351                         break; }
352
353                         default: {
354                         break; }
355
356                 }
357         }
358         if (ndr_flags & NDR_BUFFERS) {
359                 int level = ndr_push_get_switch_value(ndr, r);
360                 switch (level) {
361                         case 0:
362                                 if (r->info0) {
363                                         NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0));
364                                 }
365                         break;
366
367                         case 1:
368                                 if (r->info1) {
369                                         NDR_CHECK(ndr_push_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
370                                 }
371                         break;
372
373                         default:
374                         break;
375
376                 }
377         }
378         return NDR_ERR_SUCCESS;
379 }
380
381 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevInfo *r)
382 {
383         int level;
384         uint32_t _level;
385         TALLOC_CTX *_mem_save_info0_0;
386         TALLOC_CTX *_mem_save_info1_0;
387         level = ndr_pull_get_switch_value(ndr, r);
388         if (ndr_flags & NDR_SCALARS) {
389                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
390                 if (_level != level) {
391                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
392                 }
393                 switch (level) {
394                         case 0: {
395                                 uint32_t _ptr_info0;
396                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0));
397                                 if (_ptr_info0) {
398                                         NDR_PULL_ALLOC(ndr, r->info0);
399                                 } else {
400                                         r->info0 = NULL;
401                                 }
402                         break; }
403
404                         case 1: {
405                                 uint32_t _ptr_info1;
406                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
407                                 if (_ptr_info1) {
408                                         NDR_PULL_ALLOC(ndr, r->info1);
409                                 } else {
410                                         r->info1 = NULL;
411                                 }
412                         break; }
413
414                         default: {
415                         break; }
416
417                 }
418         }
419         if (ndr_flags & NDR_BUFFERS) {
420                 switch (level) {
421                         case 0:
422                                 if (r->info0) {
423                                         _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr);
424                                         NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0);
425                                         NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0));
426                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0);
427                                 }
428                         break;
429
430                         case 1:
431                                 if (r->info1) {
432                                         _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
433                                         NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
434                                         NDR_CHECK(ndr_pull_srvsvc_NetCharDevInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
435                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
436                                 }
437                         break;
438
439                         default:
440                         break;
441
442                 }
443         }
444         return NDR_ERR_SUCCESS;
445 }
446
447 _PUBLIC_ void ndr_print_srvsvc_NetCharDevInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevInfo *r)
448 {
449         int level;
450         level = ndr_print_get_switch_value(ndr, r);
451         ndr_print_union(ndr, name, level, "srvsvc_NetCharDevInfo");
452         switch (level) {
453                 case 0:
454                         ndr_print_ptr(ndr, "info0", r->info0);
455                         ndr->depth++;
456                         if (r->info0) {
457                                 ndr_print_srvsvc_NetCharDevInfo0(ndr, "info0", r->info0);
458                         }
459                         ndr->depth--;
460                 break;
461
462                 case 1:
463                         ndr_print_ptr(ndr, "info1", r->info1);
464                         ndr->depth++;
465                         if (r->info1) {
466                                 ndr_print_srvsvc_NetCharDevInfo1(ndr, "info1", r->info1);
467                         }
468                         ndr->depth--;
469                 break;
470
471                 default:
472                 break;
473
474         }
475 }
476
477 static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevCtr *r)
478 {
479         if (ndr_flags & NDR_SCALARS) {
480                 int level = ndr_push_get_switch_value(ndr, r);
481                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
482                 switch (level) {
483                         case 0: {
484                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0));
485                         break; }
486
487                         case 1: {
488                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1));
489                         break; }
490
491                         default: {
492                         break; }
493
494                 }
495         }
496         if (ndr_flags & NDR_BUFFERS) {
497                 int level = ndr_push_get_switch_value(ndr, r);
498                 switch (level) {
499                         case 0:
500                                 if (r->ctr0) {
501                                         NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0));
502                                 }
503                         break;
504
505                         case 1:
506                                 if (r->ctr1) {
507                                         NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
508                                 }
509                         break;
510
511                         default:
512                         break;
513
514                 }
515         }
516         return NDR_ERR_SUCCESS;
517 }
518
519 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevCtr *r)
520 {
521         int level;
522         uint32_t _level;
523         TALLOC_CTX *_mem_save_ctr0_0;
524         TALLOC_CTX *_mem_save_ctr1_0;
525         level = ndr_pull_get_switch_value(ndr, r);
526         if (ndr_flags & NDR_SCALARS) {
527                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
528                 if (_level != level) {
529                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
530                 }
531                 switch (level) {
532                         case 0: {
533                                 uint32_t _ptr_ctr0;
534                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0));
535                                 if (_ptr_ctr0) {
536                                         NDR_PULL_ALLOC(ndr, r->ctr0);
537                                 } else {
538                                         r->ctr0 = NULL;
539                                 }
540                         break; }
541
542                         case 1: {
543                                 uint32_t _ptr_ctr1;
544                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1));
545                                 if (_ptr_ctr1) {
546                                         NDR_PULL_ALLOC(ndr, r->ctr1);
547                                 } else {
548                                         r->ctr1 = NULL;
549                                 }
550                         break; }
551
552                         default: {
553                         break; }
554
555                 }
556         }
557         if (ndr_flags & NDR_BUFFERS) {
558                 switch (level) {
559                         case 0:
560                                 if (r->ctr0) {
561                                         _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr);
562                                         NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0);
563                                         NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0));
564                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0);
565                                 }
566                         break;
567
568                         case 1:
569                                 if (r->ctr1) {
570                                         _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr);
571                                         NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0);
572                                         NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
573                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0);
574                                 }
575                         break;
576
577                         default:
578                         break;
579
580                 }
581         }
582         return NDR_ERR_SUCCESS;
583 }
584
585 _PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevCtr *r)
586 {
587         int level;
588         level = ndr_print_get_switch_value(ndr, r);
589         ndr_print_union(ndr, name, level, "srvsvc_NetCharDevCtr");
590         switch (level) {
591                 case 0:
592                         ndr_print_ptr(ndr, "ctr0", r->ctr0);
593                         ndr->depth++;
594                         if (r->ctr0) {
595                                 ndr_print_srvsvc_NetCharDevCtr0(ndr, "ctr0", r->ctr0);
596                         }
597                         ndr->depth--;
598                 break;
599
600                 case 1:
601                         ndr_print_ptr(ndr, "ctr1", r->ctr1);
602                         ndr->depth++;
603                         if (r->ctr1) {
604                                 ndr_print_srvsvc_NetCharDevCtr1(ndr, "ctr1", r->ctr1);
605                         }
606                         ndr->depth--;
607                 break;
608
609                 default:
610                 break;
611
612         }
613 }
614
615 static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevInfoCtr *r)
616 {
617         if (ndr_flags & NDR_SCALARS) {
618                 NDR_CHECK(ndr_push_align(ndr, 4));
619                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
620                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level));
621                 NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr(ndr, NDR_SCALARS, &r->ctr));
622         }
623         if (ndr_flags & NDR_BUFFERS) {
624                 NDR_CHECK(ndr_push_srvsvc_NetCharDevCtr(ndr, NDR_BUFFERS, &r->ctr));
625         }
626         return NDR_ERR_SUCCESS;
627 }
628
629 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevInfoCtr *r)
630 {
631         if (ndr_flags & NDR_SCALARS) {
632                 NDR_CHECK(ndr_pull_align(ndr, 4));
633                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
634                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level));
635                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr(ndr, NDR_SCALARS, &r->ctr));
636         }
637         if (ndr_flags & NDR_BUFFERS) {
638                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevCtr(ndr, NDR_BUFFERS, &r->ctr));
639         }
640         return NDR_ERR_SUCCESS;
641 }
642
643 _PUBLIC_ void ndr_print_srvsvc_NetCharDevInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevInfoCtr *r)
644 {
645         ndr_print_struct(ndr, name, "srvsvc_NetCharDevInfoCtr");
646         ndr->depth++;
647         ndr_print_uint32(ndr, "level", r->level);
648         ndr_print_set_switch_value(ndr, &r->ctr, r->level);
649         ndr_print_srvsvc_NetCharDevCtr(ndr, "ctr", &r->ctr);
650         ndr->depth--;
651 }
652
653 static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfo0 *r)
654 {
655         if (ndr_flags & NDR_SCALARS) {
656                 NDR_CHECK(ndr_push_align(ndr, 4));
657                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->device));
658         }
659         if (ndr_flags & NDR_BUFFERS) {
660                 if (r->device) {
661                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16)));
662                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
663                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16)));
664                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16));
665                 }
666         }
667         return NDR_ERR_SUCCESS;
668 }
669
670 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfo0 *r)
671 {
672         uint32_t _ptr_device;
673         TALLOC_CTX *_mem_save_device_0;
674         if (ndr_flags & NDR_SCALARS) {
675                 NDR_CHECK(ndr_pull_align(ndr, 4));
676                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device));
677                 if (_ptr_device) {
678                         NDR_PULL_ALLOC(ndr, r->device);
679                 } else {
680                         r->device = NULL;
681                 }
682         }
683         if (ndr_flags & NDR_BUFFERS) {
684                 if (r->device) {
685                         _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr);
686                         NDR_PULL_SET_MEM_CTX(ndr, r->device, 0);
687                         NDR_CHECK(ndr_pull_array_size(ndr, &r->device));
688                         NDR_CHECK(ndr_pull_array_length(ndr, &r->device));
689                         if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) {
690                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device));
691                         }
692                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t)));
693                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16));
694                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0);
695                 }
696         }
697         return NDR_ERR_SUCCESS;
698 }
699
700 _PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo0 *r)
701 {
702         ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfo0");
703         ndr->depth++;
704         ndr_print_ptr(ndr, "device", r->device);
705         ndr->depth++;
706         if (r->device) {
707                 ndr_print_string(ndr, "device", r->device);
708         }
709         ndr->depth--;
710         ndr->depth--;
711 }
712
713 static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQCtr0 *r)
714 {
715         uint32_t cntr_array_1;
716         if (ndr_flags & NDR_SCALARS) {
717                 NDR_CHECK(ndr_push_align(ndr, 4));
718                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
719                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
720         }
721         if (ndr_flags & NDR_BUFFERS) {
722                 if (r->array) {
723                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
724                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
725                                 NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
726                         }
727                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
728                                 NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
729                         }
730                 }
731         }
732         return NDR_ERR_SUCCESS;
733 }
734
735 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQCtr0 *r)
736 {
737         uint32_t _ptr_array;
738         uint32_t cntr_array_1;
739         TALLOC_CTX *_mem_save_array_0;
740         TALLOC_CTX *_mem_save_array_1;
741         if (ndr_flags & NDR_SCALARS) {
742                 NDR_CHECK(ndr_pull_align(ndr, 4));
743                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
744                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
745                 if (_ptr_array) {
746                         NDR_PULL_ALLOC(ndr, r->array);
747                 } else {
748                         r->array = NULL;
749                 }
750         }
751         if (ndr_flags & NDR_BUFFERS) {
752                 if (r->array) {
753                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
754                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
755                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
756                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
757                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
758                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
759                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
760                                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
761                         }
762                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
763                                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
764                         }
765                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
766                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
767                 }
768                 if (r->array) {
769                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
770                 }
771         }
772         return NDR_ERR_SUCCESS;
773 }
774
775 _PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr0 *r)
776 {
777         uint32_t cntr_array_1;
778         ndr_print_struct(ndr, name, "srvsvc_NetCharDevQCtr0");
779         ndr->depth++;
780         ndr_print_uint32(ndr, "count", r->count);
781         ndr_print_ptr(ndr, "array", r->array);
782         ndr->depth++;
783         if (r->array) {
784                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
785                 ndr->depth++;
786                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
787                         char *idx_1=NULL;
788                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
789                                 ndr_print_srvsvc_NetCharDevQInfo0(ndr, "array", &r->array[cntr_array_1]);
790                                 free(idx_1);
791                         }
792                 }
793                 ndr->depth--;
794         }
795         ndr->depth--;
796         ndr->depth--;
797 }
798
799 static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfo1 *r)
800 {
801         if (ndr_flags & NDR_SCALARS) {
802                 NDR_CHECK(ndr_push_align(ndr, 4));
803                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->device));
804                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
805                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->devices));
806                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->users));
807                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_ahead));
808         }
809         if (ndr_flags & NDR_BUFFERS) {
810                 if (r->device) {
811                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16)));
812                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
813                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->device, CH_UTF16)));
814                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->device, ndr_charset_length(r->device, CH_UTF16), sizeof(uint16_t), CH_UTF16));
815                 }
816                 if (r->devices) {
817                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->devices, CH_UTF16)));
818                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
819                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->devices, CH_UTF16)));
820                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->devices, ndr_charset_length(r->devices, CH_UTF16), sizeof(uint16_t), CH_UTF16));
821                 }
822         }
823         return NDR_ERR_SUCCESS;
824 }
825
826 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfo1 *r)
827 {
828         uint32_t _ptr_device;
829         TALLOC_CTX *_mem_save_device_0;
830         uint32_t _ptr_devices;
831         TALLOC_CTX *_mem_save_devices_0;
832         if (ndr_flags & NDR_SCALARS) {
833                 NDR_CHECK(ndr_pull_align(ndr, 4));
834                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_device));
835                 if (_ptr_device) {
836                         NDR_PULL_ALLOC(ndr, r->device);
837                 } else {
838                         r->device = NULL;
839                 }
840                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
841                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devices));
842                 if (_ptr_devices) {
843                         NDR_PULL_ALLOC(ndr, r->devices);
844                 } else {
845                         r->devices = NULL;
846                 }
847                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->users));
848                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_ahead));
849         }
850         if (ndr_flags & NDR_BUFFERS) {
851                 if (r->device) {
852                         _mem_save_device_0 = NDR_PULL_GET_MEM_CTX(ndr);
853                         NDR_PULL_SET_MEM_CTX(ndr, r->device, 0);
854                         NDR_CHECK(ndr_pull_array_size(ndr, &r->device));
855                         NDR_CHECK(ndr_pull_array_length(ndr, &r->device));
856                         if (ndr_get_array_length(ndr, &r->device) > ndr_get_array_size(ndr, &r->device)) {
857                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->device), ndr_get_array_length(ndr, &r->device));
858                         }
859                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t)));
860                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->device, ndr_get_array_length(ndr, &r->device), sizeof(uint16_t), CH_UTF16));
861                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_device_0, 0);
862                 }
863                 if (r->devices) {
864                         _mem_save_devices_0 = NDR_PULL_GET_MEM_CTX(ndr);
865                         NDR_PULL_SET_MEM_CTX(ndr, r->devices, 0);
866                         NDR_CHECK(ndr_pull_array_size(ndr, &r->devices));
867                         NDR_CHECK(ndr_pull_array_length(ndr, &r->devices));
868                         if (ndr_get_array_length(ndr, &r->devices) > ndr_get_array_size(ndr, &r->devices)) {
869                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->devices), ndr_get_array_length(ndr, &r->devices));
870                         }
871                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->devices), sizeof(uint16_t)));
872                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->devices, ndr_get_array_length(ndr, &r->devices), sizeof(uint16_t), CH_UTF16));
873                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devices_0, 0);
874                 }
875         }
876         return NDR_ERR_SUCCESS;
877 }
878
879 _PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfo1 *r)
880 {
881         ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfo1");
882         ndr->depth++;
883         ndr_print_ptr(ndr, "device", r->device);
884         ndr->depth++;
885         if (r->device) {
886                 ndr_print_string(ndr, "device", r->device);
887         }
888         ndr->depth--;
889         ndr_print_uint32(ndr, "priority", r->priority);
890         ndr_print_ptr(ndr, "devices", r->devices);
891         ndr->depth++;
892         if (r->devices) {
893                 ndr_print_string(ndr, "devices", r->devices);
894         }
895         ndr->depth--;
896         ndr_print_uint32(ndr, "users", r->users);
897         ndr_print_uint32(ndr, "num_ahead", r->num_ahead);
898         ndr->depth--;
899 }
900
901 static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQCtr1 *r)
902 {
903         uint32_t cntr_array_1;
904         if (ndr_flags & NDR_SCALARS) {
905                 NDR_CHECK(ndr_push_align(ndr, 4));
906                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
907                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
908         }
909         if (ndr_flags & NDR_BUFFERS) {
910                 if (r->array) {
911                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
912                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
913                                 NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
914                         }
915                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
916                                 NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
917                         }
918                 }
919         }
920         return NDR_ERR_SUCCESS;
921 }
922
923 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQCtr1 *r)
924 {
925         uint32_t _ptr_array;
926         uint32_t cntr_array_1;
927         TALLOC_CTX *_mem_save_array_0;
928         TALLOC_CTX *_mem_save_array_1;
929         if (ndr_flags & NDR_SCALARS) {
930                 NDR_CHECK(ndr_pull_align(ndr, 4));
931                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
932                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
933                 if (_ptr_array) {
934                         NDR_PULL_ALLOC(ndr, r->array);
935                 } else {
936                         r->array = NULL;
937                 }
938         }
939         if (ndr_flags & NDR_BUFFERS) {
940                 if (r->array) {
941                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
942                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
943                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
944                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
945                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
946                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
947                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
948                                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
949                         }
950                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
951                                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
952                         }
953                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
954                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
955                 }
956                 if (r->array) {
957                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
958                 }
959         }
960         return NDR_ERR_SUCCESS;
961 }
962
963 _PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQCtr1 *r)
964 {
965         uint32_t cntr_array_1;
966         ndr_print_struct(ndr, name, "srvsvc_NetCharDevQCtr1");
967         ndr->depth++;
968         ndr_print_uint32(ndr, "count", r->count);
969         ndr_print_ptr(ndr, "array", r->array);
970         ndr->depth++;
971         if (r->array) {
972                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
973                 ndr->depth++;
974                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
975                         char *idx_1=NULL;
976                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
977                                 ndr_print_srvsvc_NetCharDevQInfo1(ndr, "array", &r->array[cntr_array_1]);
978                                 free(idx_1);
979                         }
980                 }
981                 ndr->depth--;
982         }
983         ndr->depth--;
984         ndr->depth--;
985 }
986
987 static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevQInfo *r)
988 {
989         if (ndr_flags & NDR_SCALARS) {
990                 int level = ndr_push_get_switch_value(ndr, r);
991                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
992                 switch (level) {
993                         case 0: {
994                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0));
995                         break; }
996
997                         case 1: {
998                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
999                         break; }
1000
1001                         default: {
1002                         break; }
1003
1004                 }
1005         }
1006         if (ndr_flags & NDR_BUFFERS) {
1007                 int level = ndr_push_get_switch_value(ndr, r);
1008                 switch (level) {
1009                         case 0:
1010                                 if (r->info0) {
1011                                         NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0));
1012                                 }
1013                         break;
1014
1015                         case 1:
1016                                 if (r->info1) {
1017                                         NDR_CHECK(ndr_push_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
1018                                 }
1019                         break;
1020
1021                         default:
1022                         break;
1023
1024                 }
1025         }
1026         return NDR_ERR_SUCCESS;
1027 }
1028
1029 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevQInfo *r)
1030 {
1031         int level;
1032         uint32_t _level;
1033         TALLOC_CTX *_mem_save_info0_0;
1034         TALLOC_CTX *_mem_save_info1_0;
1035         level = ndr_pull_get_switch_value(ndr, r);
1036         if (ndr_flags & NDR_SCALARS) {
1037                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
1038                 if (_level != level) {
1039                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1040                 }
1041                 switch (level) {
1042                         case 0: {
1043                                 uint32_t _ptr_info0;
1044                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0));
1045                                 if (_ptr_info0) {
1046                                         NDR_PULL_ALLOC(ndr, r->info0);
1047                                 } else {
1048                                         r->info0 = NULL;
1049                                 }
1050                         break; }
1051
1052                         case 1: {
1053                                 uint32_t _ptr_info1;
1054                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
1055                                 if (_ptr_info1) {
1056                                         NDR_PULL_ALLOC(ndr, r->info1);
1057                                 } else {
1058                                         r->info1 = NULL;
1059                                 }
1060                         break; }
1061
1062                         default: {
1063                         break; }
1064
1065                 }
1066         }
1067         if (ndr_flags & NDR_BUFFERS) {
1068                 switch (level) {
1069                         case 0:
1070                                 if (r->info0) {
1071                                         _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr);
1072                                         NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0);
1073                                         NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0));
1074                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0);
1075                                 }
1076                         break;
1077
1078                         case 1:
1079                                 if (r->info1) {
1080                                         _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1081                                         NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
1082                                         NDR_CHECK(ndr_pull_srvsvc_NetCharDevQInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
1083                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
1084                                 }
1085                         break;
1086
1087                         default:
1088                         break;
1089
1090                 }
1091         }
1092         return NDR_ERR_SUCCESS;
1093 }
1094
1095 _PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQInfo *r)
1096 {
1097         int level;
1098         level = ndr_print_get_switch_value(ndr, r);
1099         ndr_print_union(ndr, name, level, "srvsvc_NetCharDevQInfo");
1100         switch (level) {
1101                 case 0:
1102                         ndr_print_ptr(ndr, "info0", r->info0);
1103                         ndr->depth++;
1104                         if (r->info0) {
1105                                 ndr_print_srvsvc_NetCharDevQInfo0(ndr, "info0", r->info0);
1106                         }
1107                         ndr->depth--;
1108                 break;
1109
1110                 case 1:
1111                         ndr_print_ptr(ndr, "info1", r->info1);
1112                         ndr->depth++;
1113                         if (r->info1) {
1114                                 ndr_print_srvsvc_NetCharDevQInfo1(ndr, "info1", r->info1);
1115                         }
1116                         ndr->depth--;
1117                 break;
1118
1119                 default:
1120                 break;
1121
1122         }
1123 }
1124
1125 static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetCharDevQCtr *r)
1126 {
1127         if (ndr_flags & NDR_SCALARS) {
1128                 int level = ndr_push_get_switch_value(ndr, r);
1129                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
1130                 switch (level) {
1131                         case 0: {
1132                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0));
1133                         break; }
1134
1135                         case 1: {
1136                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1));
1137                         break; }
1138
1139                         default: {
1140                         break; }
1141
1142                 }
1143         }
1144         if (ndr_flags & NDR_BUFFERS) {
1145                 int level = ndr_push_get_switch_value(ndr, r);
1146                 switch (level) {
1147                         case 0:
1148                                 if (r->ctr0) {
1149                                         NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0));
1150                                 }
1151                         break;
1152
1153                         case 1:
1154                                 if (r->ctr1) {
1155                                         NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
1156                                 }
1157                         break;
1158
1159                         default:
1160                         break;
1161
1162                 }
1163         }
1164         return NDR_ERR_SUCCESS;
1165 }
1166
1167 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetCharDevQCtr *r)
1168 {
1169         int level;
1170         uint32_t _level;
1171         TALLOC_CTX *_mem_save_ctr0_0;
1172         TALLOC_CTX *_mem_save_ctr1_0;
1173         level = ndr_pull_get_switch_value(ndr, r);
1174         if (ndr_flags & NDR_SCALARS) {
1175                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
1176                 if (_level != level) {
1177                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1178                 }
1179                 switch (level) {
1180                         case 0: {
1181                                 uint32_t _ptr_ctr0;
1182                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0));
1183                                 if (_ptr_ctr0) {
1184                                         NDR_PULL_ALLOC(ndr, r->ctr0);
1185                                 } else {
1186                                         r->ctr0 = NULL;
1187                                 }
1188                         break; }
1189
1190                         case 1: {
1191                                 uint32_t _ptr_ctr1;
1192                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1));
1193                                 if (_ptr_ctr1) {
1194                                         NDR_PULL_ALLOC(ndr, r->ctr1);
1195                                 } else {
1196                                         r->ctr1 = NULL;
1197                                 }
1198                         break; }
1199
1200                         default: {
1201                         break; }
1202
1203                 }
1204         }
1205         if (ndr_flags & NDR_BUFFERS) {
1206                 switch (level) {
1207                         case 0:
1208                                 if (r->ctr0) {
1209                                         _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr);
1210                                         NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0);
1211                                         NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0));
1212                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0);
1213                                 }
1214                         break;
1215
1216                         case 1:
1217                                 if (r->ctr1) {
1218                                         _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1219                                         NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0);
1220                                         NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
1221                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0);
1222                                 }
1223                         break;
1224
1225                         default:
1226                         break;
1227
1228                 }
1229         }
1230         return NDR_ERR_SUCCESS;
1231 }
1232
1233 _PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetCharDevQCtr *r)
1234 {
1235         int level;
1236         level = ndr_print_get_switch_value(ndr, r);
1237         ndr_print_union(ndr, name, level, "srvsvc_NetCharDevQCtr");
1238         switch (level) {
1239                 case 0:
1240                         ndr_print_ptr(ndr, "ctr0", r->ctr0);
1241                         ndr->depth++;
1242                         if (r->ctr0) {
1243                                 ndr_print_srvsvc_NetCharDevQCtr0(ndr, "ctr0", r->ctr0);
1244                         }
1245                         ndr->depth--;
1246                 break;
1247
1248                 case 1:
1249                         ndr_print_ptr(ndr, "ctr1", r->ctr1);
1250                         ndr->depth++;
1251                         if (r->ctr1) {
1252                                 ndr_print_srvsvc_NetCharDevQCtr1(ndr, "ctr1", r->ctr1);
1253                         }
1254                         ndr->depth--;
1255                 break;
1256
1257                 default:
1258                 break;
1259
1260         }
1261 }
1262
1263 static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetCharDevQInfoCtr *r)
1264 {
1265         if (ndr_flags & NDR_SCALARS) {
1266                 NDR_CHECK(ndr_push_align(ndr, 4));
1267                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
1268                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level));
1269                 NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr(ndr, NDR_SCALARS, &r->ctr));
1270         }
1271         if (ndr_flags & NDR_BUFFERS) {
1272                 NDR_CHECK(ndr_push_srvsvc_NetCharDevQCtr(ndr, NDR_BUFFERS, &r->ctr));
1273         }
1274         return NDR_ERR_SUCCESS;
1275 }
1276
1277 static enum ndr_err_code ndr_pull_srvsvc_NetCharDevQInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetCharDevQInfoCtr *r)
1278 {
1279         if (ndr_flags & NDR_SCALARS) {
1280                 NDR_CHECK(ndr_pull_align(ndr, 4));
1281                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
1282                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level));
1283                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr(ndr, NDR_SCALARS, &r->ctr));
1284         }
1285         if (ndr_flags & NDR_BUFFERS) {
1286                 NDR_CHECK(ndr_pull_srvsvc_NetCharDevQCtr(ndr, NDR_BUFFERS, &r->ctr));
1287         }
1288         return NDR_ERR_SUCCESS;
1289 }
1290
1291 _PUBLIC_ void ndr_print_srvsvc_NetCharDevQInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetCharDevQInfoCtr *r)
1292 {
1293         ndr_print_struct(ndr, name, "srvsvc_NetCharDevQInfoCtr");
1294         ndr->depth++;
1295         ndr_print_uint32(ndr, "level", r->level);
1296         ndr_print_set_switch_value(ndr, &r->ctr, r->level);
1297         ndr_print_srvsvc_NetCharDevQCtr(ndr, "ctr", &r->ctr);
1298         ndr->depth--;
1299 }
1300
1301 static enum ndr_err_code ndr_push_srvsvc_NetConnInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfo0 *r)
1302 {
1303         if (ndr_flags & NDR_SCALARS) {
1304                 NDR_CHECK(ndr_push_align(ndr, 4));
1305                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_id));
1306         }
1307         if (ndr_flags & NDR_BUFFERS) {
1308         }
1309         return NDR_ERR_SUCCESS;
1310 }
1311
1312 static enum ndr_err_code ndr_pull_srvsvc_NetConnInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfo0 *r)
1313 {
1314         if (ndr_flags & NDR_SCALARS) {
1315                 NDR_CHECK(ndr_pull_align(ndr, 4));
1316                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_id));
1317         }
1318         if (ndr_flags & NDR_BUFFERS) {
1319         }
1320         return NDR_ERR_SUCCESS;
1321 }
1322
1323 _PUBLIC_ void ndr_print_srvsvc_NetConnInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo0 *r)
1324 {
1325         ndr_print_struct(ndr, name, "srvsvc_NetConnInfo0");
1326         ndr->depth++;
1327         ndr_print_uint32(ndr, "conn_id", r->conn_id);
1328         ndr->depth--;
1329 }
1330
1331 static enum ndr_err_code ndr_push_srvsvc_NetConnCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnCtr0 *r)
1332 {
1333         uint32_t cntr_array_1;
1334         if (ndr_flags & NDR_SCALARS) {
1335                 NDR_CHECK(ndr_push_align(ndr, 4));
1336                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1337                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
1338         }
1339         if (ndr_flags & NDR_BUFFERS) {
1340                 if (r->array) {
1341                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1342                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
1343                                 NDR_CHECK(ndr_push_srvsvc_NetConnInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
1344                         }
1345                 }
1346         }
1347         return NDR_ERR_SUCCESS;
1348 }
1349
1350 static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnCtr0 *r)
1351 {
1352         uint32_t _ptr_array;
1353         uint32_t cntr_array_1;
1354         TALLOC_CTX *_mem_save_array_0;
1355         TALLOC_CTX *_mem_save_array_1;
1356         if (ndr_flags & NDR_SCALARS) {
1357                 NDR_CHECK(ndr_pull_align(ndr, 4));
1358                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1359                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
1360                 if (_ptr_array) {
1361                         NDR_PULL_ALLOC(ndr, r->array);
1362                 } else {
1363                         r->array = NULL;
1364                 }
1365         }
1366         if (ndr_flags & NDR_BUFFERS) {
1367                 if (r->array) {
1368                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
1369                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
1370                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
1371                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
1372                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
1373                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
1374                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
1375                                 NDR_CHECK(ndr_pull_srvsvc_NetConnInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
1376                         }
1377                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
1378                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
1379                 }
1380                 if (r->array) {
1381                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
1382                 }
1383         }
1384         return NDR_ERR_SUCCESS;
1385 }
1386
1387 _PUBLIC_ void ndr_print_srvsvc_NetConnCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr0 *r)
1388 {
1389         uint32_t cntr_array_1;
1390         ndr_print_struct(ndr, name, "srvsvc_NetConnCtr0");
1391         ndr->depth++;
1392         ndr_print_uint32(ndr, "count", r->count);
1393         ndr_print_ptr(ndr, "array", r->array);
1394         ndr->depth++;
1395         if (r->array) {
1396                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
1397                 ndr->depth++;
1398                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
1399                         char *idx_1=NULL;
1400                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
1401                                 ndr_print_srvsvc_NetConnInfo0(ndr, "array", &r->array[cntr_array_1]);
1402                                 free(idx_1);
1403                         }
1404                 }
1405                 ndr->depth--;
1406         }
1407         ndr->depth--;
1408         ndr->depth--;
1409 }
1410
1411 static enum ndr_err_code ndr_push_srvsvc_NetConnInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfo1 *r)
1412 {
1413         if (ndr_flags & NDR_SCALARS) {
1414                 NDR_CHECK(ndr_push_align(ndr, 4));
1415                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_id));
1416                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_type));
1417                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open));
1418                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_users));
1419                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->conn_time));
1420                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
1421                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->share));
1422         }
1423         if (ndr_flags & NDR_BUFFERS) {
1424                 if (r->user) {
1425                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
1426                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1427                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
1428                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1429                 }
1430                 if (r->share) {
1431                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16)));
1432                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1433                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->share, CH_UTF16)));
1434                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->share, ndr_charset_length(r->share, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1435                 }
1436         }
1437         return NDR_ERR_SUCCESS;
1438 }
1439
1440 static enum ndr_err_code ndr_pull_srvsvc_NetConnInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfo1 *r)
1441 {
1442         uint32_t _ptr_user;
1443         TALLOC_CTX *_mem_save_user_0;
1444         uint32_t _ptr_share;
1445         TALLOC_CTX *_mem_save_share_0;
1446         if (ndr_flags & NDR_SCALARS) {
1447                 NDR_CHECK(ndr_pull_align(ndr, 4));
1448                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_id));
1449                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_type));
1450                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open));
1451                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_users));
1452                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->conn_time));
1453                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
1454                 if (_ptr_user) {
1455                         NDR_PULL_ALLOC(ndr, r->user);
1456                 } else {
1457                         r->user = NULL;
1458                 }
1459                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share));
1460                 if (_ptr_share) {
1461                         NDR_PULL_ALLOC(ndr, r->share);
1462                 } else {
1463                         r->share = NULL;
1464                 }
1465         }
1466         if (ndr_flags & NDR_BUFFERS) {
1467                 if (r->user) {
1468                         _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
1469                         NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
1470                         NDR_CHECK(ndr_pull_array_size(ndr, &r->user));
1471                         NDR_CHECK(ndr_pull_array_length(ndr, &r->user));
1472                         if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) {
1473                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user));
1474                         }
1475                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t)));
1476                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16));
1477                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
1478                 }
1479                 if (r->share) {
1480                         _mem_save_share_0 = NDR_PULL_GET_MEM_CTX(ndr);
1481                         NDR_PULL_SET_MEM_CTX(ndr, r->share, 0);
1482                         NDR_CHECK(ndr_pull_array_size(ndr, &r->share));
1483                         NDR_CHECK(ndr_pull_array_length(ndr, &r->share));
1484                         if (ndr_get_array_length(ndr, &r->share) > ndr_get_array_size(ndr, &r->share)) {
1485                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->share), ndr_get_array_length(ndr, &r->share));
1486                         }
1487                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t)));
1488                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->share, ndr_get_array_length(ndr, &r->share), sizeof(uint16_t), CH_UTF16));
1489                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_0, 0);
1490                 }
1491         }
1492         return NDR_ERR_SUCCESS;
1493 }
1494
1495 _PUBLIC_ void ndr_print_srvsvc_NetConnInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfo1 *r)
1496 {
1497         ndr_print_struct(ndr, name, "srvsvc_NetConnInfo1");
1498         ndr->depth++;
1499         ndr_print_uint32(ndr, "conn_id", r->conn_id);
1500         ndr_print_uint32(ndr, "conn_type", r->conn_type);
1501         ndr_print_uint32(ndr, "num_open", r->num_open);
1502         ndr_print_uint32(ndr, "num_users", r->num_users);
1503         ndr_print_uint32(ndr, "conn_time", r->conn_time);
1504         ndr_print_ptr(ndr, "user", r->user);
1505         ndr->depth++;
1506         if (r->user) {
1507                 ndr_print_string(ndr, "user", r->user);
1508         }
1509         ndr->depth--;
1510         ndr_print_ptr(ndr, "share", r->share);
1511         ndr->depth++;
1512         if (r->share) {
1513                 ndr_print_string(ndr, "share", r->share);
1514         }
1515         ndr->depth--;
1516         ndr->depth--;
1517 }
1518
1519 static enum ndr_err_code ndr_push_srvsvc_NetConnCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnCtr1 *r)
1520 {
1521         uint32_t cntr_array_1;
1522         if (ndr_flags & NDR_SCALARS) {
1523                 NDR_CHECK(ndr_push_align(ndr, 4));
1524                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1525                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
1526         }
1527         if (ndr_flags & NDR_BUFFERS) {
1528                 if (r->array) {
1529                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1530                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
1531                                 NDR_CHECK(ndr_push_srvsvc_NetConnInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
1532                         }
1533                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
1534                                 NDR_CHECK(ndr_push_srvsvc_NetConnInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
1535                         }
1536                 }
1537         }
1538         return NDR_ERR_SUCCESS;
1539 }
1540
1541 static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnCtr1 *r)
1542 {
1543         uint32_t _ptr_array;
1544         uint32_t cntr_array_1;
1545         TALLOC_CTX *_mem_save_array_0;
1546         TALLOC_CTX *_mem_save_array_1;
1547         if (ndr_flags & NDR_SCALARS) {
1548                 NDR_CHECK(ndr_pull_align(ndr, 4));
1549                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1550                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
1551                 if (_ptr_array) {
1552                         NDR_PULL_ALLOC(ndr, r->array);
1553                 } else {
1554                         r->array = NULL;
1555                 }
1556         }
1557         if (ndr_flags & NDR_BUFFERS) {
1558                 if (r->array) {
1559                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
1560                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
1561                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
1562                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
1563                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
1564                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
1565                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
1566                                 NDR_CHECK(ndr_pull_srvsvc_NetConnInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
1567                         }
1568                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
1569                                 NDR_CHECK(ndr_pull_srvsvc_NetConnInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
1570                         }
1571                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
1572                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
1573                 }
1574                 if (r->array) {
1575                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
1576                 }
1577         }
1578         return NDR_ERR_SUCCESS;
1579 }
1580
1581 _PUBLIC_ void ndr_print_srvsvc_NetConnCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnCtr1 *r)
1582 {
1583         uint32_t cntr_array_1;
1584         ndr_print_struct(ndr, name, "srvsvc_NetConnCtr1");
1585         ndr->depth++;
1586         ndr_print_uint32(ndr, "count", r->count);
1587         ndr_print_ptr(ndr, "array", r->array);
1588         ndr->depth++;
1589         if (r->array) {
1590                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
1591                 ndr->depth++;
1592                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
1593                         char *idx_1=NULL;
1594                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
1595                                 ndr_print_srvsvc_NetConnInfo1(ndr, "array", &r->array[cntr_array_1]);
1596                                 free(idx_1);
1597                         }
1598                 }
1599                 ndr->depth--;
1600         }
1601         ndr->depth--;
1602         ndr->depth--;
1603 }
1604
1605 static enum ndr_err_code ndr_push_srvsvc_NetConnCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetConnCtr *r)
1606 {
1607         if (ndr_flags & NDR_SCALARS) {
1608                 int level = ndr_push_get_switch_value(ndr, r);
1609                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
1610                 switch (level) {
1611                         case 0: {
1612                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0));
1613                         break; }
1614
1615                         case 1: {
1616                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1));
1617                         break; }
1618
1619                         default: {
1620                         break; }
1621
1622                 }
1623         }
1624         if (ndr_flags & NDR_BUFFERS) {
1625                 int level = ndr_push_get_switch_value(ndr, r);
1626                 switch (level) {
1627                         case 0:
1628                                 if (r->ctr0) {
1629                                         NDR_CHECK(ndr_push_srvsvc_NetConnCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0));
1630                                 }
1631                         break;
1632
1633                         case 1:
1634                                 if (r->ctr1) {
1635                                         NDR_CHECK(ndr_push_srvsvc_NetConnCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
1636                                 }
1637                         break;
1638
1639                         default:
1640                         break;
1641
1642                 }
1643         }
1644         return NDR_ERR_SUCCESS;
1645 }
1646
1647 static enum ndr_err_code ndr_pull_srvsvc_NetConnCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetConnCtr *r)
1648 {
1649         int level;
1650         uint32_t _level;
1651         TALLOC_CTX *_mem_save_ctr0_0;
1652         TALLOC_CTX *_mem_save_ctr1_0;
1653         level = ndr_pull_get_switch_value(ndr, r);
1654         if (ndr_flags & NDR_SCALARS) {
1655                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
1656                 if (_level != level) {
1657                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1658                 }
1659                 switch (level) {
1660                         case 0: {
1661                                 uint32_t _ptr_ctr0;
1662                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr0));
1663                                 if (_ptr_ctr0) {
1664                                         NDR_PULL_ALLOC(ndr, r->ctr0);
1665                                 } else {
1666                                         r->ctr0 = NULL;
1667                                 }
1668                         break; }
1669
1670                         case 1: {
1671                                 uint32_t _ptr_ctr1;
1672                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1));
1673                                 if (_ptr_ctr1) {
1674                                         NDR_PULL_ALLOC(ndr, r->ctr1);
1675                                 } else {
1676                                         r->ctr1 = NULL;
1677                                 }
1678                         break; }
1679
1680                         default: {
1681                         break; }
1682
1683                 }
1684         }
1685         if (ndr_flags & NDR_BUFFERS) {
1686                 switch (level) {
1687                         case 0:
1688                                 if (r->ctr0) {
1689                                         _mem_save_ctr0_0 = NDR_PULL_GET_MEM_CTX(ndr);
1690                                         NDR_PULL_SET_MEM_CTX(ndr, r->ctr0, 0);
1691                                         NDR_CHECK(ndr_pull_srvsvc_NetConnCtr0(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr0));
1692                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr0_0, 0);
1693                                 }
1694                         break;
1695
1696                         case 1:
1697                                 if (r->ctr1) {
1698                                         _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1699                                         NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0);
1700                                         NDR_CHECK(ndr_pull_srvsvc_NetConnCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
1701                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0);
1702                                 }
1703                         break;
1704
1705                         default:
1706                         break;
1707
1708                 }
1709         }
1710         return NDR_ERR_SUCCESS;
1711 }
1712
1713 _PUBLIC_ void ndr_print_srvsvc_NetConnCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetConnCtr *r)
1714 {
1715         int level;
1716         level = ndr_print_get_switch_value(ndr, r);
1717         ndr_print_union(ndr, name, level, "srvsvc_NetConnCtr");
1718         switch (level) {
1719                 case 0:
1720                         ndr_print_ptr(ndr, "ctr0", r->ctr0);
1721                         ndr->depth++;
1722                         if (r->ctr0) {
1723                                 ndr_print_srvsvc_NetConnCtr0(ndr, "ctr0", r->ctr0);
1724                         }
1725                         ndr->depth--;
1726                 break;
1727
1728                 case 1:
1729                         ndr_print_ptr(ndr, "ctr1", r->ctr1);
1730                         ndr->depth++;
1731                         if (r->ctr1) {
1732                                 ndr_print_srvsvc_NetConnCtr1(ndr, "ctr1", r->ctr1);
1733                         }
1734                         ndr->depth--;
1735                 break;
1736
1737                 default:
1738                 break;
1739
1740         }
1741 }
1742
1743 static enum ndr_err_code ndr_push_srvsvc_NetConnInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetConnInfoCtr *r)
1744 {
1745         if (ndr_flags & NDR_SCALARS) {
1746                 NDR_CHECK(ndr_push_align(ndr, 4));
1747                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
1748                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level));
1749                 NDR_CHECK(ndr_push_srvsvc_NetConnCtr(ndr, NDR_SCALARS, &r->ctr));
1750         }
1751         if (ndr_flags & NDR_BUFFERS) {
1752                 NDR_CHECK(ndr_push_srvsvc_NetConnCtr(ndr, NDR_BUFFERS, &r->ctr));
1753         }
1754         return NDR_ERR_SUCCESS;
1755 }
1756
1757 static enum ndr_err_code ndr_pull_srvsvc_NetConnInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetConnInfoCtr *r)
1758 {
1759         if (ndr_flags & NDR_SCALARS) {
1760                 NDR_CHECK(ndr_pull_align(ndr, 4));
1761                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
1762                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level));
1763                 NDR_CHECK(ndr_pull_srvsvc_NetConnCtr(ndr, NDR_SCALARS, &r->ctr));
1764         }
1765         if (ndr_flags & NDR_BUFFERS) {
1766                 NDR_CHECK(ndr_pull_srvsvc_NetConnCtr(ndr, NDR_BUFFERS, &r->ctr));
1767         }
1768         return NDR_ERR_SUCCESS;
1769 }
1770
1771 _PUBLIC_ void ndr_print_srvsvc_NetConnInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetConnInfoCtr *r)
1772 {
1773         ndr_print_struct(ndr, name, "srvsvc_NetConnInfoCtr");
1774         ndr->depth++;
1775         ndr_print_uint32(ndr, "level", r->level);
1776         ndr_print_set_switch_value(ndr, &r->ctr, r->level);
1777         ndr_print_srvsvc_NetConnCtr(ndr, "ctr", &r->ctr);
1778         ndr->depth--;
1779 }
1780
1781 static enum ndr_err_code ndr_push_srvsvc_NetFileInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfo2 *r)
1782 {
1783         if (ndr_flags & NDR_SCALARS) {
1784                 NDR_CHECK(ndr_push_align(ndr, 4));
1785                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->fid));
1786         }
1787         if (ndr_flags & NDR_BUFFERS) {
1788         }
1789         return NDR_ERR_SUCCESS;
1790 }
1791
1792 static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfo2 *r)
1793 {
1794         if (ndr_flags & NDR_SCALARS) {
1795                 NDR_CHECK(ndr_pull_align(ndr, 4));
1796                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->fid));
1797         }
1798         if (ndr_flags & NDR_BUFFERS) {
1799         }
1800         return NDR_ERR_SUCCESS;
1801 }
1802
1803 _PUBLIC_ void ndr_print_srvsvc_NetFileInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo2 *r)
1804 {
1805         ndr_print_struct(ndr, name, "srvsvc_NetFileInfo2");
1806         ndr->depth++;
1807         ndr_print_uint32(ndr, "fid", r->fid);
1808         ndr->depth--;
1809 }
1810
1811 static enum ndr_err_code ndr_push_srvsvc_NetFileCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileCtr2 *r)
1812 {
1813         uint32_t cntr_array_1;
1814         if (ndr_flags & NDR_SCALARS) {
1815                 NDR_CHECK(ndr_push_align(ndr, 4));
1816                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1817                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
1818         }
1819         if (ndr_flags & NDR_BUFFERS) {
1820                 if (r->array) {
1821                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1822                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
1823                                 NDR_CHECK(ndr_push_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
1824                         }
1825                 }
1826         }
1827         return NDR_ERR_SUCCESS;
1828 }
1829
1830 static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileCtr2 *r)
1831 {
1832         uint32_t _ptr_array;
1833         uint32_t cntr_array_1;
1834         TALLOC_CTX *_mem_save_array_0;
1835         TALLOC_CTX *_mem_save_array_1;
1836         if (ndr_flags & NDR_SCALARS) {
1837                 NDR_CHECK(ndr_pull_align(ndr, 4));
1838                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1839                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
1840                 if (_ptr_array) {
1841                         NDR_PULL_ALLOC(ndr, r->array);
1842                 } else {
1843                         r->array = NULL;
1844                 }
1845         }
1846         if (ndr_flags & NDR_BUFFERS) {
1847                 if (r->array) {
1848                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
1849                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
1850                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
1851                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
1852                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
1853                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
1854                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
1855                                 NDR_CHECK(ndr_pull_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
1856                         }
1857                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
1858                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
1859                 }
1860                 if (r->array) {
1861                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
1862                 }
1863         }
1864         return NDR_ERR_SUCCESS;
1865 }
1866
1867 _PUBLIC_ void ndr_print_srvsvc_NetFileCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr2 *r)
1868 {
1869         uint32_t cntr_array_1;
1870         ndr_print_struct(ndr, name, "srvsvc_NetFileCtr2");
1871         ndr->depth++;
1872         ndr_print_uint32(ndr, "count", r->count);
1873         ndr_print_ptr(ndr, "array", r->array);
1874         ndr->depth++;
1875         if (r->array) {
1876                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
1877                 ndr->depth++;
1878                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
1879                         char *idx_1=NULL;
1880                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
1881                                 ndr_print_srvsvc_NetFileInfo2(ndr, "array", &r->array[cntr_array_1]);
1882                                 free(idx_1);
1883                         }
1884                 }
1885                 ndr->depth--;
1886         }
1887         ndr->depth--;
1888         ndr->depth--;
1889 }
1890
1891 static enum ndr_err_code ndr_push_srvsvc_NetFileInfo3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfo3 *r)
1892 {
1893         if (ndr_flags & NDR_SCALARS) {
1894                 NDR_CHECK(ndr_push_align(ndr, 4));
1895                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->fid));
1896                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->permissions));
1897                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_locks));
1898                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->path));
1899                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
1900         }
1901         if (ndr_flags & NDR_BUFFERS) {
1902                 if (r->path) {
1903                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16)));
1904                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1905                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->path, CH_UTF16)));
1906                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->path, ndr_charset_length(r->path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1907                 }
1908                 if (r->user) {
1909                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
1910                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1911                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
1912                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1913                 }
1914         }
1915         return NDR_ERR_SUCCESS;
1916 }
1917
1918 static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfo3 *r)
1919 {
1920         uint32_t _ptr_path;
1921         TALLOC_CTX *_mem_save_path_0;
1922         uint32_t _ptr_user;
1923         TALLOC_CTX *_mem_save_user_0;
1924         if (ndr_flags & NDR_SCALARS) {
1925                 NDR_CHECK(ndr_pull_align(ndr, 4));
1926                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->fid));
1927                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->permissions));
1928                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_locks));
1929                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_path));
1930                 if (_ptr_path) {
1931                         NDR_PULL_ALLOC(ndr, r->path);
1932                 } else {
1933                         r->path = NULL;
1934                 }
1935                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
1936                 if (_ptr_user) {
1937                         NDR_PULL_ALLOC(ndr, r->user);
1938                 } else {
1939                         r->user = NULL;
1940                 }
1941         }
1942         if (ndr_flags & NDR_BUFFERS) {
1943                 if (r->path) {
1944                         _mem_save_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
1945                         NDR_PULL_SET_MEM_CTX(ndr, r->path, 0);
1946                         NDR_CHECK(ndr_pull_array_size(ndr, &r->path));
1947                         NDR_CHECK(ndr_pull_array_length(ndr, &r->path));
1948                         if (ndr_get_array_length(ndr, &r->path) > ndr_get_array_size(ndr, &r->path)) {
1949                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->path), ndr_get_array_length(ndr, &r->path));
1950                         }
1951                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t)));
1952                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->path, ndr_get_array_length(ndr, &r->path), sizeof(uint16_t), CH_UTF16));
1953                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_path_0, 0);
1954                 }
1955                 if (r->user) {
1956                         _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
1957                         NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
1958                         NDR_CHECK(ndr_pull_array_size(ndr, &r->user));
1959                         NDR_CHECK(ndr_pull_array_length(ndr, &r->user));
1960                         if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) {
1961                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user));
1962                         }
1963                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t)));
1964                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16));
1965                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
1966                 }
1967         }
1968         return NDR_ERR_SUCCESS;
1969 }
1970
1971 _PUBLIC_ void ndr_print_srvsvc_NetFileInfo3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfo3 *r)
1972 {
1973         ndr_print_struct(ndr, name, "srvsvc_NetFileInfo3");
1974         ndr->depth++;
1975         ndr_print_uint32(ndr, "fid", r->fid);
1976         ndr_print_uint32(ndr, "permissions", r->permissions);
1977         ndr_print_uint32(ndr, "num_locks", r->num_locks);
1978         ndr_print_ptr(ndr, "path", r->path);
1979         ndr->depth++;
1980         if (r->path) {
1981                 ndr_print_string(ndr, "path", r->path);
1982         }
1983         ndr->depth--;
1984         ndr_print_ptr(ndr, "user", r->user);
1985         ndr->depth++;
1986         if (r->user) {
1987                 ndr_print_string(ndr, "user", r->user);
1988         }
1989         ndr->depth--;
1990         ndr->depth--;
1991 }
1992
1993 static enum ndr_err_code ndr_push_srvsvc_NetFileCtr3(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileCtr3 *r)
1994 {
1995         uint32_t cntr_array_1;
1996         if (ndr_flags & NDR_SCALARS) {
1997                 NDR_CHECK(ndr_push_align(ndr, 4));
1998                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1999                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
2000         }
2001         if (ndr_flags & NDR_BUFFERS) {
2002                 if (r->array) {
2003                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2004                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2005                                 NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
2006                         }
2007                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2008                                 NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
2009                         }
2010                 }
2011         }
2012         return NDR_ERR_SUCCESS;
2013 }
2014
2015 static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr3(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileCtr3 *r)
2016 {
2017         uint32_t _ptr_array;
2018         uint32_t cntr_array_1;
2019         TALLOC_CTX *_mem_save_array_0;
2020         TALLOC_CTX *_mem_save_array_1;
2021         if (ndr_flags & NDR_SCALARS) {
2022                 NDR_CHECK(ndr_pull_align(ndr, 4));
2023                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2024                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
2025                 if (_ptr_array) {
2026                         NDR_PULL_ALLOC(ndr, r->array);
2027                 } else {
2028                         r->array = NULL;
2029                 }
2030         }
2031         if (ndr_flags & NDR_BUFFERS) {
2032                 if (r->array) {
2033                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
2034                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
2035                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
2036                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
2037                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
2038                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
2039                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2040                                 NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
2041                         }
2042                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2043                                 NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
2044                         }
2045                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
2046                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
2047                 }
2048                 if (r->array) {
2049                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
2050                 }
2051         }
2052         return NDR_ERR_SUCCESS;
2053 }
2054
2055 _PUBLIC_ void ndr_print_srvsvc_NetFileCtr3(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileCtr3 *r)
2056 {
2057         uint32_t cntr_array_1;
2058         ndr_print_struct(ndr, name, "srvsvc_NetFileCtr3");
2059         ndr->depth++;
2060         ndr_print_uint32(ndr, "count", r->count);
2061         ndr_print_ptr(ndr, "array", r->array);
2062         ndr->depth++;
2063         if (r->array) {
2064                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
2065                 ndr->depth++;
2066                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
2067                         char *idx_1=NULL;
2068                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
2069                                 ndr_print_srvsvc_NetFileInfo3(ndr, "array", &r->array[cntr_array_1]);
2070                                 free(idx_1);
2071                         }
2072                 }
2073                 ndr->depth--;
2074         }
2075         ndr->depth--;
2076         ndr->depth--;
2077 }
2078
2079 static enum ndr_err_code ndr_push_srvsvc_NetFileInfo(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetFileInfo *r)
2080 {
2081         if (ndr_flags & NDR_SCALARS) {
2082                 int level = ndr_push_get_switch_value(ndr, r);
2083                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
2084                 switch (level) {
2085                         case 2: {
2086                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
2087                         break; }
2088
2089                         case 3: {
2090                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3));
2091                         break; }
2092
2093                         default: {
2094                         break; }
2095
2096                 }
2097         }
2098         if (ndr_flags & NDR_BUFFERS) {
2099                 int level = ndr_push_get_switch_value(ndr, r);
2100                 switch (level) {
2101                         case 2:
2102                                 if (r->info2) {
2103                                         NDR_CHECK(ndr_push_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, r->info2));
2104                                 }
2105                         break;
2106
2107                         case 3:
2108                                 if (r->info3) {
2109                                         NDR_CHECK(ndr_push_srvsvc_NetFileInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3));
2110                                 }
2111                         break;
2112
2113                         default:
2114                         break;
2115
2116                 }
2117         }
2118         return NDR_ERR_SUCCESS;
2119 }
2120
2121 static enum ndr_err_code ndr_pull_srvsvc_NetFileInfo(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetFileInfo *r)
2122 {
2123         int level;
2124         uint32_t _level;
2125         TALLOC_CTX *_mem_save_info2_0;
2126         TALLOC_CTX *_mem_save_info3_0;
2127         level = ndr_pull_get_switch_value(ndr, r);
2128         if (ndr_flags & NDR_SCALARS) {
2129                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
2130                 if (_level != level) {
2131                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
2132                 }
2133                 switch (level) {
2134                         case 2: {
2135                                 uint32_t _ptr_info2;
2136                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2));
2137                                 if (_ptr_info2) {
2138                                         NDR_PULL_ALLOC(ndr, r->info2);
2139                                 } else {
2140                                         r->info2 = NULL;
2141                                 }
2142                         break; }
2143
2144                         case 3: {
2145                                 uint32_t _ptr_info3;
2146                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3));
2147                                 if (_ptr_info3) {
2148                                         NDR_PULL_ALLOC(ndr, r->info3);
2149                                 } else {
2150                                         r->info3 = NULL;
2151                                 }
2152                         break; }
2153
2154                         default: {
2155                         break; }
2156
2157                 }
2158         }
2159         if (ndr_flags & NDR_BUFFERS) {
2160                 switch (level) {
2161                         case 2:
2162                                 if (r->info2) {
2163                                         _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr);
2164                                         NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0);
2165                                         NDR_CHECK(ndr_pull_srvsvc_NetFileInfo2(ndr, NDR_SCALARS, r->info2));
2166                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0);
2167                                 }
2168                         break;
2169
2170                         case 3:
2171                                 if (r->info3) {
2172                                         _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
2173                                         NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0);
2174                                         NDR_CHECK(ndr_pull_srvsvc_NetFileInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3));
2175                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0);
2176                                 }
2177                         break;
2178
2179                         default:
2180                         break;
2181
2182                 }
2183         }
2184         return NDR_ERR_SUCCESS;
2185 }
2186
2187 _PUBLIC_ void ndr_print_srvsvc_NetFileInfo(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileInfo *r)
2188 {
2189         int level;
2190         level = ndr_print_get_switch_value(ndr, r);
2191         ndr_print_union(ndr, name, level, "srvsvc_NetFileInfo");
2192         switch (level) {
2193                 case 2:
2194                         ndr_print_ptr(ndr, "info2", r->info2);
2195                         ndr->depth++;
2196                         if (r->info2) {
2197                                 ndr_print_srvsvc_NetFileInfo2(ndr, "info2", r->info2);
2198                         }
2199                         ndr->depth--;
2200                 break;
2201
2202                 case 3:
2203                         ndr_print_ptr(ndr, "info3", r->info3);
2204                         ndr->depth++;
2205                         if (r->info3) {
2206                                 ndr_print_srvsvc_NetFileInfo3(ndr, "info3", r->info3);
2207                         }
2208                         ndr->depth--;
2209                 break;
2210
2211                 default:
2212                 break;
2213
2214         }
2215 }
2216
2217 static enum ndr_err_code ndr_push_srvsvc_NetFileCtr(struct ndr_push *ndr, int ndr_flags, const union srvsvc_NetFileCtr *r)
2218 {
2219         if (ndr_flags & NDR_SCALARS) {
2220                 int level = ndr_push_get_switch_value(ndr, r);
2221                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
2222                 switch (level) {
2223                         case 2: {
2224                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2));
2225                         break; }
2226
2227                         case 3: {
2228                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr3));
2229                         break; }
2230
2231                         default: {
2232                         break; }
2233
2234                 }
2235         }
2236         if (ndr_flags & NDR_BUFFERS) {
2237                 int level = ndr_push_get_switch_value(ndr, r);
2238                 switch (level) {
2239                         case 2:
2240                                 if (r->ctr2) {
2241                                         NDR_CHECK(ndr_push_srvsvc_NetFileCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2));
2242                                 }
2243                         break;
2244
2245                         case 3:
2246                                 if (r->ctr3) {
2247                                         NDR_CHECK(ndr_push_srvsvc_NetFileCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3));
2248                                 }
2249                         break;
2250
2251                         default:
2252                         break;
2253
2254                 }
2255         }
2256         return NDR_ERR_SUCCESS;
2257 }
2258
2259 static enum ndr_err_code ndr_pull_srvsvc_NetFileCtr(struct ndr_pull *ndr, int ndr_flags, union srvsvc_NetFileCtr *r)
2260 {
2261         int level;
2262         uint32_t _level;
2263         TALLOC_CTX *_mem_save_ctr2_0;
2264         TALLOC_CTX *_mem_save_ctr3_0;
2265         level = ndr_pull_get_switch_value(ndr, r);
2266         if (ndr_flags & NDR_SCALARS) {
2267                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
2268                 if (_level != level) {
2269                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
2270                 }
2271                 switch (level) {
2272                         case 2: {
2273                                 uint32_t _ptr_ctr2;
2274                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr2));
2275                                 if (_ptr_ctr2) {
2276                                         NDR_PULL_ALLOC(ndr, r->ctr2);
2277                                 } else {
2278                                         r->ctr2 = NULL;
2279                                 }
2280                         break; }
2281
2282                         case 3: {
2283                                 uint32_t _ptr_ctr3;
2284                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr3));
2285                                 if (_ptr_ctr3) {
2286                                         NDR_PULL_ALLOC(ndr, r->ctr3);
2287                                 } else {
2288                                         r->ctr3 = NULL;
2289                                 }
2290                         break; }
2291
2292                         default: {
2293                         break; }
2294
2295                 }
2296         }
2297         if (ndr_flags & NDR_BUFFERS) {
2298                 switch (level) {
2299                         case 2:
2300                                 if (r->ctr2) {
2301                                         _mem_save_ctr2_0 = NDR_PULL_GET_MEM_CTX(ndr);
2302                                         NDR_PULL_SET_MEM_CTX(ndr, r->ctr2, 0);
2303                                         NDR_CHECK(ndr_pull_srvsvc_NetFileCtr2(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr2));
2304                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr2_0, 0);
2305                                 }
2306                         break;
2307
2308                         case 3:
2309                                 if (r->ctr3) {
2310                                         _mem_save_ctr3_0 = NDR_PULL_GET_MEM_CTX(ndr);
2311                                         NDR_PULL_SET_MEM_CTX(ndr, r->ctr3, 0);
2312                                         NDR_CHECK(ndr_pull_srvsvc_NetFileCtr3(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr3));
2313                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr3_0, 0);
2314                                 }
2315                         break;
2316
2317                         default:
2318                         break;
2319
2320                 }
2321         }
2322         return NDR_ERR_SUCCESS;
2323 }
2324
2325 _PUBLIC_ void ndr_print_srvsvc_NetFileCtr(struct ndr_print *ndr, const char *name, const union srvsvc_NetFileCtr *r)
2326 {
2327         int level;
2328         level = ndr_print_get_switch_value(ndr, r);
2329         ndr_print_union(ndr, name, level, "srvsvc_NetFileCtr");
2330         switch (level) {
2331                 case 2:
2332                         ndr_print_ptr(ndr, "ctr2", r->ctr2);
2333                         ndr->depth++;
2334                         if (r->ctr2) {
2335                                 ndr_print_srvsvc_NetFileCtr2(ndr, "ctr2", r->ctr2);
2336                         }
2337                         ndr->depth--;
2338                 break;
2339
2340                 case 3:
2341                         ndr_print_ptr(ndr, "ctr3", r->ctr3);
2342                         ndr->depth++;
2343                         if (r->ctr3) {
2344                                 ndr_print_srvsvc_NetFileCtr3(ndr, "ctr3", r->ctr3);
2345                         }
2346                         ndr->depth--;
2347                 break;
2348
2349                 default:
2350                 break;
2351
2352         }
2353 }
2354
2355 static enum ndr_err_code ndr_push_srvsvc_NetFileInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetFileInfoCtr *r)
2356 {
2357         if (ndr_flags & NDR_SCALARS) {
2358                 NDR_CHECK(ndr_push_align(ndr, 4));
2359                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
2360                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level));
2361                 NDR_CHECK(ndr_push_srvsvc_NetFileCtr(ndr, NDR_SCALARS, &r->ctr));
2362         }
2363         if (ndr_flags & NDR_BUFFERS) {
2364                 NDR_CHECK(ndr_push_srvsvc_NetFileCtr(ndr, NDR_BUFFERS, &r->ctr));
2365         }
2366         return NDR_ERR_SUCCESS;
2367 }
2368
2369 static enum ndr_err_code ndr_pull_srvsvc_NetFileInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetFileInfoCtr *r)
2370 {
2371         if (ndr_flags & NDR_SCALARS) {
2372                 NDR_CHECK(ndr_pull_align(ndr, 4));
2373                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
2374                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level));
2375                 NDR_CHECK(ndr_pull_srvsvc_NetFileCtr(ndr, NDR_SCALARS, &r->ctr));
2376         }
2377         if (ndr_flags & NDR_BUFFERS) {
2378                 NDR_CHECK(ndr_pull_srvsvc_NetFileCtr(ndr, NDR_BUFFERS, &r->ctr));
2379         }
2380         return NDR_ERR_SUCCESS;
2381 }
2382
2383 _PUBLIC_ void ndr_print_srvsvc_NetFileInfoCtr(struct ndr_print *ndr, const char *name, const struct srvsvc_NetFileInfoCtr *r)
2384 {
2385         ndr_print_struct(ndr, name, "srvsvc_NetFileInfoCtr");
2386         ndr->depth++;
2387         ndr_print_uint32(ndr, "level", r->level);
2388         ndr_print_set_switch_value(ndr, &r->ctr, r->level);
2389         ndr_print_srvsvc_NetFileCtr(ndr, "ctr", &r->ctr);
2390         ndr->depth--;
2391 }
2392
2393 static enum ndr_err_code ndr_push_srvsvc_NetSessInfo0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo0 *r)
2394 {
2395         if (ndr_flags & NDR_SCALARS) {
2396                 NDR_CHECK(ndr_push_align(ndr, 4));
2397                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client));
2398         }
2399         if (ndr_flags & NDR_BUFFERS) {
2400                 if (r->client) {
2401                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
2402                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2403                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
2404                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2405                 }
2406         }
2407         return NDR_ERR_SUCCESS;
2408 }
2409
2410 static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo0 *r)
2411 {
2412         uint32_t _ptr_client;
2413         TALLOC_CTX *_mem_save_client_0;
2414         if (ndr_flags & NDR_SCALARS) {
2415                 NDR_CHECK(ndr_pull_align(ndr, 4));
2416                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client));
2417                 if (_ptr_client) {
2418                         NDR_PULL_ALLOC(ndr, r->client);
2419                 } else {
2420                         r->client = NULL;
2421                 }
2422         }
2423         if (ndr_flags & NDR_BUFFERS) {
2424                 if (r->client) {
2425                         _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr);
2426                         NDR_PULL_SET_MEM_CTX(ndr, r->client, 0);
2427                         NDR_CHECK(ndr_pull_array_size(ndr, &r->client));
2428                         NDR_CHECK(ndr_pull_array_length(ndr, &r->client));
2429                         if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) {
2430                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client));
2431                         }
2432                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t)));
2433                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16));
2434                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0);
2435                 }
2436         }
2437         return NDR_ERR_SUCCESS;
2438 }
2439
2440 _PUBLIC_ void ndr_print_srvsvc_NetSessInfo0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo0 *r)
2441 {
2442         ndr_print_struct(ndr, name, "srvsvc_NetSessInfo0");
2443         ndr->depth++;
2444         ndr_print_ptr(ndr, "client", r->client);
2445         ndr->depth++;
2446         if (r->client) {
2447                 ndr_print_string(ndr, "client", r->client);
2448         }
2449         ndr->depth--;
2450         ndr->depth--;
2451 }
2452
2453 static enum ndr_err_code ndr_push_srvsvc_NetSessCtr0(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr0 *r)
2454 {
2455         uint32_t cntr_array_1;
2456         if (ndr_flags & NDR_SCALARS) {
2457                 NDR_CHECK(ndr_push_align(ndr, 4));
2458                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2459                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
2460         }
2461         if (ndr_flags & NDR_BUFFERS) {
2462                 if (r->array) {
2463                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2464                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2465                                 NDR_CHECK(ndr_push_srvsvc_NetSessInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
2466                         }
2467                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2468                                 NDR_CHECK(ndr_push_srvsvc_NetSessInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
2469                         }
2470                 }
2471         }
2472         return NDR_ERR_SUCCESS;
2473 }
2474
2475 static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr0(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr0 *r)
2476 {
2477         uint32_t _ptr_array;
2478         uint32_t cntr_array_1;
2479         TALLOC_CTX *_mem_save_array_0;
2480         TALLOC_CTX *_mem_save_array_1;
2481         if (ndr_flags & NDR_SCALARS) {
2482                 NDR_CHECK(ndr_pull_align(ndr, 4));
2483                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2484                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
2485                 if (_ptr_array) {
2486                         NDR_PULL_ALLOC(ndr, r->array);
2487                 } else {
2488                         r->array = NULL;
2489                 }
2490         }
2491         if (ndr_flags & NDR_BUFFERS) {
2492                 if (r->array) {
2493                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
2494                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
2495                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
2496                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
2497                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
2498                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
2499                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2500                                 NDR_CHECK(ndr_pull_srvsvc_NetSessInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
2501                         }
2502                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2503                                 NDR_CHECK(ndr_pull_srvsvc_NetSessInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
2504                         }
2505                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
2506                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
2507                 }
2508                 if (r->array) {
2509                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
2510                 }
2511         }
2512         return NDR_ERR_SUCCESS;
2513 }
2514
2515 _PUBLIC_ void ndr_print_srvsvc_NetSessCtr0(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr0 *r)
2516 {
2517         uint32_t cntr_array_1;
2518         ndr_print_struct(ndr, name, "srvsvc_NetSessCtr0");
2519         ndr->depth++;
2520         ndr_print_uint32(ndr, "count", r->count);
2521         ndr_print_ptr(ndr, "array", r->array);
2522         ndr->depth++;
2523         if (r->array) {
2524                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
2525                 ndr->depth++;
2526                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
2527                         char *idx_1=NULL;
2528                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
2529                                 ndr_print_srvsvc_NetSessInfo0(ndr, "array", &r->array[cntr_array_1]);
2530                                 free(idx_1);
2531                         }
2532                 }
2533                 ndr->depth--;
2534         }
2535         ndr->depth--;
2536         ndr->depth--;
2537 }
2538
2539 static enum ndr_err_code ndr_push_srvsvc_NetSessInfo1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo1 *r)
2540 {
2541         if (ndr_flags & NDR_SCALARS) {
2542                 NDR_CHECK(ndr_push_align(ndr, 4));
2543                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client));
2544                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
2545                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open));
2546                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
2547                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time));
2548                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags));
2549         }
2550         if (ndr_flags & NDR_BUFFERS) {
2551                 if (r->client) {
2552                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
2553                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2554                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
2555                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2556                 }
2557                 if (r->user) {
2558                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
2559                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2560                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
2561                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2562                 }
2563         }
2564         return NDR_ERR_SUCCESS;
2565 }
2566
2567 static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo1 *r)
2568 {
2569         uint32_t _ptr_client;
2570         TALLOC_CTX *_mem_save_client_0;
2571         uint32_t _ptr_user;
2572         TALLOC_CTX *_mem_save_user_0;
2573         if (ndr_flags & NDR_SCALARS) {
2574                 NDR_CHECK(ndr_pull_align(ndr, 4));
2575                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client));
2576                 if (_ptr_client) {
2577                         NDR_PULL_ALLOC(ndr, r->client);
2578                 } else {
2579                         r->client = NULL;
2580                 }
2581                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
2582                 if (_ptr_user) {
2583                         NDR_PULL_ALLOC(ndr, r->user);
2584                 } else {
2585                         r->user = NULL;
2586                 }
2587                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open));
2588                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time));
2589                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time));
2590                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->user_flags));
2591         }
2592         if (ndr_flags & NDR_BUFFERS) {
2593                 if (r->client) {
2594                         _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr);
2595                         NDR_PULL_SET_MEM_CTX(ndr, r->client, 0);
2596                         NDR_CHECK(ndr_pull_array_size(ndr, &r->client));
2597                         NDR_CHECK(ndr_pull_array_length(ndr, &r->client));
2598                         if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) {
2599                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client));
2600                         }
2601                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t)));
2602                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16));
2603                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0);
2604                 }
2605                 if (r->user) {
2606                         _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
2607                         NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
2608                         NDR_CHECK(ndr_pull_array_size(ndr, &r->user));
2609                         NDR_CHECK(ndr_pull_array_length(ndr, &r->user));
2610                         if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) {
2611                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user));
2612                         }
2613                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t)));
2614                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16));
2615                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
2616                 }
2617         }
2618         return NDR_ERR_SUCCESS;
2619 }
2620
2621 _PUBLIC_ void ndr_print_srvsvc_NetSessInfo1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo1 *r)
2622 {
2623         ndr_print_struct(ndr, name, "srvsvc_NetSessInfo1");
2624         ndr->depth++;
2625         ndr_print_ptr(ndr, "client", r->client);
2626         ndr->depth++;
2627         if (r->client) {
2628                 ndr_print_string(ndr, "client", r->client);
2629         }
2630         ndr->depth--;
2631         ndr_print_ptr(ndr, "user", r->user);
2632         ndr->depth++;
2633         if (r->user) {
2634                 ndr_print_string(ndr, "user", r->user);
2635         }
2636         ndr->depth--;
2637         ndr_print_uint32(ndr, "num_open", r->num_open);
2638         ndr_print_uint32(ndr, "time", r->time);
2639         ndr_print_uint32(ndr, "idle_time", r->idle_time);
2640         ndr_print_uint32(ndr, "user_flags", r->user_flags);
2641         ndr->depth--;
2642 }
2643
2644 static enum ndr_err_code ndr_push_srvsvc_NetSessCtr1(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr1 *r)
2645 {
2646         uint32_t cntr_array_1;
2647         if (ndr_flags & NDR_SCALARS) {
2648                 NDR_CHECK(ndr_push_align(ndr, 4));
2649                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2650                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
2651         }
2652         if (ndr_flags & NDR_BUFFERS) {
2653                 if (r->array) {
2654                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2655                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2656                                 NDR_CHECK(ndr_push_srvsvc_NetSessInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
2657                         }
2658                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2659                                 NDR_CHECK(ndr_push_srvsvc_NetSessInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
2660                         }
2661                 }
2662         }
2663         return NDR_ERR_SUCCESS;
2664 }
2665
2666 static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr1(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr1 *r)
2667 {
2668         uint32_t _ptr_array;
2669         uint32_t cntr_array_1;
2670         TALLOC_CTX *_mem_save_array_0;
2671         TALLOC_CTX *_mem_save_array_1;
2672         if (ndr_flags & NDR_SCALARS) {
2673                 NDR_CHECK(ndr_pull_align(ndr, 4));
2674                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2675                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
2676                 if (_ptr_array) {
2677                         NDR_PULL_ALLOC(ndr, r->array);
2678                 } else {
2679                         r->array = NULL;
2680                 }
2681         }
2682         if (ndr_flags & NDR_BUFFERS) {
2683                 if (r->array) {
2684                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
2685                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
2686                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
2687                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
2688                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
2689                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
2690                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2691                                 NDR_CHECK(ndr_pull_srvsvc_NetSessInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
2692                         }
2693                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2694                                 NDR_CHECK(ndr_pull_srvsvc_NetSessInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
2695                         }
2696                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
2697                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
2698                 }
2699                 if (r->array) {
2700                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
2701                 }
2702         }
2703         return NDR_ERR_SUCCESS;
2704 }
2705
2706 _PUBLIC_ void ndr_print_srvsvc_NetSessCtr1(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr1 *r)
2707 {
2708         uint32_t cntr_array_1;
2709         ndr_print_struct(ndr, name, "srvsvc_NetSessCtr1");
2710         ndr->depth++;
2711         ndr_print_uint32(ndr, "count", r->count);
2712         ndr_print_ptr(ndr, "array", r->array);
2713         ndr->depth++;
2714         if (r->array) {
2715                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
2716                 ndr->depth++;
2717                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
2718                         char *idx_1=NULL;
2719                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
2720                                 ndr_print_srvsvc_NetSessInfo1(ndr, "array", &r->array[cntr_array_1]);
2721                                 free(idx_1);
2722                         }
2723                 }
2724                 ndr->depth--;
2725         }
2726         ndr->depth--;
2727         ndr->depth--;
2728 }
2729
2730 static enum ndr_err_code ndr_push_srvsvc_NetSessInfo2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo2 *r)
2731 {
2732         if (ndr_flags & NDR_SCALARS) {
2733                 NDR_CHECK(ndr_push_align(ndr, 4));
2734                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client));
2735                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
2736                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open));
2737                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
2738                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time));
2739                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags));
2740                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_type));
2741         }
2742         if (ndr_flags & NDR_BUFFERS) {
2743                 if (r->client) {
2744                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
2745                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2746                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
2747                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2748                 }
2749                 if (r->user) {
2750                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
2751                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2752                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
2753                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2754                 }
2755                 if (r->client_type) {
2756                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16)));
2757                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2758                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_type, CH_UTF16)));
2759                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_type, ndr_charset_length(r->client_type, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2760                 }
2761         }
2762         return NDR_ERR_SUCCESS;
2763 }
2764
2765 static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo2 *r)
2766 {
2767         uint32_t _ptr_client;
2768         TALLOC_CTX *_mem_save_client_0;
2769         uint32_t _ptr_user;
2770         TALLOC_CTX *_mem_save_user_0;
2771         uint32_t _ptr_client_type;
2772         TALLOC_CTX *_mem_save_client_type_0;
2773         if (ndr_flags & NDR_SCALARS) {
2774                 NDR_CHECK(ndr_pull_align(ndr, 4));
2775                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client));
2776                 if (_ptr_client) {
2777                         NDR_PULL_ALLOC(ndr, r->client);
2778                 } else {
2779                         r->client = NULL;
2780                 }
2781                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
2782                 if (_ptr_user) {
2783                         NDR_PULL_ALLOC(ndr, r->user);
2784                 } else {
2785                         r->user = NULL;
2786                 }
2787                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_open));
2788                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time));
2789                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time));
2790                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->user_flags));
2791                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_type));
2792                 if (_ptr_client_type) {
2793                         NDR_PULL_ALLOC(ndr, r->client_type);
2794                 } else {
2795                         r->client_type = NULL;
2796                 }
2797         }
2798         if (ndr_flags & NDR_BUFFERS) {
2799                 if (r->client) {
2800                         _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr);
2801                         NDR_PULL_SET_MEM_CTX(ndr, r->client, 0);
2802                         NDR_CHECK(ndr_pull_array_size(ndr, &r->client));
2803                         NDR_CHECK(ndr_pull_array_length(ndr, &r->client));
2804                         if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) {
2805                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client));
2806                         }
2807                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t)));
2808                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16));
2809                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0);
2810                 }
2811                 if (r->user) {
2812                         _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
2813                         NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
2814                         NDR_CHECK(ndr_pull_array_size(ndr, &r->user));
2815                         NDR_CHECK(ndr_pull_array_length(ndr, &r->user));
2816                         if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) {
2817                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user));
2818                         }
2819                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t)));
2820                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16));
2821                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
2822                 }
2823                 if (r->client_type) {
2824                         _mem_save_client_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
2825                         NDR_PULL_SET_MEM_CTX(ndr, r->client_type, 0);
2826                         NDR_CHECK(ndr_pull_array_size(ndr, &r->client_type));
2827                         NDR_CHECK(ndr_pull_array_length(ndr, &r->client_type));
2828                         if (ndr_get_array_length(ndr, &r->client_type) > ndr_get_array_size(ndr, &r->client_type)) {
2829                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_type), ndr_get_array_length(ndr, &r->client_type));
2830                         }
2831                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t)));
2832                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_type, ndr_get_array_length(ndr, &r->client_type), sizeof(uint16_t), CH_UTF16));
2833                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_type_0, 0);
2834                 }
2835         }
2836         return NDR_ERR_SUCCESS;
2837 }
2838
2839 _PUBLIC_ void ndr_print_srvsvc_NetSessInfo2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo2 *r)
2840 {
2841         ndr_print_struct(ndr, name, "srvsvc_NetSessInfo2");
2842         ndr->depth++;
2843         ndr_print_ptr(ndr, "client", r->client);
2844         ndr->depth++;
2845         if (r->client) {
2846                 ndr_print_string(ndr, "client", r->client);
2847         }
2848         ndr->depth--;
2849         ndr_print_ptr(ndr, "user", r->user);
2850         ndr->depth++;
2851         if (r->user) {
2852                 ndr_print_string(ndr, "user", r->user);
2853         }
2854         ndr->depth--;
2855         ndr_print_uint32(ndr, "num_open", r->num_open);
2856         ndr_print_uint32(ndr, "time", r->time);
2857         ndr_print_uint32(ndr, "idle_time", r->idle_time);
2858         ndr_print_uint32(ndr, "user_flags", r->user_flags);
2859         ndr_print_ptr(ndr, "client_type", r->client_type);
2860         ndr->depth++;
2861         if (r->client_type) {
2862                 ndr_print_string(ndr, "client_type", r->client_type);
2863         }
2864         ndr->depth--;
2865         ndr->depth--;
2866 }
2867
2868 static enum ndr_err_code ndr_push_srvsvc_NetSessCtr2(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr2 *r)
2869 {
2870         uint32_t cntr_array_1;
2871         if (ndr_flags & NDR_SCALARS) {
2872                 NDR_CHECK(ndr_push_align(ndr, 4));
2873                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2874                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
2875         }
2876         if (ndr_flags & NDR_BUFFERS) {
2877                 if (r->array) {
2878                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2879                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2880                                 NDR_CHECK(ndr_push_srvsvc_NetSessInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
2881                         }
2882                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2883                                 NDR_CHECK(ndr_push_srvsvc_NetSessInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
2884                         }
2885                 }
2886         }
2887         return NDR_ERR_SUCCESS;
2888 }
2889
2890 static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr2(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr2 *r)
2891 {
2892         uint32_t _ptr_array;
2893         uint32_t cntr_array_1;
2894         TALLOC_CTX *_mem_save_array_0;
2895         TALLOC_CTX *_mem_save_array_1;
2896         if (ndr_flags & NDR_SCALARS) {
2897                 NDR_CHECK(ndr_pull_align(ndr, 4));
2898                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2899                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
2900                 if (_ptr_array) {
2901                         NDR_PULL_ALLOC(ndr, r->array);
2902                 } else {
2903                         r->array = NULL;
2904                 }
2905         }
2906         if (ndr_flags & NDR_BUFFERS) {
2907                 if (r->array) {
2908                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
2909                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
2910                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
2911                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
2912                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
2913                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
2914                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2915                                 NDR_CHECK(ndr_pull_srvsvc_NetSessInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
2916                         }
2917                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
2918                                 NDR_CHECK(ndr_pull_srvsvc_NetSessInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
2919                         }
2920                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
2921                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
2922                 }
2923                 if (r->array) {
2924                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
2925                 }
2926         }
2927         return NDR_ERR_SUCCESS;
2928 }
2929
2930 _PUBLIC_ void ndr_print_srvsvc_NetSessCtr2(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr2 *r)
2931 {
2932         uint32_t cntr_array_1;
2933         ndr_print_struct(ndr, name, "srvsvc_NetSessCtr2");
2934         ndr->depth++;
2935         ndr_print_uint32(ndr, "count", r->count);
2936         ndr_print_ptr(ndr, "array", r->array);
2937         ndr->depth++;
2938         if (r->array) {
2939                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
2940                 ndr->depth++;
2941                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
2942                         char *idx_1=NULL;
2943                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
2944                                 ndr_print_srvsvc_NetSessInfo2(ndr, "array", &r->array[cntr_array_1]);
2945                                 free(idx_1);
2946                         }
2947                 }
2948                 ndr->depth--;
2949         }
2950         ndr->depth--;
2951         ndr->depth--;
2952 }
2953
2954 static enum ndr_err_code ndr_push_srvsvc_NetSessInfo10(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo10 *r)
2955 {
2956         if (ndr_flags & NDR_SCALARS) {
2957                 NDR_CHECK(ndr_push_align(ndr, 4));
2958                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client));
2959                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
2960                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
2961                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time));
2962         }
2963         if (ndr_flags & NDR_BUFFERS) {
2964                 if (r->client) {
2965                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
2966                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2967                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
2968                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2969                 }
2970                 if (r->user) {
2971                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
2972                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2973                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
2974                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2975                 }
2976         }
2977         return NDR_ERR_SUCCESS;
2978 }
2979
2980 static enum ndr_err_code ndr_pull_srvsvc_NetSessInfo10(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessInfo10 *r)
2981 {
2982         uint32_t _ptr_client;
2983         TALLOC_CTX *_mem_save_client_0;
2984         uint32_t _ptr_user;
2985         TALLOC_CTX *_mem_save_user_0;
2986         if (ndr_flags & NDR_SCALARS) {
2987                 NDR_CHECK(ndr_pull_align(ndr, 4));
2988                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client));
2989                 if (_ptr_client) {
2990                         NDR_PULL_ALLOC(ndr, r->client);
2991                 } else {
2992                         r->client = NULL;
2993                 }
2994                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user));
2995                 if (_ptr_user) {
2996                         NDR_PULL_ALLOC(ndr, r->user);
2997                 } else {
2998                         r->user = NULL;
2999                 }
3000                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time));
3001                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idle_time));
3002         }
3003         if (ndr_flags & NDR_BUFFERS) {
3004                 if (r->client) {
3005                         _mem_save_client_0 = NDR_PULL_GET_MEM_CTX(ndr);
3006                         NDR_PULL_SET_MEM_CTX(ndr, r->client, 0);
3007                         NDR_CHECK(ndr_pull_array_size(ndr, &r->client));
3008                         NDR_CHECK(ndr_pull_array_length(ndr, &r->client));
3009                         if (ndr_get_array_length(ndr, &r->client) > ndr_get_array_size(ndr, &r->client)) {
3010                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client), ndr_get_array_length(ndr, &r->client));
3011                         }
3012                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t)));
3013                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client, ndr_get_array_length(ndr, &r->client), sizeof(uint16_t), CH_UTF16));
3014                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_0, 0);
3015                 }
3016                 if (r->user) {
3017                         _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr);
3018                         NDR_PULL_SET_MEM_CTX(ndr, r->user, 0);
3019                         NDR_CHECK(ndr_pull_array_size(ndr, &r->user));
3020                         NDR_CHECK(ndr_pull_array_length(ndr, &r->user));
3021                         if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) {
3022                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user));
3023                         }
3024                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t)));
3025                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16));
3026                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0);
3027                 }
3028         }
3029         return NDR_ERR_SUCCESS;
3030 }
3031
3032 _PUBLIC_ void ndr_print_srvsvc_NetSessInfo10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessInfo10 *r)
3033 {
3034         ndr_print_struct(ndr, name, "srvsvc_NetSessInfo10");
3035         ndr->depth++;
3036         ndr_print_ptr(ndr, "client", r->client);
3037         ndr->depth++;
3038         if (r->client) {
3039                 ndr_print_string(ndr, "client", r->client);
3040         }
3041         ndr->depth--;
3042         ndr_print_ptr(ndr, "user", r->user);
3043         ndr->depth++;
3044         if (r->user) {
3045                 ndr_print_string(ndr, "user", r->user);
3046         }
3047         ndr->depth--;
3048         ndr_print_uint32(ndr, "time", r->time);
3049         ndr_print_uint32(ndr, "idle_time", r->idle_time);
3050         ndr->depth--;
3051 }
3052
3053 static enum ndr_err_code ndr_push_srvsvc_NetSessCtr10(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessCtr10 *r)
3054 {
3055         uint32_t cntr_array_1;
3056         if (ndr_flags & NDR_SCALARS) {
3057                 NDR_CHECK(ndr_push_align(ndr, 4));
3058                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
3059                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
3060         }
3061         if (ndr_flags & NDR_BUFFERS) {
3062                 if (r->array) {
3063                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
3064                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
3065                                 NDR_CHECK(ndr_push_srvsvc_NetSessInfo10(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
3066                         }
3067                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
3068                                 NDR_CHECK(ndr_push_srvsvc_NetSessInfo10(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
3069                         }
3070                 }
3071         }
3072         return NDR_ERR_SUCCESS;
3073 }
3074
3075 static enum ndr_err_code ndr_pull_srvsvc_NetSessCtr10(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetSessCtr10 *r)
3076 {
3077         uint32_t _ptr_array;
3078         uint32_t cntr_array_1;
3079         TALLOC_CTX *_mem_save_array_0;
3080         TALLOC_CTX *_mem_save_array_1;
3081         if (ndr_flags & NDR_SCALARS) {
3082                 NDR_CHECK(ndr_pull_align(ndr, 4));
3083                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
3084                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
3085                 if (_ptr_array) {
3086                         NDR_PULL_ALLOC(ndr, r->array);
3087                 } else {
3088                         r->array = NULL;
3089                 }
3090         }
3091         if (ndr_flags & NDR_BUFFERS) {
3092                 if (r->array) {
3093                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
3094                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
3095                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
3096                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
3097                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
3098                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
3099                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
3100                                 NDR_CHECK(ndr_pull_srvsvc_NetSessInfo10(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
3101                         }
3102                         for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
3103                                 NDR_CHECK(ndr_pull_srvsvc_NetSessInfo10(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
3104                         }
3105                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
3106                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
3107                 }
3108                 if (r->array) {
3109                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
3110                 }
3111         }
3112         return NDR_ERR_SUCCESS;
3113 }
3114
3115 _PUBLIC_ void ndr_print_srvsvc_NetSessCtr10(struct ndr_print *ndr, const char *name, const struct srvsvc_NetSessCtr10 *r)
3116 {
3117         uint32_t cntr_array_1;
3118         ndr_print_struct(ndr, name, "srvsvc_NetSessCtr10");
3119         ndr->depth++;
3120         ndr_print_uint32(ndr, "count", r->count);
3121         ndr_print_ptr(ndr, "array", r->array);
3122         ndr->depth++;
3123         if (r->array) {
3124                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
3125                 ndr->depth++;
3126                 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
3127                         char *idx_1=NULL;
3128                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
3129                                 ndr_print_srvsvc_NetSessInfo10(ndr, "array", &r->array[cntr_array_1]);
3130                                 free(idx_1);
3131                         }
3132                 }
3133                 ndr->depth--;
3134         }
3135         ndr->depth--;
3136         ndr->depth--;
3137 }
3138
3139 static enum ndr_err_code ndr_push_srvsvc_NetSessInfo502(struct ndr_push *ndr, int ndr_flags, const struct srvsvc_NetSessInfo502 *r)
3140 {
3141         if (ndr_flags & NDR_SCALARS) {
3142                 NDR_CHECK(ndr_push_align(ndr, 4));
3143                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client));
3144                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->user));
3145                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_open));
3146                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
3147                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idle_time));
3148                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->user_flags));
3149                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_type));
3150                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->transport));
3151         }
3152         if (ndr_flags & NDR_BUFFERS) {
3153                 if (r->client) {
3154                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
3155                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
3156                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client, CH_UTF16)));
3157                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client, ndr_charset_length(r->client, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3158                 }
3159                 if (r->user) {
3160                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
3161                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
3162                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16)));
3163                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16));
3164                &nb